Skip to content

Instantly share code, notes, and snippets.

@dasl-
Last active July 11, 2019 16:21
Show Gist options
  • Save dasl-/b8bfa127d7921c909d07c3e560c85eba to your computer and use it in GitHub Desktop.
Save dasl-/b8bfa127d7921c909d07c3e560c85eba to your computer and use it in GitHub Desktop.
sudo apt-get install bluealsa 
bluetoothctl
power on
agent on
scan on
pair XX:XX:XX:XX:XX
trust XX:XX:XX:XX:XX
connect XX:XX:XX:XX:XX
quit
aplay -D bluealsa:HCI=hci0,DEV=XX:XX:XX:XX:XX:XX,PROFILE=a2dp test.wav
SDL_AUDIODRIVER="alsa" AUDIODEV="bluealsa:HCI=hci0,DEV=C0:28:8D:6B:5A:F4,PROFILE=a2dp" ffplay -nodisp -vn -autoexit -i piano.wav

maybe??

sudo apt-get install pulseaudio pulseaudio-module-bluetooth
sudo usermod -G bluetooth -a pi
sudo shutdown -r now

Note: pulseaudio seems to slow down sound playback even through the 1.8" jack. So installing it may screw up audio / video sync. May need to remove and reboot to fix it.

list bluetooth devices:

sudo apt-get install bluez-tools
bt-device -l

offset of 1.15s seems better for BT, but not predictable

aptx is a BT audio codec that is low latency. The pi BT does not support aptx. You'd need a BT transmitter that supports aptx (maybe like this? https://www.amazon.com/Avantree-Bluetooth-Transmitter-Wireless-Headphones/dp/B01N5KKUR0 ) as well as speakers that support aptx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment