Bug 216665

Summary: Synopsys Designware HDMI >= 2.10a seems not to insert PCUV bits into HDMI audio stream unless insert_pcuv bit is set
Product: Drivers Reporter: Geraldo Nascimento (geraldogabriel)
Component: Video(DRI - non Intel)Assignee: drivers_video-dri
Status: NEW ---    
Severity: normal CC: geraldogabriel
Priority: P1    
Hardware: ARM   
OS: Linux   
Kernel Version: 6.0.7 Subsystem:
Regression: No Bisected commit-id:
Attachments: Patch to set insert_pcuv

Description Geraldo Nascimento 2022-11-05 19:38:43 UTC
Created attachment 303135 [details]
Patch to set insert_pcuv

Enabling sound in the device tree for my Radxa Rock Pi N10 (RK3399Pro SoM) resulted in music sounding like white noise with my Philips 243V HDMI monitor.

I then found out I wasn't alone by reading the following LibreELEC thread:
https://forum.libreelec.tv/thread/17600-rk3399-hdmi-audio-quality/

Particularly, sigmaris on page 2 of that thread, experienced similar symptoms with his/her Samsung TV, like I did. Like him/her, I had to software mix the volume down to 33% at which point music would sound like music, not white noise.

I was very puzzled by that, and after an exchange with Sugar Zhang from Rockchip I dumped all the HDMI registers with i2cdump and started checking them one by one, comparing what was set by the Linux kernel driver with the Rockchip Technical Reference Manual.

This lead me to the missing insert_pcuv bit, which it seems to me, Synopsys introduced purposefully breaking compatibility with existing driver codebases. The attached patch fixes my problem (I have normal music with 100% of audio volume and no glitches) and was posted to relevant kernel lists: https://lore.kernel.org/dri-devel/Y2A48a5ff+SyxqLR@geday/T/

I'd like to thank Mark Brown for pointing out the fix should be restricted to Linear PCM only, and Neil Armstrong for further researching this. Unfortunately it seems we're out of testers for the time being.

I post this in the hope all this doesn't sink down the memory hole, and maybe Google will lead people experiencing the same problems towards here, and they can test the proposed solution in the attachment.