Only stereo sound with gtx570 over hdmi (regression)
Subsystems (3)
Hello all,
I'm using gentoo, with kernel 3.17.0-p1-pf and at some point, a patch was included in this branch of the gentoo kernel that broke hdmi audio.
I've checked with the latest 3.19 vanilla kernel, and I still have the same problem. I cannot output multichannel sound over hdmi.
After some investigations, I've narrowed down the issue to the following lines in the file nv50_display.c:
(the structure slightly changed and declared "packed". Reverting this change made the multichannel audio back) I still do not known exactly when this modification was introoduced. If you need more details, please let me know.
drivers/gpu/drm/nouveau/nv50_display.c +10 -8
@@ -1653,15 +1653,17 @@struct nouveau_encoder *nv_encoder =nouveau_encoder (encoder);struct nouveau_connector *nv_connector;struct nv50_disp *disp =nv50_disp (encoder->dev); -struct { -struct nv50_disp_mthd_v1 base; -struct nv50_disp_sor_hda_eld_v0 eld; +struct __packed { +struct { +struct nv50_disp_mthd_v1 mthd; +struct nv50_disp_sor_hda_eld_v0 eld; + } base;u8 data[sizeof (nv_connector->base.eld)]; } args = { - .base.version =1 , - .base.method =NV50_DISP_MTHD_V1_SOR_HDA_ELD , - .base.hasht = nv_encoder->dcb->hasht, - .base.hashm = nv_encoder->dcb->hashm, + .base.mthd.version =1 , + .base.mthd.method =NV50_DISP_MTHD_V1_SOR_HDA_ELD , + .base.mthd.hasht = nv_encoder->dcb->hasht, + .base.mthd.hashm = nv_encoder->dcb->hashm, }; nv_connector =nouveau_encoder_connector_get (nv_encoder);
@@ -1671,7 +1673,7 @@drm_edid_to_eld (&nv_connector->base, nv_connector->edid);memcpy (args.data, nv_connector->base.eld,sizeof (args.data)); -nvif_mthd (disp->disp,0 , &args,sizeof (args)); +nvif_mthd (disp->disp,0 , &args,sizeof (args.base) + args.data[2 ] *4 ); } static void
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
Quoted 10 lines · Farid BENAMROUCHE
Hello all,
I'm using gentoo, with kernel 3.17.0-p1-pf and at some point, a patch was included in this branch of the gentoo kernel that broke hdmi audio.
I've checked with the latest 3.19 vanilla kernel, and I still have the same problem. I cannot output multichannel sound over hdmi.
After some investigations, I've narrowed down the issue to the following lines in the file
nv50_display.c:(the structure slightly changed and declared "packed". Reverting this change made the multichannel audio back) I still do not known exactly when this modification was introoduced. If you need more details, please let me know.
There were bugs in the implementation for a while that could've caused this problem. However, those should be fixed already by 3.19. What kernel version is your revert against? It's not the latest code, because that uses drm_eld_size().
Testing on my TV at home (3.19.0-rc5), I see this in /proc/asound/card1/eld#0.0:
monitor_present 1eld_valid 1monitor_name SAMSUNGconnection_type HDMIeld_version [0x2] CEA-861D or belowedid_version [0x3] CEA-861-B, C or Dmanufacture_id 0x2d4cproduct_id 0x69bport_id 0x0support_hdcp 0support_ai 1audio_sync_delay 0
speakers [0xf] FL/FR LFE FC RL/RRsad_count 4sad0_coding_type [0x1] LPCMsad0_channels 2sad0_rates [0x6e0] 32000 44100 48000 88200 96000sad0_bits [0xe0000] 16 20 24sad1_coding_type [0x1] LPCMsad1_channels 6sad1_rates [0x6e0] 32000 44100 48000 88200 96000sad1_bits [0xe0000] 16 20 24sad2_coding_type [0x2] AC-3sad2_channels 6sad2_rates [0xe0] 32000 44100 48000sad2_max_bitrate 640000sad3_coding_type [0x7] DTSsad3_channels 6sad3_rates [0xe0] 32000 44100 48000sad3_max_bitrate 1536000
Which looks correct, and like the code you mention is doing the right thing.
Thanks,
Ben.
Quoted 39 lines
drivers/gpu/drm/nouveau/nv50_display.c +10
-8@@ -1653,15 +1653,17 @@struct nouveau_encoder *nv_encoder =nouveau_encoder (encoder);struct nouveau_connector *nv_connector;struct nv50_disp *disp =nv50_disp (encoder->dev); -struct { -struct nv50_disp_mthd_v1 base; -struct nv50_disp_sor_hda_eld_v0 eld; +struct __packed { +struct { +struct nv50_disp_mthd_v1 mthd; +struct nv50_disp_sor_hda_eld_v0 eld; + } base;u8 data[sizeof (nv_connector->base.eld)]; } args = { - .base.version =1 , - .base.method =NV50_DISP_MTHD_V1_SOR_HDA_ELD , - .base.hasht = nv_encoder->dcb->hasht, - .base.hashm = nv_encoder->dcb->hashm, + .base.mthd.version =1 , + .base.mthd.method =NV50_DISP_MTHD_V1_SOR_HDA_ELD , + .base.mthd.hasht = nv_encoder->dcb->hasht, + .base.mthd.hashm = nv_encoder->dcb->hashm, }; nv_connector =nouveau_encoder_connector_get (nv_encoder);@@ -1671,7 +1673,7 @@drm_edid_to_eld (&nv_connector->base, nv_connector->edid);memcpy (args.data, nv_connector->base.eld,sizeof (args.data)); -nvif_mthd (disp->disp,0 , &args,sizeof (args)); +nvif_mthd (disp->disp,0 , &args,sizeof (args.base) + args.data[2 ] *4 ); } static void
Quoted 4 lines
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
Hello Ben,
The working kernel code I based my investigation was a 1.3.17 + gentoo patch (so yes, pretty old)
The new one below, not working is the vanilla 3.19 (from the gentoo repo, should be identical to the latest 3.19 stable)
I've narrowed down the issue to the size of the eld.
The new patch (that indeed uses drm_eld_size) (with this patch, I have a working 3.19 kernel):
I will need to restart my computer with the non working kernel to check the eld output (by the way, what is the ELD?, is it the EDID?)
Thanks
gpu/drm/nouveau/nv50_display.c renamed from gpu/drm/nouveau/nv50_display.c.orig +1 -1
@@ -1700,7 +1700,7 @@memcpy (args.data, nv_connector->base.eld,sizeof (args.data));nvif_mthd (disp->disp,0 , &args, -sizeof (args.base) +drm_eld_size (args.data)); +sizeof (args.base)); } static void
--------------------------------------------
En date de : Mar 17.2.15, Ben Skeggs <[email protected]> a écrit :
Objet: Re: [Nouveau] Only stereo sound with gtx570 over hdmi (regression) À: "Farid BENAMROUCHE" <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Mardi 17 février 2015, 0h47
Quoted 3 lines · Farid BENAMROUCHE
Hello all,
I'm using gentoo,
with kernel 3.17.0-p1-pf and at some point, a patch was included in this branch of the gentoo kernel that broke hdmi audio.
Quoted 2 lines
I've
checked with the latest 3.19 vanilla kernel, and I still have the same problem. I cannot output multichannel sound over hdmi.
Quoted 2 lines
After
some investigations, I've narrowed down the issue to the following lines in the file nv50_display.c:
Quoted 2 lines
(the structure
slightly changed and declared "packed". Reverting this change made the multichannel audio back)
Quoted 1 line
I still do not known exactly when this
modification was introoduced. If you need more details, please let me know.
There were bugs in the
implementation for a while that could've caused this problem. However, those should be fixed already by 3.19. What
kernel version is
your revert against? It's not the latest code, because that uses drm_eld_size().
Testing on my TV at home
(3.19.0-rc5), I see this in /proc/asound/card1/eld#0.0:
monitor_present 1
eld_valid 1
monitor_name
SAMSUNG
connection_type HDMI
eld_version [0x2] CEA-861D or below
edid_version [0x3] CEA-861-B, C or D
manufacture_id 0x2d4c
product_id 0x69b
port_id 0x0
support_hdcp 0
support_ai 1
audio_sync_delay 0
speakers
[0xf] FL/FR LFE FC RL/RR
sad_count 4
sad0_coding_type [0x1] LPCM
sad0_channels 2
sad0_rates
[0x6e0] 32000 44100 48000 88200 96000
sad0_bits [0xe0000] 16 20 24
sad1_coding_type [0x1] LPCM
sad1_channels 6
sad1_rates
[0x6e0] 32000 44100 48000 88200 96000
sad1_bits [0xe0000] 16 20 24
sad2_coding_type [0x2] AC-3
sad2_channels 6
sad2_rates
[0xe0] 32000 44100 48000
sad2_max_bitrate
640000
sad3_coding_type [0x7] DTS
sad3_channels 6
sad3_rates
[0xe0] 32000 44100 48000
sad3_max_bitrate
1536000
Which looks
correct, and like the code you mention is doing the right thing.
Thanks,
Ben.
Quoted 2 lines
---
working_kernel/drivers/gpu/drm/nouveau/nv50_display.c
Quoted 1 line
+++
not_working_kernel/drivers/gpu/drm/nouveau/nv50_display.c
Quoted 2 lines
(quoted diff) +0
-0@@ -1653,15 +1653,17 @@struct
nouveau_encoder *nv_encoder = nouveau_encoder(encoder);
Quoted 1 line
struct
nouveau_connector *nv_connector;
Quoted 1 line
struct nv50_disp *disp =
nv50_disp(encoder->dev);
Quoted 1 line
-
struct {
Quoted 1 line
-
struct nv50_disp_mthd_v1 base;
Quoted 1 line
- struct
nv50_disp_sor_hda_eld_v0 eld;
Quoted 1 line
+
struct __packed {
Quoted 1 line
+
struct {
Quoted 1 line
+
struct
nv50_disp_mthd_v1 mthd;
Quoted 1 line
+
struct nv50_disp_sor_hda_eld_v0
eld;
Quoted 1 line
+ }
base;
Quoted 1 line
u8 data[sizeof(nv_connector->base.eld)];
Quoted 2 lines
} args = {
-
.base.version = 1,
Quoted 1 line
-
.base.method =
NV50_DISP_MTHD_V1_SOR_HDA_ELD,
Quoted 1 line
-
.base.hasht =
nv_encoder->dcb->hasht,
Quoted 1 line
-
.base.hashm =
nv_encoder->dcb->hashm,
Quoted 1 line
+
.base.mthd.version = 1,
Quoted 1 line
+
.base.mthd.method =
NV50_DISP_MTHD_V1_SOR_HDA_ELD,
Quoted 1 line
+
.base.mthd.hasht =
nv_encoder->dcb->hasht,
Quoted 1 line
+
.base.mthd.hashm =
nv_encoder->dcb->hashm,
Quoted 1 line
};
Quoted 2 lines
nv_connector =
nouveau_encoder_connector_get(nv_encoder);
Quoted 2 lines
(quoted diff) +0
-0@@ -1671,7 +1673,7 @@
drm_edid_to_eld(&nv_connector->base,
nv_connector->edid);
Quoted 1 line
memcpy(args.data, nv_connector->base.eld,
sizeof(args.data));
Quoted 2 lines
-
nvif_mthd(disp->disp, 0, &args,
sizeof(args));
Quoted 1 line
+
nvif_mthd(disp->disp, 0, &args,
sizeof(args.base) + args.data[2] * 4);
Quoted 6 lines
}
static void
_______________________________________________
Quoted 2 lines
Nouveau mailing list
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau
Quoted 15 lines · Farid BENAMROUCHE
Hello Ben,
The working kernel code I based my investigation was a 1.3.17 + gentoo patch (so yes, pretty old)
The new one below, not working is the vanilla 3.19 (from the gentoo repo, should be identical to the latest 3.19 stable)
I've narrowed down the issue to the size of the eld.
The new patch (that indeed usesdrm_eld_size) (with this patch, I have a working 3.19 kernel):
I will need to restart my computer with the non working kernel to check the eld output (by the way, what is the ELD?, is it the EDID?)Thanks
gpu/drm/nouveau/nv50_display.c 2015-02-15 20:46:43.518148777 +0100 line 1703
Quoted 5 lines
gpu/drm/nouveau/nv50_display.c 2015-02-15 20:46:43.518148777 +0100 renamed from gpu/drm/nouveau/nv50_display.c.orig 2015-02-15 20:04:10.583860698 +0100 +1
-1@@ -1700,7 +1700,7 @@ memcpy(args.data, nv_connector->base.eld, sizeof(args.data)); nvif_mthd(disp->disp, 0, &args, - sizeof(args.base) + drm_eld_size(args.data)); + sizeof(args.base));
That's... Odd. Can you boot with "nouveau.debug=drm=trace" both with and without the patch and attach the results here?
Thanks,
Ben.
Quoted 173 lines
gpu/drm/nouveau/nv50_display.c 2015-02-15 20:46:43.518148777 +0100 renamed from gpu/drm/nouveau/nv50_display.c.orig 2015-02-15 20:04:10.583860698 +0100 +0
-1} static void --------------------------------------------En date de : Mar 17.2.15, Ben Skeggs <[email protected]> a écrit :
Objet: Re: [Nouveau] Only stereo sound with gtx570 over hdmi (regression) À: "Farid BENAMROUCHE" <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Mardi 17 février 2015, 0h47Quoted 3 lines · Farid BENAMROUCHE
Hello all,
I'm using gentoo,
with kernel 3.17.0-p1-pf and at some point, a patch was included in this branch of the gentoo kernel that broke hdmi audio.
Quoted 2 lines
I've
checked with the latest 3.19 vanilla kernel, and I still have the same problem. I cannot output multichannel sound over hdmi.
Quoted 2 lines
After
some investigations, I've narrowed down the issue to the following lines in the file
nv50_display.c:Quoted 2 lines
(the structure
slightly changed and declared "packed". Reverting this change made the multichannel audio back)
Quoted 1 line
I still do not known exactly when this
modification was introoduced. If you need more details, please let me know.
There were bugs in the
implementation for a while that could've caused this problem. However, those should be fixed already by 3.19. What
kernel version is
your revert against? It's not the latest code, because that usesdrm_eld_size().Testing on my TV at home
(3.19.0-rc5), I see this in /proc/asound/card1/eld#0.0:
monitor_present1
eld_valid1
monitor_name
SAMSUNG
connection_typeHDMI
eld_version[0x2] CEA-861D or below
edid_version[0x3] CEA-861-B, C or D
manufacture_id0x2d4c
product_id0x69b
port_id0x0
support_hdcp0
support_ai1
audio_sync_delay0
speakers
[0xf] FL/FR LFE FC RL/RR
sad_count4
sad0_coding_type[0x1] LPCM
sad0_channels2
sad0_rates
[0x6e0] 32000 44100 48000 88200 96000
sad0_bits[0xe0000] 16 20 24
sad1_coding_type[0x1] LPCM
sad1_channels6
sad1_rates
[0x6e0] 32000 44100 48000 88200 96000
sad1_bits[0xe0000] 16 20 24
sad2_coding_type[0x2] AC-3
sad2_channels6
sad2_rates
[0xe0] 32000 44100 48000
sad2_max_bitrate
640000
sad3_coding_type[0x7] DTS
sad3_channels6
sad3_rates
[0xe0] 32000 44100 48000
sad3_max_bitrate
1536000Which looks
correct, and like the code you mention is doing the right thing.Thanks,
Ben.Quoted 2 lines
---
working_kernel/drivers/gpu/drm/nouveau/nv50_display.cQuoted 1 line
+++
not_working_kernel/drivers/gpu/drm/nouveau/nv50_display.cReview line 1653
Quoted 2 lines
(quoted diff) +0
-0@@ -1653,15 +1653,17 @@ struct
nouveau_encoder*nv_encoder=nouveau_encoder(encoder);Review line 1654
Quoted 1 line
(quoted diff) +0
-0struct
nouveau_connector*nv_connector;Quoted 1 line
struct
nv50_disp*disp =
nv50_disp(encoder->dev);Quoted 1 line
-
struct {Quoted 1 line
-
struct nv50_disp_mthd_v1 base;Quoted 1 line
- struct
nv50_disp_sor_hda_eld_v0eld;Quoted 1 line
+
struct __packed {Quoted 1 line
+
struct {Quoted 1 line
+
struct
nv50_disp_mthd_v1mthd;Quoted 1 line
+
struct nv50_disp_sor_hda_eld_v0eld;
Quoted 1 line
+ }
base;
Quoted 1 line
u8 data[sizeof(nv_connector->base.eld)];Quoted 2 lines
} args = {-
.base.version = 1,Quoted 1 line
-
.base.method =
NV50_DISP_MTHD_V1_SOR_HDA_ELD,Quoted 1 line
-
.base.hasht =
nv_encoder->dcb->hasht,Quoted 1 line
-
.base.hashm =
nv_encoder->dcb->hashm,Quoted 1 line
+
.base.mthd.version = 1,Quoted 1 line
+
.base.mthd.method =
NV50_DISP_MTHD_V1_SOR_HDA_ELD,Quoted 1 line
+
.base.mthd.hasht =
nv_encoder->dcb->hasht,Quoted 1 line
+
.base.mthd.hashm =
nv_encoder->dcb->hashm,Quoted 1 line
};Quoted 2 lines
nv_connector=
nouveau_encoder_connector_get(nv_encoder);Review line 1673
Quoted 2 lines
(quoted diff) +0
-0@@ -1671,7 +1673,7 @@drm_edid_to_eld(&nv_connector->base,
nv_connector->edid);Quoted 1 line
memcpy(args.data, nv_connector->base.eld,sizeof(args.data));
Quoted 2 lines
-
nvif_mthd(disp->disp, 0, &args,sizeof(args));
Quoted 1 line
+
nvif_mthd(disp->disp, 0, &args,sizeof(args.base) + args.data[2] * 4);
Quoted 2 lines
}
Quoted 10 lines
Quoted 4 lines
static void
_______________________________________________
Quoted 2 lines
Nouveau mailing list
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau