From 8438e14d1101f195e4c1a5dff41fdbacbc9366df Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Tue, 8 Mar 2011 10:51:33 +0100 Subject: [PATCH] alsa-mixer: Add separate profile for Nvidia This is a profile for all Nvidia cards - some Nvidia cards have four HDMI codecs, and which ones are working seems to vary a lot between GPU boards. In addition, Nvidia makes southbridges as well, so we need to keep the existing analog profiles. (And by not adding all these extra profiles to default.conf, we make sure there is no performance hit for non-Nvidia cards.) Once we have proper jack detection, there would probably be room for improvement here. Signed-off-by: David Henningsson --- src/Makefile.am | 1 + .../alsa/mixer/profile-sets/90-pulseaudio.rules | 1 + src/modules/alsa/mixer/profile-sets/nvidia.conf | 160 ++++++++++++++++++++ 3 files changed, 162 insertions(+), 0 deletions(-) create mode 100644 src/modules/alsa/mixer/profile-sets/nvidia.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-03-14 13:02:17.205663627 +0100 +++ pulseaudio-0.9.22+stable-queue-24-g67d18/src/Makefile.am 2011-03-14 13:02:17.535663651 +0100 @@ -109,6 +109,7 @@ ALSA_PROFILES = \ modules/alsa/mixer/profile-sets/default.conf \ + modules/alsa/mixer/profile-sets/nvidia.conf \ modules/alsa/mixer/profile-sets/maudio-fasttrack-pro.conf \ modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf \ modules/alsa/mixer/profile-sets/native-instruments-audio8dj.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-03-14 13:00:42.375663641 +0100 +++ pulseaudio-0.9.22+stable-queue-24-g67d18/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules 2011-03-14 13:02:17.535663651 +0100 @@ -25,5 +25,6 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="17cc", ATTRS{idProduct}=="baff", ENV{PULSE_PROFILE_SET}="native-instruments-traktorkontrol-s4.conf" SUBSYSTEMS=="usb", ATTRS{idVendor}=="17cc", ATTRS{idProduct}=="4711", ENV{PULSE_PROFILE_SET}="native-instruments-korecontroller.conf" SUBSYSTEMS=="usb", ATTRS{idVendor}=="0763", ATTRS{idProduct}=="2012", ENV{PULSE_PROFILE_SET}="maudio-fasttrack-pro.conf" +ATTRS{vendor}=="0x10de", ENV{PULSE_PROFILE_SET}="nvidia.conf" LABEL="pulseaudio_end" Index: pulseaudio-0.9.22+stable-queue-24-g67d18/src/modules/alsa/mixer/profile-sets/nvidia.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/nvidia.conf 2011-03-14 13:02:17.535663651 +0100 @@ -0,0 +1,160 @@ +# 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 profile for all Nvidia cards - some Nvidia cards have four HDMI codecs, +; and which ones are working seems to vary a lot between GPU boards. In addition, +; Nvidia makes southbridges as well, so we need to keep the existing analog profiles. +; (And by not adding all these extra profiles to default.conf, we make sure +; there is no performance hit for non-Nvidia cards.) + +; Once we have proper jack detection, there would probably be room for improvement here. + +[General] +auto-profiles = yes + +[Mapping analog-mono] +device-strings = hw:%f +channel-map = mono +paths-output = analog-output analog-output-speaker analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono analog-output-lfe-on-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 +priority = 1 + +[Mapping analog-stereo] +device-strings = front:%f hw:%f +channel-map = left,right +paths-output = analog-output analog-output-speaker analog-output-desktop-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono analog-output-lfe-on-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 +priority = 10 + +[Mapping analog-surround-40] +device-strings = surround40:%f +channel-map = front-left,front-right,rear-left,rear-right +paths-output = analog-output analog-output-speaker analog-output-desktop-speaker analog-output-lfe-on-mono +priority = 7 +direction = output + +[Mapping analog-surround-41] +device-strings = surround41:%f +channel-map = front-left,front-right,rear-left,rear-right,lfe +paths-output = analog-output analog-output-speaker analog-output-desktop-speaker analog-output-lfe-on-mono +priority = 8 +direction = output + +[Mapping analog-surround-50] +device-strings = surround50:%f +channel-map = front-left,front-right,rear-left,rear-right,front-center +paths-output = analog-output analog-output-speaker analog-output-desktop-speaker analog-output-lfe-on-mono +priority = 7 +direction = output + +[Mapping analog-surround-51] +device-strings = surround51:%f +channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe +paths-output = analog-output analog-output-speaker analog-output-desktop-speaker analog-output-lfe-on-mono +priority = 8 +direction = output + +[Mapping analog-surround-71] +device-strings = surround71:%f +channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right +description = Analog Surround 7.1 +paths-output = analog-output analog-output-speaker analog-output-desktop-speaker analog-output-lfe-on-mono +priority = 7 +direction = output + +[Mapping iec958-stereo] +device-strings = iec958:%f +channel-map = left,right +priority = 5 + +[Mapping iec958-surround-40] +device-strings = iec958:%f +channel-map = front-left,front-right,rear-left,rear-right +priority = 1 + +[Mapping iec958-ac3-surround-40] +device-strings = a52:%f +channel-map = front-left,front-right,rear-left,rear-right +priority = 2 +direction = output + +[Mapping iec958-ac3-surround-51] +device-strings = a52:%f +channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe +priority = 3 +direction = output + +[Mapping hdmi-stereo] +device-strings = hdmi:%f +channel-map = left,right +priority = 4 +direction = output + +[Mapping hdmi-surround] +description = Digital Surround 5.1 (HDMI) +device-strings = hdmi:%f +channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe +priority = 3 +direction = output + +[Mapping hdmi-stereo-extra1] +description = Digital Stereo (HDMI) nr 2 +device-strings = hdmi:%f,1 +channel-map = left,right +priority = 2 +direction = output + +[Mapping hdmi-surround-extra1] +description = Digital Surround 5.1 (HDMI) nr 2 +device-strings = hdmi:%f,1 +channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe +priority = 1 +direction = output + +[Mapping hdmi-stereo-extra2] +description = Digital Stereo (HDMI) nr 3 +device-strings = hdmi:%f,2 +channel-map = left,right +priority = 2 +direction = output + +[Mapping hdmi-surround-extra2] +description = Digital Surround 5.1 (HDMI) nr 3 +device-strings = hdmi:%f,2 +channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe +priority = 1 +direction = output + +[Mapping hdmi-stereo-extra3] +description = Digital Stereo (HDMI) nr 4 +device-strings = hdmi:%f,3 +channel-map = left,right +priority = 2 +direction = output + +[Mapping hdmi-surround-extra3] +description = Digital Surround 5.1 (HDMI) nr 4 +device-strings = hdmi:%f,3 +channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe +priority = 1 +direction = output + + +; An example for defining multiple-sink profiles +#[Profile output:analog-stereo+output:iec958-stereo+input:analog-stereo] +#description = Foobar +#output-mappings = analog-stereo iec958-stereo +#input-mappings = analog-stereo 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-03-14 13:06:15.535663640 +0100 +++ pulseaudio-0.9.22+stable-queue-24-g67d18/src/Makefile.in 2011-03-14 13:07:01.315663627 +0100 @@ -2645,6 +2645,7 @@ ################################### ALSA_PROFILES = \ modules/alsa/mixer/profile-sets/default.conf \ + modules/alsa/mixer/profile-sets/nvidia.conf \ modules/alsa/mixer/profile-sets/maudio-fasttrack-pro.conf \ modules/alsa/mixer/profile-sets/native-instruments-audio4dj.conf \ modules/alsa/mixer/profile-sets/native-instruments-audio8dj.conf \