Stuttering on VAAPI

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

Moderator: Forum Moderators

Post Reply
jensk
Junior
Posts: 19
Joined: Sat Oct 06, 2018 11:38 am
Denmark

Stuttering on VAAPI

Post by jensk »

I have a Intel NUC7PJYH on Lubuntu 20.04 with Myth 31 + fixes as a frontend. It stutters on playback and i have tried different solutions and setting but the error persists. It stutters on both mpeg2 and H264 recordings and videos

I tried setting a /usr/share/X11/xorg.conf.d/20-intel.conf file
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "uxa"
Option "TearFree" "true"
EndSection
But the stuttering persists

I did a log on the frontend with the command mythfrontend -v playback > debug.txt
The result is downloadable here:
https://www.kjellerup-hansen.dk/nextclo ... sfpELdikFW

It was suggested in this thread that there is a error in the frontend not adjusting to the 25Hz framerate:
viewtopic.php?f=3&t=3544&p=18598#p18612

Any god suggestions on how i cure this stuttering?
User avatar
mark_k
Developer
Posts: 61
Joined: Tue Jan 28, 2020 3:14 pm
Great Britain

Re: Stuttering on VAAPI

Post by mark_k »

Your log looks pretty good to me:-

- VAAPI looks to be available, configured and used.
- CPU load is broadly as I would expect
- framerate appears to be pretty good - with low deviation
- no obvious audio/video sync issues

The only 'unusual' item is OpenGL 4.6 is used - but I'm guessing that is a result of the newer drivers in 20.04 (I haven't tested 20.04) - and is probably not relevant.

I would suggest the following;-

- if it is just an issue with matching the video frame rate to the display, then from the main menu, go into Setup->Appearance. Enable 'Separate video modes for GUI and TV playback' and enter the menu beneath that. Select 1920x1080 for your GUI and Video Output and set 'Rate' to 'Auto'. If you have any 4k content - you could use that for Video output (and GUI if you wanted) - or just add an override for 4k content (which will save memory for non-4k content).

- if that doesn't work then post another 'mythfrontend -v playback' log with the framerate switching enabled.

For what it's worth, my VAAPI development machine (Coffeelake desktop) has a vanilla Debian installation - I've never had to touch xorg.conf etc for trouble free playback.

Regards, Mark
User avatar
mark_k
Developer
Posts: 61
Joined: Tue Jan 28, 2020 3:14 pm
Great Britain

Re: Stuttering on VAAPI

Post by mark_k »

I forgot to ask - what window manager are you using?
jensk
Junior
Posts: 19
Joined: Sat Oct 06, 2018 11:38 am
Denmark

Re: Stuttering on VAAPI

Post by jensk »

HI mark_k
I have tried the settings you suggest and now i Have a small video picture i the upper left 20% of the screen - with the same stuttering.
If I disable the separate GUI and video playback i get a almost normal picture but with the wrong aspect ration. So now all my videos are played with black borders on each side. No matter how i adjust the settings I cant get back to the original aspect ratio - which is correct.

How do i reset the frontend to standard?

BTW: my window manager is Openbox
jensk
Junior
Posts: 19
Joined: Sat Oct 06, 2018 11:38 am
Denmark

Re: Stuttering on VAAPI

Post by jensk »

I ran a mythfrontend --reset to get back to normal.
I the ran a new mythfrontend - v playback > debug.txt
The result can be downloaded here:
https://www.kjellerup-hansen.dk/nextclo ... d7TNxKYTYC
pletchtd
Newcomer
Posts: 4
Joined: Sat Mar 28, 2020 7:47 pm
United States of America

Re: Stuttering on VAAPI

Post by pletchtd »

You might try running mythtv with the i965 driver rather than iHD driver and see if anything improves.

Code: Select all

LIBVA_DRIVER_NAME=i965 mythfrontend -v playback
I have found there are some issues with the now default iHD driver and some architectures on 20.04.
User avatar
mark_k
Developer
Posts: 61
Joined: Tue Jan 28, 2020 3:14 pm
Great Britain

Re: Stuttering on VAAPI

Post by mark_k »

pletchtd wrote:
Wed Jun 10, 2020 9:18 pm
You might try running mythtv with the i965 driver rather than iHD driver and see if anything improves.

Code: Select all

LIBVA_DRIVER_NAME=i965 mythfrontend -v playback
I have found there are some issues with the now default iHD driver and some architectures on 20.04.
Good call - I hadn't realised that 20.04 shipped with different drivers.

There also appears to be a problem with the openbox window manager - I'll try it out and see if I can replicate the problem.

Regards
Mark
jensk
Junior
Posts: 19
Joined: Sat Oct 06, 2018 11:38 am
Denmark

Re: Stuttering on VAAPI

Post by jensk »

pletchtd wrote:
Wed Jun 10, 2020 9:18 pm
You might try running mythtv with the i965 driver rather than iHD driver and see if anything improves.

Code: Select all

LIBVA_DRIVER_NAME=i965 mythfrontend -v playback
I have found there are some issues with the now default iHD driver and some architectures on 20.04.
Thank you for your suggestions and you patience.
I tried your suggestion - but with no god result. My frontend is still stuttering.
I wonder if I shall find an old Acer Aspire Revo x600 to get an nVidia ION chip to get stutterfree playback :-( But the again there is problems playing the newer codecs on these old nVidia platforms.
jensk
Junior
Posts: 19
Joined: Sat Oct 06, 2018 11:38 am
Denmark

Re: Stuttering on VAAPI

Post by jensk »

mark_k wrote:
Thu Jun 11, 2020 10:13 am

There also appears to be a problem with the openbox window manager - I'll try it out and see if I can replicate the problem.
Hi Mark.
Are you suggesting that i should try another flavor of Ubuntu that is not using openbox?
Right now I am using Lubuntu 20.04. I could try to install Xubuntu 20.04 with xfce4 tomorrow and se if that helps
User avatar
mark_k
Developer
Posts: 61
Joined: Tue Jan 28, 2020 3:14 pm
Great Britain

Re: Stuttering on VAAPI

Post by mark_k »

My comment re openbox was in relation to video mode switching - where you said that you ended up with video in the top left of the screen; which just indicates to me that the window manager is not behaving as expected (there are a few window resize/hide/show events when the display mode is switched). Not necessarily an openbox bug but something we just need to handle (if we can).

That said - I would definitely recommend trying a different window manager - though I'm sure you don't need to install xubuntu; probably just install e.g. xfce4 and switch to it at login?

regards
Mark
jensk
Junior
Posts: 19
Joined: Sat Oct 06, 2018 11:38 am
Denmark

Re: Stuttering on VAAPI

Post by jensk »

I installed Xubuntu with xfce4 windows manager. Unfortunately the stuttering persists. It seems to me that the Intel GPU support under Linux is very inmatture and thus gives these stuttering or tearing issues. I do not experience tearing but I still have stuttering
jksj
Senior
Posts: 148
Joined: Thu Feb 13, 2014 7:53 pm
Great Britain

Re: Stuttering on VAAPI

Post by jksj »

Have you tried making the audio buffer in Setup>Video>Playback>Advanced Playback Settings>Audio read ahead to 1000?
I would be interested to know how good Open GL High Quality is on the NUC.
Post Reply