OpenWrt Forum Archive

Topic: [wiki] play audio from bluetooth devices (bluez5, pulseaudio)

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

I submitted some changes to OpenWrt that should enable audio playback from bluetooth sources (Android mobile) to an OpenWrt "system" with bluetooth (USB dongle) and audio (speaker)

Wiki page: http://wiki.openwrt.org/wiki/bluetooth.audio

Please test

Getting bluetooth to run is difficult. Bluetooth development is fast, not documented and
there are issues with the bluez userspace development in general. [1]
So there are a ton of outdated documentation using bluez3 or bluez4.
Using Audio with bluez5 requires DBUS and pulseaudio. (bluez->alsa only in old bluez4)
Pulseaudio 6 supports bluez4 and blue5.

This guide uses Pulse6, bluez5 and DBUS

Another requirement: sbc library (split from bluez) and kmod-input-uinput

Recommended: Python because the test tools make use of python.
Test tools can supply legacy methods via commandline for pairing for example.


Most changes are submitted to the mailing list / github packages repo

Changing the (default) permissions of daemons (dbus,pulseaudio,bluetoothd) are not done atm but documented in the wiki - feel free to add/contribute.


[1] http://blog.projectnibble.org/2010/08/0 … ame-to-be/

(Last edited by zloop on 2 Apr 2015, 10:58)

Hello.
Where get Required OpenWrt packages:
    kmod-input-uinput (new)
    pulseaudio 6
    sbc library (new)
    bluez5
    dbus (because bluez5)
for x86?

on Wrt:

root@OpenWrt:~# opkg install kmod-input-uinput
Unknown package 'kmod-input-uinput'.
Collected errors:
 * opkg_install_cmd: Cannot install package kmod-input-uinput.

On toolchain:

openwrt$ scripts/feeds install kmod-input-uinput
WARNING: No feed for package 'kmod-input-uinput' found, maybe it's already part of the standard packages?

You might be using BB or your feed is not up to date

opkg update

should update the feed and then you should be able to install

kmod-input-uinput seems to be available for trunk - it is listed at:
https://downloads.openwrt.org/snapshots … ages/base/

zloop,

I was trying your instructions using the CC release but I was stumped by two problems:

1) I don't have  /etc/dbus-1/system.d/pulseaudio.conf. this file is not installed by any of the pulse audio packages

pulseaudio-daemon - 6.0-2
pulseaudio-profiles - 6.0-2
pulseaudio-tools - 6.0-2

2) when i try to run Paplay, I keep getting this error

root@EPIAV:/home# paplay music.mp3
Failed to open audio file.

3) The following 3 modules are missing as well.

load-module module-bluetooth-discover
load-module module-bluetooth-policy
load-module module-zeroconf-publish

If i don't comment it out, running pulseaudio -nF system.pa would fail.
Do you know where I can get these modules?

Some updates on the sequence of the post. You need to make the changes to the dbus access control before using the bluetoothctl command. If you try to run bluetoothctl before making the changes to the dbus config file, bluetoothctl will just show you the bluetooth prompt. You can only control break of the program.

For the pulseaudio.conf file, you can use this one => https://gist.github.com/dlech/7e9d28bcc … tooth-conf

I have managed to paplay a wave file after doing this. However, I am unsure if this is because I have finally found a proper file to play. Take note that paplay does not play MP3 files, just a whole bunch of uncompressed formats.

I am still missing the bluetooth modules.

The discussion might have continued from here.