Skip to content

Commit 9e9662d

Browse files
CvHgitbook-bot
authored andcommitted
GitBook: [master] 51 pages and 3 assets modified
1 parent 324e3ca commit 9e9662d

File tree

5 files changed

+352
-0
lines changed

5 files changed

+352
-0
lines changed

.gitbook/assets/image (1).png

15.5 KB
Loading

.gitbook/assets/image (2).png

39.1 KB
Loading

.gitbook/assets/image.png

26 KB
Loading

SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* [Blu-Ray Playback](configuration/blu-ray.md)
3131
* [Config.txt](configuration/config_txt.md)
3232
* [Dual Boot](configuration/dual-boot.md)
33+
* [EDID](configuration/edid.md)
3334
* [Hypercon](configuration/hypercon.md)
3435
* [Hyperion](configuration/hyperion.md)
3536
* [Infra-Red Remotes](configuration/ir-remotes.md)

configuration/edid.md

Lines changed: 351 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,351 @@
1+
# EDID
2+
3+
4+
5+
## Custom EDID
6+
7+
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\).
8+
9+
In the steps below we will explain how this can be done:
10+
11+
**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.
12+
13+
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.
14+
15+
## Generic
16+
17+
**Note:** This script will also only work for Intel or nVidia based GPUs. AMD/ATI GPU's are not supported.
18+
19+
To use the getedid script you need to have SSH access to your LibreELEC machine.
20+
21+
Once you are in, just type in
22+
23+
```text
24+
getedid
25+
```
26+
27+
to see which options are available. It will look like this.
28+
29+
![](../.gitbook/assets/image.png)
30+
31+
The available options are `create`, `gpu`, `delete` and `help`. These are explained below.
32+
33+
#### getedid help
34+
35+
This will show a help message and a little explanation for the specific options.
36+
37+
#### getedid gpu
38+
39+
This will check which GPU you are using and you will either get "Intel", "NVidia" or "GPU is not supported" after running that command.
40+
41+
#### getedid create
42+
43+
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.
44+
45+
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.
46+
47+
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.
48+
49+
#### getedid delete
50+
51+
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.
52+
53+
For the source of that script please look at: [https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/sysutils/busybox/scripts/getedid](https://github.com/LibreELEC/LibreELEC.tv/blob/master/packages/sysutils/busybox/scripts/getedid)
54+
55+
### Intel
56+
57+
#### Get the needed information about your system
58+
59+
First, you have to SSH in your LibreELEC machine. Then enter the following command.
60+
61+
```text
62+
tail /sys/class/drm/*/status
63+
```
64+
65+
Look for the connected device:
66+
67+
![how it looks like at the shell](../.gitbook/assets/image%20%281%29.png)
68+
69+
```text
70+
==> /sys/class/drm/card0-HDMI-A-2/status <==
71+
connected
72+
```
73+
74+
The information we need **HDMI-A-2** is connected.
75+
76+
#### Create the EDID file
77+
78+
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.
79+
80+
```text
81+
mkdir -p /storage/.config/firmware/edid
82+
```
83+
84+
HDMI-A-1
85+
86+
```text
87+
cat /sys/class/drm/card0-HDMI-A-1/edid > /storage/.config/firmware/edid/edid.bin</code>
88+
```
89+
90+
HDMI-A-2
91+
92+
```text
93+
cat /sys/class/drm/card0-HDMI-A-2/edid > /storage/.config/firmware/edid/edid.bin</code>
94+
```
95+
96+
Next a cpio archive file will be created which will be loaded at boot.
97+
98+
```text
99+
cd ~
100+
mkdir -p cpio/lib/firmware/edid
101+
cp .config/firmware/edid/edid.bin cpio/lib/firmware/edid/
102+
cd cpio/
103+
find . -print | cpio -ov -H newc > ../edid.cpio
104+
```
105+
106+
#### Editing the extlinux.conf or syslinux.cfg
107+
108+
Now mount the boot partition as "RW" and move the file to it
109+
110+
```text
111+
mount -o remount,rw /flash
112+
mv ../edid.cpio /flash/
113+
```
114+
115+
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.
116+
117+
```text
118+
ls /flash/
119+
```
120+
121+
Search for "extlinux.conf" or "syslinux.cfg" and edit it. Only one of them is available.
122+
123+
**syslinux.cfg**
124+
125+
```text
126+
nano -w /flash/syslinux.cfg
127+
```
128+
129+
**extlinux.conf**
130+
131+
```text
132+
nano -w /flash/extlinux.conf
133+
```
134+
135+
Add to the APPEND line the following things.
136+
137+
HDMI-A-1
138+
139+
```text
140+
initrd=/edid.cpio drm_kms_helper.edid_firmware=HDMI-A-1:edid/edid.bin video=HDMI-A-1:D
141+
```
142+
143+
The APPEND line should look this like this after \(everything in a single line\):
144+
145+
```text
146+
APPEND boot=LABEL=System disk=LABEL=Storage ssh quiet initrd=/edid.cpio drm_kms_helper.edid_firmware=HDMI-A-1:edid/edid.bin video=HDMI-A-1:D
147+
```
148+
149+
HDMI-A-2
150+
151+
```text
152+
initrd=/edid.cpio drm_kms_helper.edid_firmware=HDMI-A-2:edid/edid.bin video=HDMI-A-2:D
153+
```
154+
155+
The APPEND line should look this like this after \(everything in a single line\).
156+
157+
```text
158+
APPEND boot=LABEL=System disk=LABEL=Storage ssh quiet initrd=/edid.cpio drm_kms_helper.edid_firmware=HDMI-A-2:edid/edid.bin video=HDMI-A-2:D
159+
```
160+
161+
Last step is to reboot the device.
162+
163+
```text
164+
reboot
165+
```
166+
167+
### Nvidia
168+
169+
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.
170+
171+
**Note:** This example will NOT work on Intel or AMD GPU's.
172+
173+
#### Get the needed information about your system
174+
175+
Open an SSH session to your LibreELEC machine. Once logged into the console we need to work out the DFP number.
176+
177+
```text
178+
grep ": connected" /var/log/Xorg.0.log | head -n 1
179+
```
180+
181+
You should see message like the following:
182+
183+
```text
184+
[3241512.110] (--) NVIDIA(0): SAMSUNG (DFP-0): connected
185+
```
186+
187+
Note the DFP number - in this example it is "DFP-0" but yours may be different.
188+
189+
#### Set Xorg to Debug Mode
190+
191+
To extract EDID data we need we need to place Xorg into debug mode. First we stop Xorg.
192+
193+
```text
194+
systemctl stop xorg.service
195+
```
196+
197+
Next we clone the xorg.conf to the config override location in `/storage/.config`.
198+
199+
```text
200+
cp /etc/X11/xorg-nvidia.conf /storage/.config/xorg.conf
201+
```
202+
203+
Then we edit the file with `sed` to enable debug mode.
204+
205+
```text
206+
sed -i 's/"ModeDebug" "false"/"ModeDebug" "true"/g' /storage/.config/xorg.conf
207+
```
208+
209+
The device section in the modified file should look something like this.
210+
211+
```text
212+
Section "Device"
213+
Identifier "nvidia"
214+
Driver "nvidia"
215+
Option "DynamicTwinView" "False"
216+
Option "NoFlip" "false"
217+
Option "NoLogo" "true"
218+
Option "ConnectToAcpid" "0"
219+
Option "FlatPanelProperties" "Scaling = Native"
220+
Option "ModeValidation" "NoVesaModes, NoXServerModes"
221+
Option "HWCursor" "false"
222+
Option "ModeDebug" "true"
223+
EndSection
224+
```
225+
226+
Now restart Xorg.
227+
228+
```text
229+
systemctl start xorg.service
230+
```
231+
232+
#### Create the EDID file
233+
234+
Extract the RAW binary EDID information from the debug /var/log/Xog.0.log to a file.
235+
236+
```text
237+
nvidia-xconfig --extract-edids-from-file=/var/log/Xorg.0.log --extract-edids-output-file=/storage/.config/edid.bin
238+
```
239+
240+
The command should output something like.
241+
242+
```text
243+
Found 1 EDID in "/var/log/Xorg.0.log".
244+
Wrote EDID for "ONK TX-NR616 (DFP-0)" to "/storage/.config/edid.bin" (256 bytes).
245+
```
246+
247+
#### Edit xorg.conf
248+
249+
Now we edit /storage/.config/xorg.conf - set ModeDebug back to False \(edit the word true to false\) and uncomment the following lines.
250+
251+
```text
252+
Option "ConnectedMonitor" "DFP-0"
253+
Option "CustomEDID" "DFP-0:/storage/.config/edid.bin"
254+
Option "IgnoreEDID" "false"
255+
Option "UseEDID" "true"
256+
```
257+
258+
Make sure you change the DFP number to match the one we found earlier. In the end your config will look something like.
259+
260+
```text
261+
Section "Device"
262+
Identifier "nvidia"
263+
Driver "nvidia"
264+
Option "DynamicTwinView" "False"
265+
Option "NoFlip" "false"
266+
Option "NoLogo" "true"
267+
Option "ConnectToAcpid" "0"
268+
Option "FlatPanelProperties" "Scaling = Native"
269+
Option "ModeValidation" "NoVesaModes, NoXServerModes"
270+
Option "HWCursor" "false"
271+
Option "ModeDebug" "false"
272+
Option "ConnectedMonitor" "DFP-0"
273+
Option "CustomEDID" "DFP-0:/storage/.config/edid.bin"
274+
Option "IgnoreEDID" "false"
275+
Option "UseEDID" "true"
276+
EndSection
277+
Section "Screen"
278+
Identifier "screen"
279+
Device "nvidia"
280+
DefaultDepth 24
281+
Option "ColorRange" "Full"
282+
# Option "ColorRange" "Limited"
283+
# Option "ColorSpace" "RGB"
284+
SubSection "Display"
285+
Depth 24
286+
EndSubSection
287+
EndSection
288+
Section "Extensions"
289+
Option "Composite" "false"
290+
EndSection
291+
```
292+
293+
Finally we stop/restart xorg.service to disable debug mode and use the new edid.bin file.
294+
295+
```text
296+
systemctl restart xorg.service
297+
```
298+
299+
If all has gone to plan Xorg now detects the EDID file and the order of powering on equipment no longer matters!
300+
301+
### Amlogic
302+
303+
Amlogic devices 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.
304+
305+
```text
306+
cat /sys/class/amhdmitx/amhdmitx0/disp_cap > /storage/.kodi/userdata/disp_cap
307+
```
308+
309+
This stores a list of the supported resolutions. It looks like
310+
311+
```text
312+
480p60hz
313+
480p_rpt
314+
576p50hz
315+
720p60hz
316+
1080i60hz
317+
1080p60hz
318+
720p50hz
319+
1080i50hz
320+
1080p30hz
321+
1080p50hz
322+
1080p25hz
323+
1080p24hz
324+
2160p30hz
325+
2160p25hz
326+
2160p24hz
327+
smpte24hz
328+
smpte25hz
329+
smpte30hz
330+
smpte50hz
331+
smpte60hz
332+
smpte50hz420
333+
smpte60hz420
334+
2160p50hz
335+
2160p60hz
336+
2160p50hz420
337+
2160p60hz420
338+
```
339+
340+
To remove or add specific resolutions, e.g. if 1080p24hz is missing, edit disp\_cap.
341+
342+
```text
343+
nano /storage/.kodi/userdata/disp_cap
344+
```
345+
346+
Ctrl+o to save, Ctrl+x to exit the nano editor. Next restart Kodi by rebooting the box or running.
347+
348+
```text
349+
systemctl restart kodi
350+
```
351+

0 commit comments

Comments
 (0)