Archive:Creating and using edid.bin via xorg.conf: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>UNiversal
m (argh copy and paste monster.)
mNo edit summary
 
(19 intermediate revisions by 7 users not shown)
Line 1: Line 1:
<center>{{Navigation
| nav name =Xorg
| link1 =User:UNiversal
| link1 name ='''Resolution configuration xorg.conf'''
| link2 =Xorg_Modelines
| link2 name ='''Xorg Modelines'''
| link3 =Minimal_NVidia_xorg.conf
| link3 name = '''Minimal NVidia xorg.conf'''
| link4 =Creating and using edid.bin via xorg.conf
| link4 name ='''Creating_and_using_edid.bin_via_xorg.conf'''
}}</center>
{{-}}
=='''Creating and using edid.bin via xorg.conf'''==
{{greenv|Information:|This page contains explanation about EDID generation and usage in xorg.conf}}
{{greenv|Information:|This page contains explanation about EDID generation and usage in xorg.conf}}
{{bluev|Advanced:|The information contained in this page is considered advanced.}}
{{bluev|Advanced:|The information contained in this page is considered advanced.}}
{{redv|Warning:|The informations contained in this page can cause issues with your X if any errors or incorrect information is entered.}}
{{redv|Warning:|The informations contained in this page can cause issues with your X if any errors or incorrect information is entered.}}


=='''Outline'''==
{| style="border: 1px solid #aaa;background-color: #f9f9f9;color: black;margin: 0.5em 0 0.5em 1em;padding: 0.5em;clear: all; float: right;"
! colspan="2" | {{bigger|xorg table of contents:}}
|-
| '''Configuration guides:'''
* [[Archive:Configuring_resolution_via_xorg.conf]]
* [[Archive:Creating_and_using_edid.bin_via_xorg.conf]]
| '''Modeline references:'''
* [[Archive:Minimal_NVidia_xorg.conf]]
* [[Archive:Xorg_Modelines]]
|}
 
==Outline==
If your machine has a black screen only when you boot it up before TV or AMP, follow this guide.  
If your machine has a black screen only when you boot it up before TV or AMP, follow this guide.  


Line 28: Line 24:
stop all handshake issues.
stop all handshake issues.


==Generate EDID.bin==
===Method 1: Snag EDID from plugged in device (using read-edid; edid-decode to verify)===
Using read-edid we can fetch the EDID directly from the device.
You should be running as normal user while following this guide, i.e. not as '''root'''
Any further references to "root" are meant to be interpreted as base directory not the user.
{{how-to
|Step1=
Install read-edid.
<syntaxhighlight lang="bash" enclose="div">
sudo apt install read-edid edid-decode
</syntaxhighlight>
|Step2=
Fetch edid for the specified monitor number (it starts at zero and increments by one), then use edid-decode to verify.
<syntaxhighlight lang="bash" enclose="div">
# the integer after -m is the monitor id, starting from zero and incrementing by one.
sudo get-edid -m 0 > edid.bin
# View the output of this command and verify you have the right monitor.
# You can tell via the vendor, resolutions, serial number, all that jazz.
cat edid.bin | edid-decode
</syntaxhighlight>
Voila, edid.bin.
Continue on #Configure_xorg_to_read_custom_EDID_file below.
}}
===Method 2: Generate edid.bin from an Xorg modeline (edid-generator)===
If you happen to already know or have a working Xorg modeline for your device (or want to tweak one) you can use edid-generator to do so easily.
You should be running as normal user while following this guide, i.e. not as '''root'''
Any further references to "root" are meant to be interpreted as base directory not the user.
{{how-to
|Step1=
Install dependencies.
<syntaxhighlight lang="bash" enclose="div">
sudo apt install zsh edid-decode automake
</syntaxhighlight>
|Step2=
Snag a copy of edid-generator, enter into it.
<syntaxhighlight lang="bash" enclose="div">
git clone https://github.com/akatrevorjay/edid-generator
cd edid-generator
</syntaxhighlight>
|Step3=
Run modeline2edid and paste in your Xorg modelines. This will generate the required <name>.S file(s) required for the next step.
<syntaxhighlight lang="bash" enclose="div">
./modeline2edid
# <paste in modeline>
</syntaxhighlight>
|Step4=
Run make to generate .bin files.
<syntaxhighlight lang="bash" enclose="div">
make
</syntaxhighlight>
Voila, you should now have EDID bins for all modes pasted in. They are named by the same name you use for the modeline itself.
Continue on #Configure_xorg_to_read_custom_EDID_file below.
}}
===Method 3: Nvidia Xorg driver log parsing===
This example is for a nVidia GPU, other GPUs will have a similar approach but are not covered here.
This example is for a nVidia GPU, other GPUs will have a similar approach but are not covered here.


=='''Introduction'''==
In this method we use a defer to nvidia-xconfig which is reliable, even for ATI GPUs.
There are other tools for acquiring EDID information from Xorg.0.log, in this page we use a defer to nvidia-xconfig which is reliable and has been reported that the resulting information is more reliable using this tool, even for ATI GPU's.


You'll need:
You'll need:


* [[SSH]] access.
* SSH access.
* Nano installed or your editor of choice.
* Nano installed or your editor of choice.
* Reading glasses.
* Reading glasses.
Line 45: Line 118:
{{note|'''[http://manpages.ubuntu.com/manpages/precise/man1/alt-nvidia-96-xconfig.1.html nvidia-xconfig]''' is already installed on Ubuntu and variants if you have the '''nvidia-current drivers installed''' via the Ubuntu packaging or Xswat ppa. It is not intend to instruct users on full use of this tool.}}
{{note|'''[http://manpages.ubuntu.com/manpages/precise/man1/alt-nvidia-96-xconfig.1.html nvidia-xconfig]''' is already installed on Ubuntu and variants if you have the '''nvidia-current drivers installed''' via the Ubuntu packaging or Xswat ppa. It is not intend to instruct users on full use of this tool.}}


=='''Generating & using edid.bin'''==
====Snag output from nvidia Xorg driver====


Make sure your install is in a working state, powered on in the correct order so that you can see the GUI.
Make sure your install is in a working state, powered on in the correct order so that you can see the GUI.
Line 53: Line 126:
Open an SSH session to your machine and backup any existing xorg.conf.
Open an SSH session to your machine and backup any existing xorg.conf.


<source lang="bash">cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak</source>
<syntaxhighlight lang="bash" enclose="div">cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak</syntaxhighlight>


  |Step2=
  |Step2=
You can use a current xorg.conf and should always have a backup of existing, however if you want to start with an fresh xorg.conf proceed with following step.
You can use a current xorg.conf and should always have a backup of existing, however if you want to start with an fresh xorg.conf proceed with following step.
<source lang="bash">
<syntaxhighlight lang="bash" enclose="div">
sudo nvidia-xconfig -s --no-logo --no-composite --no-dynamic-twinview --force-generate --output-xconfig=/etc/X11/xorg.conf
sudo nvidia-xconfig -s --no-logo --no-composite --no-dynamic-twinview --force-generate --output-xconfig=/etc/X11/xorg.conf
</source>
</syntaxhighlight>


  |Step3=
  |Step3=
Line 65: Line 138:


Kill xbmc if it's running by:
Kill xbmc if it's running by:
<source lang="bash">
<syntaxhighlight lang="bash" enclose="div">
sudo stop xbmc
sudo stop xbmc


cd ~
cd ~


sudo X -verbose 6 > ~/xlog.txt 2>&1</source>
sudo X -verbose 6 > ~/xlog.txt 2>&1</syntaxhighlight>


This process needs interrupting via {{keypress|Ctrl|C}} after a few seconds.
This process needs interrupting via {{keypress|Ctrl|C}} after a few seconds.
Line 80: Line 153:


type:
type:
<source lang="bash">
<syntaxhighlight lang="bash" enclose="div">
cat /home/xbmc/xlog.txt | grep ConnectedMonitor |cut -f2 -d\"
cat /home/xbmc/xlog.txt | grep ConnectedMonitor |cut -f2 -d\"
</source>
</syntaxhighlight>


you should see message like the following:
you should see message like the following:
Line 92: Line 165:
Take a note of the DFP number in this example "DFP-0". Your number may vary.
Take a note of the DFP number in this example "DFP-0". Your number may vary.
}}
}}
==Extracting EDID binary==
 
==== Extracting EDID binary from nvidia Xorg driver log output ====
Now that all the information is noted and gathered, we can generate the '''RAW''' binary edid information to a binary..
Now that all the information is noted and gathered, we can generate the '''RAW''' binary edid information to a binary..


Line 98: Line 172:
  |Step1=
  |Step1=
The following command works on 32bit and 64bit:
The following command works on 32bit and 64bit:
<source lang="bash">
<syntaxhighlight lang="bash" enclose="div">
sudo nvidia-xconfig --extract-edids-from-file=/home/xbmc/xlog.txt --extract-edids-output-file=/etc/X11/edid.bin
sudo nvidia-xconfig --extract-edids-from-file=/home/xbmc/xlog.txt --extract-edids-output-file=/etc/X11/edid.bin
</source>
</syntaxhighlight>


On success you should see a message like the following:
On success you should see a message like the following:
Line 110: Line 184:
  |Step2=
  |Step2=
If you did not see the above message we confirm if the edid.bin was created and exists, if not retrace your steps until file is created.
If you did not see the above message we confirm if the edid.bin was created and exists, if not retrace your steps until file is created.
<source lang="bash">
<syntaxhighlight lang="bash" enclose="div">
test -f /etc/X11/edid.bin && echo 'File exists' || echo 'File not found'
test -f /etc/X11/edid.bin && echo 'File exists' || echo 'File not found'
</source>
</syntaxhighlight>
}}
}}
==Configure xorg to read from EDID==
 
== Configure xorg to read custom EDID file ==
Now edit the xorg.conf you created again and find '''Section "Device"'''
Now edit the xorg.conf you created again and find '''Section "Device"'''
{{how-to
{{how-to
  |Step1=
  |Step1=
<source lang="bash">sudo nano /etc/X11/xorg.conf</source>
<syntaxhighlight lang="bash" enclose="div">sudo nano /etc/X11/xorg.conf</syntaxhighlight>


  |Step2=
  |Step2=
And append the following information to '''Section "Device"''' within the /etc/X11/xorg.conf
And append the following information to '''Section "Device"''' within the /etc/X11/xorg.conf


<source lang="xml">
<syntaxhighlight lang="xml" enclose="div">
  Option        "ConnectedMonitor" "DFP-0"
  Option        "ConnectedMonitor" "DFP-0"
  Option        "CustomEDID" "DFP-0:/etc/X11/edid.bin"
  Option        "CustomEDID" "DFP-0:/etc/X11/edid.bin"
  Option        "IgnoreEDID" "false"
  Option        "IgnoreEDID" "false"
  Option        "UseEDID" "true"
  Option        "UseEDID" "true"
</source>
</syntaxhighlight>
{{redv|Important:|It is VITAL you change the '''DFP-<big>#</big>''' number to match the one we found earlier.}}
{{redv|Important:|It is VITAL you change the '''DFP-<big>#</big>''' number to match the one we found earlier.}}


In the end your '''Section "Device"''' will look something like the '''example''' below.
In the end your '''Section "Device"''' will look something like the '''example''' below.


<source lang="xml">
<syntaxhighlight lang="xml" enclose="div">
  Section "Device"
  Section "Device"
   Identifier    "nvidia"
   Identifier    "nvidia"
Line 146: Line 221:
   Option        "UseEDID" "true"
   Option        "UseEDID" "true"
  EndSection
  EndSection
</source>
</syntaxhighlight>
}}
 
Since we have created a new xorg.conf file in a location the OS knows to use as default, no further changes need made to make this permanent. If at a later date you need to undo this work simple rename the config file and reboot to revert to default.
Since we have created a new xorg.conf file in a location the OS knows to use as default, no further changes need made to make this permanent. If at a later date you need to undo this work simple rename the config file and reboot to revert to default.


Line 154: Line 229:
{{note|If your equipment is coupled to a receiver that has broader HDMI capabilities than your TV, you should edit your xorg.conf so that the '''section "Screen"''' looks like this:}}<br />
{{note|If your equipment is coupled to a receiver that has broader HDMI capabilities than your TV, you should edit your xorg.conf so that the '''section "Screen"''' looks like this:}}<br />


<source lang="xml">
<syntaxhighlight lang="xml" enclose="div">
Section "Screen"
Section "Screen"
     Identifier    "screen"
     Identifier    "screen"
Line 165: Line 240:
     EndSubSection
     EndSubSection
EndSection
EndSection
</source>
</syntaxhighlight>
}}


==Edid Library==
== Edid Library ==


The edid library is intended to be a collection of user generated edid.bin for equipment such as TV's or AVR's in case users want to test or modify or share with others existing edid's.
The edid library is intended to be a collection of user generated edid.bin for equipment such as TV's or AVR's in case users want to test or modify or share with others existing edid's.
This section is a WIP and will need to be improved on by users.  
This section is a WIP and will need to be improved on by users.
 
Some bins for standard modes can also be found in the edid-generator repo: https://github.com/akatrevorjay/edid-generator .


Use the '''Legend''' below as a guide to fill in new entries onto the '''edid.bin''' table.
Use the '''Legend''' below as a guide to fill in new entries onto the '''edid.bin''' table.


{| class="wikitable" style="text-align: center;width: 100px"
{| class="prettytable" style="text-align: center"
! colspan="4" | '''Legend'''
! colspan="5" | '''Legend'''
|-
|-
| {{yes}}
| {{yes}}
Line 190: Line 268:
|}
|}


{{redv|Warning:|Make sure you have a backup of your current installation before using any '''edid.bin''' below.}}
{{redv|Warning:|Make sure you have a backup of your current installation before using any '''edid.bin''' below. Verify download integrity via MD5 checksum.}}


Below is an area that the general community can share their '''edid.bin''' and relevant information with other users.
Below is an area that the general community can share their '''edid.bin''' and relevant information with other users.
<br />'''<big>Feel free to update and share your experience below.</big>'''<br />
<br />'''<big>Feel free to update and share your experience below.</big>'''<br />


{| class="wikitable" style="text-align: center; width: 800px"
{| class="prettytable" style="text-align: center"
! '''TV Brand'''
! style="background: #DBDBDB; width: 100px" | '''TV Brand'''
! '''AVR Brand'''
! style="background: #DBDBDB; width: 100px" | '''AVR Brand'''
! '''Model'''
! style="background: #DBDBDB; width: 100px" | '''Model'''
! '''GPU Brand/Model'''
! style="background: #DBDBDB; width: 150px" | '''GPU Brand/Model'''
! '''Working'''
! style="background: #DBDBDB; width: 100px" | '''Working'''
! '''Download'''
! style="background: #DBDBDB; width: 200px" | '''Download link'''
! style="background: #DBDBDB; width: 150px" colspan="2" | '''Download contents'''
|-
|-
| Samsung
| Samsung
Line 208: Line 287:
| Nvidia ION
| Nvidia ION
| {{yes}}
| {{yes}}
| [https://doc-0c-6k-docs.googleusercontent.com/docs/securesc/hb227t3udqsi360dbu9fa81pi5iet76k/o261g1d108guvh0rju2nctju1nucsmvt/1367064000000/07228990622808543443/07228990622808543443/0B1U8Q5MB7tfnVnlNdDlBaHdvNFk?e=download Download edid.bin]
| [https://dl.dropboxusercontent.com/u/4325533/edid.zip Download edid.zip]
| edid.bin || edid.md5
|-
|-
| {{?}}
| {{?}}
Line 215: Line 295:
| {{?}}
| {{?}}
| {{?}}
| {{?}}
| http://placeholder-download.com
| [http://placeholder-download.com Download edid.bin]
| {{?}} || {{?}}
|}
|}


==Credits==
{{note|Recommended you would create a md5 checksum of the edid.bin and compress both so it can be checked for integrity on download.}}
The edid instructions are adapted from the Openelec wiki, credit to original authors<ref>[http://wiki.openelec.tv/index.php?title=Config_EDID_nvidia Config EDID NVidia]</ref>


==References==
== Credits ==
Portions of the the edid instructions are adapted from the Openelec wiki, credit to original authors<ref>[http://wiki.openelec.tv/index.php?title=Config_EDID_nvidia Config EDID NVidia]</ref>
 
== References ==
<references/>
<references/>
[[Category:Development-Archived]]

Latest revision as of 01:23, 22 July 2020

Information: This page contains explanation about EDID generation and usage in xorg.conf
Advanced: The information contained in this page is considered advanced.
Warning: The informations contained in this page can cause issues with your X if any errors or incorrect information is entered.


xorg table of contents:
Configuration guides: Modeline references:

Outline

If your machine has a black screen only when you boot it up before TV or AMP, follow this guide.

On some combinations of equipments (AVR/TV/XBMC) in rarer cases you may find that the order you power on your equipment matters. This is obviously inconvenient but can be easily fixed.

The root cause of this issue is the EDID (Extended display identification data) handshake. Xorg may not correctly handshake with AV equipment after boot. Typically this results in a black screen and a full system shut down and restart to rectify.

In this guide we will show you how to trick Xorg into thinking your AV equipment is connected and powered on at all times. This locks on your install to one monitor/AVR (port specific) and should stop all handshake issues.

Generate EDID.bin

Method 1: Snag EDID from plugged in device (using read-edid; edid-decode to verify)

Using read-edid we can fetch the EDID directly from the device.

You should be running as normal user while following this guide, i.e. not as root Any further references to "root" are meant to be interpreted as base directory not the user.

1 Install read-edid.
sudo apt install read-edid edid-decode
2 Fetch edid for the specified monitor number (it starts at zero and increments by one), then use edid-decode to verify.
# the integer after -m is the monitor id, starting from zero and incrementing by one.
sudo get-edid -m 0 > edid.bin

# View the output of this command and verify you have the right monitor.
# You can tell via the vendor, resolutions, serial number, all that jazz.
cat edid.bin | edid-decode

Voila, edid.bin.

Continue on #Configure_xorg_to_read_custom_EDID_file below.


Method 2: Generate edid.bin from an Xorg modeline (edid-generator)

If you happen to already know or have a working Xorg modeline for your device (or want to tweak one) you can use edid-generator to do so easily.

You should be running as normal user while following this guide, i.e. not as root Any further references to "root" are meant to be interpreted as base directory not the user.

1 Install dependencies.
sudo apt install zsh edid-decode automake
2 Snag a copy of edid-generator, enter into it.
git clone https://github.com/akatrevorjay/edid-generator
cd edid-generator
3 Run modeline2edid and paste in your Xorg modelines. This will generate the required <name>.S file(s) required for the next step.
./modeline2edid
# <paste in modeline>
4 Run make to generate .bin files.
make

Voila, you should now have EDID bins for all modes pasted in. They are named by the same name you use for the modeline itself.

Continue on #Configure_xorg_to_read_custom_EDID_file below.


Method 3: Nvidia Xorg driver log parsing

This example is for a nVidia GPU, other GPUs will have a similar approach but are not covered here.

In this method we use a defer to nvidia-xconfig which is reliable, even for ATI GPUs.

You'll need:

  • SSH access.
  • Nano installed or your editor of choice.
  • Reading glasses.
  • nvidia-xconfig

You should be running as normal user while following this guide, i.e. not as root Any further references to "root" are meant to be interpreted as base directory not the user.

Note: nvidia-xconfig is already installed on Ubuntu and variants if you have the nvidia-current drivers installed via the Ubuntu packaging or Xswat ppa. It is not intend to instruct users on full use of this tool.

Snag output from nvidia Xorg driver

Make sure your install is in a working state, powered on in the correct order so that you can see the GUI.

1 Open an SSH session to your machine and backup any existing xorg.conf.
cp /etc/X11/xorg.conf /etc/X11/xorg.conf.bak
2 You can use a current xorg.conf and should always have a backup of existing, however if you want to start with an fresh xorg.conf proceed with following step.
sudo nvidia-xconfig -s --no-logo --no-composite --no-dynamic-twinview --force-generate --output-xconfig=/etc/X11/xorg.conf
3 We need a verbose log from X to generate the edid.bin from the raw data.

Kill xbmc if it's running by:

sudo stop xbmc

cd ~

sudo X -verbose 6 > ~/xlog.txt 2>&1

This process needs interrupting via Ctrl+C after a few seconds.

In the root of your home directory you will find a xlog.txt /home/xbmc/xlog.txt

4 Now we work out the Assigned Display Device DFP number

type:

cat /home/xbmc/xlog.txt | grep ConnectedMonitor |cut -f2 -d\"

you should see message like the following:

ConnectedMonitor
DFP-0
DFP-0

Take a note of the DFP number in this example "DFP-0". Your number may vary.


Extracting EDID binary from nvidia Xorg driver log output

Now that all the information is noted and gathered, we can generate the RAW binary edid information to a binary..

1 The following command works on 32bit and 64bit:
sudo nvidia-xconfig --extract-edids-from-file=/home/xbmc/xlog.txt --extract-edids-output-file=/etc/X11/edid.bin

On success you should see a message like the following:

Found 1 EDID in "/home/xbmc/xlog.txt".
  Wrote EDID for "SAMSUNG (DFP-0)" to "/etc/X11/edid.bin" (256 bytes)..
2 If you did not see the above message we confirm if the edid.bin was created and exists, if not retrace your steps until file is created.
test -f /etc/X11/edid.bin && echo 'File exists' || echo 'File not found'


Configure xorg to read custom EDID file

Now edit the xorg.conf you created again and find Section "Device"

1
sudo nano /etc/X11/xorg.conf
2 And append the following information to Section "Device" within the /etc/X11/xorg.conf
 Option         "ConnectedMonitor" "DFP-0"
 Option         "CustomEDID" "DFP-0:/etc/X11/edid.bin"
 Option         "IgnoreEDID" "false"
 Option         "UseEDID" "true"
Important: It is VITAL you change the DFP-# number to match the one we found earlier.


In the end your Section "Device" will look something like the example below.

 Section "Device"
  Identifier     "nvidia"
  Driver         "nvidia"
  Option         "DynamicTwinView" "false"
  Option         "NoFlip" "false"
  Option         "NoLogo" "true"
  Option         "ModeValidation" "NoVesaModes, NoXServerModes"
  Option         "ConnectedMonitor" "DFP-0"
  Option         "CustomEDID" "DFP-0:/etc/X11/edid.bin"
  Option         "IgnoreEDID" "false"
  Option         "UseEDID" "true"
 EndSection

Since we have created a new xorg.conf file in a location the OS knows to use as default, no further changes need made to make this permanent. If at a later date you need to undo this work simple rename the config file and reboot to revert to default.

If all has went to plan when you reboot everything will just work and the order of powering equipment up will not matter anymore.

Note: If your equipment is coupled to a receiver that has broader HDMI capabilities than your TV, you should edit your xorg.conf so that the section "Screen" looks like this:

Section "Screen"
    Identifier     "screen"
    Device         "nvidia"
    DefaultDepth    24
    Option         "ColorRange" "Full"
    Option         "ColorSpace" "RGB"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection


Edid Library

The edid library is intended to be a collection of user generated edid.bin for equipment such as TV's or AVR's in case users want to test or modify or share with others existing edid's. This section is a WIP and will need to be improved on by users.

Some bins for standard modes can also be found in the edid-generator repo: https://github.com/akatrevorjay/edid-generator .

Use the Legend below as a guide to fill in new entries onto the edid.bin table.

Legend
Yes No N/A ? Other
{{yes}} {{no}} {{NA}} {{?}} Other
Warning: Make sure you have a backup of your current installation before using any edid.bin below. Verify download integrity via MD5 checksum.


Below is an area that the general community can share their edid.bin and relevant information with other users.
Feel free to update and share your experience below.

TV Brand AVR Brand Model GPU Brand/Model Working Download link Download contents
Samsung N/A Series 5 Nvidia ION Yes Download edid.zip edid.bin edid.md5
? ? ? ? ? Download edid.bin ? ?

Note: Recommended you would create a md5 checksum of the edid.bin and compress both so it can be checked for integrity on download.

Credits

Portions of the the edid instructions are adapted from the Openelec wiki, credit to original authors[1]

References