Changing Video Mode causes Failure

For discussion of topics specific to MythTV on linux
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Changing Video Mode causes Failure

Post 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?
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Changing Video Mode causes Failure

Post 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.
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Changing Video Mode causes Failure

Post 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
blm-ubunet
Senior
Posts: 265
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Changing Video Mode causes Failure

Post 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.
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Changing Video Mode causes Failure

Post 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?
blm-ubunet
Senior
Posts: 265
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Changing Video Mode causes Failure

Post 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.
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Changing Video Mode causes Failure

Post 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.
blm-ubunet
Senior
Posts: 265
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Changing Video Mode causes Failure

Post 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.
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Changing Video Mode causes Failure

Post 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.
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Display Randomly Crashes

Post 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.
blm-ubunet
Senior
Posts: 265
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Changing Video Mode causes Failure

Post 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??
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Changing Video Mode causes Failure

Post 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.
blm-ubunet
Senior
Posts: 265
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Changing Video Mode causes Failure

Post 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.
kbocek
Senior
Posts: 201
Joined: Mon Jul 20, 2015 4:42 pm
United States of America

Re: Changing Video Mode causes Failure

Post 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.
blm-ubunet
Senior
Posts: 265
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Changing Video Mode causes Failure

Post 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.
Post Reply