Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stuttering Video on AMD GPU with DXVA on some H.264 LiveTV streams #496

Open
YARD2 opened this issue May 17, 2022 · 26 comments
Open

Stuttering Video on AMD GPU with DXVA on some H.264 LiveTV streams #496

YARD2 opened this issue May 17, 2022 · 26 comments

Comments

@YARD2
Copy link

YARD2 commented May 17, 2022

System Info:
Ryzen 5 2500U with Vega iGPU
Windows 10

I noticed that on a few TV Live streams with h264 / recordings via satellite (Astra 19.2) results
in stuttering video if DXVA is enabled on AMD GPUs.
Intel and Nvidia are OK.
Without DXVA (using Software decoding) it is also OK.
But it works with the Microsoft Filter DTV Video Decoder and DXVA.

Tested with:
LAVFilter 0.76.1 with DVBviewer
MPC-HC newest version

Sample:
Sample

@psyborg55
Copy link

Maybe not the same problem, but is also noticeable on Eutelsat 7east channel CineFilm. AMD GPU as well.
I think channel use L4.1 format, while most others are L4.0

@mitzsch
Copy link

mitzsch commented Sep 19, 2022

Noticed a similar issue on my end too. GPU is a RX580.
The end crawl of a single Bluray rip is stuttering like a mess, turning off the hw decoding fixes it. Works fine with an Nvidia GPU.
Interestingly I could not recreate the problem with your sample. @YARD2

Another thing I noticed is, that the same issue also shows up when using mpv (maybe you (@YARD2) could try mpv too? ), however only in windows - under linux using vaapi it was fine. (your sample was fine there too)

@YARD2
Copy link
Author

YARD2 commented Oct 4, 2022

mpv is working in Windows with the latest build i tried.

@vdrfan
Copy link

vdrfan commented Nov 25, 2022

I have a similar problem (buggy DXVA on some TV Live Streams).
But older Driver works (last working 20.12.1).
My Problem is - i cannot use old Driver becouse of a HDR Bug in old Driver.

I spend the whole day with testing Adrenalin Drivers to find working Drivers.

i can test 3200G, 3400G, 5600G with two different Mainboards, and all of them having the same problem.

here are my result:
testfiles: https://drive.google.com/file/d/1WBjMTsYIGX2S32s91UME7HA_8o1KuutM/view?usp=sharing

tested with MPC-BE
Renderer doesn't matter - (EVR/MADVR/MPCVR).
Decoder: MPC Decoder - DX11 Hardware Decode
info: VLC has same problem.

tested working Drivers: 19.9.2, 20.12.1 (and maybe all between of them)

tested buggy Drivers:
21.2.3, 21.4.1, 21.5.2, 21.6.1, 21.8.2, 21.9.1, 21.10.2, 21.10.3, 21.11.1, 21.12.1,
22.1.1, 22.1.2, 22.2.1, 22.2.2, 22.2.3, 22.3.1, 22.3.2,
22.4.1, 22.4.2, 22.5.1, 22.5.2, 22.6.1, 22.7.1, 22.8.1,
22.10.2, 22.10.3, 22.11.1

i did not find a working driver starting from 21.2.3
some of them(21.2.3, 21.4.1, 21.5.2) are starting playing without problems, and get buggy when skipping.

@Clemens12345
Copy link

Same issue here with 6700 xt. Reported it also to AMD via their tool, is probably more an issue of AMD (hw or driver) then of LAV.
Will maybe do a test with my R7 7700x as well, but probably need to remove my GPU for that as I can not select the other device in the menu.
https://www.dropbox.com/s/3xen8e8axfmf7py/01-07_16-33-14_VTM%204_Top%20Gear%20-%20S30%20E03.%20Freddie%20Flintoff%2C%20Chris%20Harris%20en%20Paddy%20M.ts?dl=0

@kasper93
Copy link
Contributor

kasper93 commented Jan 11, 2023

Could you try reporting it here? https://github.com/GPUOpen-LibrariesAndSDKs/AMF it has higher chance going to correct people.

And indeed I've seen it too where interlaced files are completely unplayable. It is probably regression in driver, because it used to work.

@TomArrow
Copy link

Was just googling AMD DXVA video playback stuttering and landed here. Just thought I'd add - for moral support - I also get video playback stuttering with DXVA in MPC-HC. Not sure if this is LAV related (dunno if MPC-HC uses LAV), but I definitely think this is an AMD issue. Was a problem on a few months old drivers as well as current drivers. Specifically for me it tends to happen when I try to playback a video at slower or faster speed. It stutters really badly for a while but eventually it "settles" and plays back decently, which is really strange. And when I go back to normal speed the stuttering is back for a while until it resolves.

@vdrfan
Copy link

vdrfan commented Jan 16, 2023

it has nothing to do with LAV, VLC has same problem.
there are working AMD drivers 19.9.2 and 20.12.1.
my observation: playback is like slow motion - and error does not recover.

@clsid2
Copy link
Contributor

clsid2 commented Jan 16, 2023

Use a GPU monitoring tool to check if maybe it gets stuck in a low clockspeed or low memory speed state. Maybe it is downclocking too aggressively.

@vdrfan
Copy link

vdrfan commented Jan 16, 2023

i checkd GPU in taskmanager, nothing special found.
this bug cannot be from downclocking - movie plays with 1 frame per second.
there are working drivers - it must be a driver issue.
i filmed it. https://drive.google.com/file/d/1sgcMGeGMLNe74OtB7unfZ9-dupT49ORd/view

@clsid2
Copy link
Contributor

clsid2 commented Jan 16, 2023

It is obvious that it is a driver bug. The driver controls the power states.
Task manager is crap. Use something like GPU-Z.

@vdrfan
Copy link

vdrfan commented Jan 16, 2023

it will bring us nothing further (if power states causes problem).
i already know that this is a driver problem.
i will test it tomorrow with GPU-Z.

@TomArrow
Copy link

Is 20.12.1 the last version people know about that still worked fine?

@vdrfan
Copy link

vdrfan commented Jan 22, 2023

Yes. but 20.12.1 driver has a HDR Bug.
Aleksoid1978/VideoRenderer#71
how can we tell AMD to fix it.

@Clemens12345
Copy link

Clemens12345 commented Feb 15, 2023

Not solved with 23.2.1 on 6700 xt. :(

@vdrfan
Copy link

vdrfan commented Mar 11, 2023

Same issue here with: Asus Vivobook Pro 16X OLED M7600QE (Ryzen 5800H).
I think all IGPUs from AMD have this problem (i can only test VEGA)
Is there any Graphics from AMD without that issue, maybe RDNA is ok?

@kasper93
Copy link
Contributor

kasper93 commented Mar 28, 2023

testfiles: https://drive.google.com/file/d/1WBjMTsYIGX2S32s91UME7HA_8o1KuutM/view?usp=sharing

Those samples works correctly with Microsoft DTV-DVD Video Decoder. Can do over 400 fps on my GPU, while LAV/ffmpeg goes up to 40, which results in not smooth playback on this 50fps file.

Driver issue is only with interlaced samples, progressive ones seem to work correctly in non ffmpeg based decoders.

@vdrfan
Copy link

vdrfan commented Mar 28, 2023

@kasper93, my samples are progressiv.
and it has nothing todo with Video Decoder (every Video Decoder has the same problem when you usw HW Decoding).
if you have Veag Graphics - can you test with this file: https://drive.google.com/file/d/1WBjMTsYIGX2S32s91UME7HA_8o1KuutM/view

@kasper93
Copy link
Contributor

kasper93 commented Mar 28, 2023

@vdrfan: Maybe there are some preconditions to make it not work. But like I said for me the 720p ERROR.ts file works ok with Microsoft's decoder. While interlaced samples reliably doesn't work on anything.

The point I'm making here is that while there may be a driver issue, at least progressive samples can be fixed in userspace. And there is definitely difference between decoders at least for this specific file.

@vdrfan
Copy link

vdrfan commented Mar 29, 2023

@kasper93, my mistake. i thought you have testet with your own files.
with Microsoft DTV-DVD Video Decoder, the testfiles are working.
ffmpeg based decoders(LAV, MPC ...) have the problem with Vega Graphics?
can we tell that ffmpeg devs to fix it.

funny: Microsoft DTV-DVD Video Decoder thinks it is interlaced: dwInterlaceFlags: 0x00000081(AMINTERLACE_IsInterlaced and AMINTERLACE_DisplayModeBobOrWeave), but it is is progressiv.

@vdrfan
Copy link

vdrfan commented Apr 3, 2023

@kasper93,
interlaced Videos are working with ffmpeg based decoders, but not with Microsoft DTV-DVD Video Decoder
progressiv video exactly reversed (not working with ffmpeg, working with Microsoft DTV).
frustrating.
interlaced Sample: https://drive.google.com/file/d/1-Ih1p8sUhPEvwKft6pba-Dxn7Ckuan1a/view?usp=sharing
progressiv Sample: https://drive.google.com/file/d/1WBjMTsYIGX2S32s91UME7HA_8o1KuutM/view?usp=share_link

@Clemens12345
Copy link

Clemens12345 commented Aug 27, 2023

Just installed latest 23.8.1 driver on my Windows PC with 6700xt.
When selecting DXVA2, SW decoding seems to be used.
When selecting D3D11, HW decoding seems to be used and the problem seems to be solved.
Can some one confirm this?

EDIT when using EVR custom renderer instead of MPC video renderer, DXVA2 works, and also there problem seems to be solved.
Will maybe check Linux as well somewhere coming days as I had the problem there as well.

EDIT2 have the issue still sometimes, but issue seems to recover after 1-2 seconds.

@Clemens12345
Copy link

Can be just an impression, looks even better with drivers 23.9.1.
Confirmation of someone else would be nice (and then this issue can be closed here).
Linux I might test next weekend / next week.

@kasper93
Copy link
Contributor

kasper93 commented Sep 7, 2023

I can still reproduce the issue on 23.9.1. Not with all samples, but try Sample2_#2750.zip it is really bad.

It looks like it gives frames out of order from the decoder, with a little bit of seeking you can sometimes fix it, but it general it breaks.

@Clemens12345
Copy link

Clemens12345 commented Sep 8, 2023

@kasper93 I tried that sample, have it the first 2 seconds or so but then it recovers and is fine ( I guess it recovers at the second iframe or so, would need to check when exactly those are)
Which card? Here 6700 xt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants