From 6f41a4140013dac7737847bb5eddc78906eb09b7 Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Tue, 5 Apr 2011 11:37:59 +0200 Subject: [PATCH] alsa-mixer: Add workaround for some USB headsets This is a workaround - these usb headsets have one output volume control only, labeled "Speaker". This causes the default profile set to not control the volume at all, which is a bug. Workaround that by creating a separate profile set. Signed-off-by: David Henningsson --- src/Makefile.am | 3 +- .../alsa/mixer/profile-sets/90-pulseaudio.rules | 3 ++ .../alsa/mixer/profile-sets/usb-headset.conf | 35 ++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletions(-) create mode 100644 src/modules/alsa/mixer/profile-sets/usb-headset.conf Index: pulseaudio-0.9.22+stable-queue-24-g67d18/src/Makefile.am =================================================================== --- pulseaudio-0.9.22+stable-queue-24-g67d18.orig/src/Makefile.am 2011-04-05 13:19:10.556010980 +0200 +++ pulseaudio-0.9.22+stable-queue-24-g67d18/src/Makefile.am 2011-04-05 13:20:34.968010925 +0200 @@ -114,7 +114,8 @@ modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf \ modules/alsa/mixer/profile-sets/native-instruments-audio8dj.conf \ modules/alsa/mixer/profile-sets/native-instruments-traktorkontrol-s4.conf \ - modules/alsa/mixer/profile-sets/native-instruments-korecontroller.conf + modules/alsa/mixer/profile-sets/native-instruments-korecontroller.conf \ + modules/alsa/mixer/profile-sets/usb-headset.conf ALSA_PATHS = \ modules/alsa/mixer/paths/analog-input-aux.conf \ Index: pulseaudio-0.9.22+stable-queue-24-g67d18/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules =================================================================== --- pulseaudio-0.9.22+stable-queue-24-g67d18.orig/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules 2011-04-05 13:20:04.280010945 +0200 +++ pulseaudio-0.9.22+stable-queue-24-g67d18/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules 2011-04-05 13:20:34.968010925 +0200 @@ -20,6 +20,9 @@ ACTION!="change", GOTO="pulseaudio_end" KERNEL!="card*", GOTO="pulseaudio_end" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="01ab", ENV{PULSE_PROFILE_SET}="usb-headset.conf" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="0a0c", ENV{PULSE_PROFILE_SET}="usb-headset.conf" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1395", ATTRS{idProduct}=="0002", ENV{PULSE_PROFILE_SET}="usb-headset.conf" SUBSYSTEMS=="usb", ATTRS{idVendor}=="17cc", ATTRS{idProduct}=="1978", ENV{PULSE_PROFILE_SET}="native-instruments-audio8dj.conf" SUBSYSTEMS=="usb", ATTRS{idVendor}=="17cc", ATTRS{idProduct}=="0839", ENV{PULSE_PROFILE_SET}="native-instruments-audio4dj.conf" SUBSYSTEMS=="usb", ATTRS{idVendor}=="17cc", ATTRS{idProduct}=="baff", ENV{PULSE_PROFILE_SET}="native-instruments-traktorkontrol-s4.conf" Index: pulseaudio-0.9.22+stable-queue-24-g67d18/src/modules/alsa/mixer/profile-sets/usb-headset.conf =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ pulseaudio-0.9.22+stable-queue-24-g67d18/src/modules/alsa/mixer/profile-sets/usb-headset.conf 2011-04-05 13:20:34.972010925 +0200 @@ -0,0 +1,35 @@ +# 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, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +; This is a workaround - these usb headsets have one output volume control only, labeled "Speaker". +; This causes the default profile set to not control the volume at all, which is a bug. + +[General] +auto-profiles = yes + +[Mapping analog-mono] +device-strings = hw:%f +channel-map = mono +paths-output = analog-output-speaker +paths-input = analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line +priority = 1 + +[Mapping analog-stereo] +device-strings = front:%f hw:%f +channel-map = left,right +paths-output = analog-output-speaker +paths-input = analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line +priority = 10 Index: pulseaudio-0.9.22+stable-queue-24-g67d18/src/Makefile.in =================================================================== --- pulseaudio-0.9.22+stable-queue-24-g67d18.orig/src/Makefile.in 2011-04-05 13:20:49.356010915 +0200 +++ pulseaudio-0.9.22+stable-queue-24-g67d18/src/Makefile.in 2011-04-05 13:21:45.760010878 +0200 @@ -2650,7 +2650,8 @@ modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf \ modules/alsa/mixer/profile-sets/native-instruments-audio8dj.conf \ modules/alsa/mixer/profile-sets/native-instruments-traktorkontrol-s4.conf \ - modules/alsa/mixer/profile-sets/native-instruments-korecontroller.conf + modules/alsa/mixer/profile-sets/native-instruments-korecontroller.conf \ + modules/alsa/mixer/profile-sets/usb-headset.conf ALSA_PATHS = \ modules/alsa/mixer/paths/analog-input-aux.conf \