[Linux] Workaround to start Kodi on the TV after it has been switched off then on
#1
HI,

My Linux install is based on wayland and my set-up includes one DVI monitor and one HDMI TV. I know wayland support will come in Kodi 18 but in the mean time I was looking for tricks to workaround the black screen issues in a convenient manner.

The main issue was when my TV was switched off, Kodi full screen window, become a black screen on my main monitor. Restarting Kodi is needed, but when setting again the right monitor in Kodi led to a black screen. Forcing me to edit in the settings file the correct screen identifier then start kodi.

I cannot prevent the black screen, it seems there are tricks with the EDID, but I didn't tried them as I see a lot of threads that have Xorg and I don't. Maybe I'm confusing things. Anyway I found a way to start Kodi on the correct screen wchich is my TV.

Code:

env DISPLAY=:0 sed -i -E "s/<monitor[^>]*>.*<\/monitor>/<monitor>$(env DISPLAY=:0 /usr/lib/kodi/kodi-xrandr --current | grep -o 'XWAYLAND[1-9][0-9]\?')<\/monitor>/g" $HOME/.kodi/userdata/guisettings.xml && env DISPLAY=:0 nohup kodi &

To explain a bit this command : Wayland offers a compatibility mode for X based application, the screens are identified as XWAYLAND#. XWAYLAND0 is the main monitor, this number is stable in my experience. Then there's XWAYLAND# (starting form 1) which represents the TV, and this number increases each time the TV is switched on and off again. By looking at the kodi logs and the Kodi bin, I found kodi-xrandr, which I found useful to detect current screen identifiers. With some shell scripting I found a way to replace the old identifier by the correct one. I know this isn't a perfect solution, but it allows to start kodi without the manual gymnastic which is pretty handy.
Setting the DISPLAY=:0 also helps me to run this command while on ssh shell e.g. from my mobile phone.

What do you think of that workaround ?
Reply
#2
Overriding the EDID is the best fix, it has nothing to do with X11.
Also note that you won't get any hardware video decoding on xwayland, so a kodi v18 nightly is suggested.
Reply
#3
Actually the only content I found on the Kodi wiki regarding the EDID was this page : http://kodi.wiki/view/Creating_and_using..._xorg.conf which dos not mention Wayland.

Do you have a better cointent regarding this topic while Kodi 18 is not out ? Also maybe the support of Wayland won't change anything to the fact that the EDID has to be corrected.
Reply
#4
Please search for drm_kms_helper in this forum. It's a kernel issue in combination with HDMI hotplug (not TV there -> no edid), kodi is an application.

For Ubuntu 17.10 - if you use the xwayland session no hw accel will work. For intel GPUs use kodi v18 nightlies (kodi-wayland) instead with VAAPI. If you need VDPAU either don't install 17.10 Desktop or make sure to use the x11 session.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply

Logout Mark Read Team Forum Stats Members Help
[Linux] Workaround to start Kodi on the TV after it has been switched off then on0