Skip to content

Instantly share code, notes, and snippets.

@msutter
Last active January 2, 2023 09:22
Show Gist options
  • Save msutter/d376e79a6d899aafe30dff95ec97c0ac to your computer and use it in GitHub Desktop.
Save msutter/d376e79a6d899aafe30dff95ec97c0ac to your computer and use it in GitHub Desktop.
Macbook pro 2017 OSX version 13.1 Bluetooth Audio Stutter fix
# This are the command line commands to change the bluetooth settings in case of audio stuttering
# Changes are based on the nice video made by Simon McCabe on youtube where he is using the bluetooth explorer app
# https://www.youtube.com/watch?v=OVRbLRRz5TU
# The settings are reversible but proceed at your own risk.
#
# My defaults are
# sudo defaults read com.apple.BluetoothAudioAgent
# {
# "Apple Bitpool Max (editable)" = 64;
# "Apple Bitpool Min (editable)" = 50;
# "Apple Initial Bitpool (editable)" = 40;
# "Negotiated Bitpool" = 40;
# "Negotiated Bitpool Max" = 53;
# "Negotiated Bitpool Min" = 2;
# "Stream - Flush Ring on Packet Drop (editable)" = 0;
# "Stream - Max Outstanding Packets (editable)" = 30;
# "Stream Resume Delay" = "0.75";
# }
# Check the default values
sudo defaults read bluetoothaudiod
sudo defaults read com.apple.BluetoothAudioAgent
# Changes to fix the stutter
sudo defaults write bluetoothaudiod "Enable AptX codec" -bool true
sudo defaults write bluetoothaudiod "Enable AAC codec" -bool false
sudo defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
sudo defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 80
sudo defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 80
sudo defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 80
sudo defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 80
sudo defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 80
sudo defaults write com.apple.BluetoothAudioAgent "Stream - Flush Ring on Packet Drop (editable)" 0
sudo defaults write com.apple.BluetoothAudioAgent "Stream - Max Outstanding Packets (editable)" 30
sudo defaults write com.apple.BluetoothAudioAgent "Stream Resume Delay" "0.75"
# Check your changes
sudo defaults read bluetoothaudiod
sudo defaults read com.apple.BluetoothAudioAgent
# reset the Bluetooth and coreaudi modules
sudo killall coreaudiod
sudo pkill bluetoothd
# reconnect your speakers and enjoy!
# special thank to Simon for the values, it works perfectly for me
# Back to defaults if needed
sudo defaults write bluetoothaudiod "Enable AptX codec" -bool false
sudo defaults write bluetoothaudiod "Enable AAC codec" -bool true
sudo defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 64
sudo defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 50
sudo defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
sudo defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 40
sudo defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 53
sudo defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 2
sudo defaults write com.apple.BluetoothAudioAgent "Stream - Flush Ring on Packet Drop (editable)" 0
sudo defaults write com.apple.BluetoothAudioAgent "Stream - Max Outstanding Packets (editable)" 30
sudo defaults write com.apple.BluetoothAudioAgent "Stream Resume Delay" "0.75"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment