* NVIDIA HDMI: Channel remapping does not work for stereo?
@ 2013-10-24 23:31 Anssi Hannula
2013-10-29 23:12 ` Aaron Plattner
0 siblings, 1 reply; 6+ messages in thread
From: Anssi Hannula @ 2013-10-24 23:31 UTC (permalink / raw)
To: Aaron Plattner; +Cc: alsa-devel@alsa-project.org
Hi!
I just noticed while testing the ALSA HDMI channel remapping code that
my NVIDIA codec 0x10de0015 does not seem to follow the Audio Sample
Packet (ASP) channel mapping (set by verb F34h as per HDA spec 7.3.3.41)
when playing back stereo audio.
This can be reproduced by e.g.:
$ speaker-test -c2 -Dhdmi:CARD=NVidia,DEV=0 -m FR,FL
The channels are reversed compared to what the printout is (i.e. the
codec plays the streams straight-through instead of swapping channels as
instructed).
E.g. this works expectedly, however:
$ speaker-test -c4 -Dhdmi:CARD=NVidia,DEV=1 -m FR,FL,RR,RL
(note that recent sound git master or for-next is needed for these kind
of remappings to work properly at all)
On Intel HDMI codec 0x80862806 both work.
While stereo right-left swapping is admittedly a rather corner-case
situation, I guess we should probably refuse such chmaps when they are
not supported.
Aaron, do you have any information on whether this affects all NVIDIA
HDMI codecs?
--
Anssi Hannula
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: NVIDIA HDMI: Channel remapping does not work for stereo?
2013-10-24 23:31 NVIDIA HDMI: Channel remapping does not work for stereo? Anssi Hannula
@ 2013-10-29 23:12 ` Aaron Plattner
2013-10-29 23:39 ` Anssi Hannula
0 siblings, 1 reply; 6+ messages in thread
From: Aaron Plattner @ 2013-10-29 23:12 UTC (permalink / raw)
To: Anssi Hannula; +Cc: alsa-devel@alsa-project.org
On 10/24/2013 04:31 PM, Anssi Hannula wrote:
> Hi!
>
> I just noticed while testing the ALSA HDMI channel remapping code that
> my NVIDIA codec 0x10de0015 does not seem to follow the Audio Sample
> Packet (ASP) channel mapping (set by verb F34h as per HDA spec 7.3.3.41)
> when playing back stereo audio.
>
> This can be reproduced by e.g.:
> $ speaker-test -c2 -Dhdmi:CARD=NVidia,DEV=0 -m FR,FL
> The channels are reversed compared to what the printout is (i.e. the
> codec plays the streams straight-through instead of swapping channels as
> instructed).
>
> E.g. this works expectedly, however:
> $ speaker-test -c4 -Dhdmi:CARD=NVidia,DEV=1 -m FR,FL,RR,RL
>
> (note that recent sound git master or for-next is needed for these kind
> of remappings to work properly at all)
>
> On Intel HDMI codec 0x80862806 both work.
>
> While stereo right-left swapping is admittedly a rather corner-case
> situation, I guess we should probably refuse such chmaps when they are
> not supported.
>
> Aaron, do you have any information on whether this affects all NVIDIA
> HDMI codecs?
I don't know much about the audio side of things, I'm afraid. The more
knowledgeable people I asked about this said that they would expect a
L/R swap to work.
"In fact the CTR/LFE channels have their mappings swapped.
The default mapping is:
Converter channel 0 mapped to ASP slot 0
Converter channel 1 mapped to ASP slot 1
Converter channel 2 mapped to ASP slot 3
Converter channel 3 mapped to ASP slot 2
Converter channel 4 mapped to ASP slot 4
Converter channel 5 mapped to ASP slot 5
Converter channel 6 mapped to ASP slot 6
Converter channel 7 mapped to ASP slot 7
In theory, you should be able to map any incoming channel, to any
outgoing channel.
You can look at section7.3.3.41 of the HDA spec (Audio Sample Packet
(ASP) Channel Mapping) for the information on this.
There is a way to manually send verbs and get their responses to see if
the HW is programmed correctly.
To do this, you have to use the Immediate Command and response registers
to issue a "Get ASP Channel Mapping" for each channel. The other
parameters needed are the codec id and node id of the associated
converter node.
It is a bit involved, but I can send you the info. If you have the codec
and node ids already, it is actually relatively simple."
--
Aaron
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: NVIDIA HDMI: Channel remapping does not work for stereo?
2013-10-29 23:12 ` Aaron Plattner
@ 2013-10-29 23:39 ` Anssi Hannula
2013-10-30 6:34 ` Takashi Iwai
0 siblings, 1 reply; 6+ messages in thread
From: Anssi Hannula @ 2013-10-29 23:39 UTC (permalink / raw)
To: Aaron Plattner; +Cc: alsa-devel@alsa-project.org
30.10.2013 01:12, Aaron Plattner kirjoitti:
> On 10/24/2013 04:31 PM, Anssi Hannula wrote:
>> Hi!
>>
>> I just noticed while testing the ALSA HDMI channel remapping code that
>> my NVIDIA codec 0x10de0015 does not seem to follow the Audio Sample
>> Packet (ASP) channel mapping (set by verb F34h as per HDA spec 7.3.3.41)
>> when playing back stereo audio.
>>
>> This can be reproduced by e.g.:
>> $ speaker-test -c2 -Dhdmi:CARD=NVidia,DEV=0 -m FR,FL
>> The channels are reversed compared to what the printout is (i.e. the
>> codec plays the streams straight-through instead of swapping channels as
>> instructed).
>>
>> E.g. this works expectedly, however:
>> $ speaker-test -c4 -Dhdmi:CARD=NVidia,DEV=1 -m FR,FL,RR,RL
>>
>> (note that recent sound git master or for-next is needed for these kind
>> of remappings to work properly at all)
>>
>> On Intel HDMI codec 0x80862806 both work.
>>
>> While stereo right-left swapping is admittedly a rather corner-case
>> situation, I guess we should probably refuse such chmaps when they are
>> not supported.
>>
>> Aaron, do you have any information on whether this affects all NVIDIA
>> HDMI codecs?
>
> I don't know much about the audio side of things, I'm afraid. The more
> knowledgeable people I asked about this said that they would expect a
> L/R swap to work.
OK, well, it does not. But as noted, only on stereo playback. When there
are more than 2 channels everything (including the FL/FR swap) works fine.
I also verified with "Get ASP Channel Mapping" (which was mentioned
below) that the mapping is 0=>1 and 1=>0. It just doesn't seem to take
effect on 2-channel playback (but works fine on an Intel codec).
My guess is that it may have got something to do with the fact that
2-channel playback can use a different layout where each HDMI Audio
Sample Packet contains 4 samples for each channel, whereas in
multichannel playback the ASP packet contains 1 sample for each channel,
and the ASP channel mapping is somehow only affecting the latter
multichannel layout mode.
In case you can't confirm if this issue exists on other codecs than
0x10de0015, I guess I can try to find a tester with one of the later
codecs, and if the same issue happens there, just add a tweak to
disallow 2-channel FR/FL map on all nvidia codecs. While it would be
nice to fix it for later codec revisions (if it isn't already), it is
not like it is a big feature loss :)
Thanks for looking into it anyway.
> "In fact the CTR/LFE channels have their mappings swapped.
>
> The default mapping is:
> Converter channel 0 mapped to ASP slot 0
> Converter channel 1 mapped to ASP slot 1
> Converter channel 2 mapped to ASP slot 3
> Converter channel 3 mapped to ASP slot 2
> Converter channel 4 mapped to ASP slot 4
> Converter channel 5 mapped to ASP slot 5
> Converter channel 6 mapped to ASP slot 6
> Converter channel 7 mapped to ASP slot 7
>
> In theory, you should be able to map any incoming channel, to any
> outgoing channel.
>
>
> You can look at section7.3.3.41 of the HDA spec (Audio Sample Packet
> (ASP) Channel Mapping) for the information on this.
>
> There is a way to manually send verbs and get their responses to see if
> the HW is programmed correctly.
>
> To do this, you have to use the Immediate Command and response registers
> to issue a "Get ASP Channel Mapping" for each channel. The other
> parameters needed are the codec id and node id of the associated
> converter node.
>
> It is a bit involved, but I can send you the info. If you have the codec
> and node ids already, it is actually relatively simple."
--
Anssi Hannula
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: NVIDIA HDMI: Channel remapping does not work for stereo?
2013-10-29 23:39 ` Anssi Hannula
@ 2013-10-30 6:34 ` Takashi Iwai
2013-11-03 15:15 ` [PATCH] ALSA: hda - hdmi: Disallow unsupported 2ch remapping on NVIDIA codecs Anssi Hannula
0 siblings, 1 reply; 6+ messages in thread
From: Takashi Iwai @ 2013-10-30 6:34 UTC (permalink / raw)
To: Anssi Hannula; +Cc: alsa-devel@alsa-project.org, Aaron Plattner
At Wed, 30 Oct 2013 01:39:16 +0200,
Anssi Hannula wrote:
>
> 30.10.2013 01:12, Aaron Plattner kirjoitti:
> > On 10/24/2013 04:31 PM, Anssi Hannula wrote:
> >> Hi!
> >>
> >> I just noticed while testing the ALSA HDMI channel remapping code that
> >> my NVIDIA codec 0x10de0015 does not seem to follow the Audio Sample
> >> Packet (ASP) channel mapping (set by verb F34h as per HDA spec 7.3.3.41)
> >> when playing back stereo audio.
> >>
> >> This can be reproduced by e.g.:
> >> $ speaker-test -c2 -Dhdmi:CARD=NVidia,DEV=0 -m FR,FL
> >> The channels are reversed compared to what the printout is (i.e. the
> >> codec plays the streams straight-through instead of swapping channels as
> >> instructed).
> >>
> >> E.g. this works expectedly, however:
> >> $ speaker-test -c4 -Dhdmi:CARD=NVidia,DEV=1 -m FR,FL,RR,RL
> >>
> >> (note that recent sound git master or for-next is needed for these kind
> >> of remappings to work properly at all)
> >>
> >> On Intel HDMI codec 0x80862806 both work.
> >>
> >> While stereo right-left swapping is admittedly a rather corner-case
> >> situation, I guess we should probably refuse such chmaps when they are
> >> not supported.
> >>
> >> Aaron, do you have any information on whether this affects all NVIDIA
> >> HDMI codecs?
> >
> > I don't know much about the audio side of things, I'm afraid. The more
> > knowledgeable people I asked about this said that they would expect a
> > L/R swap to work.
>
> OK, well, it does not. But as noted, only on stereo playback. When there
> are more than 2 channels everything (including the FL/FR swap) works fine.
>
> I also verified with "Get ASP Channel Mapping" (which was mentioned
> below) that the mapping is 0=>1 and 1=>0. It just doesn't seem to take
> effect on 2-channel playback (but works fine on an Intel codec).
>
> My guess is that it may have got something to do with the fact that
> 2-channel playback can use a different layout where each HDMI Audio
> Sample Packet contains 4 samples for each channel, whereas in
> multichannel playback the ASP packet contains 1 sample for each channel,
> and the ASP channel mapping is somehow only affecting the latter
> multichannel layout mode.
>
>
> In case you can't confirm if this issue exists on other codecs than
> 0x10de0015, I guess I can try to find a tester with one of the later
> codecs, and if the same issue happens there, just add a tweak to
> disallow 2-channel FR/FL map on all nvidia codecs. While it would be
> nice to fix it for later codec revisions (if it isn't already), it is
> not like it is a big feature loss :)
>
> Thanks for looking into it anyway.
Thanks for intensive tests. I agree that disabling FL/FR for 2
channels would be a good enough fix.
Takashi
> > "In fact the CTR/LFE channels have their mappings swapped.
> >
> > The default mapping is:
> > Converter channel 0 mapped to ASP slot 0
> > Converter channel 1 mapped to ASP slot 1
> > Converter channel 2 mapped to ASP slot 3
> > Converter channel 3 mapped to ASP slot 2
> > Converter channel 4 mapped to ASP slot 4
> > Converter channel 5 mapped to ASP slot 5
> > Converter channel 6 mapped to ASP slot 6
> > Converter channel 7 mapped to ASP slot 7
> >
> > In theory, you should be able to map any incoming channel, to any
> > outgoing channel.
> >
> >
> > You can look at section7.3.3.41 of the HDA spec (Audio Sample Packet
> > (ASP) Channel Mapping) for the information on this.
> >
> > There is a way to manually send verbs and get their responses to see if
> > the HW is programmed correctly.
> >
> > To do this, you have to use the Immediate Command and response registers
> > to issue a "Get ASP Channel Mapping" for each channel. The other
> > parameters needed are the codec id and node id of the associated
> > converter node.
> >
> > It is a bit involved, but I can send you the info. If you have the codec
> > and node ids already, it is actually relatively simple."
>
>
> --
> Anssi Hannula
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] ALSA: hda - hdmi: Disallow unsupported 2ch remapping on NVIDIA codecs
2013-10-30 6:34 ` Takashi Iwai
@ 2013-11-03 15:15 ` Anssi Hannula
2013-11-04 9:12 ` Takashi Iwai
0 siblings, 1 reply; 6+ messages in thread
From: Anssi Hannula @ 2013-11-03 15:15 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel, Aaron Plattner, Juho Teperi
NVIDIA HDMI codecs do not seem to follow the Audio Sample Packet (ASP)
channel mapping (as set by verb F32h per HDA specification 7.3.3.41)
when playing back 2-channel audio (CEA CA 0x00).
Basically this means that specifying swapped channels for stereo audio
(FR,FL) does not take effect, and e.g. this command plays back on the
wrong channel:
speaker-test -c2 -Dhdmi:CARD=NVidia,DEV=0 -m FR,FL -s1
Multichannel audio is not affected.
This issue has been confirmed to exist on codec 0x10de0015 by me and on
0x10de0040 by Juho Teperi.
Disable 2ch FL/FR channel swapping on all NVIDIA HDMI codecs that use
the standard HDA channel mapping system. Since this is a very minor
functionality loss, we err on the side of disabling it for newer codecs
as well until any future testing confirms that this issue has been
fixed.
Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Helped-by: Juho Teperi <juho.teperi@iki.fi>
Cc: Aaron Plattner <aplattner@nvidia.com>
---
sound/pci/hda/patch_hdmi.c | 86 +++++++++++++++++++++++++++++++++-------------
1 file changed, 63 insertions(+), 23 deletions(-)
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index d61cc2ab52af..c3e3537b3196 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -2787,6 +2787,46 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
}
/*
+ * NVIDIA codecs ignore ASP mapping for 2ch - confirmed on:
+ * - 0x10de0015
+ * - 0x10de0040
+ */
+static int nvhdmi_chmap_cea_alloc_validate_get_type(struct cea_channel_speaker_allocation *cap,
+ int channels)
+{
+ if (cap->ca_index == 0x00 && channels == 2)
+ return SNDRV_CTL_TLVT_CHMAP_FIXED;
+
+ return hdmi_chmap_cea_alloc_validate_get_type(cap, channels);
+}
+
+static int nvhdmi_chmap_validate(int ca, int chs, unsigned char *map)
+{
+ if (ca == 0x00 && (map[0] != SNDRV_CHMAP_FL || map[1] != SNDRV_CHMAP_FR))
+ return -EINVAL;
+
+ return 0;
+}
+
+static int patch_nvhdmi(struct hda_codec *codec)
+{
+ struct hdmi_spec *spec;
+ int err;
+
+ err = patch_generic_hdmi(codec);
+ if (err)
+ return err;
+
+ spec = codec->spec;
+
+ spec->ops.chmap_cea_alloc_validate_get_type =
+ nvhdmi_chmap_cea_alloc_validate_get_type;
+ spec->ops.chmap_validate = nvhdmi_chmap_validate;
+
+ return 0;
+}
+
+/*
* ATI/AMD-specific implementations
*/
@@ -3167,30 +3207,30 @@ static const struct hda_codec_preset snd_hda_preset_hdmi[] = {
{ .id = 0x10de0005, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
{ .id = 0x10de0006, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
{ .id = 0x10de0007, .name = "MCP79/7A HDMI", .patch = patch_nvhdmi_8ch_7x },
-{ .id = 0x10de000a, .name = "GPU 0a HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de000b, .name = "GPU 0b HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de000c, .name = "MCP89 HDMI", .patch = patch_generic_hdmi },
-{ .id = 0x10de000d, .name = "GPU 0d HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0010, .name = "GPU 10 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0011, .name = "GPU 11 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0012, .name = "GPU 12 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0013, .name = "GPU 13 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0014, .name = "GPU 14 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0015, .name = "GPU 15 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0016, .name = "GPU 16 HDMI/DP", .patch = patch_generic_hdmi },
+{ .id = 0x10de000a, .name = "GPU 0a HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de000b, .name = "GPU 0b HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de000c, .name = "MCP89 HDMI", .patch = patch_nvhdmi },
+{ .id = 0x10de000d, .name = "GPU 0d HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0010, .name = "GPU 10 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0011, .name = "GPU 11 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0012, .name = "GPU 12 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0013, .name = "GPU 13 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0014, .name = "GPU 14 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0015, .name = "GPU 15 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0016, .name = "GPU 16 HDMI/DP", .patch = patch_nvhdmi },
/* 17 is known to be absent */
-{ .id = 0x10de0018, .name = "GPU 18 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0019, .name = "GPU 19 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de001a, .name = "GPU 1a HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de001b, .name = "GPU 1b HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de001c, .name = "GPU 1c HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0040, .name = "GPU 40 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0041, .name = "GPU 41 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0042, .name = "GPU 42 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0043, .name = "GPU 43 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0044, .name = "GPU 44 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0051, .name = "GPU 51 HDMI/DP", .patch = patch_generic_hdmi },
-{ .id = 0x10de0060, .name = "GPU 60 HDMI/DP", .patch = patch_generic_hdmi },
+{ .id = 0x10de0018, .name = "GPU 18 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0019, .name = "GPU 19 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de001a, .name = "GPU 1a HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de001b, .name = "GPU 1b HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de001c, .name = "GPU 1c HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0040, .name = "GPU 40 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0041, .name = "GPU 41 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0042, .name = "GPU 42 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0043, .name = "GPU 43 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0044, .name = "GPU 44 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0051, .name = "GPU 51 HDMI/DP", .patch = patch_nvhdmi },
+{ .id = 0x10de0060, .name = "GPU 60 HDMI/DP", .patch = patch_nvhdmi },
{ .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
{ .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch },
{ .id = 0x11069f80, .name = "VX900 HDMI/DP", .patch = patch_via_hdmi },
--
1.8.1.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] ALSA: hda - hdmi: Disallow unsupported 2ch remapping on NVIDIA codecs
2013-11-03 15:15 ` [PATCH] ALSA: hda - hdmi: Disallow unsupported 2ch remapping on NVIDIA codecs Anssi Hannula
@ 2013-11-04 9:12 ` Takashi Iwai
0 siblings, 0 replies; 6+ messages in thread
From: Takashi Iwai @ 2013-11-04 9:12 UTC (permalink / raw)
To: Anssi Hannula; +Cc: alsa-devel, Aaron Plattner, Juho Teperi
At Sun, 3 Nov 2013 17:15:00 +0200,
Anssi Hannula wrote:
>
> NVIDIA HDMI codecs do not seem to follow the Audio Sample Packet (ASP)
> channel mapping (as set by verb F32h per HDA specification 7.3.3.41)
> when playing back 2-channel audio (CEA CA 0x00).
>
> Basically this means that specifying swapped channels for stereo audio
> (FR,FL) does not take effect, and e.g. this command plays back on the
> wrong channel:
> speaker-test -c2 -Dhdmi:CARD=NVidia,DEV=0 -m FR,FL -s1
>
> Multichannel audio is not affected.
>
> This issue has been confirmed to exist on codec 0x10de0015 by me and on
> 0x10de0040 by Juho Teperi.
>
> Disable 2ch FL/FR channel swapping on all NVIDIA HDMI codecs that use
> the standard HDA channel mapping system. Since this is a very minor
> functionality loss, we err on the side of disabling it for newer codecs
> as well until any future testing confirms that this issue has been
> fixed.
>
> Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
> Helped-by: Juho Teperi <juho.teperi@iki.fi>
> Cc: Aaron Plattner <aplattner@nvidia.com>
Thanks, applied.
Takashi
> ---
> sound/pci/hda/patch_hdmi.c | 86 +++++++++++++++++++++++++++++++++-------------
> 1 file changed, 63 insertions(+), 23 deletions(-)
>
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index d61cc2ab52af..c3e3537b3196 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -2787,6 +2787,46 @@ static int patch_nvhdmi_8ch_7x(struct hda_codec *codec)
> }
>
> /*
> + * NVIDIA codecs ignore ASP mapping for 2ch - confirmed on:
> + * - 0x10de0015
> + * - 0x10de0040
> + */
> +static int nvhdmi_chmap_cea_alloc_validate_get_type(struct cea_channel_speaker_allocation *cap,
> + int channels)
> +{
> + if (cap->ca_index == 0x00 && channels == 2)
> + return SNDRV_CTL_TLVT_CHMAP_FIXED;
> +
> + return hdmi_chmap_cea_alloc_validate_get_type(cap, channels);
> +}
> +
> +static int nvhdmi_chmap_validate(int ca, int chs, unsigned char *map)
> +{
> + if (ca == 0x00 && (map[0] != SNDRV_CHMAP_FL || map[1] != SNDRV_CHMAP_FR))
> + return -EINVAL;
> +
> + return 0;
> +}
> +
> +static int patch_nvhdmi(struct hda_codec *codec)
> +{
> + struct hdmi_spec *spec;
> + int err;
> +
> + err = patch_generic_hdmi(codec);
> + if (err)
> + return err;
> +
> + spec = codec->spec;
> +
> + spec->ops.chmap_cea_alloc_validate_get_type =
> + nvhdmi_chmap_cea_alloc_validate_get_type;
> + spec->ops.chmap_validate = nvhdmi_chmap_validate;
> +
> + return 0;
> +}
> +
> +/*
> * ATI/AMD-specific implementations
> */
>
> @@ -3167,30 +3207,30 @@ static const struct hda_codec_preset snd_hda_preset_hdmi[] = {
> { .id = 0x10de0005, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
> { .id = 0x10de0006, .name = "MCP77/78 HDMI", .patch = patch_nvhdmi_8ch_7x },
> { .id = 0x10de0007, .name = "MCP79/7A HDMI", .patch = patch_nvhdmi_8ch_7x },
> -{ .id = 0x10de000a, .name = "GPU 0a HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de000b, .name = "GPU 0b HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de000c, .name = "MCP89 HDMI", .patch = patch_generic_hdmi },
> -{ .id = 0x10de000d, .name = "GPU 0d HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0010, .name = "GPU 10 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0011, .name = "GPU 11 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0012, .name = "GPU 12 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0013, .name = "GPU 13 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0014, .name = "GPU 14 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0015, .name = "GPU 15 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0016, .name = "GPU 16 HDMI/DP", .patch = patch_generic_hdmi },
> +{ .id = 0x10de000a, .name = "GPU 0a HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de000b, .name = "GPU 0b HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de000c, .name = "MCP89 HDMI", .patch = patch_nvhdmi },
> +{ .id = 0x10de000d, .name = "GPU 0d HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0010, .name = "GPU 10 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0011, .name = "GPU 11 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0012, .name = "GPU 12 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0013, .name = "GPU 13 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0014, .name = "GPU 14 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0015, .name = "GPU 15 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0016, .name = "GPU 16 HDMI/DP", .patch = patch_nvhdmi },
> /* 17 is known to be absent */
> -{ .id = 0x10de0018, .name = "GPU 18 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0019, .name = "GPU 19 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de001a, .name = "GPU 1a HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de001b, .name = "GPU 1b HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de001c, .name = "GPU 1c HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0040, .name = "GPU 40 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0041, .name = "GPU 41 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0042, .name = "GPU 42 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0043, .name = "GPU 43 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0044, .name = "GPU 44 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0051, .name = "GPU 51 HDMI/DP", .patch = patch_generic_hdmi },
> -{ .id = 0x10de0060, .name = "GPU 60 HDMI/DP", .patch = patch_generic_hdmi },
> +{ .id = 0x10de0018, .name = "GPU 18 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0019, .name = "GPU 19 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de001a, .name = "GPU 1a HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de001b, .name = "GPU 1b HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de001c, .name = "GPU 1c HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0040, .name = "GPU 40 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0041, .name = "GPU 41 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0042, .name = "GPU 42 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0043, .name = "GPU 43 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0044, .name = "GPU 44 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0051, .name = "GPU 51 HDMI/DP", .patch = patch_nvhdmi },
> +{ .id = 0x10de0060, .name = "GPU 60 HDMI/DP", .patch = patch_nvhdmi },
> { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch },
> { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch },
> { .id = 0x11069f80, .name = "VX900 HDMI/DP", .patch = patch_via_hdmi },
> --
> 1.8.1.5
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-11-04 9:12 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-24 23:31 NVIDIA HDMI: Channel remapping does not work for stereo? Anssi Hannula
2013-10-29 23:12 ` Aaron Plattner
2013-10-29 23:39 ` Anssi Hannula
2013-10-30 6:34 ` Takashi Iwai
2013-11-03 15:15 ` [PATCH] ALSA: hda - hdmi: Disallow unsupported 2ch remapping on NVIDIA codecs Anssi Hannula
2013-11-04 9:12 ` Takashi Iwai
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).