RPI3 A2DP audio sink support

  • Could you please give me the steps to set this up on rpi4?

    One more question: Is it possible to use analog output on rpi?

    Edited once, last by polo_joe (March 13, 2020 at 9:31 AM).

  • Then to get music playing over the USB sound card all I really had to do was run pactl load-module module-udev-detect. My sound card is detected and is set as the default sink instantly (I guess because it is the only sink available on my RPi2) and my Bluetooth streamed music starts playing over my speakers, yay! At the same time I can play anything using Kodi and Kodi's sound is passed through over HDMI while simultaneously streaming Bluetooth music, exactly what I wanted to achieve.

    To automatically detect my sound card at boot I added pactl load-module module-udev-detect to autostart.sh. Funny how that was really all I had to do to get my ideal setup working.

    Wow I have been wanting this for years. I found your post and it worked a treat.

    For clarity, I've been using Kodi on an RPI2 for years with a Creative USB sound card. Airplay has been mostly ok - but a bit unstable - and streaming from Android has been impossible.

    To get Android (and Apple for that matter) streaming to the RPI's Bluetooth, do the following:

    1. Pair the phone using Settings -> Libreelec -> Bluetooth
    2. Change the Audio output device to PULSE in Settings -> System -> Audio. When you change this the audio will stop working until the rest of this procedure is completed so don't be alarmed
    3. Get the network IP Address from Settings -> System information
    4. SSH into Kodi using the IP address and login with user root pw libreelec
    5. nano /storage/.config/autostart.sh
    6. paste the following:

      pactl load-module module-udev-detect
    7. Save the file (CTRL-X -> y -> [ENTER])
    8. Reboot the RPI
    9. Reconnect Bluetooth from your phone
    10. Start streaming from Spotify or any other app, as you would with any bluetooth speaker or headset
    11. You can still play audio as usual from Core or Yatse but if you are streaming at the same time, the audio will mix so stick to using one or the other at any given time
    12. Pros of playing from Core or Yatse are guaranteed audio quality and access to your library, playlists etc. Once you start playing audio your phone is no longer required; the music will play even if the phone leaves wifi or bluetooth range or is switched off
    13. Streaming via bluetooth is convenient. Downsides are that the phone must stream audio from the Internet as long as it is playing (meaning battery, bandwidth) and the phone must remain in bluetooth range or the audio will get choppy and eventually disconnect. Audio quality is not guaranteed as compression is likely. Sounds pretty satisfactory me my old ears though!

    I hope this helps other people who want to get this working. It really only takes a few minutes and has awesome payback. I'm unsure if the autostart.sh changes will survive an upgrade - time will tell.

    Happy me :)