-
Notifications
You must be signed in to change notification settings - Fork 3k
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
AMD vdpau hwdec + opengl-hq corrupted recent regression #2531
Comments
Of course it doesn't make sense being a decoding issue I will get and pastebin -v output on good and bad soon(ish). |
If you can, try |
I went over the list of commits between the two you pointed out. There were no changes to vdpau. There were some heavy changes to the opengl renderer with the addition of prescalers (7438f20 4c43c30 27dc834) - they are not enabled by default, but the resulting shader chain could have changed. There also were heavy changes to display-sync mode, if you use that. |
Oh, and I take it you ran the two versions on the same hardware/driver combination. (I've got some reports of hwdec corruption on newer nvidia drivers, but they also happened with vlc for the user.) |
I am testing with the same s/w, which is I admit cutting edge, but then I can get a clear good and bad resetting mpv tree within mpv-build, so using same ffmpeg also. It seems that many combinations of the full opengl test above fail, so maybe there is something a bit deeper than just one feature. Been AFK so haven't had much time on that one yet. |
Had another go at bisecting getting h/w accel as I went along by applying/reversing - eb66038 is the first bad commit
|
When testing this I noticed that even on "goods" which show no corruption whether -fs or not, that if not fs and I grabbed the image with mouse so I could scroll around it there was a chance of some similar but less severe corruption which continued for a while then cleared. I couldn't reproduce with s/w dec and this is reproducable with the ./use-*-release build of mpv that I have installed. This one I can produce with release --vo=opengl (in fact it has a chance of being worse with opengl than it is opengl-hq). |
You can avoid this by forcing the GLX backend with
This seems impossible or a coincidence. It just adjusts the opengl-hq presets slightly. I couldn't reproduce any of this. I tried a 3840x2160 h264 clip on 340.93 on a GTX 750. |
Which btw. suggests that it's a problem with the AMD driver, rather than any change in mpv. |
I agree it's probably some strange driver/timing/luck issue, which sometime I may hunt for - it's just not something I've tested/noticed before so will be bugger to find - that's if it ever worked. FWIW I am back on head now with eb66038 reverted and it's good - still not saying this is an mpv issue. |
Yes, it sounds like something of a timing/synchronization issue. As far as the technical details go, we simply maintain a single VdpOutputSurface, which is associated with an OpenGL texture via glVDPAURegisterOutputSurfaceNV. Then, each frame we call glVDPAUUnmapSurfacesNV, render the current vdpau video surface on the output surface, and map it as OpenGL texture glVDPAUMapSurfacesNV. Then it's used for rendering. |
Ok, thanks for the info. |
Also, I assume you get none such problems with |
Ahh --vo=vdpau that is a different story which I didn't want to pollute this bug with. In summary I don't know because the main sample I've been testing with is nowhere near playable at full speed as my GPU doesn't have proper/working power management yet. It is also not playable with CPU. It seems that --vo-vdpau doesn't honor --framedrop=no and there are so many drops it's just stuck at the start with hwdec. With s/w dec it does get further but still gets stuck after a while. I recently worked out how to get vaapi to work on my h/w and --hwdec=vaapi --vo=vaapi does honor framedrop=no and does not have the issue. I did test the original issue with a lower bit/frame rate sample not made by me - and it existed, so I don't think it's my file, but I didn't test that one with --vo=vdpau. I can try later - in the middle of compiling a new llvm currently which would not be an ideal time to test something I can hopefully play at full speed. |
Yes, vo_vdpau implements its own framedrop for whatever reasons. It can be disabled with |
Also, does that mean Mesa/Radeon have vaapi support too now? |
-vo=vdpau:fps=-1 renders OK. Before I saw that post I was messing with --speed=0.2 and I notice that with --vo=opengl-hq replacing --framedrop=no with speed=0.2 also renders OK. vaapi does work for me on radeonsi, though I don't really know that OSS users are meant to use it. AMD devs did it - possibly as they are moving towards their closed driver working with open kernel/wharever bits. That may be totally wrong, but it doesn't just work for me. It could be because I build my own stuff/don't know how I suppose, but when I installed libvaapi it would look for /usr/lib/dri/radeonsi_drv_video.so which doesn't exist. After installing libvaapi mesa does notice and starts building gallium_drv_video.so. If I make a symlink to that called radeonsi_drv_video.so I have working vaapi. It doesn't work with mpv --vo=opengl before or after your egl changes. mpv plays as if OK but I just see a still frame of black or junk/old buffer contents. |
LIBVA_DRIVER_NAME=gallium works for r600g and maybe nouveau as well. |
Since updating from 0.10 to 0.13 I noticed this bug when running libmpv under linux when having -fsanitize=address enabled: Is this related to this bug? If not I'll create a new issue.
|
Probably not related. Please open a new issue. Redoing the run with debug infos would also be helpful. (I can try doing the same on nvidia drivers, but not today.) |
Not yet for nouveau, but there are patches on the mesa mailing list. Right now radeonsi and r600 work. |
@ LateAdopter Thanks, should have thought of using env. I played more with this with older mesa - still exists. Also what I said above about vdpau and vaapi --vo being OK is not correct. They are OK for normal use, but playing 2160p unscaled on 1080p monitor, then grabbing the image and repeatedly moving as fast as possible, will eventually produce similar, though short lived corruption. I can reproduce this specific test using mplayer. It only happens with hwdec, all --vo with swdec are OK. As already noted this seems to be related to not being fast enough. It is just about possible for me using experimental (=with issues) powerplay kernel on my uvd v5 card to play >200mbit 2160p60 x264 with opengl-hq and with cpu/gpu clocks forced high there is no corruption. Since other radeonsi/r600 cards have working power management and UVD < v5.0 is limited to 1080p I doubt they would see this even if it's there for them (I guess someone could force clocks to low to test). |
Could be a race condition, or some sort of buffer starvation. (But I have no clue how the driver works.) |
This is going to be a bit of a crap report as I can't (easily) bisect.
First thanks for fixing vdpau gl interop for amd I see that was fun for you :-)
Somewhere between that breaking =
375886c
vo_opengl: probe for EGL by default
and that being fixed =
6b22b21
vo_opengl: attempt to improve GLX vs. EGL backend detection
There is regression using -
mpv --hwdec=vdpau --vo=opengl-hq 2160p60-h264.mkv
I tried bisecting by making patches from both above but they don't apply far enough into the bisect.
The corruption looks like a decoding issue = (guess) key frame OK -> gets more trashed then OK again -> repeat. Though there are factors that go against this = there are less "back to good" events than I think there are keyframes - maybe it could be that some key frames are missed - this is just guesswork.
doesn't happen with s/w dec
doesn't happen with -hwdec=vdpau --vo=opengl
doesn't happen with 1080p60
Happens whether I use -fs and get downscaled (1080p monitor) ot without and see unscaled portion in window.
I am (sort of) too slow to play this content --framedrop=no makes no difference to issue and is what I normally use (I am testing my h/w).
The text was updated successfully, but these errors were encountered: