You are not logged in.

#1 2022-01-21 17:48:18

MaciekChudek
Member
Registered: 2017-07-08
Posts: 11

edid_override has no effect, not in lockdown

My goal is to watch movies on a projector which doesn't have a speaker. I purchased an HDMI audio-splitter to fork the sound component of the HDMI signal to a soundbar. It works when connected to my TV (which has a speaker), however when I connect my projector it sends an EDID that specifies no audio capability and pipewire-pulse -> pavucontrol shows no available profiles.

I have edited the projector's EDID to add basic audio capability and as an alternative have captured the EDID from my TV which has the same display resolutions so should hopefully work as a substitute. However, I am unable to override the EDID from the projector. As I switch what's plugged in to that connector regularly, I need to dynamically override the EDID after boot, rather than permanently overriding the connector's EDID.

Following these instructions from the wiki (https://wiki.archlinux.org/title/Kernel … s_and_EDID) I have attempted to override the EDID via debugfs.

As root

#  cat fixed_edid_or_edid_of_tv.bin > /sys/kernel/debug/dri/0/HDMI-A-1/edid_override

gives exit code 0, but nothing is logged to dmesg, Xorg.log or journalctl. The apparent EDID of HDMI-A-1 does not change (i.e., as reported by xrandr --verbose) and pavucontrol still shows no available profiles.

My kernel is not in lockdown mode:

# cat /sys/kernel/security/lockdown  
[none] integrity confidentiality

I'm not sure how to proceed. Where can I find any info to debug why this isn't working? Have I misunderstood how it is supposed to work?


kernel: 5.15.13.zen1-1
sound: pipewire-pulse 1:0.3.43-1
GPU: HDMI via a Radeon RX 6800 graphics card, using amdgpu kernel module and xf86-video-amdgpu 21.0.0-2 xorg driver

Offline

#2 2022-01-21 18:11:21

progandy
Member
Registered: 2012-05-17
Posts: 5,192

Re: edid_override has no effect, not in lockdown

What is the edid you get directly from the kernel?

diff -s /sys/class/drm/card0-HDMI-A-1/edid your_custom_edid.bin

You could try to restart xorg and/or pulseaudio/pipewire or send an udev change event for that connector or something like that?

# udevadm trigger /sys/class/drm/card0-HDMI-A-1

Last edited by progandy (2022-01-21 18:16:35)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2022-01-21 18:36:03

MaciekChudek
Member
Registered: 2017-07-08
Posts: 11

Re: edid_override has no effect, not in lockdown

All of the /sys/class/drm/*/edid files on my system are empty:

# ls -l /sys/class/drm/card0-HDMI-A-1/edid
-r--r--r-- 1 root root 0 Jan 19 17:20 /sys/class/drm/card0-HDMI-A-1/edid

Restarted pipewire/pulse with

$ systemctl --user restart pipewire pipewire-pulse
$ systemctl --user daemon-reload

but no change. `udevadm trigger ...` did nothing as far as I can tell. Restarting xorg now, will post a follow up if it works, but I suspect not.

Confirmed, restarting xorg did not change either the EDID reported by xrandr or the profiles reported by pavucontrol.

Last edited by MaciekChudek (2022-01-21 18:46:40)

Offline

#4 2022-01-21 19:01:52

progandy
Member
Registered: 2012-05-17
Posts: 5,192

Re: edid_override has no effect, not in lockdown

"ls -l" doesn't have any valid size for those files. You'll have to try reading them to check the content.

But if restarting xirg did not help then I have no more ideas for now. Is there any dmesg output when you try to force the edid?

Last edited by progandy (2022-01-21 19:05:44)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2022-01-21 19:20:57

MaciekChudek
Member
Registered: 2017-07-08
Posts: 11

Re: edid_override has no effect, not in lockdown

Thanks for trying to help.

There isn't any dmesg output when writing to .../edid_override.

# diff -s /sys/class/drm/card0-HDMI-A-1/edid /home/maciek/temp/edid/proj
Files /sys/class/drm/card0-HDMI-A-1/edid and /home/maciek/temp/edid/proj are identical

so that's reassuring, but yeah, pulse and xrandr still using the old EDID even after restarting both xorg and the pipewire service.

Interestingly, switching the HDMI plug between devices changes the EDID reported by xrandr, but /sys/class/drm/card0-HDMI-A-1/edid remains unchanged. After the change, `get-edid` from package read-edid returns the same EDID as xrandr rather than the overridden one from /sys/class/drm/card0-HDMI-A-1/edid. It seems like there's a second source of EDID information these programs are reading (the 'i2c bus'?). I wonder if there's some way to override that?

Offline

#6 2022-01-21 19:32:08

progandy
Member
Registered: 2012-05-17
Posts: 5,192

Re: edid_override has no effect, not in lockdown

There are hdmi audio splitters that send a modified edid with audio capabilities, if you can't find another solution.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#7 2022-01-21 20:10:37

MaciekChudek
Member
Registered: 2017-07-08
Posts: 11

Re: edid_override has no effect, not in lockdown

Okay, made one step towards a solution.

Looks like the kernel HMDI numbers are 1-based but xrandr is 0-based:

# ls /sys/class/drm
card0  card0-DP-1  card0-DP-2  card0-HDMI-A-1  card0-HDMI-A-2  renderD128  version
# xrandr | grep HDMI
HDMI-A-0 disconnected (normal left inverted right x axis y axis)
HDMI-A-1 connected 1920x1080+4480+0 (normal left inverted right x axis y axis) 1100mm x 620mm

writing to /sys/kernel/debug/dri/0/HDMI-A-2/edid_override successfully changed the xrandr output for its "HDMI-A-1"

However pulse/pipewire still doesn't show active profiles, even when using the TV's EDID and after restarting the service. Will try restarting xorg.

Last edited by MaciekChudek (2022-01-21 20:10:56)

Offline

#8 2022-01-21 20:22:43

progandy
Member
Registered: 2012-05-17
Posts: 5,192

Re: edid_override has no effect, not in lockdown

However pulse/pipewire still doesn't show active profiles, even when using the TV's EDID and after restarting the service. Will try restarting xorg.

Maybe the kernel driver does not read the modified edid, and does not perform the necessary audio setup. I have no idea if that really is the case, though.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#9 2022-01-22 00:23:20

MaciekChudek
Member
Registered: 2017-07-08
Posts: 11

Re: edid_override has no effect, not in lockdown

Alright, found a cause and workaround. Posting here for the benefit of others with similar problems.

EDID data gets converted by the kernel to ELD (EDID-like data) for ALSA and is available in the filesystem at

/proc/asound/card*/eld\#*

The functions that translate EDID to ELD are called inconsistently by different kernel drivers and in my case there are open issues related to this with the AMDGPU drivers .

You can change ELD parameters by echoing them to these files, however this doesn't seem to automatically propagate to pulseaudio. Some other function needs to be called, which I can only seem to trigger by replugging the HDMI cable (turning the monitor on/off with xrandr doesn't do it).

Here is a workaround that is dirty but usable in my case:

  1. Plug in TV (i.e., device with audio-enabled EDID)

  2. Override the connector's EDID with the EDID of the currently plugged TV (i.e., doesn't change the EDID, but does lock it in when you replug the cable).

    sudo cat EDID_of_TV > /sys/kernel/debug/dri/0/HDMI-A-2/edid_override  
  3. Manually set the first two properties of the ELD associated with the TV to 1. This doesn't change anything, since they should already be set to this when a working audio device is connected, but echoing them to the ELD file seems to lock something in that prevents the ELD data reseting when the hdmi cable is next replugged. I suspect this is a temporary bug that I'm exploiting so this workaround will break eventually.

    echo 'monitor_present 1' | sudo tee /proc/asound/card2/eld#0.3 
    echo 'eld_valid 1' | sudo tee /proc/asound/card2/eld#0.3   
  4. Unplug the TV and plug in the projector (i.e., device with audio-less EDID). Sounds keeps playing.

This is a dirty hack and produces weirdness (e.g., after replugging the TV, its ELD 'monitor_name' property now identifies it as the projector), but the sound keeps playing and that's good enough for me until the drivers are patched.

Last edited by MaciekChudek (2022-01-22 00:25:37)

Offline

Board footer

Powered by FluxBB