[SOLVED] Loosing DTS-HD and TrueHD passthrough all the time
#1
Hi Guys!

I would like to ask your help to solve this strange problem. It is most probably not even Kodi related, rather some communication bullshit between my receiver and the PC.

So situation is the following. I have a zotac miniPC, connected to a yamaha rx-v583r over HDMI. To have DTS-HD and TrueHD passthrough I use ALSA. After a fresh boot,everything is fine, I have all the passthrough options in Kodi (17.6-r2).
The problem is , that after some time (seemingly random for now, because I don't know the reason), maybe after turning off the receiver/TV, switching to net_radio and back, I don't know why, but I loose TrueHD and DTS-HD options.
I don't exit Kodi, and even have set the "keep soundcard open" option to always, so nothing else steals (should be able to steal) the card. 
You guys have more experience with all this, so I would like to ask you if there is any way to reset the soundcard, or reset anything to go back to the status like after reboot? I found a script which can look up running applications that use the soundcard via procfs, but that only shows Kodi (and nothing if I exit Kodi).
For now, only a reboot can set things back to normal.
I have some logs, and see that when the settings disappear, the maximum samplerate is 48000. Which I read is the reason why the settings disappear... But I don't understand why this happens. What reports this to Kodi and why ? 

Log when everything is fine (device 6 is my HDMI1 which is connected to the receiver):
https://pastebin.com/Qe9d77AF


Log when the settings disappear and I have only 48000 (again, device 6):
https://pastebin.com/b6BrN2kk

I have HDMI control also Audio Return Channel (which i never use) and I also tried to turn both on and off, but same result.
I have tried a few settings I forgot about , some sync delay, and stuff like that, but nothing helped...

Thank you very much for you help in advance! I appreciate your time and patience very much!
Reply
#2
The first difference I see in the log is:

14:39:24.884 T:140448370669312  NOTICE:         m_displayNameExtra: YMH RX-V583 on HDMI #1

and the log where it does not work:

09:09:38.149 T:139827681876096  NOTICE:         m_displayNameExtra: SNY SONY TV on HDMI #1

So from that, your TV is recognized instead of your AVR. As your TV is not capable of what your AVR is capable of, Kodi will show the options which are available. I guess, this will happen after you switch the source of your AVR to do something else. The Kodi device will loose it's HDMI connection and probably your AVR does some HDMI passthrough of the TV. So the Kodi device establishes a new connection (handshake to the TV). Then you switch back to the HDMI source where the Kodi device is attached. For the reason youre device already has an attached connection, there's no need for it to do it again. The problem is, that the Kodi device gets the EDID information from the TV and therefore only knows what the TV is capable of and is not interested in what the AVR can do or not.

But that ^^ is only an assumption as I'm not a dev.

One thing to avoid that could be to grab the EDID information directly after the boot (where everything works). Then you will have the EDID informations which the AVR provides. You could add them to the kernel boot parameters to use that specific edid-file instead of anything else. Given that EDID-file the device will always "think" that some other device (may it be an AVR or a TV or whatever was connected while grabbing the EDID-info) is connected even if it is not.

Might probably worth a try.
Reply
#3
I once wrote a script for LibreELEC to do exactly that. That's the part for Intel hardware:

https://github.com/LibreELEC/LibreELEC.t...tedid#L151

I never used gentoo. For ubuntu the devices to check for are located in: /sys/class/drm/ . On Ubuntu those are symlinked to: /sys/devices/pci0000:00. the part in red might differ in your case.

You need to check the statuses for those devices:

Assuming your are using the bash:
for i in /sys/class/drm/*; do if [ "$(cat "$i"/status 2>/dev/null)" = "connected" ]; then echo "$i"; fi; done

a sample output looks like:

Code:

davu@davu-laptop1:~$ for i in /sys/class/drm/*; do if [ "$(cat "$i"/status 2>/dev/null)" = "connected" ]; then echo "$i"; fi; done
/sys/class/drm/card0-HDMI-A-2
/sys/class/drm/card0-LVDS-1
/sys/class/drm/card0-VGA-1
davu@davu-laptop1:~$ cd /sys/class/drm/card0-HDMI-A-2/
davu@davu-laptop1:/sys/class/drm/card0-HDMI-A-2$ ls
device  dpms  edid  enabled  modes  power  status  subsystem  uevent

If there's more than one device listed (as it's the case above because that's my laptop here at work), you need to dig deeper which device you actually need. Then just simply cat the edid file which is listed under the specific card0-device. You see that in that listing above.

example how it works for LibreELEC:
https://github.com/LibreELEC/LibreELEC.t...tedid#L169

and then follow the steps which are needed to get the rest done. The section for intel ends at line #192 in that script where it adds the specific things for LibreELEC to the boot parameters.

Hope that helps.
Reply
#4
(2018-03-16, 15:52)DaVu Wrote: I once wrote a script for LibreELEC to do exactly that. That's the part for Intel hardware:

https://github.com/LibreELEC/LibreELEC.t...tedid#L151

I never used gentoo. For ubuntu the devices to check for are located in: /sys/class/drm/ . On Ubuntu those are symlinked to: /sys/devices/pci0000:00. the part in red might differ in your case.

You need to check the statuses for those devices:

Assuming your are using the bash:
for i in /sys/class/drm/*; do if [ "$(cat "$i"/status 2>/dev/null)" = "connected" ]; then echo "$i"; fi; done

a sample output looks like:

Code:

davu@davu-laptop1:~$ for i in /sys/class/drm/*; do if [ "$(cat "$i"/status 2>/dev/null)" = "connected" ]; then echo "$i"; fi; done
/sys/class/drm/card0-HDMI-A-2
/sys/class/drm/card0-LVDS-1
/sys/class/drm/card0-VGA-1
davu@davu-laptop1:~$ cd /sys/class/drm/card0-HDMI-A-2/
davu@davu-laptop1:/sys/class/drm/card0-HDMI-A-2$ ls
device  dpms  edid  enabled  modes  power  status  subsystem  uevent

If there's more than one device listed (as it's the case above because that's my laptop here at work), you need to dig deeper which device you actually need. Then just simply cat the edid file which is listed under the specific card0-device. You see that in that listing above.

example how it works for LibreELEC:
https://github.com/LibreELEC/LibreELEC.t...tedid#L169

and then follow the steps which are needed to get the rest done. The section for intel ends at line #192 in that script where it adds the specific things for LibreELEC to the boot parameters.

Hope that helps.
 Huhh!!!   Thank you very much DaVu!   I did a quick check now, and the current log contains 2 different entries for HDMI1:   "HDMI #1"  and "SNY SONY TV on HDMI #1".
If I go to audio settings in Kodi, I see the device as "SNY SONY TV on HDMI #1" , that is set to output device, and also to passthrough device.

Anyway! What you say is something to start on! I have checked the connected devices using your oneliner:

Code:

aron@zotac ~ $ for i in /sys/class/drm/*; do if [ "$(cat "$i"/status 2>/dev/null)" = "connected" ]; then echo "$i"; fi; done
/sys/class/drm/card0-HDMI-A-2
I'll check further a bit later and report back!
Thank you very much for your help!

Edit:  I turned on the TV, while the receiver was playing net_radio, and now for the first time i see "YMH RX-V583 on HDMI #1" as device in Kodi settings....
There are some strange things going on when turn the TV on. Resolution is being switched between 1080p and 1080i  (what the hell is 1080i anyway?). The PC puts the video card to sleep when it is not used? And when "waking" it up , it must be doing some negotiating and most probably something will go wrong during this?
Reply
#5
Okay... I had no time to implement your solution during these last days, because I have to read and find out how this works in gentoo. I have found the file, can change it, but for now I don't know where to put it Big Grin

BUT! Thanks to you, i could find a way to solve the problem:   change the damn screen resolution once Big Grin
If I have the receiver on, and change the screen resolution, it most probably re-negotiates things, the card must query the client connected to it (which is then 100% the receiver) and everything goes back to normal. Even with Kodi running, this solves the problem.
So I have created a launcher for Kodi, which has an "xrandr" command right before starting Kodi, and everything is wonderful Big Grin Big Grin

I would say the problem is solved for me, but I will of course try to find and read about the edid stuff on gentoo. It would be a clearer solution Big Grin

Thank you very much for your help!
Reply

Logout Mark Read Team Forum Stats Members Help
[SOLVED] Loosing DTS-HD and TrueHD passthrough all the time0