Page 1 of 2

Changing Video Mode causes Failure

Posted: Sat Sep 21, 2019 9:32 pm
by kbocek
I have a new small X86 single board computer. Ubuntu 18.04.03 and Myth 29. Seems to have an issue when switching video modes. Eventually when playing different video streams at different resolutions my Samsung TV says "Invalid Video Mode" and refuses to display anything. When I plug it into a computer monitor this problem seems to go away.

I'm trying to replace an older front end. That old front end never had this problem on this same TV.

Can anyone think of a setting in Myth or X that might stabilize this issue? One difference between the two is I installed FVWM on the older box and I haven't installed *any* window manager on the new. Would that help things?

Re: Changing Video Mode causes Failure

Posted: Sat Sep 21, 2019 10:35 pm
by kbocek
Sorry if I'm spamming here. But I post questions, think about it, and find my own answers.

I think this was an interaction between the paint engine and video profile. The paint engine was set to QT. Setting it to auto allowed me to select the VAAPI video profile. Under QT, VAAPI playback would fail and I had to select OpenGL. I haven't had a chance to plug the box into the TV, but with Auto/VAAPI things seem to be working on the computer monitor.

Re: Changing Video Mode causes Failure

Posted: Sun Sep 22, 2019 3:51 pm
by kbocek
Damn. Nope, TV still erratically displays "Invalid Mode". Going in and out of recording, live TV and videos, eventually it shuts down.

Now I really am out of ideas. If anyone has any thoughts, I'd love to hear them

Re: Changing Video Mode causes Failure

Posted: Sun Sep 22, 2019 9:25 pm
by blm-ubunet
I believe existing VA-API implementation in MythTV requires OpenGl surface.
The menus can still use QT painter & has to for some platforms ??

Disable all video mode switching & use same display resolution for menus & video.
Only output at native display resolution & forget about refresh rate. Just leave it at 60Hz (6000/1001).

The video mode switching logic for my hardware is completely borked so I just switch manually or don't care.
I use same 4K50p modeline for both menus & video & scale everything.
Simple linear scaling does not have great processing demands.

Re: Changing Video Mode causes Failure

Posted: Mon Sep 23, 2019 7:46 pm
by kbocek
The "Use Separate Video Modes" option was unchecked. I checked it and selected 1080p for both menus and playback. I left refresh at auto. The problem still happens. I went in and out of several streams with different native resolutions.

Is there some other setting you are talking about? Should I set the refresh to 60?

Re: Changing Video Mode causes Failure

Posted: Mon Sep 23, 2019 11:14 pm
by blm-ubunet
Use separate video modes show be unchecked but what you're done should result in the same thing (would have thought).
I assume your TV is 1080 lines.
Try fixing the refresh rate.

What video GPU is in the PC ? Is it an Intel iGPU?

Could check you're connected to the "PC computer" HDMI input.
On some TVs that the only way to get 4:4:4 video & "Just Scan" or what nonsense the TV maker calls no-overscan 1:1 pixel mapping.

Re: Changing Video Mode causes Failure

Posted: Tue Sep 24, 2019 2:53 pm
by kbocek
The video is integrated Intel like I have on my working frontends. The playback is completely solid when attached via HDMI to a computer display. It's only when attached to my Samsung TV that the problem occurs.

I will play with the refresh rate setting.

Re: Changing Video Mode causes Failure

Posted: Wed Sep 25, 2019 4:17 am
by blm-ubunet
You could start frontend from terminal cmd & redirect appropriate logging to file. Then exercise the issue until it fails & then reboot & recover the file.
Or try switch to console <cntl><alt><F1>, login & look at logs with systemd tool "journctl -xe" or look at "/var/log/Xorg.0.log" or "dmesg"

If the console display comes back up then..
Could try to stop/restart the X GUI with systemctl restart lightdm.service (or gdm.service).

Interesting to see if the TV or video driver has given up.
Possible the TV has illegal/invalid EDID data.

Re: Changing Video Mode causes Failure

Posted: Wed Sep 25, 2019 2:59 pm
by kbocek
I'll try and debug this more. I have already looked at Xorg.0.log as well as mythfrontend.log. I didn't see anything.

The weird thing is I already have a working frontend on this TV and it too has Intel video.

Display Randomly Crashes

Posted: Wed Sep 25, 2019 10:46 pm
by kbocek
I clearly have the wrong title on this thread. The video mode is not changing. The TV displays 1920x1080/60 regardless of the stream I am playing.

This is my first time working with Ubuntu. I had installed ubuntu-desktop thinking it was needed. It isn't. I uninstalled it.

I went back to try the opengl-normal video profile again. I installed FVWM because I have it on my other frontends. Nothing seems to help. Eventually I get the invalid video mode message from the TV. Now this happens after successfully playing *multiple* different video sources and recordings.

Re: Changing Video Mode causes Failure

Posted: Thu Sep 26, 2019 12:47 am
by blm-ubunet
When you have the TV in the condition invalid video mode..
Does the TV turn itself off after some timeout?
Does it wake up if you pull the HDMI cable out?

If you pull & hot-plug the cable does your PC video recover?

Switch to Console terminal wakes it up??

Re: Changing Video Mode causes Failure

Posted: Sat Oct 05, 2019 7:11 pm
by kbocek
Yes, the TV turns off awhile after displaying "invalid mode." Pulling and reinserting the HDMI cable does nothing. The host is still running in this state.

I experimented using xrandr to change modes after the error:

Code: Select all

xrandr -d :0 --output HDMI2 --mode 1280x1024
This *did* make the screen come alive again. But playing content eventually still causes the "invalid mode".

This is definitely some interaction between the hardware and this TV. I spent a half hour with the box plugged into an HDMI computer monitor. I played all kinds of content of different resolutions and sources. Totally rock solid.

Re: Changing Video Mode causes Failure

Posted: Sat Oct 05, 2019 10:28 pm
by blm-ubunet
Not a root cause but a workaround is to just use native panel resolution 1080.
Personally. I never drive any LCD screen at a resolution that is not native. The panel always has to scale to native & doubt any but the latest gen TVs can out perform a humble video card.

And to get 4:4:4 video & no overscan etc you must use native & a specific HDMI port & sometimes the HDMI port has to be named correctly.

Re: Changing Video Mode causes Failure

Posted: Sat Oct 05, 2019 11:16 pm
by kbocek
As a test I renamed xorg.conf and let X autoconfigure. It picks 1080p/60 by default. No help there.

X auto-probes six different 1080p modes on this TV. I extracted them and tried to set them up in xorg.conf. Unlike my other front ends, somehow this didn't display the manually defined ModeLines in Xorg.0.log. I named them "-1", "-2", etc. They never showed up.

Re: Changing Video Mode causes Failure

Posted: Sun Oct 06, 2019 12:42 am
by blm-ubunet
MythTV is causing the problem so try fix it there.
Can you just make mythtv not change the video size (height & width) ?
That would be a good (best general) solution (if possible), lock the dimensions (GUI & playback) & only change the refreshrate.
I can't recall is FE setup is smart enough to allow that.

The video mode switching code is ugly & borked & does not work for Nvidia without integer rate numbers & a specific order etc.
FOSS video modeline calculators are not current with latest reduced vertical blanking timings that all modern digital flat panel displays support.

If stuff in xorg.conf does not show up in the logging then there could be a syntax problem.
Only Nvidia provides good documentation.