Nvidia hdmi passthrough patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey,

Here's a patch that I created for git that adds passthrough support for 
the Nvidia hdmi port.  Pretty much just copy/paste from the iec958 sections.


--- ./src/modules/alsa/alsa-sink.c.orig    2011-02-16 22:58:11.000000000 
-0700
+++ ./src/modules/alsa/alsa-sink.c    2011-02-17 02:53:21.452857569 -0700
@@ -1708,7 +1708,8 @@ static int setup_mixer(struct userdata *
      }

      /* FIXME: need automatic detection rather than hard-coded path */
-    if (!strcmp(u->mixer_path->name, "iec958-passthrough-output")) {
+    if (!strcmp(u->mixer_path->name, "iec958-passthrough-output")
+            || !strcmp(u->mixer_path->name, "hdmi-passthrough-output")) {
          u->sink->flags |= PA_SINK_PASSTHROUGH;
      } else {
          u->sink->flags &= ~PA_SINK_PASSTHROUGH;
--- ./src/modules/alsa/mixer/profile-sets/default.conf.orig    
2011-02-16 22:58:11.000000000 -0700
+++ ./src/modules/alsa/mixer/profile-sets/default.conf    2011-02-17 
02:46:25.401973394 -0700
@@ -141,6 +141,25 @@ channel-map = left,right
  priority = 4
  direction = output

+[Mapping hdmi-passthrough]
+device-strings = hdmi:%f
+channel-map = left,right
+direction = output
+paths-output = hdmi-passthrough-output
+priority = 5
+
+[Mapping hdmi-ac3-surround-40]
+device-strings = a52:%f
+channel-map = front-left,front-right,rear-left,rear-right
+priority = 2
+direction = output
+
+[Mapping hdmi-ac3-surround-51]
+device-strings = a52:%f
+channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe
+priority = 3
+direction = output
+
  ; An example for defining multiple-sink profiles
  #[Profile output:analog-stereo+output:iec958-stereo+input:analog-stereo]
  #description = Foobar
--- ./src/modules/alsa/mixer/paths/hdmi-passthrough-output.conf.orig    
2011-02-17 02:40:11.766291419 -0700
+++ ./src/modules/alsa/mixer/paths/hdmi-passthrough-output.conf    
2011-02-17 02:39:48.168179164 -0700
@@ -0,0 +1,19 @@
+# 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.
+
+
+[Element HDMI]
+switch = mute
--- ./src/modules/alsa/mixer/paths/hdmi-stereo-output.conf.orig    
2011-02-17 02:40:18.921630373 -0700
+++ ./src/modules/alsa/mixer/paths/hdmi-stereo-output.conf    2011-02-17 
02:39:55.903542803 -0700
@@ -0,0 +1,19 @@
+# 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.
+
+
+[Element HDMI]
+switch = mute
--- ./src/modules/alsa/alsa-mixer.c.orig    2011-02-16 
22:58:11.000000000 -0700
+++ ./src/modules/alsa/alsa-mixer.c    2011-02-17 02:38:08.117560106 -0700
@@ -1888,7 +1888,9 @@ static int path_verify(pa_alsa_path *p)
          { "analog-output-mono",         N_("Analog Mono Output") },
          { "analog-output-speaker",      N_("Analog Speakers") },
          { "iec958-stereo-output",       N_("Digital Output (IEC958)") },
-        { "iec958-passthrough-output",  N_("Digital Passthrough 
(IEC958)") }
+        { "iec958-passthrough-output",  N_("Digital Passthrough 
(IEC958)") },
+        { "hdmi-stereo-output",  N_("Digital Output (HDMI)") },
+        { "hdmi-passthrough-output",  N_("Digital Passthrough (HDMI)") }
      };

      pa_alsa_element *e;
@@ -2914,7 +2916,10 @@ static int mapping_verify(pa_alsa_mappin
          { "iec958-passthrough",     N_("Digital Passthrough  (IEC958)") },
          { "iec958-ac3-surround-40", N_("Digital Surround 4.0 
(IEC958/AC3)") },
          { "iec958-ac3-surround-51", N_("Digital Surround 5.1 
(IEC958/AC3)") },
-        { "hdmi-stereo",            N_("Digital Stereo (HDMI)") }
+        { "hdmi-stereo",            N_("Digital Stereo (HDMI)") },
+        { "hdmi-passthrough",     N_("Digital Passthrough  (HDMI)") },
+        { "hdmi-ac3-surround-40", N_("Digital Surround 4.0 (HDMI/AC3)") },
+        { "hdmi-ac3-surround-51", N_("Digital Surround 5.1 (HDMI/AC3)") }
      };

      pa_assert(m);
@@ -3038,6 +3043,7 @@ static int profile_verify(pa_alsa_profil
          { "output:analog-mono+input:analog-mono",     N_("Analog Mono 
Duplex") },
          { "output:analog-stereo+input:analog-stereo", N_("Analog 
Stereo Duplex") },
          { "output:iec958-stereo+input:iec958-stereo", N_("Digital 
Stereo Duplex (IEC958)") },
+        { "output:hdmi-stereo+input:hdmi-stereo", N_("Digital Stereo 
Duplex (HDMI)") },
          { "off",                                      N_("Off") }
      };

--- ./src/Makefile.am.orig    2011-02-16 22:58:11.000000000 -0700
+++ ./src/Makefile.am    2011-02-17 02:41:50.056014531 -0700
@@ -1115,7 +1115,9 @@ dist_alsapaths_DATA = \
          modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf \
          modules/alsa/mixer/paths/analog-output-mono.conf \
          modules/alsa/mixer/paths/iec958-stereo-output.conf \
-        modules/alsa/mixer/paths/iec958-passthrough-output.conf
+        modules/alsa/mixer/paths/iec958-passthrough-output.conf \
+        modules/alsa/mixer/paths/hdmi-stereo-output.conf \
+        modules/alsa/mixer/paths/hdmi-passthrough-output.conf

  endif





[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux