Created
February 23, 2016 10:05
-
-
Save oleiade/5cafdf715d9b2743e545 to your computer and use it in GitHub Desktop.
Properly configure audio over bluetooth for osx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Reconfigure bluetooth audio driver | |
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80 | |
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 80 | |
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 80 | |
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool Min (editable)" 80 | |
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 80 | |
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 80 | |
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 80 | |
# Restart bluetooth daemon | |
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport | |
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport | |
# Prioritize audio/bluetooth processes | |
list="$( | |
sudo ps -A \ | |
| grep -iE '([h]ear|[f]irefox|[b]lue|[c]oreaudiod)' \ | |
| cut -c 1-90 | |
)" | |
pids=$( cut -c 1-6 <<< "$list" ) | |
echo sudo renice -5 $pids | |
sudo renice -5 $pids | |
# Ask the user to restart the system | |
while true; do | |
read -p "It is recommended to restart the system after running this script. Restart [y/n]?" yn | |
case $yn in | |
[Yy]* ) sudo shutdown -r now "Rebooting"; break;; | |
[Nn]* ) exit;; | |
* ) echo "Please answer yes or no.";; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ahhh uhhhh how can I undo this? My bluetooth audio doesn't work at all anymore. I deleted the com.apple.BluetoothAudioAgent.plist file to clear the defaults but I guess the process prioritization messed it up?