Archive for December 2018

As a continuation of my previously posted Sennheiser GSX 1000 setup this is the followup which comes from a better understanding of pulseaudio and the device itself. First of all, the GSX 1000 exports three hardware devices. hw:1,0 and hw:1,1 as outputs as well as hw:1,0 as a microphone input. Regarding the outputs, hw:1,0 is actually the mono chat output that is mixed into the main 7.1 channel output by the GSX 1000. The offset from the main volume can be controlled with the small knob on the right side of the device. This makes it especially interesting for use with voice applications like mumble or teamspeak. Your friends are too loud or too low? Twist the knob and adjust on the fly. hw:1,1 is the main 7.1 channel output which - at the moment - does not get detected by pulseaudio as a 7.1 channel device which is why I wrote about the workaround in the previous post.

This new and updated solution should ease usability and possibly make this a copy and paste effort not depending on your system config. This new approach leverages udev in order to catch you plugging in your device and a special udev rule then sets an environmental variable to tell pulseaudio to use a different configuration file for the card. Also it sets a unique id so it is easier to reference the card in case you have more than one soundcard connected.

First of all you need to create a file 91-pulseaudio-gsx1000.rules in the directory /lib/udev/rules.d/ or wherever your udev stores its rules. In this file you put the following:

SUBSYSTEM!="sound", GOTO="pulseaudio_end"
ACTION!="change", GOTO="pulseaudio_end"
KERNEL!="card*", GOTO="pulseaudio_end"

ATTRS{idVendor}=="1395", ATTRS{idProduct}=="005e", ENV{PULSE_PROFILE_SET}="sennheiser-gsx-1000.conf", ATTR{id}="GSX1000"


1395 is the id for the vendor Sennheiser and 005e is the GSX 1000. After that we set the environment variable for pulseaudio and the id attribute of the soundcard. Now you need to create a second (and last, I promise!) file name sennheiser-gsx-1000.conf in your pulseaudio profile sets directory. For me this goes into /usr/share/pulseaudio/alsa-mixer/profile-sets/sennheiser-gsx-1000.conf:
auto-profiles = no

[Mapping analog-output-surround71]
description = main output
device-strings = hw:CARD=GSX1000,DEV=1
#device-strings = hw:%f,1
channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right
paths-output = analog-output analog-output-lineout analog-output-speaker
priority = 2

[Mapping analog-output-chat]
description = chat output
device-strings = hw:CARD=GSX1000,DEV=0
#device-strings = hw:%f,0
channel-map = mono
paths-output = analog-output-headphones analog-output-headphones-2 analog-output-mono
priority = 1

[Mapping analog-input]
description = microphone input
device-strings = hw:CARD=GSX1000,DEV=0
#device-strings = hw:%f,0
channel-map = mono
paths-input = analog-input-front-mic analog-input-rear-mic analog-input-internal-mic analog-input-dock-mic analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line analog-input-headset-mic
priority = 2

# Combined output profile
[Profile output:analog-output-surround71+output:analog-output-chat+input:analog-input]
description = 7.1 Surround
output-mappings = analog-output-surround71 analog-output-chat
input-mappings = analog-input
priority = 88
skip-probe = yes

Now, all that is left is to reload udev, trigger the new ruleset and restart pulseaudio.

$> sudo udevadm control -R
$> sudo udevadm trigger
$> pulseaudio -k

After a couple of seconds pulseaudio should have restarted and you should have a nice and functional GSX 1000. Now, if someone has found a way to get software volume control working and how to keep the GSX from going Volume-Down all the time please tell me. :) Until then the temporary workaround for that problem remains unchanged and you can find it in the old article.

After a bit of a hiatus due to a new job engagement I am hopefully back on a more regular basis. For today with some instructions on getting a Sennheiser GSX1000 audio amplifier to run under Linux. This device is a 7.1 channel surround headphone amplifier with a lot of integrated extra functionality and a nice volume wheel. It connects via USB and there are a few steps to get it working correctly with pulseaudio. It does work right after plugging it in but only in mono mode which is not exactly what I bought this for. ;)

First of all let us get the ids of the sound card playback devices (sinks) via

$> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 9: HDMI 3 [HDMI 3]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Audio [GSX 1000 Main Audio], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: Audio [GSX 1000 Main Audio], device 1: USB Audio [USB Audio #1]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

In my case, card 0 defaults to the HDMI output of my NVidia GPU, let us ignore those entries. Card 1 however is the Sennheiser GSX 1000. I am actually not 100% sure on why it is listed twice with the same subdevices. From trial and error I managed to find out that the subdevice 1 is the correct one to drive the unit. From this information we know that the hardware address of the card for playpack (sink) is 1,1 (card 1 subdevice 1). Next we have to find out the recording device (source).

$> arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Audio [GSX 1000 Main Audio], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

Our recording device (source) is at the hardware address 1,0 (card 1 subdevice 0 - as there is only one anyway). With this information we can tell pulseaudio how to correctly talk to our audio amplifier. Edit /etc/pulse/ and under Load audio drivers statically we add

load-module module-alsa-sink device=hw:1,1 channels=8
load-module module-alsa-source device=hw:1,0

The first line tells pulseaudio that the playback device (sink) is located at hardware address 1,1 and has 8 (7+1) channels. The second line defines our recording device (source) as hardware address 1,0. At this point you can either restart your pulseaudio with pulseaudio -k or opt for a reboot if you still have not shaken your Windows heritage. ;) Voilla, it works!

The only problem left for me was that the turning of the volume ring gets detected by the kernel as volume down no matter the direction you turn the know. As such I went into the keyboard shortcut settings and disabled the multimedia hotkeys for volume up and volume down. I don’t mind losing that functionality as I want to set the master volume via the GSX1000 wheel anyway. After this small fix I can just use the hardware functionality of the volume wheel as supposed to and that leaves me one happy Alex ^^.

Update: I have found a more elegant way to handle this device. Check out the followup!