Posts by jant90

    I would like to enable and disable the Bluetooth service without going into the LibreELEC settings menu. What are my options for that?

    I will try to elaborate a little more: I want to enable/disable the Bluetooth service based on specific events in Kodi. For this I would like to use the plugin Kodi Callbacks. Basically the plugin can execute a script (Bash / shell / Python) or one of Kodi's builtin functions upon certain events.

    In addition it would also be nice if I can configure a button in Yatse (Android remote control app) to do the same thing. From Yatse it's easy

    If it's possible via one of the builtin functions, for example the RunPlugin function it would be fairly simply to set it up in both the Kodi Callbacks plugin and in Yatse.

    Thanks, then I guess I just have to buy one and hope to be lucky.

    In your example in the wiki you use the analog output of you Amlogic box as sink right (aml_m8)? If I may ask: what device do you have and what is the output of pactl list short sinks?

    Boy do I feel like an idiot, I used OSMC for a while and before that I ran OpenELEC which didn't have Bluetooth support so it didn't even occur to me to look there.

    Anyways pairing via de GUI in LibreELEC settings works perfectly, safe and secure too, great :). I got my phone, tablet and Bluetooth speaker paired in seconds (while on OSMC I couldn't get anything paired anymore).

    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.

    Lastly I would like to note that I tested all this with an old USB sound card I had lying around (a "C-Media USB headset solution") but assuming that any USB sound card will be detected as an ALSA sink (including the PCM2704 USB DAC's) this should work over S/PDIF with those kind of USB DAC's too I guess.

    Last question (I promise): all this got me wondering about one last thing regarding Amlogic S905 devices with an S/PDIF output. Is the S/PDIF device a separate ALSA sink that I can configure as the default sink with pactl while at the same time giving Kodi full access to the HDMI output so I can achieve what I described above with an Amlogic S905 with built in Bluetooth and S/PDIF out without any additional peripherals, that would be really cool. Or would I still need an external USB sound card on those devices to use as an ALSA sink for my Bluetooth A2DP music streams?

    Thanks for the quick reply. I've been playing around the last couple of hours and I was able to bring up my Bluetooth device with hciconfig hci0 up and give it a name with hciconfig hci0 name RPi2 and then made it discoverable using hciconfig hci0 piscan. However when I try to pair with my phone a PIN is asked and 0000 or 1234 don't work.

    I also noticed the Bluetooth device shows the Bluetooth icon on my Android phone, not a headphone icon like when pairing with speakers. Is my phone even aware it should stream music to it then? In this screenshot the top one is a paired speaker, the bottom one is my RPi2 with Bluetooth dongle.


    I was hoping to try it with bluetoothctl but that one completely freezes, it will show [bluetooth]# with a cursor but I can't enter any text. All I can do is press ctrl-c to return to the shell. So I'm not sure how to pair it from the cli then. I can't trust it

    Very interesting, I hope it's alright that I revive this thread, I found it Googling.

    I assume this, A2DP music streaming to LibreELEC, is also possible with other devices, such as an RPi2 with Bluetooth dongle or an Amlogic s905 device with built in Bluetooth running LibreELEC? If so how do I find the proper module to enable (I assume snd-bcm2835 is just for RPi3) or do I have to find and download one myself or something?

    If that first part is possible, then the next step is configuring the audio sink where the Bluetooth music is routed to. Would it be possible to use an external USB sound card for that? There are cheap PCM2704 DAC's available that have a S/PDIF output which are perfect (in theory) to route the audio without loss of quality to my sound receiver. Do I need a driver or anything to get the PCM2704 USB DAC / sound card working or should it work out of the box?

    And then lastly it would be great if this A2DP streaming can be done without interfering with Kodi at all. So is it possible to enable PulseAudio just for the external USB sound card in a way that it won't interfere with Kodi? Kodi should keep outputting it's sound normally over HDMI.

    TL;DR
    The final (ideal & perfect) result I'm looking for would be that I'm able to stream music from my phone over Bluetooth to my LibreELEC device that routes this audio to an external USB sound card with a S/PDIF output that's connected to my sound receiver. Kodi should at the same time still be able to output sound over the default ALSA output (HDMI) and the Bluetooth music shouldn't interfere with Kodi at all.

    • Is it possible to use any Bluetooth dongle / device with OpenELEC and how do I find the required module to enable?
    • Is it possible to use an external USB sound card? Does LibreELEC support this out of the box or do I need drivers or something?
    • Can PulseAudio be enabled for just the external USB sound card so it won't interfere with Kodi at all?