Hello,
Could you please try setting the Bluetooth interface as following:
To start the Bluetooth service. First, you need to edit the file:
/etc/pulse/default.pa
Uncomment the following line by removing the #:
#load-module module-bluetooth-discover
Then edit the file:
/usr/bin/start-pulseaudio-x11
add the following line:
if [ x”$SESSION_MANAGER” != x ] ; then
/usr/bin/pactl load-module module-x11-xsmp “display=$DISPLAY session_manager=$SESSION_MANAGER” > /dev/null
fi
+ /usr/bin/pactl load-module module-bluetooth-discover
After modifying those files, write the below commands in the serial terminal of the i.MX8MQ-EVK board to bring up the Bluetooth connection.
# hciattach /dev/ttymxc2 qca 3000000 flow -b -t 120 # This is for the i.MX8MQ. For another i.MX device the ttymxc2 device may be different.
Just wait until the Bluetooth is set up and write.
# hciconfig hci0 up
Then bring up manually the Bluetooth-discover module:
pactl load-module module-bluetooth-discover
After that, the Bluetooth service is ready to be used.
Then, to connect a Bluetooth device, follow the below steps:
First, enter the bluetoothctl menu
# bluetoothctl
Then, make sure that the Bluetooth is powered on.
[bluetooth]# power on
Start the scanning to search for your Bluetooth device:
[bluetooth]# scan on
You need to search for the MAC address of your Bluetooth device.
After you found the desired device that you want to connect. Turn off the scanner.
[bluetooth]# scan off
If you want to review the devices that you have already connected. Write the following.
[bluetooth]# devices
Finally, connect to the Bluetooth device:
[bluetooth]# connect <The Bluetooth MAC address that you want to connect>
Some devices will need to be set as trusty.
[bluetooth]# trust <The Bluetooth MAC address that you want to connect>
After that, you will be connected to your Bluetooth device.
Finally, to reproduce a song follow use the following GStreamer pipeline.
# gst-launch-1.0 location=test.mp3 ! id3demux ! queue ! mpegaudioparse ! beepdec ! pulsesink
Whit that you should be able to stream audio over your Bluetooth device.
Best regards,
Diego.