Bluetooth, Bluez, Headsetd, A2DPD, Jabra, Motorola HT820,Kaffeine

linuxren 2023年12月14日17:55:41未分类97字数 2366阅读7分53秒阅读模式

howto setup a bluetooth mono headset(aka, MONO) or stereo Headset under linux.

1, what we had already:
hardware:
bluetooth USB dongle, CSR chipset.
Jabra BT250
Motorola HT820

software:

kernel-2.6.20.4 with sco flow control patch(this patch is under plugz patches directory, need some modification to apply)
alsa-libs-1.0.14rc3(up to now, the latest version)
libsbc
plugz
bluez bluetooth stack from bluez.org

2, setup
I assume every body knows how to pair a bluetooth device, so we do not touch it here.

1, get plugz and sbc from bluetooth-alsa.soruceforge.net

cvs -d:pserver:anonymous@sbc.cvs.sourceforge.net:/cvsroot/sbc login
cvs -d:pserver:anonymous@sbc.cvs.sourceforge.net:/cvsroot/sbc co sbc
cd sbc
./bootstrap
./configure --prefix=/usr
make
sudo make install

install plugz:

cvs -d:pserver:anonymous@bluetooth-alsa.cvs.sourceforge.net:/cvsroot/bluetooth-alsa login
cvs -d:pserver:anonymous@bluetooth-alsa.cvs.sourceforge.net:/cvsroot/bluetooth-alsa co plugz
cd plugz
./bootstrap
./configure --prefix=/usr --sysconfdir=/etc
make
sudo make install

2,pair device

3,create /etc/asound.conf(it will included by /etc/alsa/alsa.conf) like below:

pcm.headset {
@args [BDADDR TIMEOUT]

# The Bluetooth device address for target headset, used for Audio Gateway (PC) initiated connections
# Please note that this value is ignored when the connection is Headset initiated
@args.BDADDR {
type string
default "00:07:A4:0A:55:65"
}

# This value represents how long we will try to reach the headset, until we give up.
# Value is in milliseconds
@args.TIMEOUT {
type integer
default 6000
}
type sco
bdaddr $BDADDR
timeout $TIMEOUT
}

ctl.headset {
type sco
}

pcm.a2dpd {
type a2dpd
}

NOTE: the line contains bluetooth headset address, it means you mono bluetooth headset, use "hcitool scanning" to get it.

4, create ~/.a2dprc, used by a2dpd. you can get a example from "plugz"
[a2dpd]
rate=44100
sbcbitpool=32
flags=0
enablereversestereo=1
enableautoconnect=1
timeout=2000
cmdplay=xmms --play
cmdpause=xmms --pause
cmdprev=xmms --rew
cmdnext=xmms --fwd
cmdnew=xmms --play
cmdstop=xmms --stop
enableavrcp=1
enablerereadconfig=1
enabledebug=0
enablestdin=0
enableredirectalsa=0
address=00:07:A4:B5:BC:B1
alsaoutput=

NOTE: "address" means your stereo headset address.

5, run daemons:
run a2dpd and headsetd from command line.

6,test
mono headset(jabra BT250)
aplay -Dplug:pcm.headset /usr/share/sounds/KDE_Startup.wav
stereo headset(Motorola HT820)
aplay -Dplug:a2dpd /usr/share/sounds/KDE_Startup.wav
you will get a crash here, just ignore it.

7,kaffeine settings.
from "settings" - "xine engine"
find audio tab.
change audio driver to "alsa"
then goto "advanced" tab, change "device.alsa_front_device" to "plug:a2dpd"

相关文章
weinxin
我的微信公众号
微信扫一扫