Bluetooth Streaming

  • I got a box that finally has bluetooth and thanks to Kszaq bluetooth works with when i send audio from LE to my bluetooth speaker but what i'd like to do is send audio from my phone/tablet to Kodi that way i can use my sound system for streaming audio.

    Is this possible?

  • Here's what I do (in autostart.sh):

    Some black magic is involved in playing with the pactl options to find the proper names for your card, but once it's done streaming audio to LibreELEC with A2DP works great. Hopefully someone with some real skills might take up the task to create a proper add-on that lets you do this easily.

    Edited once, last by escalade (September 18, 2016 at 11:45 AM).


  • Here's what I do (in autostart.sh):

    Code
    # Set default Pulse sink to my ALSA card's HDMI outputpactl load-module module-udev-detectpactl set-card-profile alsa_card.pci-0000_00_03.0 output:hdmi-stereo-extra1pactl set-default-sink alsa_output.pci-0000_00_03.0.hdmi-stereo-extra1 # Make the bluetooth adapter discoverablehciconfig hci0 piscan

    Some black magic is involved in playing with the pactl options to find the proper names for your card, but once it's done streaming audio to LibreELEC with A2DP works great. Hopefully someone with some real skills might take up the task to create a proper add-on that lets you do this easily.

    Wow. This is nice. Should i just add this to autostart.sh or some additional steps are necessary? I have a Minix NEO U1.
    Thank you!


  • If you read again it's already answered. Time to start learning pactl, as those values are for my NUC.

    Good point.

    I am new to linux and trying to understand how everything is done on a basic level.
    Will keep digging into this.

    Thank you.

  • Looks like the line breaks was messed up in the commands posted above, fixed it now. "pactl list" should lead you on the right way btw. Pair your phone first, and I recommend stopping Kodi when testing just to make sure that the sound device is available.


  • Looks like the line breaks was messed up in the commands posted above, fixed it now. "pactl list" should lead you on the right way btw. Pair your phone first, and I recommend stopping Kodi when testing just to make sure that the sound device is available.

    I have spent major part of yesterday's evening playing with pactl. I still can't figure out how to switch sources. Need some guidance.
    Here is the output of pactl list when music is playing in Kodi (from library) and iPhone is paired and playing music through BT, LE outputs music playing in Kodi:


  • Did you run "pactl load-module module-udev-detect" first? I don't see any alsa_card profiles in your list.

    Of course I dit not... :)

    Edited once, last by astep (September 18, 2016 at 12:57 PM).

  • Hi, here's what I've got when I try:

    Code
    zbox:~ # pactl load-module module-udev-detect
    Failure: Module initialization failed
    zbox:~ # pactl list short sources
    1    alsa_output.pci-0000_00_1b.0.analog-stereo.monitor    module-alsa-card.c    s16le 2ch 44100Hz    SUSPENDED
    2    alsa_input.pci-0000_00_1b.0.analog-stereo    module-alsa-card.c    s16le 2ch 44100Hz    SUSPENDED


    Nothing in the dmesg. Anyone has an idea why ?

    I'm fully for a checkbox in the settings saying "allow bluetooth streaming to this device".


  • Hi, here's what I've got when I try:

    Code
    zbox:~ # pactl load-module module-udev-detect
    Failure: Module initialization failed
    zbox:~ # pactl list short sources
    1    alsa_output.pci-0000_00_1b.0.analog-stereo.monitor    module-alsa-card.c    s16le 2ch 44100Hz    SUSPENDED
    2    alsa_input.pci-0000_00_1b.0.analog-stereo    module-alsa-card.c    s16le 2ch 44100Hz    SUSPENDED


    Nothing in the dmesg. Anyone has an idea why ?

    I'm fully for a checkbox in the settings saying "allow bluetooth streaming to this device".


    What are you wanting to stream to? Does it show up in alsa?

    Code
    aplay -l
  • No it doesn't:


    But it's there: my phone is paired with LibreElec, and accepts to stream music over BT; the problem is that nothing happens on the Kodi side, the audio is just lost somewhere.

  • I don't have a Raspberry Pi, it's a Zotac Z-Box, an intel-based computer, with a BT dongle used mainly for a BT keyboard, but with whom I'd like to stream audio from my phone.