OpenELEC Forum
[Fixed] HD Audio - My Guide to EDID Editing - Printable Version

+- OpenELEC Forum (https://forum.openelec.tv)
+-- Forum: Generic Forum (https://forum.openelec.tv/forumdisplay.php?fid=5)
+--- Forum: AUDIO (https://forum.openelec.tv/forumdisplay.php?fid=53)
+--- Thread: [Fixed] HD Audio - My Guide to EDID Editing (/showthread.php?tid=65894)

Pages: 1 2 3 4 5 6 7 8


[Fixed] HD Audio - My Guide to EDID Editing - GrimGriefer - 07-30-2013

Hey everyone,

So if any of you have stumbled across my thread about my problems with bitstreaming HD audio sources to my Onkyo amps will know that in summary my Shuttle XS35GTV2 with an nVidia ION2 would bitstream HD sources using release candidate version 2.99.2 to my Onkyo HTX22HDX amp but every subsequent version after that wouldn't. My Intel NUC also wouldn't bitstream to the HTX22HDX either but the weird thing was both devices would bitstream HD audio my other older Onkyo HTX22HD no matter which version was used.

So anyway, after weeks of reading countless forum posts I learned more about the handshake between devices known as the EDID information that basically tells a connected device what audio formats, audio channels and display resolutions the amp supports. Thanks to user Duren, I found a guide to extracting the EDID information from your amp using nVidia hardware such as the ION2 and OpenELEC (Note: if there are guides on how to do this on other platforms in OpenELEC I'm sure others would be grateful if you could post in this forum thread).
The guide also states how to point the Xorg.conf to a specific EDID.bin file stored on your OpenELEC shared folder such as the ConfigFiles folder (eg \192.168.1.2Configfiles) rather than accepting the info it receives from the amplifier. When I extracted the EDID info for my HTX22HDX and tried using it from the EDID.bin file in OpenELEC it unsurprisingly had no change to my problems. This is what would appear in the audio settings in my OpenELEC install.

OpenELEC v3.15 with Shuttle XS35GTV2, Onkyo HTX22HDX & HTX22HDX EDID.bin file.
[Image: 1Onkyo-With-HTX22HDX-EDID.jpg]

The next thing I did was use the same process to extract the EDID information from the older Onkyo HTX22HD that I know works with all of my devices and versions of OpenELEC. Now seen as these two devices are very very similar I decided to take the EDID.bin file HTX22HD and use it on the HTX22HDX. To do this I simply turned on the HTX22HDX and replaced the EDID.bin file in the ConfigFiles folder already mention with the EDID I had just extracted from the older amp and then rebooted. Upon the reboot I checked the audio settings again and this was what I found.

OpenELEC v3.15 with Shuttle XS35GTV2, Onkyo HTX22HDX & HTX22HD EDID.bin file.
[Image: 2Onkyo-With-HTX22HD-EDID.jpg]

Next I tried to play some HD audio samples I found from Demolandia.net and guess what.....THEY WORKED!

[Image: 4Onkyo-DTSHDMA.jpg]
[Image: 3Onkyo-DolbyTrueHD.jpg]

So now I know there is definitely something in the EDID.bin file from the HTX22HDX and OpenELEC that is preventing HD audio bitstreaming and I would rather work out what that was instead of using the EDID of another device (no matter how similar they are).

Eventually I came across this forum post on the XBMC forums from a user named golddk that stated:
Some Onkyo receivers have this bad EDID. The fix is to have 7.1 in EDID instead of 5.1, then DTS HD and TrueHD is working. (and this is strange, the reciver is only 5.1)

In post he also mentioned
Then edit it with EDID manager and in Speaker Allocation Data Block (SADB) add Rear Left Center/Rear Right Center Audio Channel (RLC/RRC) to EDID, for me i changed 0F to 4F.

This got me thinking that I need to investigate the two EDID.bin files to check out if there are differences like he mentioned in his post. To open and view the EDID.bin file I used a program called EDID Manager which can be downloaded from here and looked specifically the SADB info in the full view tab and sure enough this is what I found.

Onkyo HTX22HD EDID.bin
[Image: 5Onkyo-HTX22HD-EDID-a.jpg]

Onkyo HTX22HDX EDID.bin
[Image: 7Onkyo-HTX22HDX-EDID-a.jpg]

Onkyo HTX22HD EDID.bin
[Image: 6Onkyo-HTX22HD-EDID-b.jpg]

Onkyo HTX22HDX EDID.bin
[Image: 8Onkyo-HTX22HDX-EDID-b.jpg]

Just as golddk had mentioned the Rear Left Center/Rear Right Center Audio Channel (RLC/RRC) channel information was not evident in the EDID.bin for the HTX22HDX so it was time to try and modify that. First thing make a note of the EDID version which can be found in EDID Manager here and then close the program.

[Image: 9EDIDRevisionNumber.jpg]

You will need to download a program called E-EDID Editor from Deltacast.tv.

When you start it and open your EDID.bin navigate the tabs as shown here and you will see the channel options defined by the EDID.bin.
(Note: it may ask you what version the EDID.bin is that you are using and you should know that from the previous step.

[Image: 10EDIDChange1.jpg]

We can see simply that the Rear Left Center Rear Right Center channel is not ticked so simply tick the box and then save the EDID.bin file so it looks like this.

[Image: 11EDIDChange2.jpg]

To verify that all is ok, open the newly modified EDID.bin file with EDID Manager again and recheck the same details as before. If it looks like this then everything has be modified perfectly.

Onkyo HTX22HDX Modified EDID.bin
[Image: 12ModifiedEDIDCheck1.jpg]
[Image: 13ModifiedEDIDCheck2.jpg]

Copy the new modified EDID.bin file over to the ConfigFiles folder on your OpenELEC install and reboot.

Now my audio settings show up as the correct amp and my HD audio bitstreaming has returned. Happy days!

[Image: 1Onkyo-With-HTX22HDX-EDID.jpg]
[Image: 4Onkyo-DTSHDMA.jpg]
[Image: 3Onkyo-DolbyTrueHD.jpg]

This problem has driven me crazy for a few months now so I hope that this post will help you out of you are experiencing similar problems and save you some time.

I have put the programs used, photos and guides into a RAR file which you can download from here.
Password: openelecedid

Issues Still unknown:
1) Is the EDID info being reported incorrectly by the amp or being read incorrectly by the XBMC AudioEngine.
2) What happened after ION64 build 2.99.2 that causes the AudioEngine to no longer recognise the Rear Left Center Rear Right Center channels in the EDID.


[Fixed] HD Audio - My Guide to EDID Editing - GrimGriefer - 07-30-2013

So the guide above is obviously working for the nVidia ION2 chipset, but I 'm trying now to figure out how to get it to work on an Intel Ivybridge Core i3 3225 with the Intel build of OpenELEC. Obviously the same applies as above insofar as all HD audio works on the old HTX22HD but not on the newer HDX22HDX.

So far I have run an SSH session to the box and the command killall Xorg, then Xorg -configure and finally cp /storage/xorg.conf.new /storage/.config/xorg.conf.

When I open the new xorg.conf file in Notepad++ it looks like this:

Code:
Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/misc"
FontPath "built-ins"
EndSection

Section "Module"
Load "dbe"
Load "dri"
Load "dri2"
Load "extmod"
Load "glx"
Load "glx_mesa"
Load "record"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection

Section "Device"
### Available Driver options are:-
### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
### <percent>: "<f>%"
### [arg]: arg optional
#Option "NoAccel" # [<bool>]
#Option "AccelMethod" # <str>
#Option "Backlight" # <str>
#Option "DRI" # <str>
#Option "ColorKey" # <i>
#Option "VideoKey" # <i>
#Option "Tiling" # [<bool>]
#Option "LinearFramebuffer" # [<bool>]
#Option "SwapbuffersWait" # [<bool>]
#Option "TripleBuffer" # [<bool>]
#Option "XvPreferOverlay" # [<bool>]
#Option "HotPlug" # [<bool>]
#Option "RelaxedFencing" # [<bool>]
#Option "ZaphodHeads" # <str>
#Option "TearFree" # [<bool>]
#Option "PerCrtcPixmaps" # [<bool>]
#Option "FallbackDebug" # [<bool>]
#Option "DebugFlushBatches" # [<bool>]
#Option "DebugFlushCaches" # [<bool>]
#Option "DebugWait" # [<bool>]
#Option "BufferCache" # [<bool>]
Identifier "Card0"
Driver "intel"
BusID "PCI:0:2:0"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
SubSection "Display"
Viewport 0 0
Depth 1
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 4
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 8
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 15
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 16
EndSubSection
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection

I've been trying different commands to point to a custom EDID.bin file but unfortunately none are working. The OpenELEC wiki doesn't mention anywhere this might be possible and I'm a bit concerned to read this post (even though its from 2010) about Intel not supporting custom EDID's.

Can any devs comment on the ability of using custom EDID's in an Intel environment?


[Fixed] HD Audio - My Guide to EDID Editing - escalade - 07-30-2013

It's certainly possible to use a custom EDID in an Intel environment, but you'll need KMS. Haven't used OpenELEC in a while and not with Intel so I don't know if it's enabled there. You could build yourself and enable it though, although it might require some work getting it into the initrd.

EDID can be read from /sys/class/drm/card0-HDMI-A-1/edid and then you can boot with something like "drm_kms_helper.edid_firmware=HDMI-A-1:edid/ed
id.bin video=HDMI-A-1:1920x1080@60e" as options to the kernel. When Xorg queries for the EDID, the kernel will return your custom one.

I'm doing this successfully with Arch Linux, but haven't got bitstreaming to work. My next step is to edit the EDID as described above, guessing that will fix it.


[Fixed] HD Audio - My Guide to EDID Editing - chewitt - 07-31-2013

The major revolution in Eden was that AudioEngine stopped blindly trusting filesystem config files and started evaluating how hardware was presented in the OS so that autoconfiguration worked properly. I'd wager an educated guess that after 2.99.2 the XBMC devs fixed bugs so AudioEngine correctly detects the incorrect/bad EDID and configures itself appropriately - over time we have seen many AVR's and TV's with bad EDID and while current AE is not perfect it's stable and rarely to blame for this kind of thing.


[Fixed] HD Audio - My Guide to EDID Editing - GrimGriefer - 07-31-2013

Certainly not blaming the dev's in this situation at all. The more I've looked into it the more I appreciate how much they have to work with to get this working in the first place. I've also contacted Onkyo support and provided them with details of my findings to see if they have any answers to come back with. Given that the AMP/AVR is a few years old now I'm not holding out for much.

In this instance I'm just delighted to have finally got a working solution, if at least from the nVidia perspective for now.

Escalade, I bow to your knowledge of different loaders as it is way above my head. Smile

Ideally I would like to find a solution for the Intel side that is as straightforward as I have hopefully demonstrated in the first post of this thread.

If anyone has some thoughts then I would be most grateful.


[Fixed] HD Audio - My Guide to EDID Editing - BossMan - 08-08-2013

I have tried drm_kms_helper way for loading the modified EDID file and it works. However, it's not possible on the stock Intel build out of the box, as the kernel is built without the necessary config flags, namely CONFIG_DRM_LOAD_EDID_FIRMWARE (see here for more info: link).
With a rebuilt kernel, it seems to work, but:
- if I pass EDID as a kernel parameter, it results in pausing the boot for 60s (seems like the kernel can't access the EDID file at the very beginning of the startup process) , but nevertheless, it seems it works,
- passing the EDID as an option via modprobe does not have any effect (probably because it's not a module, but rather a kernel built-in..)
- passing the EDID via /sys interface works as well, but it requires restart of all services utilizing drm configuration (X, in particular).

For now I ended up using the last option: in autostart.sh I set the edid_firmware parameter and then kill and restart the Xorg server.

This method works fine but unfortunately this did not solve my issues with not working HD audio Sad I use a similar Onkyo AVR that also sets the speaker configuration to 0x0F (i.e. without the rear/left right center), but unfortunately patching the edid file did not solve my problem.

Any hints what to try to enable the HD audio are welcomed Smile


[Fixed] HD Audio - My Guide to EDID Editing - fritsch - 08-08-2013

You can patch the ELD info directly, if it is only the missing speakers:

Something like:
Code:
echo speakers 0x4f > /proc/asound/card0/eld#3.0
echo sad0_channels 8 > /proc/asound/card0/eld#3.0

Do it _after_ X is up and before xbmc


[Fixed] HD Audio - My Guide to EDID Editing - BossMan - 08-09-2013

Fritsch,
thanks, that did it! Looks like although the EDID was patched, somehow the speakers config in the asound was still set to 0x0F. I added a line that sets only the speaker config to the autostart.sh and Dolby TrueHD and DTS MA-HD blinked for the first time on my AVR Smile

However, there's still one thing that bugs me: Dolby Digitial Plus. It does not work and when I play a file with DD+, there's a constant toggle between ac3 and e-ac3, which is reflected by the HDMI icon blinking furiously on my AVR.
Here's the xbmc log showing this issue: http://xbmclogs.com/show.php?id=43566 (look in the log for a file named hd_dolby_digital_plus_lossless)
and this is the current output shown in my eld:
Code:
monitor_present 1
eld_valid 1
monitor_name HT-R538
connection_type HDMI
eld_version [0x2] CEA-861D or below
edid_version [0x3] CEA-861-B, C or D
manufacture_id 0xcb3d
product_id 0xa34
port_id 0x0
support_hdcp 0
support_ai 1
audio_sync_delay 0
speakers [0x4f] FL/FR LFE FC RL/RR RLC/RRC
sad_count 8
sad0_coding_type [0x1] LPCM
sad0_channels 2
sad0_rates [0x1ee0] 32000 44100 48000 88200 96000 176400 192000
sad0_bits [0xe0000] 16 20 24
sad1_coding_type [0x1] LPCM
sad1_channels 6
sad1_rates [0x1ee0] 32000 44100 48000 88200 96000 176400 192000
sad1_bits [0xe0000] 16 20 24
sad2_coding_type [0x2] AC-3
sad2_channels 8
sad2_rates [0xe0] 32000 44100 48000
sad2_max_bitrate 640000
sad3_coding_type [0x7] DTS
sad3_channels 8
sad3_rates [0xc0] 44100 48000
sad3_max_bitrate 1536000
sad4_coding_type [0x9] DSD (One Bit Audio)
sad4_channels 6
sad4_rates [0x40] 44100
sad5_coding_type [0xa] E-AC-3/DD+ (Dolby Digital Plus)
sad5_channels 8
sad5_rates [0xc0] 44100 48000
sad6_coding_type [0xb] DTS-HD
sad6_channels 8
sad6_rates [0x1ec0] 44100 48000 88200 96000 176400 192000
sad7_coding_type [0xc] MLP (Dolby TrueHD)
sad7_channels 8
sad7_rates [0x1480] 48000 96000 192000

One thing bugs me: my AVR is actually 5.1, not 7.1 so it seems it basically introduces itself correctly (i.e. the speaker config). If so, why this ends up in unplayable HD audio? Is this a correct behavior?

Thanks for any advice,
A.


[Fixed] HD Audio - My Guide to EDID Editing - fritsch - 08-09-2013

If you can - try a xbmc openelec gotham build - we have rewritten SoftAE. Fernetmenta and me - we now have a dedicated thread for the sink, this should care for underruns (signal turning on / off) and the like.


[Fixed] HD Audio - My Guide to EDID Editing - fritsch - 08-09-2013

Concerning your last point with the speaker config: Most DTS-HD signals are 7.1 - we don't touch that stream in any way - just passthrough it - by openening 7.1 channels. This explains your 5.1 problem behaviour.