Using LibreElec as a bluetooth receiver

  • I'm trying to use my Odroid C2 with LibreElec as a bluetooth receiver for my phone, so I can pull up my streaming service of choice on the couch and listen on my home A/V receiver. I have been, for the past two weeks, doing this by pulling out my laptop. I followed the initial steps here: Pulseaudio [LibreELEC.wiki] for audio receiving, and it worked. for the next week, I didn't turn off my kodi box, and used it to stream music. I didn't use Kodi to watch anything in that time, and I disconnected and reconnected my phone, and then it no longer functioned. I followed the directions again, and found that simply by having my phone be on with bluetooth, and using

    Code
    systemctl stop kodi

    and then loading the pulseaudio udev module

    Code
    pactl load-module module-udev-detect

    the music would begin streaming again.



    This still required me to pull out the laptop, ssh in, and do it everytime I wanted to listen to music after restarting kodi, having my bluetooth off on the phone, or after watching another source on Kodi. This morning I decided to make an autostart script. Following the directions in the wiki, I placed a file called autostart.sh in /storage/.config, and in that file I placed


    Code
    #/bin/sh
    pactl load-module module-udev-detect
    done




    Currently, if my phone is bluetooth on, and I reset the Odroid C2, I can then go into Kodi>Settings>Bluetooth and connect to my phone and streaming works. Kodi has no system sounds at startup (which maybe helpful, but I don't care about the lack of sounds). If I turn off bluetooth on my phone, watch another source, etc, then GUI sounds return to Kodi, and I'm not longer able to stream from my phone.




    It seems that KODI is "grabbing" pulseaudio away from the bluetooth source. Rebooting is quick enough, and I've suceeded in eliminating the need to boot the laptop for an ssh session, but is there a way to do what I want to do better, cleaner, faster? :) I'd like to just be able to stream to my LibreElec box anytime my phone is paired. Is there a way to tell Kodi to not grab the audio input of LibreElec if no other sources are playing?



    Thanks for any help, and hopefully this helps anyone else trying to do the same in future!




    Edit: if I turn off GUI sounds by telling kodi to "never" use them, and disconnect and reconnect from my phone in System settings>Kodi>Bluetooth, I can stream again. I'm going to leave this post for others who maybe have the same question, and also because if others do the same thing in a more effecient say (stream bluetooth to kodi) I'd love to hear how. If that's inappropriate, I'll delete the post.

  • Hello,

    I tried your little autostart script and it worked :) However, the sound is terribly overamplified and clipped, even at the lowest possible volume level from my bluetooth-audio source (my smartphone). I haven't found a volume knob for pulse audio so far.


    I removed the autostart script and rebooted but unfortunately all audio output sounds clipped now.


    In


    Settings > System > Audio > Audiodecoder


    the uppermost line


    Audio Output Device Default, Bluetooth (Pulse Audio)


    is greyed out. How can I turn back to Default (ALSA)?


    Any hints appreciated.


    TIA

    Edited once, last by Digitalis ().

  • Have you found a smarter solution to the problem? I came to the same situation as you. I'm trying to connect google home to my Raspberry pi.