Kodi Community Forum
Bluetooth Audio under Raspbmc - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: General Support (https://forum.kodi.tv/forumdisplay.php?fid=111)
+---- Forum: Raspberry Pi (https://forum.kodi.tv/forumdisplay.php?fid=166)
+---- Thread: Bluetooth Audio under Raspbmc (/showthread.php?tid=169842)



Bluetooth Audio under Raspbmc - spacex - 2013-07-26

Hi there!

Setup:
XBMC nightly 13-20130724 (but I also tried earlier nightlies and the default version of XBMC that comes with Raspian 12-20130504)
Raspbmc
Raspberry PI B rev. 2
Addons: Raspbmc settings
Raspbmc has a setting to enable/disable AudioEngine. I tried both (not sure if this actually does anything, I didn't notice any difference)

Issue:
I have a Bluetooth Speaker which I can connect to my Pi. It gets picked up by blueman and set as an audio device, at which point I can make it known to ALSA with the following /etc/asound.conf

Code:
pcm.!default {
        type bluetooth
            device 00:02:3C:26:BA:87 # change this MAC address using the command "hcitool scan"
            profile "auto"}

Pulseaudio does not pick it up, because there is some weird permission problem with the bluetooth module and I cannot make it use ALSA as a sink, because the module-alsa-sink fails with a non-descriptive error message.

Yet, I can make mplayer use the ALSA configuration with
Code:
mplayer -ao alsa http://robtowns.com/music/blind_willie.mp3
or if I remove pulesaudio with
Code:
mplayer http://robtowns.com/music/blind_willie.mp3

Unfortunately, XBMC does not pick this up at all.

In the audio menu, I only have two options: Analog and HDMI. They output to the headphone jack and (probably) the HDMI, but not to my bluetooth speakers. Also, I saw in some screenshots on the net that there are supposed to be more settings in the audio output settings screen (like here: http://askubuntu.com/questions/145052/xbmc-passthrough-audio-and-pulse), but my dialog only has the topmost option, which chooses between Analog and HDMI.

I also tried using advancedsettings.xml to that end, but to no avail:
Code:
<advancedsettings>
<audiooutput>
        <audiodevice>ALSA:beide</audiodevice>
        <passthroughdevice>ALSA:beide</passthroughdevice>
    </audiooutput>
</advancedsettings>

Is there any way to tell XBMC to use my default ALSA device, which is a bluetooth speaker? Or does XBMC ignore ALSA completely?

Any help would be greatly appreciated! :-)


RE: Bluetooth Audio under Raspbmc - fedexp - 2013-07-26

Guess we are in the same boat here... I had posted something very similar.
One thing that you can probably do is specify your device as audio out on omxplayer command line - I would think that you would have to this from somewhere in xbmc configuration file. I am stuck here as well - please let me know if you find something that works


RE: Bluetooth Audio under Raspbmc - spacex - 2013-07-26

Welcome then, shipmate ;-)

I tried to do that as well, but OMXPlayer seems to be compiled directly into XBMC, so there is no way to specify any command line options. Plus OMXPlayer doesn't seem to have any global config file like mplayer.

Using an external player (e.g. mplayer) might be an option, but then I think we'd lose the nice integration with XBMC (play, pause, progress bar etc.), so I'd like to avoid that if possible.


RE: Bluetooth Audio under Raspbmc - fedexp - 2013-07-26

With external player you also loose hardware decoding abilities for video -people who tried it reported laggy video playback. But if you intend to play just audio, external player might just do the job for you.


RE: Bluetooth Audio under Raspbmc - spacex - 2013-07-26

ah, good to know! no, I'd like it for both video and audio. After all: a movie without sound is kind of pointless Tongue (except for a few black-and-white ones ;-))

So do we know if XBMC uses pulseaudio or alsa or anything similar? I don't want to spend a lot of time on trying to fix pulseaudio when XBMC isn't actually using it.


Re: Bluetooth Audio under Raspbmc - nickr - 2013-07-27

Xbmc on rpi does not use pulse or alsa. You could try an analogue to Bluetooth convertor.


RE: Bluetooth Audio under Raspbmc - spacex - 2013-07-27

That's no good, I can already plug the thing into the audio jack (it has an analog in), but the sound quality is drastically worse.

What about this: https://github.com/xbmc/xbmc/tree/master/xbmc/cores/AudioEngine/Engines/PulseAE
And this: https://github.com/xbmc/xbmc/tree/master/xbmc/cores/AudioEngine/Sinks

There seems to be code for both Alsa and PulseAudio here?


RE: Bluetooth Audio under Raspbmc - spacex - 2013-07-27

I see now. After some more googling, I came across these pages:

http://www.raspberrypi.org/phpBB3/viewtopic.php?f=70&t=33101
Apparently XBMC exclusively uses OpenMAX on the RPi, not Alsa nor Pulse. And the non-OpenSource Broadcom implementation of OpenMAX as that, since it supports HW acceleration on the RPi.

https://github.com/raspberrypi/userland/issues/70
There is no ALSA sink for the broadcom implementation.
There is one for the bellagio implementation, but that has no HW acceleration.

http://forum.stmlabs.com/showthread.php?tid=1052
There's this dirty hack, which sort of works and sort of not :/

All in all: no luck with ALSA ;-)


Re: Bluetooth Audio under Raspbmc - nickr - 2013-07-27

Which is what I said above


RE: Bluetooth Audio under Raspbmc - spacex - 2013-07-28

Exactly, I was trying to understand why as well ;-)


RE: Bluetooth Audio under Raspbmc - Rajeevsa - 2014-02-26

Guys joining this party very late but despite of searching the net and scouring this forum I couldn't find a way to send sound from raspbmc to my bluetooth speaker.
Context:
I have an acer K11 projector which I have connected to my raspbmc. This setup allows me to access my nas media center through my raspbmc wirelessly and project it on my wall using my projector. The whole setup works pretty neatly since the raspbmc is powered through my acer kqq USB port. Tunis means that when I start up my projector my raspbmc boots up and presents a nice display. Now the problem is that the acer k11 projector has very teeny speakers (2watts) which are no good. I can hook up a small speaker to my raspbmc via the audio Pitt but it would mean hooking up my speakers next to my projector, I would rather have raspbmc send. Audio wirelessly to my bluetooth speakers placed next to my projection wall to give the cinematic experience. In worst case scenario I would run a wire across the room, but don't want to give up so soon. Hopefully I can find a solution for streaming audio via bluetooth to my sony bluetooth speakers. Please don't give suggestion to use analog to bluetooth adapters on raspbmc, I am hell bent on hooking up a bluetooth dingle in raspbmc and transmitting audio via bluetooth.


RE: Bluetooth Audio under Raspbmc - nickr - 2014-02-26

Read post #8 (3 above yours).


RE: Bluetooth Audio under Raspbmc - alvarjo - 2015-06-09

Hello,
Have been implemented also or pulseaudio in Kodi?. I have seen in audio ouptsettings that ppalyback pulse audio appears, but I was not able to get audio form my headset, and I was able to pair them, I was only able to send music to my headset via aplay -D bluetooth command.

Does anyone how to insytall pulseaudio, start this service and add headset bluettoth in the raspberry?. i think that is not working in kodi because something is missing in my pulseaudio configuration or the service did not started.

Thanks