Skip to contentSkip to conversation

Only stereo sound with gtx570 over hdmi (regression)

PATCH Farid BENAMROUCHE 2 participants 4 messages Feb 15, 2015 – Feb 17, 2015 3 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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

A message that is not in the archive (sent off-list or not yet received): 1424027006.51914.YahooMailBasic-UplRsOVdabU874a3UngkqtbnKcCSMkHPVpNB7YpNyf8@public.gmane.org

#2 lore raw
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 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 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

A message that is not in the archive (sent off-list or not yet received): CACAvsv4809j-fuQB5nOp23vc7M5vL7DKxTHppRZ1guXh9dvnmQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw

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

[email protected]

Quoted 1 line

http://lists.freedesktop.org/mailman/listinfo/nouveau

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 1424180479.1612.YahooMailBasic-UplRsOVdabV/[email protected]

#6 lore raw
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 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 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, 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

Review 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 -0
        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);

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

[email protected]

Quoted 1 line

http://lists.freedesktop.org/mailman/listinfo/nouveau

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau