Monday, October 25, 2010

nVidia EDID override and HDMI

I have a media center that is running Debian with XBMC on it, as I am a developer for XBMC I have just receved a new HDMI 1.4 capable AVR. I also have a large monitor that lies about its native resolution, reporting 1280x1024 instead of 1280x720. Normally I have been using a modified EDID file and the CustomEDID option in the nVidia driver to override the one the monitor supplies, which works really well IMHO, but there is a downside it took me 4 hours to track down, if you do this via a HDMI audio capable device, your HDMI audio will not work.

So, I had to find another option, took a few hours to figure out what worked, and I eventually came up with this. If you are allready using a custom/modified EDID keep reading, if not, figure that part out first over here.

To make use of your EDID information without using an EDID file is fairly simple, first you will need to install the package "read-edid", which comes with the "parse-edid" program. This program will generate an x conf "Display" section from the EDID information specifically for your monitor with all the modes and timing information.

Paste this section into your x conf file and add the following two options to the "Device" section to stop your video card from using the EDID frequency and timing information.


"UseEdidFreqs" "false"
Option "ExactModeTimingsDVI" "true"

And thats it, you get your custom resolutions, no more need for the CustomEDID option or file, and your HDMI audio will now work as it is not getting ignored by your video card.

For reference, here is my xorg.conf file, obviously this is specifically for my monitor (which is rather rare, so dont try it on yours).

# xorg.conf (X.Org X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type "man xorg.conf" at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
#   sudo dpkg-reconfigure -phigh xserver-xorg

Section "InputDevice"
        Identifier      "Generic Keyboard"
        Driver          "kbd"
        Option          "XkbRules"      "xorg"
        Option          "XkbModel"      "pc104"
        Option          "XkbLayout"     "us"
EndSection

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
EndSection

Section "Device"
        Identifier      "Configured Video Device"
        driver          "nvidia"

        Option          "UseEdidFreqs"          "false"
        Option          "ExactModeTimingsDVI"   "true"
EndSection

Section "Monitor"
        Identifier      "LG"
        VendorName      "GSM"
        ModelName       "LG"
        HorizSync       31-86
        VertRefresh     56-100

        Mode "1280x720"
                DotClock        108.000000
                HTimings        1280 1328 1440 1688
                VTimings        720 721 724 762
                Flags           "-HSync" "-VSync"
        EndMode
EndSection

Section "Screen"
        Identifier      "Default Screen"
        Monitor         "LG"
        SubSection "Display"
                Depth   24
                Modes   "1280x720"
        EndSubSection
EndSection