Difference between revisions of "Bluetooth headset"

From ArchWiki
Jump to: navigation, search
m (Bot: Removing from Category:HOWTOs (English))
(Added the "new" method using pulseaudio, removed clutter in BTSCO method headings.)
Line 2: Line 2:
 
This article describes how to set up a bluetooth headset with Arch Linux. Before you get started, you have to make sure that bluetooth is set up and working, especially that the ''dbus'' and ''hcid'' (started with the bluetooth start scriptlet) daemons are running.
 
This article describes how to set up a bluetooth headset with Arch Linux. Before you get started, you have to make sure that bluetooth is set up and working, especially that the ''dbus'' and ''hcid'' (started with the bluetooth start scriptlet) daemons are running.
  
== Latest Hint ==
+
== ALSA-BTSCO method ==
  
 
It is much easier to set up your bluetooth headset today, with bluez >= 3.16. All you have to do is following the [http://wiki.bluez.org/wiki/HOWTO/AudioDevices bluez official howto]>> bluez wiki does not exist enymore :(  And you may wanna try the out-of-box python script in [http://fosswire.com/2008/01/11/a2dp-stereo-linux/ this blog] (you need edit the skript to work with gconftool-2). There's also a piece of equivalent bash script [http://lymanrb.blogspot.com/2008/05/linux.html here].
 
It is much easier to set up your bluetooth headset today, with bluez >= 3.16. All you have to do is following the [http://wiki.bluez.org/wiki/HOWTO/AudioDevices bluez official howto]>> bluez wiki does not exist enymore :(  And you may wanna try the out-of-box python script in [http://fosswire.com/2008/01/11/a2dp-stereo-linux/ this blog] (you need edit the skript to work with gconftool-2). There's also a piece of equivalent bash script [http://lymanrb.blogspot.com/2008/05/linux.html here].
Line 8: Line 8:
 
The following method is '''out-of-date''' and '''obsoleted'''.
 
The following method is '''out-of-date''' and '''obsoleted'''.
  
'''NOTE: This method is also outdated as with newer versions of BlueZ.''' The simplest way to setup your headset is to follow the steps at http://www.funkynerd.com/using-a2dp-bluetooth-in-kubuntu-karmic. Make sure to take a look at the [[PulseAudio]] wiki entry for setting up PulseAudio, especially if you are running KDE.
+
'''NOTE: This method is also outdated as with newer versions of BlueZ.'''  
  
== Required software ==
+
You need your headset's bdaddr. It is of the form ''12:34:56:78:9A:BC''. Either find it in the documentation of your headset, on the headset itself or with the '''hcitool scan''' command.
  
 
You need the '''btsco''' package from the community repository. If you use the beyond kernel, then grab the '''btsco-beyond''' package.
 
You need the '''btsco''' package from the community repository. If you use the beyond kernel, then grab the '''btsco-beyond''' package.
 
  # pacman -S btsco
 
  # pacman -S btsco
  
== Finding out your headset's bluetooth bdaddr ==
+
To load the kernel module, type
 
+
You need your headset's bdaddr. It is of the form ''12:34:56:78:9A:BC''. Either find it in the documentation of your headset, on the headset itself or with the '''hcitool scan''' command.
+
 
+
== Loading the kernel module ==
+
 
+
The command
+
 
  # modprobe snd-bt-sco
 
  # modprobe snd-bt-sco
loads the btsco kernel module. There will now be an extra audio device. Use '''alsamixer -cN''' (where N is most likely 1) to set the volume. You can access the device with any alsa-capable application by choosing the device ''BT headset'', or with any OSS application by using ''/dev/dspN'' as the audio device.
+
There will now be an extra audio device. Use '''alsamixer -cN''' (where N is most likely 1) to set the volume. You can access the device with any alsa-capable application by choosing the device ''BT headset'', or with any OSS application by using ''/dev/dspN'' as the audio device.
  
 
But to actually get any sound, you have to connect your headset to the computer first.
 
But to actually get any sound, you have to connect your headset to the computer first.
  
== Connecting the headset ==
+
=== Connecting the headset ===
  
 
If you connect your headset for the first time, read the section about pairing first. To connect to your headset to the computer, use the command
 
If you connect your headset for the first time, read the section about pairing first. To connect to your headset to the computer, use the command
Line 34: Line 28:
 
  $ btsco -f 12:34:56:78:9A:BC
 
  $ btsco -f 12:34:56:78:9A:BC
  
=== Pairing the headset with your computer ===
+
==== Pairing the headset with your computer ====
  
 
The first time you connect the headset, you have to pair it with the computer. To do this, you need your headset's PIN. Depending on your headset you may have to reset the headset and repeat the pairing everytime you used the headset with another bluetooth device.
 
The first time you connect the headset, you have to pair it with the computer. To do this, you need your headset's PIN. Depending on your headset you may have to reset the headset and repeat the pairing everytime you used the headset with another bluetooth device.
Line 40: Line 34:
 
There are two ways to pair your headset with the computer:
 
There are two ways to pair your headset with the computer:
  
==== Using ''bluez-gnome'' ====
+
===== Using ''bluez-gnome'' =====
  
 
Install the ''bluez-gnome'' package from the community repository. Then start the '''bt-applet''' program. Once you try to connect to the headset, a window will open and ask for the PIN.
 
Install the ''bluez-gnome'' package from the community repository. Then start the '''bt-applet''' program. Once you try to connect to the headset, a window will open and ask for the PIN.
  
==== Using ''passkey-agent'' ====
+
===== Using ''passkey-agent'' =====
  
 
Before connecting to the headset, enter the command
 
Before connecting to the headset, enter the command
Line 50: Line 44:
 
where ''<pin>'' is your headset's PIN. Then try to connect to the headset.
 
where ''<pin>'' is your headset's PIN. Then try to connect to the headset.
  
== Headset's multimedia buttons ==
+
=== Headset's multimedia buttons ===
  
 
In order to get your bluetooth headset's multimedia buttons (play, pause, next, previous) working you need to add '''uinput''' to MODULES section in /etc/rc.conf:
 
In order to get your bluetooth headset's multimedia buttons (play, pause, next, previous) working you need to add '''uinput''' to MODULES section in /etc/rc.conf:
 
  MODULES=(fuse ipw2200 ... '''uinput''')
 
  MODULES=(fuse ipw2200 ... '''uinput''')
 +
 +
 +
== PulseAudio method ==
 +
 +
This one`s much easier and more elegant. PulseAudio will seamlessly switch between output devices when the headset is turned on. If you have ALSA as the sound server, you need the following packages installed:
 +
# pacman -S pulseaudio pulseaudio-alsa
 +
The latter package is the only one in the '''pulseaudio-gnome''' group, you could install that instead.
 +
 +
Now, to configure the audio output to use bluetooth, just install and run '''pavucontrol''' to configure the audio output:
 +
# pacman -S pavucontrol
 +
$ pavucontrol
 +
 +
That`s it!
 +
 +
See [[http://www.funkynerd.com/using-a2dp-bluetooth-in-kubuntu-karmic this blog]] for futher explanations. Make sure to take a look at the [[PulseAudio]] wiki entry for setting up PulseAudio, especially if you are running KDE.
 +
 
== Links ==
 
== Links ==
 
Alternative method of connecting a BT headset to Linux:
 
Alternative method of connecting a BT headset to Linux:

Revision as of 14:06, 14 June 2011

This article describes how to set up a bluetooth headset with Arch Linux. Before you get started, you have to make sure that bluetooth is set up and working, especially that the dbus and hcid (started with the bluetooth start scriptlet) daemons are running.

ALSA-BTSCO method

It is much easier to set up your bluetooth headset today, with bluez >= 3.16. All you have to do is following the bluez official howto>> bluez wiki does not exist enymore :( And you may wanna try the out-of-box python script in this blog (you need edit the skript to work with gconftool-2). There's also a piece of equivalent bash script here.

The following method is out-of-date and obsoleted.

NOTE: This method is also outdated as with newer versions of BlueZ.

You need your headset's bdaddr. It is of the form 12:34:56:78:9A:BC. Either find it in the documentation of your headset, on the headset itself or with the hcitool scan command.

You need the btsco package from the community repository. If you use the beyond kernel, then grab the btsco-beyond package.

# pacman -S btsco

To load the kernel module, type

# modprobe snd-bt-sco

There will now be an extra audio device. Use alsamixer -cN (where N is most likely 1) to set the volume. You can access the device with any alsa-capable application by choosing the device BT headset, or with any OSS application by using /dev/dspN as the audio device.

But to actually get any sound, you have to connect your headset to the computer first.

Connecting the headset

If you connect your headset for the first time, read the section about pairing first. To connect to your headset to the computer, use the command

$ btsco -f <bdaddr>

for example

$ btsco -f 12:34:56:78:9A:BC

Pairing the headset with your computer

The first time you connect the headset, you have to pair it with the computer. To do this, you need your headset's PIN. Depending on your headset you may have to reset the headset and repeat the pairing everytime you used the headset with another bluetooth device.

There are two ways to pair your headset with the computer:

Using bluez-gnome

Install the bluez-gnome package from the community repository. Then start the bt-applet program. Once you try to connect to the headset, a window will open and ask for the PIN.

Using passkey-agent

Before connecting to the headset, enter the command

$ passkey-agent --default <pin>

where <pin> is your headset's PIN. Then try to connect to the headset.

Headset's multimedia buttons

In order to get your bluetooth headset's multimedia buttons (play, pause, next, previous) working you need to add uinput to MODULES section in /etc/rc.conf:

MODULES=(fuse ipw2200 ... uinput)


PulseAudio method

This one`s much easier and more elegant. PulseAudio will seamlessly switch between output devices when the headset is turned on. If you have ALSA as the sound server, you need the following packages installed:

# pacman -S pulseaudio pulseaudio-alsa

The latter package is the only one in the pulseaudio-gnome group, you could install that instead.

Now, to configure the audio output to use bluetooth, just install and run pavucontrol to configure the audio output:

# pacman -S pavucontrol
$ pavucontrol

That`s it!

See [this blog] for futher explanations. Make sure to take a look at the PulseAudio wiki entry for setting up PulseAudio, especially if you are running KDE.

Links

Alternative method of connecting a BT headset to Linux:


See also: