Tag/tag.png

Style Cleanup Required
This article does not follow the style standards in the Wiki Guide. More info...

Tag/tag.png

Unsupported Version
This article applies to an unsupported version of Ubuntu. More info...

Tag/tag.png

Candidate for Deletion
This article may not be appropriate for this wiki, and may be deleted. More info...

How To - Get the volume control working on the Plantronics USB headset

Overview

I got a Plantronics USB headset to use for Skype. The headset has a control with volume and mute buttons. While the headset itself worked straight off, the volume control did not. I also had problems if the headset was plugged in when I booted the PC.

The model I have is the DSP 300, although I expect that these instructions will work for other models also.

When I first tried to use the headset, It worked fine, but I couldn't control the volume or mute the mic no matter what I tried. I still don't know what changed, but at some point the headset could be controlled from alsamixer. This may have started working at the same time I downloaded new firmware to the device, I just don't know.

I want the headset to be the second device

If I booted the PC without the headset, my main sound card would naturally be the first device(/dev/dsp). Plugging in the headset now would make it the second device (/dev/dsp1).

If I booted with the headset plugged in, the headset device drivers would load first,making the headset the first device. I wanted things to be consistent.

The assignment of device numbers can be controlled using a module parameter. Create new file /etc/modprobe.d/usb-headset with

# Set usb headset as second device
options snd_usb_audio index=1

Now when I boot, the headset is always the second device.

Getting the volume control to work

The mute button worked without any action on my part, but the volume did not.

The trick In getting the volume control to work was realising that part of the headset was behaving like a USB keyboard. The mute and volume buttons were sending keycodes to the system.

I used xev (from xbase-clients package), to find what keycodes are being generated by the headset.

I used lineakd to handle the keycodes from the headset.

Create a definition file for the headset in ~/.lineak/lineakkb.def

[PLA-DSP300]
  brandname = "Plantronics"
  modelname = "DSP 300 headset"
  [KEYS]
    AudioMute        = 123
    AudioLowerVolume = 174
    AudioRaiseVolume = 176
  [END KEYS]
[END PLA-DSP300]

Then create a config file ~/.lineak/lineakd.conf

KeyboardType = PLA-DSP300
AudioLowerVolume = /usr/bin/amixer -c 1 set PCM 2-
AudioLowerVolume+shift = /usr/bin/amixer -c 1 set Mic 2-
AudioMute =
AudioRaiseVolume = /usr/bin/amixer set -c 1 PCM 2+
AudioRaiseVolume+shift = /usr/bin/amixer set -c 1 Mic 2+

Start the lineakd daemon in the background and the volume control should work.

Starting lineakd automatically

Create a script lineakd. I created it in /etc/init.d, but it could be anywhere. (Don't create links from /etc/rc?.d. The daemon must be started from an X session).

#
# Start the lineakd daemon
#

LINEAKD=/usr/bin/lineakd

case "$1" in
  start)
        echo  "Starting lineakd "
        $LINEAKD > /dev/null &
  ;;
  reload)
        echo  "Reloading lineakd config files "
        $LINEAKD -r
  ;;
  stop)
        echo  "Stopping lineakd "
        $LINEAKD -x
  ;;
  *)
    echo "Usage: $0 {start|stop|reload}" >&2
    exit 1
esac

exit 0

With Gnome, use System->Preferences->Sessions. Select "Startup Programs" tab. Add "/etc/init.d/lineakd start". I don't know what the KDE equivalent would be.

Now when you log in using Gnome, the lineakd daemon will start automatically.

It doesn't work if the headset is plugged in at boot

If the headset is plugged in while the PC is booting, the controls do not work. If the headset is plugged in afterwards it does work.

This appears to be something about the order the snd_usb_audio and usbhid modules are loaded. If snd_usb_audio is loaded first, things work ok.

To force snd_usb_audio to be loaded before usbhid, I added to my /etc/modprobe.d/usb-headset

# Make sure that snd_usb_audio is loaded before usbhid
install usbhid modprobe  snd-usb-audio; modprobe --ignore-install usbhid

PlantronicsUSBHeadsetControls (last edited 2017-09-08 03:00:39 by ckimes)