alsa-mixer: add support for Sennheiser GSX 1000 gaming DAC
authorPatrick McLean <chutzpah@gentoo.org>
Wed, 26 Feb 2020 08:26:12 +0000 (00:26 -0800)
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>
Wed, 9 Dec 2020 16:51:16 +0000 (16:51 +0000)
This same profile should also work for the GSX 1200, but I don't know the USB id
for that.

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/257>

src/Makefile.am
src/modules/alsa/90-pulseaudio.rules
src/modules/alsa/alsa-mixer.c
src/modules/alsa/mixer/paths/analog-output-chat.conf [new file with mode: 0644]
src/modules/alsa/mixer/paths/virtual-surround-7.1.conf [new file with mode: 0644]
src/modules/alsa/mixer/profile-sets/sennheiser-gsx.conf [new file with mode: 0644]

index df912a8..eeec40b 100644 (file)
@@ -1370,7 +1370,8 @@ dist_alsaprofilesets_DATA = \
                modules/alsa/mixer/profile-sets/dell-dock-tb16-usb-audio.conf \
                modules/alsa/mixer/profile-sets/cmedia-high-speed-true-hdaudio.conf \
                modules/alsa/mixer/profile-sets/hp-tbt-dock-120w-g2.conf \
-               modules/alsa/mixer/profile-sets/hp-tbt-dock-audio-module.conf
+               modules/alsa/mixer/profile-sets/hp-tbt-dock-audio-module.conf \
+               modules/alsa/mixer/profile-sets/sennheiser-gsx.conf
 
 if HAVE_UDEV
 dist_udevrules_DATA = \
@@ -1417,7 +1418,9 @@ dist_alsapaths_DATA = \
                modules/alsa/mixer/paths/steelseries-arctis-output-game-common.conf \
                modules/alsa/mixer/paths/usb-gaming-headset-input.conf \
                modules/alsa/mixer/paths/usb-gaming-headset-output-mono.conf \
-               modules/alsa/mixer/paths/usb-gaming-headset-output-stereo.conf
+               modules/alsa/mixer/paths/usb-gaming-headset-output-stereo.conf \
+               modules/alsa/mixer/paths/analog-output-chat.conf \
+               modules/alsa/mixer/paths/virtual-surround-7.1.conf
 
 endif
 
index 4de4012..cc5a359 100644 (file)
@@ -150,6 +150,13 @@ ATTRS{idVendor}=="0951", ATTRS{idProduct}=="1703", ENV{ID_ID}="usb-HyperX_Cloud_
 # OnePlus Type-C Bullets (ED117)
 ATTRS{idVendor}=="2a70", ATTRS{idProduct}=="1881", ENV{PULSE_PROFILE_SET}="simple-headphones-mic.conf"
 
+# ID 1395:005e is for Sennheiser GSX 1000
+# ID 1395:00a0 is for Sennheiser GSX 1000
+# ID 1395:005f is for Sennheiser GSX 1200
+ATTRS{idVendor}=="1395", ATTRS{idProduct}=="005e", ENV{PULSE_PROFILE_SET}="sennheiser-gsx.conf"
+ATTRS{idVendor}=="1395", ATTRS{idProduct}=="00a0", ENV{PULSE_PROFILE_SET}="sennheiser-gsx.conf"
+ATTRS{idVendor}=="1395", ATTRS{idProduct}=="005f", ENV{PULSE_PROFILE_SET}="sennheiser-gsx.conf"
+
 GOTO="pulseaudio_end"
 
 LABEL="pulseaudio_check_pci"
index 937771d..f978f71 100644 (file)
@@ -2729,6 +2729,9 @@ static int path_verify(pa_alsa_path *p) {
         { "multichannel-output",              N_("Multichannel Output"),          PA_DEVICE_PORT_TYPE_LINE },
         { "steelseries-arctis-output-game-common", N_("Game Output"),             PA_DEVICE_PORT_TYPE_HEADSET },
         { "steelseries-arctis-output-chat-common", N_("Chat Output"),             PA_DEVICE_PORT_TYPE_HEADSET },
+        { "analog-chat-output",               N_("Chat Output"),                  PA_DEVICE_PORT_TYPE_HEADSET },
+        { "analog-chat-input",                N_("Chat Input"),                   PA_DEVICE_PORT_TYPE_HEADSET },
+        { "virtual-surround-7.1",             N_("Virtual Surround 7.1"),         PA_DEVICE_PORT_TYPE_HEADPHONES },
     };
 
     pa_alsa_element *e;
@@ -4567,6 +4570,7 @@ static int profile_verify(pa_alsa_profile *p) {
         { "output:iec958-stereo+input:iec958-stereo", N_("Digital Stereo Duplex (IEC958)") },
         { "output:multichannel-output+input:multichannel-input", N_("Multichannel Duplex") },
         { "output:unknown-stereo+input:unknown-stereo", N_("Stereo Duplex") },
+        { "output:analog-output-surround71+output:analog-output-chat+input:analog-input", N_("Mono Chat + 7.1 Surround") },
         { "off",                                      N_("Off") }
     };
     const char *description_key = p->description_key ? p->description_key : p->name;
diff --git a/src/modules/alsa/mixer/paths/analog-output-chat.conf b/src/modules/alsa/mixer/paths/analog-output-chat.conf
new file mode 100644 (file)
index 0000000..360a1fc
--- /dev/null
@@ -0,0 +1,5 @@
+; Some gaming devices have a separate "chat" device, this is for voice chat
+; while playing games. This device is just a fairly standard analog mono
+; device, but it's nicer to make it clear that this is the "chat" device
+; as is mentioned in the marketing info and manual.
+.include analog-output.conf.common
diff --git a/src/modules/alsa/mixer/paths/virtual-surround-7.1.conf b/src/modules/alsa/mixer/paths/virtual-surround-7.1.conf
new file mode 100644 (file)
index 0000000..7f111f2
--- /dev/null
@@ -0,0 +1,5 @@
+[Element PCM,1]
+switch = mute
+volume = merge
+override-map.1 = all
+override-map.2 = all-left,all-right
diff --git a/src/modules/alsa/mixer/profile-sets/sennheiser-gsx.conf b/src/modules/alsa/mixer/profile-sets/sennheiser-gsx.conf
new file mode 100644 (file)
index 0000000..0ac1576
--- /dev/null
@@ -0,0 +1,58 @@
+# This file is part of PulseAudio.
+#
+# PulseAudio is free software; you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as
+# published by the Free Software Foundation; either version 2.1 of the
+# License, or (at your option) any later version.
+#
+# PulseAudio is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>.
+
+; USB Gaming DAC.
+; These devices have two output devices. The first one is mono, meant for
+; voice audio, and the second one is 7.1 surround, meant for everything
+; else. The 7.1 surround is mapped to headphones within the device.
+; The purpose of the mono/7.1 design is to provide separate volume
+; controls for voice and other audio, which can be useful in gaming.
+;
+; Works with:
+; Sennheiser GSX 1000
+; Sennheiser GSX 1200
+;
+; See default.conf for an explanation on the directives used here.
+
+[General]
+auto-profiles = no
+
+[Mapping analog-chat-output]
+device-strings = hw:%f,0
+channel-map = mono
+paths-output = analog-chat-output
+direction = output
+priority = 4000
+intended-roles = phone
+
+[Mapping analog-output-surround71]
+device-strings = hw:%f,1
+channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right
+paths-output = virtual-surround-7.1
+priority = 4100
+direction = output
+
+[Mapping analog-chat-input]
+device-strings = hw:%f,0
+channel-map = mono
+paths-input = analog-chat-input
+priority = 4100
+direction = input
+
+[Profile output:analog-output-surround71+output:analog-output-chat+input:analog-input]
+output-mappings = analog-output-surround71 analog-chat-output
+input-mappings = analog-chat-input
+priority = 5100
+skip-probe = yes