OpenWrt Forum Archive

Topic: bluetooth + pulseaudio

The content of this topic has been archived on 31 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I'm trying to setup a bluetooth audio sink on my router with the current trunk. Searched the forum but still do not have a clean picture how to do that. I've managed to get pulseaudio working and now I want to configure bluetooth with it.

I compiled bluez-utils with --enable-audio and pulseaudio with --enable-bluez.
Tried to load-module-bluetooth-discover in the /etc/pulse/system.pa but this module isn't loading and also not listed with --dump-modules

the router is not discoverable but hcid is running.

What should I do next?

thanks

I managed to compile pulseaudio with the bt support. The only problem is to initialize bluez correctly because it doesn't seem to have audio profile activated

I'm loading bt module the following way:

load-module module-bluetooth-device profile=a2dp channels=2 sink_name="BT Audio" path="/org/bluez/hci0"

and here is the result

D: [pulseaudio] bluetooth-util.c: dbus: interface=org.freedesktop.DBus, path=/org/freedesktop/DBus, member=NameAcquired
E: [pulseaudio] bluetooth-util.c: org.bluez.Manager.ListAdapters() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "ListAdapters" with signature "" on interface "org.bluez.Manager" doesn't exist
I: [pulseaudio] module.c: Loaded "module-bluetooth-discover" (index: #6; argument: "").
E: [pulseaudio] module-bluetooth-device.c: /org/bluez/hci0 is not a valid BlueZ audio device.
E: [pulseaudio] module.c: Failed to load module "module-bluetooth-device" (argument: "profile=a2dp channels=2 sink_name="BT Audio" path="/org/bluez/hci0""): initialization failed.
E: [pulseaudio] main.c: Module load failed.
E: [pulseaudio] main.c: Failed to initialize daemon.

bluez-utils where compiled with --enable-audio

Any hints here?

Hm,

root@Buffalo:~# dbus-send --system --dest=org.bluez --print-reply /org/bluez org.bluez.Manager.ActivateService string:Audio
Error org.bluez.Error.NoSuchService: No such service

but seems like audio services are compiled into the hcid

root@Buffalo:~# strings $(which hcid) | grep -i audio
Audio service
audio/video
portable audio
car audio
hifi audio

and I've added a /etc/bluetooth/audio.conf with following content

root@Buffalo:~# grep ^[^#] /etc/bluetooth/audio.conf 
[General]
Enable=Socket
AutoConnect=true
[Headset]
HFP=true
MaxConnected=1
FastConnectable=false

nobody?

I'd think that audio support is somehow broken or not integrated into bluez-utils. But it seems like it possible with bluez-libs 3.36 to connect alsa to a bt headset.

Well it's been a long time Flux, but I'm working on the same thing you are.
I can't get pulse to compile with the bluetooth module, seems like you figured it out though.
Could you share how you did it by any chance if you happen to read this?

I've got a whole thread on my misadventures with this here:
https://forum.openwrt.org/viewtopic.php?id=53093

I am also looking forward to this since a long time ago, but everybody says that OpenWRT Bluetooth support is kinda poor and broken.
I have already got a working setup with Shairport for audio streaming over Wi-Fi using an USB sound card with Toslink Optical output, I was hoping to get also Bluetooth A2DP audio receiving support. sad

If anybody works out how to do Bluetooth A2DP audio receiving, please let me know!  Very interested.

dcam wrote:

If anybody works out how to do Bluetooth A2DP audio receiving, please let me know!  Very interested.

You can code a program in c to do that using bluez libs, in a few of steps.

1. Set the class ID of your bt dongle to headset profile (using hciconfig of bluez)
2. Open a rfcomm connection to the bt device address and channel of A2DP (using sdptool to know what is the channel of AD2P of your device).
3. Send the commands AT in the rfcomm connection to active a SCO channel (see the AT commands in the bluetooth official website).
4. Open a bluetooth SCO connection.
5. Poll both connections in the c program and send the data you get by SCO to a audio sink (the data is received in PCM RAW audio format).

Hi,
Is there a requirement of installing pulseaudio-bluetooth package for using A2DP profile as source and sink? Also if anybody could provide some information on enabling A2DP source and sink on openwrt with bluez, it would be highly appreciated.

Thanks

The discussion might have continued from here.