Garbage playing UHD movie on 4K TV with vdpau only

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
dborn
Junior
Posts: 20
Joined: Tue Aug 29, 2017 9:21 pm
Canada

Garbage playing UHD movie on 4K TV with vdpau only

Post by dborn » Fri Aug 09, 2019 4:01 pm

Hi all,

I have a mythtv 29.0 setup on xubuntu 18.04 with several HD frontends. I recently setup a new, more powerful computer for eventual UHD playback. I have nvidia 418.56 driver with an nVidia GeForce GTX 1050 video card, using vdpau high quality profile configured on it, connected to a 65" Samsung UHD TV.

All works fine playing HD TV shows recorded from an HDPVR and OTA digital tuner, DVD rips and also HD BD rips but when I try to playback an UHD 4K BD rip, the sound plays fine but the screen is filled with garbage (multi-colored blinking patterns), looking at mythfrontend.log gives me nothing to go on.

If I try to play it on my most powerful non-UHD backend/frontend, it does play but with heavy stuttering. I suppose there is automatic downscaling going on there?. That machine has nVidia 340.107 on it with a GT220 video card which is fine for HD content.

On the UHD frontend, If I switch to a different decoder, it will play fine but the quad-core i3 processor will be pretty busy and there is slight stuttering. I tried playing with different settings for vdpau and nothing seems to improve it. I tried playing back the .m2ts file directly from the rip as well as converting it using makemkv and it makes no difference.

Any advice, things to check? let me know what information could be helpful to help you help me :)

Thanks,
Daniel

dborn
Junior
Posts: 20
Joined: Tue Aug 29, 2017 9:21 pm
Canada

Re: Garbage playing UHD movie on 4K TV with vdpau only

Post by dborn » Fri Aug 09, 2019 5:53 pm

I think I may have found the problem... but how to fix it?
According to ffprobe, the mkv video format is:
Stream #0:0(eng): Video: hevc (Main 10), yuv420p10le(tv, bt2020nc/bt2020/smpte2084), 3840x2160 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc"

And according to vdpauinfo, the video card's capabilities for HEVC are:
HEVC_MAIN 153 262144 8192 8192
HEVC_MAIN_10 --- not supported ---
HEVC_MAIN_STILL --- not supported ---
HEVC_MAIN_12 --- not supported ---
HEVC_MAIN_444 --- not supported ---

I won't pretend to understand exactly what it means but can I convert an HEVC_MAIN_10 into HEVC_MAIN??

Thanks,
Daniel

dborn
Junior
Posts: 20
Joined: Tue Aug 29, 2017 9:21 pm
Canada

Re: Garbage playing UHD movie on 4K TV with vdpau only

Post by dborn » Sat Aug 10, 2019 2:11 am

Seems I'm SOL with VDPAU ever supporting HEVC_MAIN_10 so I managed to configure mythtv using VAAPI profile for HEVC codecs. I know VAAPI is for Intel hardware acceleration but it seems to provide near-stutter-free playback of my UHD movie on my nvidia GTX1050 card even if it keeps my quad-core I3 processor at ~250% (4x65%) CPU usage. The other settings appear to give poorer results. Any suggestions for improving this situation will be appreciated. :)

User avatar
pgbennett
Developer
Posts: 319
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Garbage playing UHD movie on 4K TV with vdpau only

Post by pgbennett » Sat Aug 10, 2019 2:35 pm

Normally VAAPI will not work if you have an NVIDIA card. I think what is happening in your case is that it is failing VAAPI and using standard decoding instead. If you select standard decoding with OpenGL you will likely see the same as when you select VAAPI. You can also verify this by specifying -v playback on the command line and looking at the log. That will show if VAAPI is failing.

The next version of MythTV, V31, supports NVDEC decoding for NVIDIA cards, and that may work better for your HEVC. Note that to use NVDEC you need a recent NVIDIA driver, which can be obtained from a ppa.

dborn
Junior
Posts: 20
Joined: Tue Aug 29, 2017 9:21 pm
Canada

Re: Garbage playing UHD movie on 4K TV with vdpau only

Post by dborn » Sun Aug 11, 2019 12:40 am

Hi pgbennett, first of all thanks for all your hard work on getting mythtv frontends working so well on Raspberry Pi's. One of my frontends plays fine on an "HD" 1280x720 screen using your "bennettpeter" ppa :)

Yeah, I figured that using VAAPI on an nVidia card didn't actually produce any GPU acceleration but it seemed to work better than just using opengl. Perhaps I need to revisit this as I agree it doesn't really make any sense. I'll probably skip the V30 upgrade and wait for the upcoming V31. Good to know about NVDEC, I'll start reading up on it.
I only have 1 UHD movie so far (which I bought specifically to experiment with). It also came with an HD bluray version of the same movie (Apollo 13) and I can't say I notice a big difference between the two. I confirmed the TV does see the 4K resolution material being received. I've only recently upgraded from DVD "not even close to HD" movies to BD so not having optimal UHD capabilities yet is not making me lose any sleep.

Cheers,
Daniel

blm-ubunet
Junior
Posts: 16
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Garbage playing UHD movie on 4K TV with vdpau only

Post by blm-ubunet » Sun Aug 11, 2019 4:48 am

All hope of VDPAU supporting anything new (and not just on life support) may not be a fading dream
https://lists.freedesktop.org/archives/ ... 00434.html
VP9 was also added a couple months back.
Not sure if the HEVC support add to VDPAU was more than some headers but it suggests all is not lost.

MythTV's nvdec implementation does not support zero copy so is sadly academic to most.
My core2duo / gtx1050ti needs the following to prevent sideshow:
mpv --hwdec=cuvid --vo=gnu /path/to/UHDHEVC.mpeg

I find driver 418 to be very unstable (shows how brittle X display server is), video playback X lock-ups every other day.
430 is much more reliable but adv. de-interlacing is much worse.

User avatar
pgbennett
Developer
Posts: 319
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Garbage playing UHD movie on 4K TV with vdpau only

Post by pgbennett » Sun Aug 11, 2019 3:29 pm

See the table here https://developer.nvidia.com/video-enco ... ix#Decoder
It shows that certain 10-bit formats are supported with that device if using NVDEC.

dborn
Junior
Posts: 20
Joined: Tue Aug 29, 2017 9:21 pm
Canada

Re: Garbage playing UHD movie on 4K TV with vdpau only

Post by dborn » Sun Aug 11, 2019 9:39 pm

Thanks for your replies. Unfortunately I don't know what "zero copy" means, nor "prevent sideshow". :)
I've been having pretty good stability with 418 but I do get some wierdness with hdmi sound. I need to put my FE to sleep and then wakeup to get proper 5.1 sound sent out. If I reboot it, there's no sound until it is suspended/woken up. Not sure it has anything to do with 418 but since I always leave the FE in sleep when not using it, it's not a show-stopper.

Doing an apt list | grep nvidia shows that I am currently running with 430 and not 418. I know I haven't upgraded manually so it must have upgraded on its own. I guess that's settled then :)

*edit: alright, got it. :)

blm-ubunet
Junior
Posts: 16
Joined: Sun Jun 15, 2014 1:08 am
Cambodia

Re: Garbage playing UHD movie on 4K TV with vdpau only

Post by blm-ubunet » Mon Aug 12, 2019 8:33 am

sideshow > Slideshow (2-4 fps with UHD test broadcasts).
Zero copy means video decode data stays in the GPU for rendering & not copy back to system RAM.

I have switched back to 418 twice due to DI pict quality hoping the problem was elsewhere but the crashing & hopeless X server is too much.

All credit for PeterB making everything work better inc. adding NVDEC.

The good thing about trying "mpv" to play your UHD/HEVC is that you soon realise how MythTV stands out with great UI.

NVDEC is more flexible than VDPAU, it can operate as (multiple concurrent) decoder only but this mean more glue is needed to do zero copy.
AIUI VDPAU can be mixer/renderer or decoder/mixer/renderer.
The GTX1050ti can transcode NVDEC/NVENC 2 concurrent H264 (medium broadcast bitrates) at 15x real time & only just starts spin the fans.

If I was buying a new video card now, I think the time has come to leave Nvidia on the shelf.
Lots of the nice desktops do not work well with nvidia prop. driver (composited desktops like mate18.04 which I use) or have frame delay problems & terrible overhead (gnome). Linux booting up on Nvidia prop. driver is an embaressment of mode switching & half broken console.
There's a lot of hate for Nvidia's EGL? streams approach over the open GBM so AMD looks a better choice.
Automatic refresh rate switching for nvidia hasn't worked right for years & was an ugly kludge from the start.
De-interlacing has been problem before https://devtalk.nvidia.com/default/topi ... rlacers-/1 & it not very good now.

Post Reply