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

AMD: Artifacts when playing HEVC videos with vaapi #10681

Closed
csantv opened this issue Sep 25, 2022 · 9 comments
Closed

AMD: Artifacts when playing HEVC videos with vaapi #10681

csantv opened this issue Sep 25, 2022 · 9 comments
Labels
down-upstream features and bugs that need to be implemented and fixed upstream os:linux

Comments

@csantv
Copy link

csantv commented Sep 25, 2022

Important Information

Provide following Information:

  • mpv version: mpv 0.34.0-468-gba81e4ed88
  • Linux Distribution and Version: Archlinux rolling (kernel 5.19.10)
  • Source of the mpv binary: mpv-git aur
  • If known which version of mpv introduced the problem: not known
  • Window Manager and version: i3 4.21
  • GPU driver and version: amdgpu/mesa 22.1.7
  • Possible screenshot or video of visual glitches

image

image

Reproduction steps

  1. enable vaapi
  2. play any (? hevc video

I'm not sure if the issue shows up with any hevc vid. Could it be the encode? All videos I've downloaded are HEVC-10bit encoded.

The issue doesn't appear with software decoding (i.e. mpv --no-config).

Expected behavior

No artifacts showed in hevc video

Actual behavior

Artifacts appear in the upper left hand corner of the screen, any content that touches it also gets artifacts.
H264 videos with vaapi enabled don't present artifacts.

Log file

https://0x0.st/oWVc.txt

Sample files

https://0x0.st/oWVA.mkv

Config file

vo=gpu
gpu-api=opengl
hwdec=vaapi
gpu-context=x11egl

ytdl-format="bestvideo[height<=?1080]+bestaudio/best"

# Image Quality
profile=gpu-hq
video-sync=display-resample
interpolation=yes

Vainfo

vainfo: VA-API version: 1.15 (libva 2.15.0)
vainfo: Driver version: Mesa Gallium driver 22.1.7 for AMD Radeon RX 6700 XT (navy_flounder, LLVM 14.0.6, DRM 3.47, 5.19.10-zen1-1-zen)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileJPEGBaseline           : VAEntrypointVLD
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc
@sfan5
Copy link
Member

sfan5 commented Sep 25, 2022

Can confirm, I first noticed this on 13th Sep. Might be a recent regression in Mesa or the kernel.
This happens on 10-bit and 8-bit videos.

vainfo: VA-API version: 1.15 (libva 2.15.0)
vainfo: Driver version: Mesa Gallium driver 22.1.7 for AMD Radeon RX 6500 XT (beige_goby, LLVM 14.0.6, DRM 3.47, 5.19.9-arch1-1)

[2022-08-28T23:05:45+0200] [ALPM] upgraded mesa (22.1.4-1 -> 22.1.7-1)
[2022-08-28T23:05:54+0200] [ALPM] upgraded lib32-mesa (22.1.4-1 -> 22.1.7-1)
[2022-08-28T23:05:57+0200] [ALPM] upgraded libva-mesa-driver (22.1.4-1 -> 22.1.7-1)
[2022-08-28T23:05:58+0200] [ALPM] upgraded linux (5.18.16.arch1-1 -> 5.19.4.arch1-1)
[2022-09-11T20:02:37+0200] [ALPM] upgraded linux (5.19.4.arch1-1 -> 5.19.7.arch1-1)
[2022-09-11T20:02:37+0200] [ALPM] upgraded linux-firmware (20220708.be7798e-1 -> 20220815.8413c63-1)

@sfan5 sfan5 changed the title Artifacts when playing HEVC videos with vaapi enabled AMD: Artifacts when playing HEVC videos with vaapi Sep 25, 2022
@csantv
Copy link
Author

csantv commented Sep 25, 2022

Just tested with vlc, the issue is present there as well. Upgrading to mesa-git also had no changes.
Perhaps mpv/vlc could work around this issue?

@sfan5
Copy link
Member

sfan5 commented Sep 25, 2022

I downgraded mesa to 22.1.4 and the kernel to 5.15.70-1-lts and the issue is still present. It's possible I didn't downgrade far enough, the broken commit was backported into the kernel or it's another library that has this bug entirely.

@philipl
Copy link
Member

philipl commented Sep 25, 2022

It's currently working fine on my Steam Deck:

libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Mesa Gallium driver 22.2.0 - kisak-mesa PPA for AMD Custom GPU 0405 (vangogh, LLVM 14.0.6, DRM 3.47, 5.19.5-051905-generic)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointEncSlice
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointEncSlice
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD
      VAProfileAV1Profile0            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc

I'd be very surprised if the kernel going from 5.19.5 to 5.19.10 is the issue. The main difference left appears to be libva. Try downgrading to 1.14?

@philipl
Copy link
Member

philipl commented Sep 25, 2022

Oh, I should also point out that I'm using Vulkan. If I try and play back with OpenGL, it's messed up in a different way. No visual artifacts as reported but it seems to show old frames and acts like it is stuttering. Some synchronisation problem.

edit: Yeah, OpenGL is a synchronisation diaster.

@sfan5
Copy link
Member

sfan5 commented Sep 25, 2022

I downgraded libva to 2.14.0-1 and libva-mesa-driver to 22.1.2-3 (wouldn't work otherwise) and the issue is still present.

@sfan5 sfan5 added down-upstream features and bugs that need to be implemented and fixed upstream and removed down-upstream:mesa labels Sep 25, 2022
@csantv
Copy link
Author

csantv commented Sep 26, 2022

I might have found the culprit. Removing xf86-video-amdgpu and letting xorg use the modesetting driver removes the artifacts. Now, xf86-video-amdgpu has not been updated for 7 months so perhaps something changed in mesa and amd has not fixed their drivers.

@nyanmisaka
Copy link

nyanmisaka commented Sep 27, 2022

This is an amdgpu firmware regression.

https://gitlab.freedesktop.org/mesa/mesa/-/issues/7190
https://gitlab.freedesktop.org/drm/amd/-/issues/2139

@csantv
Copy link
Author

csantv commented Sep 27, 2022

lmao, it was not a change to modesetting but an upgrade to linux-firmware. Oh well, since this is fixed with the new linux-firmware then this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
down-upstream features and bugs that need to be implemented and fixed upstream os:linux
Projects
None yet
Development

No branches or pull requests

4 participants