Thread: AudIO (A2DP) streaming from device to Ubuntu host using ALSA
hi,
i've succeeded streaming audio android device ubuntu 12.04 host pc of pulseaudio. needed using command line commands (i.e. no ui helpers), since next step make on embedded system.
these steps followed in case useful:
a) edit /etc/bluetooth/audio.conf , add
on general section (read somewhere if fails enable=socket might work).code:enable=source
b) pair device using:
note: previous steps stopped working after while (still working on embedded system), i'm still trying figure out why. output get:code:hcitool dev -> bluetooth device <bt_dev> hcitool scan ->get device mac address bluez-simple-agent <bt_dev> xx:xx:xx:xx:xx:xx -> xx:xx:xx:xx:xx:xx device mac address
anyway, after setting device blueman (sudo apt-get install blueman) next steps still work.code:requestconfirmation (/org/bluez/955/hci0/dev_xx_xx_xx_xx_xx_xx, 357756) confirm passkey (yes/no): yes release creating device failed: org.freedesktop.dbus.error.noreply: did not receive reply. possible causes include: remote application did not send reply, message bus security policy blocked reply, reply timeout expired, or network connection broken.
c) configure android device use ubuntu host media media audio (on htc 1 x go settings->bluetooth->select device->select use media audio.
d) bluetooth device object path. can output on step b or use:
e) connect device audio sourcecode:adapter=`dbus-send --print-reply --system --dest=org.bluez / org.bluez.manager.defaultadapter | cut -d'"' -f 2 | grep org` device_path=`dbus-send --system --dest=org.bluez --print-reply $adapter org.bluez.adapter.listdevices | grep path | cut -d'"' -f 2`
f) bluez audio source , alsa audio sinkcode:dbus-send --print-reply --system --dest=org.bluez $device_path org.bluez.audiosource.connect
g) connect bluez audio source alsa outputcode:source=`pacmd list-sources | grep bluez | grep card | cut -d"<" -f2` sink=`pacmd list-sinks | grep alsa | grep card | grep pci | cut -d"<" -f2` (note: 1 might not work on side, use list-sinks , yours)
h) play audio on mobile device , listen on speakerscode:id=`pactl load-module module-loopback source=$source sink=$sink`
i) stop playback
j) disconnect audio source:code:pactl unload-module $id
now, using alsa only. tried doing going through steps e , created/modified file /etc/asound.conf:code:dbus-send --print-reply --system --dest=org.bluez $device_path org.bluez.audiosource.disconnect
but when docode:#/etc/asound.conf pcm.btheadset { type plug slave { pcm { type bluetooth device xx:xx:xx:xx:xx:xx profile "auto" } } hint { show on description "bt headset" } } ctl.btheadset { type bluetooth }
i get:code:arecord -d btheadset test.wav
i've looked around apparently people want stream host device (headset model) , posts ~3 years old. suggestions welcomecode:recording wave 'test.wav' : unsigned 8 bit, rate 8000 hz, mono alsa lib pcm_params.c:2162:(snd1_pcm_hw_refine_slave) slave pcm not usable arecord: set_params:1059: broken configuration pcm: no configurations available
i trying achieve same result varying levels of success.
1 thing have noticed think asound.conf set bluetooth output, not input. have yet find way of configuring bluez output directly alsa (which holy grail both seeking).
managed better quality result pulseaudio using pacat in example http://thelinuxexperiment.com/guinea-pigs/tyler-b/fix-pulseaudio-loopback-delay/
nice rid of pa adds processing overhead underpowered raspberry pi.
Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu] AudIO (A2DP) streaming from device to Ubuntu host using ALSA
Ubuntu
Comments
Post a Comment