EDID

Custom EDID

To change the order of turning on your devices (normally your HTPC has to be powered on last) or to use your LibreELEC device without the TV turned on, you need to dump/save the EDID information from your TV (or AVR).
In the steps below we will explain how this can be done:
Note: Your devices should all be turned on and you should have a screen and audio working. Otherwise the EDID information aren't provided properly and this How-To won't work.
In the tabs below we explain different ways how to dump the EDID information. Intel explains the steps which need to be done for Intel based GPUs and nVidia will explain the same steps for nVidia based GPUs which will differ much from each other. We also provide a script which does the needed things for the specific GPUs automatically.

Generic x86_64

Note: This script will also only work for Intel or nVidia based GPUs. AMD/ATI GPU's are not supported.
To use the getedid script you need to have SSH access to your LibreELEC machine.
Once you are in, just type in
1
getedid
Copied!
to see which options are available. It will look like this.
The available options are create, gpu, delete and help. These are explained below.

getedid help

This will show a help message and a little explanation for the specific options.

getedid gpu

This will check which GPU you are using and you will either get "Intel", "NVidia" or "GPU is not supported" after running that command.

getedid create

This will do all needed steps which are needed to dump the EDID for the GPU you are using. It first checks if the GPU is supported, then it checks if you already have done changes to the files which the script needs to change, too. If you already have done some changes to those files, the script will stop and you should dump the EDID manually. Those steps are explained in the other tabs. The reason for that is, that we can't know what you already have changed and therefore the script might do something horrible wrong and we don't want to break your system. As you already know how to edit those files it should not be that hard to do that again.
If the files are like they should be from a vanilla installation, the script does its thing and will do everything which is necessary and reboot your machine after everything is done as expected.
After that you shouldn't take care about the ordering how to turn on your devices, anymore. Your HTPC should also be turned on as the first device in the chain now.

getedid delete

This will delete all the created files from getedid create if you have used it before. After using getedid delete the default configuration is restored. No unneeded files on it, everything is like a vanilla installation and you have to take care about the ordering how to turn on your devices again.

Intel

Get the needed information about your system

First, you have to SSH in your LibreELEC machine. Then enter the following command.
1
tail /sys/class/drm/*/status
Copied!
Look for the connected device:
how it looks like at the shell
1
==> /sys/class/drm/card0-HDMI-A-2/status <==
2
connected
Copied!
The information we need HDMI-A-2 is connected.

Create the EDID file

Now we will create a copy of the EDID binary data and put it where it needs to go. Change the cat command to match the active HDMI/DP port. For the possibility to copy and paste the correct commands, change the tabs below to the matching port.
1
mkdir -p /storage/.config/firmware/edid
Copied!
HDMI-A-1
1
cat /sys/class/drm/card0-HDMI-A-1/edid > /storage/.config/firmware/edid/edid.bin
Copied!
HDMI-A-2
1
cat /sys/class/drm/card0-HDMI-A-2/edid > /storage/.config/firmware/edid/edid.bin
Copied!
Next a cpio archive file will be created which will be loaded at boot.
1
cd ~
2
mkdir -p cpio/lib/firmware/edid
3
cp .config/firmware/edid/edid.bin cpio/lib/firmware/edid/
4
cd cpio/
5
find . -print | cpio -ov -H newc > ../edid.cpio
Copied!

Editing the extlinux.conf or syslinux.cfg

Now mount the boot partition as "RW" and move the file to it
1
mount -o remount,rw /flash
2
mv ../edid.cpio /flash/
Copied!
After the file is moved to the correct place, we have to add some boot parameters. For this we have edit either the "extlinux.conf" or the "syslinux.cfg" file in your /flash/ directory. Use this command to check which one is available.
1
ls /flash/
Copied!
Search for "extlinux.conf" or "syslinux.cfg" and edit it. Only one of them is available.
syslinux.cfg
1
nano /flash/syslinux.cfg
Copied!
extlinux.conf
1
nano /flash/extlinux.conf
Copied!
Note: If you are not using LibreELEC 9.0 or newer please use nano -w instead of nano
Add to the APPEND line the following things.
HDMI-A-1
1
initrd=/edid.cpio drm.edid_firmware=edid/edid.bin video=HDMI-A-1:D
Copied!
The APPEND line should look this like this after (everything in a single line):
1
APPEND boot=LABEL=System disk=LABEL=Storage ssh quiet initrd=/edid.cpio drm.edid_firmware=edid/edid.bin video=HDMI-A-1:D
Copied!
HDMI-A-2
1
initrd=/edid.cpio drm.edid_firmware=edid/edid.bin video=HDMI-A-2:D
Copied!
The APPEND line should look this like this after (everything in a single line).
1
APPEND boot=LABEL=System disk=LABEL=Storage ssh quiet drm.edid_firmware=edid/edid.bin video=HDMI-A-2:D
Copied!
Last step is to reboot the device.
1
reboot
Copied!

nVidia

If you boot your nVidia GPU based LibreELEC box before the TV/AVR and you see a black screen on boot - follow this guide to create an edid.bin file that tricks Xorg into thinking the TV/AVR are powered on at boot time.
Note: This example will NOT work on Intel or AMD GPU's.

Get the needed information about your system

Open an SSH session to your LibreELEC machine. Once logged into the console we need to work out the DFP number.
1
grep ": connected" /var/log/Xorg.0.log | head -n 1
Copied!
You should see message like the following:
1
[3241512.110] (--) NVIDIA(0): SAMSUNG (DFP-0): connected
Copied!
Note the DFP number - in this example it is "DFP-0" but yours may be different.

Set Xorg to Debug Mode

To extract EDID data we need we need to place Xorg into debug mode. First we stop Xorg.
1
systemctl stop xorg.service
Copied!
Next we clone the xorg.conf to the config override location in /storage/.config.
1
cp /etc/X11/xorg-nvidia.conf /storage/.config/xorg.conf
Copied!
Then we edit the file with sed to enable debug mode.
1
sed -i 's/"ModeDebug" "false"/"ModeDebug" "true"/g' /storage/.config/xorg.conf
Copied!
The device section in the modified file should look something like this.
1
Section "Device"
2
Identifier "nvidia"
3
Driver "nvidia"
4
Option "DynamicTwinView" "False"
5
Option "NoFlip" "false"
6
Option "NoLogo" "true"
7
Option "ConnectToAcpid" "0"
8
Option "FlatPanelProperties" "Scaling = Native"
9
Option "ModeValidation" "NoVesaModes, NoXServerModes"
10
Option "HWCursor" "false"
11
Option "ModeDebug" "true"
12
EndSection
Copied!
Now restart Xorg.
1
systemctl start xorg.service
Copied!

Create the EDID file

Extract the RAW binary EDID information from the debug /var/log/Xog.0.log to a file.
1
nvidia-xconfig --extract-edids-from-file=/var/log/Xorg.0.log --extract-edids-output-file=/storage/.config/edid.bin
Copied!
The command should output something like.
1
Found 1 EDID in "/var/log/Xorg.0.log".
2
Wrote EDID for "ONK TX-NR616 (DFP-0)" to "/storage/.config/edid.bin" (256 bytes).
Copied!

Edit xorg.conf

Now we edit /storage/.config/xorg.conf - set ModeDebug back to False (edit the word true to false) and uncomment the following lines.
1
Option "ConnectedMonitor" "DFP-0"
2
Option "CustomEDID" "DFP-0:/storage/.config/edid.bin"
3
Option "IgnoreEDID" "false"
4
Option "UseEDID" "true"
Copied!
Make sure you change the DFP number to match the one we found earlier. In the end your config will look something like.
1
Section "Device"
2
Identifier "nvidia"
3
Driver "nvidia"
4
Option "DynamicTwinView" "False"
5
Option "NoFlip" "false"
6
Option "NoLogo" "true"
7
Option "ConnectToAcpid" "0"
8
Option "FlatPanelProperties" "Scaling = Native"
9
Option "ModeValidation" "NoVesaModes, NoXServerModes"
10
Option "HWCursor" "false"
11
Option "ModeDebug" "false"
12
Option "ConnectedMonitor" "DFP-0"
13
Option "CustomEDID" "DFP-0:/storage/.config/edid.bin"
14
Option "IgnoreEDID" "false"
15
Option "UseEDID" "true"
16
EndSection
17
Section "Screen"
18
Identifier "screen"
19
Device "nvidia"
20
DefaultDepth 24
21
Option "ColorRange" "Full"
22
# Option "ColorRange" "Limited"
23
# Option "ColorSpace" "RGB"
24
SubSection "Display"
25
Depth 24
26
EndSubSection
27
EndSection
28
Section "Extensions"
29
Option "Composite" "false"
30
EndSection
Copied!
Finally we stop/restart xorg.service to disable debug mode and use the new edid.bin file.
1
systemctl restart xorg.service
Copied!
If all has gone to plan Xorg now detects the EDID file and the order of powering on equipment no longer matters!

Amlogic (Legacy)

Amlogic legacy kernel devices (using 3.10, 3.14 kernels) do not capture "edid.bin" files like Intel and nVidia devices, but a similar process can capture, store and force the resolutions of a device. Connect your HTPC device directly to the HDMI source that you want to capture EDID information from, then login over SSH and run the following command.
1
cat /sys/class/amhdmitx/amhdmitx0/disp_cap > /storage/.kodi/userdata/disp_cap
Copied!
This stores a list of the supported resolutions. It looks like
1
480p60hz
2
480p_rpt
3
576p50hz
4
720p60hz
5
1080i60hz
6
1080p60hz
7
720p50hz
8
1080i50hz
9
1080p30hz
10
1080p50hz
11
1080p25hz
12
1080p24hz
13
2160p30hz
14
2160p25hz
15
2160p24hz
16
smpte24hz
17
smpte25hz
18
smpte30hz
19
smpte50hz
20
smpte60hz
21
smpte50hz420
22
smpte60hz420
23
2160p50hz
24
2160p60hz
25
2160p50hz420
26
2160p60hz420
Copied!
To remove or add specific resolutions, e.g. if 1080p24hz is missing, edit disp_cap.
1
nano /storage/.kodi/userdata/disp_cap
Copied!
Ctrl+o to save, Ctrl+x to exit the nano editor. Next restart Kodi by rebooting the box or running.
1
systemctl restart kodi
Copied!
Last modified 9mo ago