2

I have the HDMI-to-VGA adapter with the bad EDID. The monitor says "unsupported mode" on the mode that should be supported. The 1600x900 mode don't work, only the 1280x720. The virtual console is broken.

Using the EDID override, I was able to set 1440x900 mode in both X and console. That however prevented ALSA from working. Even with the original EDID dump.

There's no visible difference in the system. Pulseaudio have the same playback device. Aplay works the same. The only difference is no sound.

By the way, the system is Allwinner H3.

Add: I used Deltacast E-EDID for patching. Just took default edid/1440x900.bin and added a CEA extension block.

  • Which CEA block? Audio? With the same information as in the original EDID? What are the drivers for the video hardware, and the audio HDMI? Does the correct ELD part of the EDID show up in `/proc/asound/card*/eld\#*`, with and/or without your overwrite? IIRC the cooperation between the video drivers supplying the EDID and the audio driver extracting the ELD is a bit sketchy, so it may well not work with a user-supplied EDID ... in doubt, read kernel code. – dirkt Dec 22 '17 at 10:27
  • Audio and channel. With the same. Driver for the sound is allwinner-hdmi. There's no eld either with or without override. To read kernel code? Okay, I'll try. –  Dec 22 '17 at 10:41
  • The system says it's okay, but it's not. –  Dec 22 '17 at 10:44
  • Had time to look into the source code. It seems that something important is in file https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-next/sound/soc/codecs/hdmi-codec.c at line 787. I think there. Then look to vars backwards until I'll find it. –  Dec 25 '17 at 09:36
  • Also, allwinner-hdmi is just name, the module is snd_soc_hdmi_codec. –  Dec 25 '17 at 09:37
  • Also I have sun8i_dw_hdmi and sun4i_i2s. –  Dec 25 '17 at 09:55
  • I added debug to the kernel options. It seems that snd_soc_hdmi_codec working correctly. Gonna try dump sysfs. –  Dec 25 '17 at 09:57
  • Not sure how the HDMI stack for the Allwinner does it, but I'd expect some driver **above** the codec to control the codec (like the Intel HDA hardware does), and *that* driver should pass along the ELD it got from the EDID. `lsmod` may help to narrow that down, unless you've all modules compiled in. – dirkt Dec 25 '17 at 10:48
  • https://pastebin.com/Kn8Rnsq8 - that's my asound state when the sound DOES work. Look, there's no ELD but it's working somehow. –  Dec 28 '17 at 09:39
  • Anyway, here's complete lsmod output https://pastebin.com/PBd9dG3v when it does work –  Dec 28 '17 at 09:48
  • Maybe empty ELD means "use driver one" and can be overrided? –  Dec 28 '17 at 09:51
  • Empty ELD probably means "whoever wrote the driver was lazy and didn't implement that part". [dw-hdmi-i2s-audio](https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-next/drivers/gpu/drm/bridge/synopsys/dw-hdmi-i2s-audio.c) seems to be the connection between HDMI and the (digital?) codec. There is initialization in `dw_hdmi_i2s_hw_params`, but I didn't see where the data comes from, and I'm too lazy to clone the git and grep. – dirkt Dec 28 '17 at 16:51
  • Another angle of attack is to look at the (digital, if there are several) codec state in `/proc/asound/card*/codec\#*`, and see if there are differences that explain missing sound. – dirkt Dec 28 '17 at 16:52
  • I don't have codec in /proc/asound/card, everything is here: https://pastebin.com/48vqGCz5 –  Dec 30 '17 at 10:58
  • About the kernel - I have source packages in my system. –  Dec 30 '17 at 10:58
  • Looks like the Allwinner drivers are very different from the Intel HDA drivers, so I guess there's no choice but to wade through the code ... – dirkt Dec 30 '17 at 14:00
  • static int dw_hdmi_i2s_hw_params(struct device *dev, void *data, struct hdmi_codec_daifmt *fmt, struct hdmi_codec_params *hparms) –  Jan 17 '18 at 02:40
  • seems to be called from return hcp->hcd.ops->hw_params(dai->dev->parent, hcp->hcd.data, &hcp->daifmt[dai->id], &hp); –  Jan 17 '18 at 02:40
  • in sound/soc/codecs/hdmi-codec.c –  Jan 17 '18 at 02:41
  • static int hdmi_codec_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) –  Jan 17 '18 at 02:42
  • It seems I should look into /sound/soc dir. –  Jan 17 '18 at 02:52

1 Answers1

0

I think the exact solution is too hard for me to find. So I did this instead.

I wrote

extraargs=drm_kms_helper.drm_fbdev_overalloc=200 video=1024x768

in /boot/armbianEnv.txt and

Section "Monitor"
   Identifier    "HDMI-1"
EndSection

Section "Device"
    Identifier     "Allwinner sun4i DRM driver"
    Driver         "armsoc"
    Option         "DRI2"   "true"
        Option         "ConnectedMonitor" "HDMI-1"
        Option         "CustomEDID" "HDMI-1:/lib/firmware/edid/1280x1024.bin"
        Option         "IgnoreEDID" "false"
        Option         "UseEDID" "true"
EndSection

Section "ServerFlags"
Option  "AIGLX" "off"
EndSection

Section "Screen"
   Identifier    "Screen0"
   Device        "Allwinner sun4i DRM driver"
   Monitor       "HDMI-1"
EndSection

in /etc/X11/xorg.conf.d/80-armsoc-sun4i.conf .

I don't know if it's correct, but it works for me. Also note - I used another monitor. This monitor worked too but with different settings.