summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McLean <chutzpah@gentoo.org>2020-02-26 00:26:12 -0800
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>2020-12-09 16:51:16 +0000
commit7ec6ee4725a72b42ddcb38550efc968a06e6be2f (patch)
tree874735381712046e1da9600ce6c7b9c977bf5c87
parenta8cb4edf7591bf3038769ea1cd2eae264c67ea51 (diff)
downloadpulseaudio-7ec6ee4725a72b42ddcb38550efc968a06e6be2f.tar.gz
alsa-mixer: add support for Sennheiser GSX 1000 gaming DAC
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>
-rw-r--r--src/Makefile.am7
-rw-r--r--src/modules/alsa/90-pulseaudio.rules7
-rw-r--r--src/modules/alsa/alsa-mixer.c4
-rw-r--r--src/modules/alsa/mixer/paths/analog-output-chat.conf5
-rw-r--r--src/modules/alsa/mixer/paths/virtual-surround-7.1.conf5
-rw-r--r--src/modules/alsa/mixer/profile-sets/sennheiser-gsx.conf58
6 files changed, 84 insertions, 2 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index df912a8b3..eeec40b55 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -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
diff --git a/src/modules/alsa/90-pulseaudio.rules b/src/modules/alsa/90-pulseaudio.rules
index 4de40127e..cc5a3597a 100644
--- a/src/modules/alsa/90-pulseaudio.rules
+++ b/src/modules/alsa/90-pulseaudio.rules
@@ -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"
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index 937771d43..f978f71c3 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -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
index 000000000..360a1fceb
--- /dev/null
+++ b/src/modules/alsa/mixer/paths/analog-output-chat.conf
@@ -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
index 000000000..7f111f276
--- /dev/null
+++ b/src/modules/alsa/mixer/paths/virtual-surround-7.1.conf
@@ -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
index 000000000..0ac157685
--- /dev/null
+++ b/src/modules/alsa/mixer/profile-sets/sennheiser-gsx.conf
@@ -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