It drove me insane: It doesn't matter which one Loudspeakers ich via bluetooth connected to the Macbook: The sound stuttered, it crackled and cracked and the connection constantly broke. On top of that, the mouse and Bluetooth audio device bothered each other massively: As soon as the audio stream was running, the mouse stuttered – or the mouse movement made the speaker stutter. Luckily there's a solution for that too.
MacOS is to blame for problems with Bluetooth audio!
A bug in Apple's Mac OS X operating system is the cause of the Bluetooth problems - regardless of whether it's via SBC, AAC or aptX and how close the box is to the Macbook. You can easily check this by connecting the Bluetooth box to an iPhone, a Windows PC or another non-OS X device: it usually works flawlessly here. A value in the system file com.apple.BluetoothAudioAgent since Yosemite is to blame for the problem under OS X: Here the values for the minimum bit rate to be negotiated between Mac and Bluetooth devices are too low, which some end devices - in my case next to the Bluetooth speaker even the mouse – brings it to its knees.
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 58
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 58
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 58
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 48
defaults write com.apple.BluetoothAudioAgent "Stream – Max Outstanding Packets (editable)" 15
defaults write com.apple.BluetoothAudioAgent "Stream – Flush Ring on Packet Drop (editable)" 30
After a restart it works
You should then restart the computer. Don't be surprised: It may be that the connection to the Magic Mouse now takes a few seconds after a restart, at least that's how it was for me. The values at the end of each line are the bit rate. By the way, you can also play around with higher values with “Apple Bitpool Min (editable)”. However, if these become too high, the connection may become unstable again. The audio issues should be gone though.
Reset Bluetooth module on Mac
If none of that works, or if the tip even makes things worse, that's no problem: simply reset your Mac's Bluetooth module. To do this, hold down the (Shift)+(Option) key and click on the Bluetooth symbol in the menu bar, select "Debug" and then "Reset Bluetooth module". Confirm this in the following window with "OK". This does not affect the connection with the mouse and keyboard, but it may affect other devices. The Bluetooth module is then back in the operating mode intended by the manufacturer.