Libreelec, Hifiberry Dac+, Bluetooth A2DP

  • Hi everybody,

    I use a Raspberry PI 2 together with the Hifiberry Dac+ as my main media player attached to the TV. A couple of days ago I bought a USB Bluetooth dongle because I would like to stream music from my mobile Android devices to the Raspberry. As this did not work in OpenElec I switched to LibreElec (more vivid development) and today I installed the latest Alpha.

    I'm able to connect the mobile Android devices to LibreElec and music is shown in the mobile device as played, but the HifiBerry does not put any tone to the speakers.

    I found a documentation in the Libreelec forum how to use PulseAudio (Pulseaudio - LibreELEC), but when I call

    Code
    pactl list short sinks


    the Hifiberry is not listed.

    I'm a little bit lost as there is lot of documentation in the internet, but nothing seems to work properly for me.

    Has anybody managed to configure Libreelec on a Raspberry PI + Hifiberry Dac+ successfully to receive bluetooth audio via A2DP?

    Any hint is appreciated,
    Christoph

  • Hi Irusak,

    thanks for your quick reply.

    Here I give you what I did in my SSH console. A mobile device is paired and connected via bluetooth, in the LE Gui the mobile device is shown as connected, in the mobile device it is shown as connected also and I'm able to send music to the RaspPi.

    Code
    openELEC:~ # systemctl stop kodi
    openELEC:~ # pactl load-module module-udev-detect
    23
    openELEC:~ # pactl list short sinks
    1       alsa_output.platform-soc_sound.analog-stereo    module-alsa-card.c      s16le 2ch 44100Hz       SUSPENDED
    openELEC:~ # pactl list short sources
    5       bluez_source.E4_92_FB_4B_0F_78  module-bluez5-device.c  s16le 2ch 44100Hz       SUSPENDED
    6       alsa_output.platform-soc_sound.analog-stereo.monitor    module-alsa-card.c      s16le 2ch 44100Hz       SUSPENDED
    openELEC:~ # systemctl start kodi


    As you can see the bluetooth is shown as music source, but in the sinks list my Hifiberry is not shown - and I do not want to use the onboard sound.

    Cheers,
    Christoph


  • Hi Irusak,

    thanks for your quick reply.

    Here I give you what I did in my SSH console. A mobile device is paired and connected via bluetooth, in the LE Gui the mobile device is shown as connected, in the mobile device it is shown as connected also and I'm able to send music to the RaspPi.

    Code
    openELEC:~ # systemctl stop kodi
    openELEC:~ # pactl load-module module-udev-detect
    23
    openELEC:~ # pactl list short sinks
    1       alsa_output.platform-soc_sound.analog-stereo    module-alsa-card.c      s16le 2ch 44100Hz       SUSPENDED
    openELEC:~ # pactl list short sources
    5       bluez_source.E4_92_FB_4B_0F_78  module-bluez5-device.c  s16le 2ch 44100Hz       SUSPENDED
    6       alsa_output.platform-soc_sound.analog-stereo.monitor    module-alsa-card.c      s16le 2ch 44100Hz       SUSPENDED
    openELEC:~ # systemctl start kodi


    As you can see the bluetooth is shown as music source, but in the sinks list my Hifiberry is not shown - and I do not want to use the onboard sound.

    Cheers,
    Christoph


    Try stopping kodi before you do it otherwise it will hold onto the alsa sink

    Code
    systemctl stop kodi
  • Hi Irusak,

    as you can see in my posted bash history stopping kodi was the first step.

    I retried to get the Hifiberry as audio sink by:

    • stopping kodi using:
      Code
      systemctl stop kodi
    • checking if really no kodi process is running:
      Code
      ps -Alf | grep kodi


      (no kodi process is running)

    • listing all audio sinks:
      Code
      pactl list short sinks


    with result

    Code
    1 alsa_output.platform-soc_sound.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED

    Unfortunately stopping kodi did not the trick.

  • Hi Irusak,

    Code
    openELEC:~ # aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ HiFi pcm512x-hifi-0
      Subdevices: 1/1
      Subdevice #0: subdevice #0


    Yes, the HiFiBerry shows up in alsa and works - apart from the bluetooth thing - completely as expected.

    My /flash/config.txt file looks like this:


    I only added the device tree overlay configuration. The difference to the LibreElec documentation is the enabled debugging which comes from the HiFiBerry documentation.

    I removed the debug option but this did not change anything.

  • Hi everybody,

    I think I fixed my problem.

    It turned out my device

    Code
    alsa_output.platform-soc_sound.analog-stereo

    was not the on-board sound, but the Hifiberry.

    If you use something like

    Code
    pactl list


    you get more information about your sound devices.

    By accident I checked sound is played properly after loading the modules using

    Code
    pactl load-module module-udev-detect

    As I don't want to load the modules manually, I put the load command into /storage/.config/autostart.sh.

    As the last step I had to choose "Bluetooth" as the default audio device in Libreelec. With this setting I'm now able to stream audio from a mobile device via A2DP and have LE played another sound at the same time.

    Hope this helps,
    Christoph