From 69ba5a2b58ad6e98c8899aa297afd8276dbbe052 Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Sat, 21 Dec 2019 14:01:44 +0200 Subject: [PATCH] alsa-mixer: add mono input support for Behringer UMC22 --- src/modules/alsa/90-pulseaudio.rules | 1 + src/modules/alsa/alsa-mixer.c | 2 + .../mixer/profile-sets/behringer-umc22.conf | 68 +++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 src/modules/alsa/mixer/profile-sets/behringer-umc22.conf diff --git a/src/modules/alsa/90-pulseaudio.rules b/src/modules/alsa/90-pulseaudio.rules index 7bfacda09..c81f05b51 100644 --- a/src/modules/alsa/90-pulseaudio.rules +++ b/src/modules/alsa/90-pulseaudio.rules @@ -110,6 +110,7 @@ ATTRS{idVendor}=="0763", ATTRS{idProduct}=="2012", ENV{PULSE_PROFILE_SET}="maudi ATTRS{idVendor}=="045e", ATTRS{idProduct}=="02bb", ENV{PULSE_PROFILE_SET}="kinect-audio.conf" ATTRS{idVendor}=="041e", ATTRS{idProduct}=="322c", ENV{PULSE_PROFILE_SET}="sb-omni-surround-5.1.conf" ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="4014", ENV{PULSE_PROFILE_SET}="dell-dock-tb16-usb-audio.conf" +ATTRS{idVendor}=="08bb", ATTRS{idProduct}=="2902", ENV{PULSE_PROFILE_SET}="behringer-umc22.conf" # ID 1038:12ad is for the 2018 refresh of the Arctis 7. # ID 1038:1294 is for Arctis Pro Wireless (which works with the Arctis 7 configuration). diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c index 063179052..a05ae7e08 100644 --- a/src/modules/alsa/alsa-mixer.c +++ b/src/modules/alsa/alsa-mixer.c @@ -4392,6 +4392,8 @@ static int mapping_verify(pa_alsa_mapping *m, const pa_channel_map *bonus) { static const struct description_map well_known_descriptions[] = { { "analog-mono", N_("Analog Mono") }, + { "analog-mono-left", N_("Analog Mono (Left)") }, + { "analog-mono-right", N_("Analog Mono (Right)") }, { "analog-stereo", N_("Analog Stereo") }, { "mono-fallback", N_("Mono") }, { "stereo-fallback", N_("Stereo") }, diff --git a/src/modules/alsa/mixer/profile-sets/behringer-umc22.conf b/src/modules/alsa/mixer/profile-sets/behringer-umc22.conf new file mode 100644 index 000000000..cc74852c3 --- /dev/null +++ b/src/modules/alsa/mixer/profile-sets/behringer-umc22.conf @@ -0,0 +1,68 @@ +# 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 . + +; Behringer U-Phoria UMC22 +; +; Default mapping only allows to use stereo input and sound card has two +; physical input channels. +; +; However in case of only using a single input channel (like condenser +; microphone) only one channel will have any sound, which is often +; inconvenient for casual use. +; +; This config includes mono input options which makes it much more +; friendly in single input configuration. +; +; This config also removes default digital input/output mappings that do +; not physically exist on this card. +; +; Added by Nazar Mokrynskyi + +[General] +auto-profiles = yes + +[Mapping analog-stereo-input] +device-strings = hw:%f +channel-map = left,right +paths-input = analog-input-mic +direction = input +priority = 4 + +[Mapping analog-mono] +device-strings = hw:%f +channel-map = mono,mono +paths-input = analog-input-mic +direction = input +priority = 3 + +[Mapping analog-mono-left] +device-strings = hw:%f +channel-map = mono,aux1 +paths-input = analog-input-mic +direction = input +priority = 2 + +[Mapping analog-mono-right] +device-strings = hw:%f +channel-map = aux1,mono +paths-input = analog-input-mic +direction = input +priority = 1 + +[Mapping analog-stereo-output] +device-strings = front:%f +channel-map = left,right +paths-output = analog-output +direction = output