Bluetooth Media Streaming
To set up Bluetooth media streaming on the Jetson, it first had to be set up to allow connections with bluetooth devices.
Although somewhat outdated, the following resource was used to help the process: https://blog.stevenocchipinti.com/2012/10/bluetooth-audio-streaming-from-phone-to.html/.
First, pulseaudio was installed: sudo apt-get install pulseaudio
.
Then, the following line was added to the file /etc/bluetooth/main.conf
:
Enable=Gateway,Source,Socket
Then the bluetooth daemon was restarted using:
sudo service bluetooth restart
Then a phone was paired with the Jetson using the tool bluetoothctl. The specific steps were:
bluetoothctl scan on
bluetoothctl pair (Bluetooth Address of Phone)
The pair was successful, but the connection was not. To fix this, the following line of code was ran to load a bluetooth module:
pactl load-module module-bluetooth-discover
Then the following was added uncommented to the file
etc/pulse/daemon.conf
after the commented out line resample method...
resample-method = trivial
Then the device was sucessully connected with the Jetson TX2 after unpairing it, and pairing it again.
After being connected sucessully, the following lines were added to allow audio to begin playing:
First list the sources :
pacmd list-sources
Then list the sinks:
pacmd list-sinks
Then set the source (the bluetooth device) and sink (the speaker) using: Where the xxxx's are found through the first two commands.
load-module module-loopback source=bluez_source.xxxx sink=alsa_output.pci-xxxx
.