mpv icon indicating copy to clipboard operation
mpv copied to clipboard

Severe corruption/artifacting with opengl + gpu-next

Open awused opened this issue 2 years ago • 31 comments

Important Information

mpv --version: mpv 0.35.1 Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects built on UNKNOWN FFmpeg library versions: libavutil 57.28.100 libavcodec 59.37.100 libavformat 59.27.100 libswscale 6.7.100 libavfilter 8.44.100 libswresample 4.7.100 FFmpeg version: 5.1.2

  • Fedora 37
  • Installed from the Fedora official repos
  • Hadn't tried gpu-next before, so can't say when it started
  • Window manager is i3 (version 4.22 (2023-01-02)), reproduces with and without a compositor
  • Nvidia proprietary drivers (525.89.02-1.fc37), this is on a 4090 in case that's relevant

Reproduction steps

mpv --no-config --vo=gpu-next --gpu-api=opengl

opengl works fine without gpu-next, and gpu-next works fine with vulkan.

Expected behavior

Normal playback.

Actual behavior

Severe artifacting and corruption, even for the gui overlay. Does not persist when the videos are paused. https://i.imgur.com/iUeEieh.png https://i.imgur.com/MFPkgSl.png

Log file

https://0x0.st/HoeZ.log

Sample files

Seems to reproduce on every video file I've tried regardless of codecs.

awused avatar Mar 26 '23 01:03 awused

Can't reproduce this locally. @philipl ?

haasn avatar Mar 27 '23 14:03 haasn

Yep, reproduces as stated. I'm sure it's nvidia specific.

philipl avatar Mar 27 '23 16:03 philipl

image

philipl avatar Mar 27 '23 16:03 philipl

Compare with: image

philipl avatar Mar 27 '23 16:03 philipl

It might be related, but I tried gpu-next with vulkan (and gpu-context x11vk) for a bit and ran into frequent hangs. Playback seems fine as long as I don't touch my mouse, but interacting with other windows or resizing mpv seems to result in hangs where even mpv -v -v gives me nothing and I have to kill it. Video playback never recovers but audio playback does. No compositor for these tests.

mpv --no-config --vo=gpu-next --gpu-api=vulkan --gpu-context=x11vk --vulkan-queue-count=8 seems to reproduce it more often. I had vulkan-queue-count=4 in my config and after experimentation, higher queue counts seem to lead to more frequent hangs. Just rapidly maximizing and minimizing the window should trigger it.

awused avatar Mar 28 '23 06:03 awused

Is it possible for you to somehow compile/test the libplacebo demo programs to see if they also exhibit similar issues? (In particular, plplay and colors)

haasn avatar Mar 28 '23 11:03 haasn

Yup, reproduces there too. Here is colors. image

philipl avatar Mar 28 '23 17:03 philipl

If even colors reproduces this issue them I'm slightly at a loss for words - that program does literally nothing other than clearing the framebuffer...

haasn avatar Mar 28 '23 17:03 haasn

For what it's worth, --no-config --vo=gpu-next --gpu-api=opengl seems to be the worst-case scenario. If I run my full opengl config with --vo=gpu-next I still get glitchy playback, but the artifacts aren't nearly as omnipresent. At first I believed it was just a corrupted or poorly encoded file.

awused avatar Mar 30 '23 06:03 awused

@awused can you try different cscale values?

input.conf:

ctrl+d cycle-values cscale bilinear spline36 lanczos ewa_lanczos ewa_lanczossharp mitchell oversample

i have similar artefacts only with bilinear and oversample as cscale value. But that could be a different bug.

monarc99 avatar Apr 01 '23 16:04 monarc99

I get the same artifacts with every one of those options except for ewa_lanczos and ewa_lanczossharp where they are significantly reduced but still present. Maybe if there are two different sources of artifacts those two options remove one of them. With --no-config --vo=gpu-next --gpu-api=opengl --cscale=ewa_lanczos:

04-01_11-59-06

awused avatar Apr 01 '23 19:04 awused

I believe I just got this same issue. For me it seems like that large resolution files, created from the same source file by scaling with ffmpeg do not artifact. The smaller resolution of the file, the more it artifacts. Also, if you increase the display resolution of an artifacting video, the image improves but there's always artifacting at the very bottom. Pausing the video clears any artifacting immediately. vo=gpu has no such issues and everything works fine.

As previously mentioned gpu-api=vulkan doesn't seem to artifact.

According to my pacman.log, I upgraded mpv from 35.1-4 to 35.1-6 around a month ago, but I only now noticed the issue so I suspect it is quite recent. I upgraded the following nvidia drivers just few days ago, so that would be more likely the culprit. [ALPM] upgraded linux61-nvidia (530.41.03-10 -> 530.41.03-13)

System details Package versions: - mpv 0.35.1-dirty Copyright © 2000-2023 mpv/MPlayer/mplayer2 projects built on Fri Apr 21 07:11:25 2023 FFmpeg library versions: libavutil 58.2.100 libavcodec 60.3.100 libavformat 60.3.100 libswscale 7.1.100 libavfilter 9.3.100 libswresample 4.10.100 FFmpeg version: n6.0 - Operating System: Manjaro Linux KDE Plasma Version: 5.27.5 KDE Frameworks Version: 5.106.0 Qt Version: 5.15.9 Kernel Version: 5.15.114-2-MANJARO (64-bit) Graphics Platform: X11 Graphics Processor: NVIDIA GeForce GTX 1060 6GB/PCIe/SSE2 - Manjaro stable repo - Nvidia Driver 530.41.03

Screen recording of the artifacting. 400x400 video artifacting: https://0x0.st/HcLl.mp4 180x180 video, increasing the display size makes it better, making it smaller makes artifacting worse: https://0x0.st/HcLU.mp4 640x640 video, no artifacting. (Ignore different colormatrix value, happens even with bt709.) https://0x0.st/HcL0.mp4

Log file

https://0x0.st/HcLg.log

Sample files

400x400 video which does artifact with vo=gpu-next. https://0x0.st/HcLE.mp4

Jertzukka avatar Jun 10 '23 21:06 Jertzukka

Now testing on an RTX 3050, still can't reproduce this.

haasn avatar Jul 31 '23 20:07 haasn

I can reproduce this on my RTX 3050.

mpv --no-config av://lavfi:testsrc --vo=gpu-next --gpu-api=opengl

image mpv-sucks.log

Traneptora avatar Feb 14 '24 18:02 Traneptora

I no longer get artifacts on the 550 driver, can anyone else still reproduce them?

guidocella avatar Feb 28 '24 08:02 guidocella

I can reproduce this on 550. mpv --no-config av://lavfi:testsrc --vo=gpu-next --gpu-api=opengl --log-file=mpv-sucks.log image https://0x0.st/HRJl.log

Traneptora avatar Feb 29 '24 03:02 Traneptora

It's not as bad. But I can still see it too. Screenshot from 2024-03-01 09-19-14

philipl avatar Mar 01 '24 17:03 philipl