Difference between revisions of "Configuring Analog Sound DVI to HDMI"

From MythTV Official Wiki
Jump to: navigation, search
(New page: Firstly I tested the audio was working on my PC before even hooking to the TV and after hooking it to the TV I modified the xorg.conf to test that infact the sound would work by adding the...)
 
(Correction: 16 lines not "12 or so")
 
(11 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Firstly I tested the audio was working on my PC before even hooking to the TV and after hooking it to the TV I modified the xorg.conf to test that infact the sound would work by adding the following '''Option        "UseEdid" "FALSE"''' in the Section "Screen" and opening Rythmbox then selecting a Radiostation to play - the resolution was jacked up but the sound played.
+
Newer nVidia hardware supports audio over HDMI.  When a display device notifies the drivers that it will accept audio, the card will provide an audio stream.  This will occur on both HDMI and DVI ports, whether or not the card has pass-through audio inputsSome TVs will automatically use this empty audio stream, and have no option to switch to another input
  
The first part was getting my TV EDID.bin, I did this by booting my computer (Ubuntu) on my TV going to Aplications>System Tools>Nvidia X Server Settings then to the section DFP-0 and clicking on the button "Acquire EDID", saved it and transferred that file to my Windows box.
+
=Acquire EDID Block=
 +
In order to resolve this, the nVidia drivers must be provided a modified EDID block saying the TV does not support audio. On nVidia hardware, there are two ways to acquire the original EDID block.
  
I downloaded the application Monitor Asset Manager from ([http://www.entechtaiwan.com/util/moninfo.shtm] - Windows only) launched that program and copied out the modelines for use in the my xorg.conf. I'm sure there are other ways but this was very simple.
+
==Using nvidia-settings==
 +
This method requires you have a mouse and keyboard attached to the machine.
 +
# Run 'nvidia-settings' on the local X-Server
 +
# Click the entry corresponding to your TV (e.g. DFP-0)
 +
# Click 'Acquire EDID' and save the 'edid.bin' file
  
    Modeline............... "1920x1080" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
+
==Using nvidia-xconfig==
    Modeline............... "1280x720" 74.250 1280 1390 1430 1650 720 725 730 750 +hsync +vsync
+
This method can be performed completely from a text console.
    Modeline............... "720x480" 27.000 720 736 798 858 480 489 495 525 -hsync -vsync
+
# Run an X server with enough verbosity to print out the EDID block<br><code>startx -- -logverbose 6</code>
 +
# After the X-Server has finished initializing, close it
 +
# Find your log file, it will probably be in /var/log/Xorg.0.log
 +
# Extract the EDID block using nvidia-xconfig<br><code>nvidia-xconfig --extract-edids-from-file=/var/log/Xorg.0.log --extract-edids-output-file=edid.bin </code>
 +
# The previous nvidia-xconfig command may fail to extract an EDID even if it's present in the log file. Open the log file and look for 16 lines of raw hex (it should be exactly 512 characters once all the spaces and non-hex characters have been removed). Copy the raw hex into a hex editor like HxD and save it as edid.bin (the resulting file should be exactly 256 bytes).
  
After acuiring the Modelines, I had to modify the EDID file itself and did this with a cool utility on this site ([http://analogbit.com/node/23]) it's called '''edid_disable_exts'''. It actually did all the modification to the EDID file for me by simply feeding it the input and output file names (./edid_disable_exts [input_file] [output_file] ). The original file was 256bytes and the modified file was 128bytes if I remember correctly.
+
=Modify EDID Block=
 +
The EDID block contains a block listing capable extensions, which must be removed.  A program to do this is available at [http://analogbit.com/software/edid_disable_exts analogbit.com].  Download 'edid_disable_exts' and compile if necessary. The program takes two arguments, the input file and the output file, so process your original EDID and save the new one in '/etc/X11/'.
  
Once that file was created and saved back on Ubuntu in /etc/X11/ I needed to assemble my xorg.conf and needed to include the following which directs xorg to use the new EDID file I had just created.
+
Version 1.2 of edid_disable_exts supports a --to-dvi command line argument that leaves advanced resolution/hz settings intact.
  
Section "Device"
+
=Apply Modified EDID=
Identifier "nVidia"
+
Open your '/etc/X11/xorg.conf' file, and go to the Device section for your video card.  Add the line<br>
Driver "nvidia"
+
<code>Option "CustomEDID" "DFP-0:/etc/X11/edid.modified.bin"</code><br>
Option "CustomEDID" "DFP-0:/etc/X11/L2410NM-modified.edid"
+
to tell the driver to use your custom block rather than acquiring one from your TV. The changes will take effect after a restart of X.
EndSection
 
  
Some important areas of xorg:
+
[[Category:HOWTO]]
 
 
'''Section "Monitor"'''
 
...
 
Vertrefresh 59.0-71.0
 
modeline "1920x1080" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
 
modeline "1280x720" 74.250 1280 1390 1430 1650 720 725 730 750 +hsync +vsync
 
modeline "720x480" 27.000 720 736 798 858 480 489 495 525 -hsync -vsync
 
 
 
'''Section "Device"'''
 
...
 
 
 
#This should point to the FIXED edid file as described on that webpage after fixing the edid file should
 
#be 128 bytes. Fix filename and path below accordingly.
 
Option "CustomEDID" "DFP-0:/etc/X11/edid_mod.bin"
 
 
 
Option "ModeValidation" "AllowNon60HzDFPModes, NoVESAModes, NoXServerModes
 
Option "ExactModeTimingsDVI" "true"
 
Option "DPI" "100x100"
 
 
 
 
 
Section "Screen"
 
...
 
Option "ConnectedMonitor" "DFP"
 
 
 
 
 
My completed xorg:
 
 
 
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
 
 
 
Section "ServerLayout"
 
Identifier "Layout0"
 
Screen 0 "Screen0" 0 0
 
InputDevice "Keyboard0" "CoreKeyboard"
 
InputDevice "Mouse0" "CorePointer"
 
EndSection
 
 
 
Section "Files"
 
EndSection
 
 
 
Section "Module"
 
Load "dbe"
 
Load "extmod"
 
Load "type1"
 
Load "freetype"
 
Load "glx"
 
EndSection
 
 
 
Section "InputDevice"
 
 
 
# generated from default
 
Identifier "Mouse0"
 
Driver "mouse"
 
Option "Protocol" "auto"
 
Option "Device" "/dev/psaux"
 
Option "Emulate3Buttons" "no"
 
Option "ZAxisMapping" "4 5"
 
EndSection
 
 
 
Section "InputDevice"
 
 
 
# generated from default
 
Identifier "Keyboard0"
 
Driver "kbd"
 
EndSection
 
 
 
Section "Monitor"
 
Identifier "Monitor0"
 
Vendorname "Samsung"
 
Modelname "LN-T4665F"
 
 
 
Horizsync 30.0-70.0
 
Vertrefresh 59.0-71.0
 
modeline "1920x1080" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
 
modeline "1280x720" 74.250 1280 1390 1430 1650 720 725 730 750 +hsync +vsync
 
modeline "720x480" 27.000 720 736 798 858 480 489 495 525 -hsync -vsync
 
 
 
Gamma 1.0
 
EndSection
 
 
 
Section "Device"
 
Identifier "Device0"
 
Driver "nvidia"
 
VendorName "NVIDIA Corporation"
 
#This should point to the FIXED edid file as described on that webpage after fixing the edid file should
 
#be 128 bytes. Fix filename and path below accordingly.
 
Option "CustomEDID" "DFP-0:/etc/X11/edid_mod.bin"
 
 
 
Option "ModeValidation" "AllowNon60HzDFPModes, NoVESAModes, NoXServerModes
 
Option "ExactModeTimingsDVI" "true"
 
Option "DPI" "100x100"
 
EndSection
 
 
 
Section "Screen"
 
Identifier "Screen0"
 
Device "Device0"
 
Monitor "Monitor0"
 
Defaultdepth 24
 
Option "UdeEDID" "False"
 
 
 
Option "RenderAccel" "true"
 
Option "DynamicTwinView" "False"
 
Option "TVOverScan" "0.00000"
 
Option "AllowGLXWithComposite" "true"
 
Option "NoLogo"
 
Option "XvmcUsesTextures" "false"
 
Option "UseEvents" "True"
 
Option "ConnectedMonitor" "DFP"
 
SubSection "Display"
 
Depth 24
 
Modes "1920x1080" "1280x720" "720x480"
 
EndSubSection
 
EndSection
 
 
 
A reboot loaded the new xorg.conf and the resolution was set correctly. I would suggest taking a look in xorg.log for any issues that might arise also that you turn off any "Visual Effects" System>Preferences>Appearance, this was important for me, YMMV.
 
 
 
I hope I didn't miss anything...
 

Latest revision as of 01:55, 1 February 2011

Newer nVidia hardware supports audio over HDMI. When a display device notifies the drivers that it will accept audio, the card will provide an audio stream. This will occur on both HDMI and DVI ports, whether or not the card has pass-through audio inputs. Some TVs will automatically use this empty audio stream, and have no option to switch to another input

Acquire EDID Block

In order to resolve this, the nVidia drivers must be provided a modified EDID block saying the TV does not support audio. On nVidia hardware, there are two ways to acquire the original EDID block.

Using nvidia-settings

This method requires you have a mouse and keyboard attached to the machine.

  1. Run 'nvidia-settings' on the local X-Server
  2. Click the entry corresponding to your TV (e.g. DFP-0)
  3. Click 'Acquire EDID' and save the 'edid.bin' file

Using nvidia-xconfig

This method can be performed completely from a text console.

  1. Run an X server with enough verbosity to print out the EDID block
    startx -- -logverbose 6
  2. After the X-Server has finished initializing, close it
  3. Find your log file, it will probably be in /var/log/Xorg.0.log
  4. Extract the EDID block using nvidia-xconfig
    nvidia-xconfig --extract-edids-from-file=/var/log/Xorg.0.log --extract-edids-output-file=edid.bin
  5. The previous nvidia-xconfig command may fail to extract an EDID even if it's present in the log file. Open the log file and look for 16 lines of raw hex (it should be exactly 512 characters once all the spaces and non-hex characters have been removed). Copy the raw hex into a hex editor like HxD and save it as edid.bin (the resulting file should be exactly 256 bytes).

Modify EDID Block

The EDID block contains a block listing capable extensions, which must be removed. A program to do this is available at analogbit.com. Download 'edid_disable_exts' and compile if necessary. The program takes two arguments, the input file and the output file, so process your original EDID and save the new one in '/etc/X11/'.

Version 1.2 of edid_disable_exts supports a --to-dvi command line argument that leaves advanced resolution/hz settings intact.

Apply Modified EDID

Open your '/etc/X11/xorg.conf' file, and go to the Device section for your video card. Add the line
Option "CustomEDID" "DFP-0:/etc/X11/edid.modified.bin"
to tell the driver to use your custom block rather than acquiring one from your TV. The changes will take effect after a restart of X.