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
4k Video Frame Drops (video stuttering) #8981
Comments
It sounds like you need to enable hardware decoding. Press ctrl+h to test it. |
It is the same with and without hardware decoding. |
Intel iGPUs cannot do much post processing on 4K content at 4K size. You need to run vo=gpu in dumb mode and you will have no luck going above 24fps even then. You need a real GPU to do 4k60. |
This does not really make sense to me.
So I guess, the GPU is not at its limit when decoding the video, right? What do you mean by dumb mode? |
More information: There are 4k Videos which are being rendered without any problem, for example: And then some are problematic, e.g.: |
Oh and I am pretty sure it used to work some months ago. I have never had problems and I think an i7-10875H CPU/GPU should be capable of bringing 4k to the screen. |
Have you tried xorg? Does it perform better/worse/same for you? |
same/similar issues with i3/xorg |
try |
Yeah, the sample identified as 'problematic' is an HDR clip and the one that's fine is not. So basically, the hdr post-processing is too intensive. Maybe basic HDR10 with a single peak value for the whole file would be fine. |
I do have issues with non-HDR videos as well. The two I posted were only examples.
Is there any explanation why VLC is so much more performant/efficient than mpv? |
You really need to post a log (when the issue happens) like the issue template requires. Otherwise, everyone is just shooting in the dark. |
I was so sure I did that already. So sorry. Here it comes! :)
|
I have the same problem with a 4K TV channel on my MBP 2018 and my iOS app (the other "well-know" app play it without problem) CPU usage: 290% and frames drop I will put full logs + sample video if you need it, waiting to see if logs provided by @mindrunner are enough Edit: On my mac, adding |
@mindrunner I think you're gonna have to give more information on your hardware and software set up. I'm on a kaby lake i7-7500U with an intel HD620 GPU and it chews through those videos on dumb mode just fine. This is nowhere near cutting edge in hardware performance so I would expect anything newer than this (~2017-2018) to work just as well. The "problematic" video mentioned above has 0 performance issues despite being nearly 70 Mbps HEVC 10bit and scaled from 4k to 1080p. Here's some statistics from doing You can see that it is barely going over 4 ms/frame, which is extremely good. Likewise, the other video where you have 0 performance issues works just as well for me. So, what GPU are you using, what CPU are you using? What kernel version (assuming arch, mainline or lts?), what mesa version, what vaapi driver, what openGL driver, etc. |
Yeah, I am pretty sure it used to work on this computer w/o any problems. Computer: Dell Precision p5750 (Very similar to the current XPS 17) mesa: extra/mesa 21.1.4-1 I am usually on all latest versions of packages. Updating the system quite frequently. |
Your openGL driver is most likely iris, which is mesa's openGL driver for intel GPUs. And your GPU is better than mine (though probably not significantly better) so those videos should be no issue for you to play. Can you get a screenshot of page 2 on stats.lua? You can use EDIT:
Any approximate version? |
As I am. Thanks for jumping in btw. This is bugging me for a while now.
I remember playing around with that in the past because of some other bug. How can I check I am on default setting and make sure I am using some weird config somewhere which slows everything down This is kind of confirming what I see in
|
I guess that was this workaround: https://wiki.archlinux.org/title/Intel_graphics#Old_OpenGL_Driver_(i965) Also making clear that I do not have Guc/Huc active (https://wiki.archlinux.org/title/Intel_graphics#Enable_GuC_/_HuC_firmware_loading). Not sure if that matters here. |
Very interesting, it looks like something is bugging out for HDR. You can see the peak frame times of 66 ms there, but average is <1 ms. So I imagine this is some sort of driver issue? Can you try |
I think vulkan is not supported on
|
mpv renders through mesa directly, so your window manager or even wayland vs. x11 makes no difference. You probably need to install Sidenote: that crash is interesting, but not at all related to this issue. |
Cool, learned something. installed vulkan-intel, still crashing.
|
Also a separate issue, potentially even from the one above. So ignoring that for now my best guess is a problem with mpv's shaders or a shader bug in mesa. If this is consistent for videos with HDR then that would certainly narrow it down. The Japan video did not have HDR so that explains why it works well. Someone like @haasn might know more. You can report either of those crashes as separate issues btw, though usually they're most helpful with debug symbols, which requires recompiling mpv, and, if you're unlucky, potentially libplacebo and mesa. |
Is there an easy way to see whether a video has HDR or not?
I guess there is some getting started stuff in mpv repo, huh? I might give it a whirl |
You can use |
Cool, that helps. I have a bunch of Videos with that issue. Checked on one of those. Has HDR enabled as well. Looks like we are on the right track :) |
Tried the verbose thing. Maybe the coredump comes from a turned off NVidia card using Just a wild guess, tho
|
You'd need to provide a backtrace with debug symbols to see exactly where it's crashing. Again though, this is almost certainly a separate issue than your playback stuttering. |
Well, the computer reproducing the issue is my daily driver and very important to be reliable. Downgrading mesa on arch sounds like a very bad idea actually. I might try some time, but that is definitely nothing I can do quickly I guess. Unfortunately, I have no other box to reproduce that issue and a VM is not an option here.
Interesting, will try that out and confirm if I see same behavior. |
So did it? |
I just installed linux-lts and booted from it on my machine. I commented
I need to run a newer kernel though as oled brightness control is not baked into the lts version. |
If you guys can confirm that an older linux kernel works but a newer one does not, then that is by definition a kernel bug, and you should report it to the intel kernel driver bug tracker. You should first check to make sure this issue isn't already reported, since I didn't. If this is a new issue, I would be very specific about reporting it, making sure to note:
You're most likely going to be asked to bisect, but if it's this trivial to reproduce then the bisection should be relatively clean. You can bisect only certain paths, so you can just append |
Thank you for the pointers. |
I can report that moving to linux-lts on arch entirely resolved the issue and I can watch 4k HDR with frame brightness measurement (as verified with "i" and "2" OSD) on an Intel i7-7500U flawlessly. |
Oops, on Arch (Thanks a bunch to @LaserEyess for the pointers and to @Hergeirs for reporting this upstream). |
Thx for the hint, so the Long Term Support Kernel lasted me exactly 12 days, haha! |
Interesting i have this same problem with the same hardware (XPS 7590) and have narrowed the kernels down where the problem started: Tried to bisect but the second bisect (first one is good) allways throws an error
Even when the flags are enabled it doest compile anymore. Probebly best if someone else with more compile and git knowledge looks into it |
Arch wiki lists some older Longterm kernels here: https://wiki.archlinux.org/title/kernel |
You don't need to re-compile your kernel to work around this, just do
This is the most important piece of information in this thread. This is a kernel bug introduced in 5.12. Please move all of this conversation to the intel bug report. As you can see there there's a reply from someone requesting more information. Everything said here needs to be repeated there since this is very clearly not an mpv bug and instead an intel bug. |
I noticed from the first dmesg log that you are manually setting quite a few kernel parameters, including several i915-related ones. The consequences can be seen by searching the text for "Setting dangerous option" or "tainting kernel", which might well put off kernel developers from looking into the problem. The i915 options are usually set to sane defaults by upstream, and force-setting some of them can cause problems/expose bugs. For the purposes of the bug report you ought to only set paramaters which are absolutely necessary to successfully boot your system. (As an aside, commands such as 'modinfo i915' and 'systool -v -m i915' can aid in troubleshooting, eg to see if disabling a default-enabled parameter cures a problem).
This might be related to and fixable via https://gitlab.com/cki-project/kernel-ark/-/merge_requests/843/diffs?commit_id=e187313e5f0086538fefe0925ef84480f99616d8 |
By the way, for those of you affected by this issue, can you test if |
Removed "hdr-compute-peak=no" in config, added vo=gpu-next , but does not resolve stutter. |
Hm, why closed? Why completed? What is the solution? |
The mpv solution is |
You're right. Now I remember. Thanks for heads up! And all patience!! :) |
I too experienced heavy frame drops watching a 2k HDR-Video, on a second run I tried a 1080p HDR Video where the same amount of frame drops seemed to happen. Another observation is colours being too strong, so everyone looks like having a sunburn. To cut a long story short: I have to bear the message about vaapi being inferior to vo=gpu, but I hope vaapi will be supported for longer since it gives me a satisfying video-experience. |
Might be another issue and not directly related. Can you provide an example video, so I can test it on my box. Also, we should really consider moving that to linux/intel bugtracker to not create so much noise here. |
I tried to upload a sample, hope this will do to show the issues.
The question remaining for me is: |
The Video heavily stutters on my computer. It actually renders my whole Desktop unusable (mouse cursor gets very laggy). Cannot confirm the color issue, tho. hw: If I try with
|
@mindrunner That is a specific issue with libva not supporting DRI3, which is required for xwayland, not really related but see intel/libva#536. This was "fixed" by downgrading it from a crash to an error. Until libva supports DRI3, it won't work.
Emphasis mine. Please open another issue. Also keep in mind that HDR is a performance feature, it has no hardware acceleration on linux or vaapi, so it requires a decent GPU. If you have a potato machine, you simply will not be able to play it back properly. You can mitigate performance impacts by turning down settings but at some point your GPU is just not powerful enough and you have to accept that. |
I consider opening another issue. I don't use HDR videos regularly, but as far as I see, all HDR videos show the same behaviour. If mpv did not insist on suggesting to not use vo vaapi at all, I would have thought it to be a performance problem. But if vo gpu is superior in any case to vo vaapi, then what is wrong? For the record: |
|
@LaserEyess |
Important Information
Provide following Information:
mpv --no-config --log-file=output.txt HDR10-LG-Cymatic-Jazz*
output.txt
mpv --no-config --hwdec=auto --log-file=output-hw.txt HDR10-LG-Cymatic-Jazz*
output-hw.txt
Reproduction steps
Playing a high quality Video results in heavy frame drops and messages like
Also, the mouse cursor movement seems not smooth anymore then.
This happens with 4k Videos x264/x265 and only if the mpv window is actually full screen on a 4k monitor. A screen with lower resolution or a smaller window gives a better experience. I noticed that
intel-gpu-top
shows 100% load onRender/3D
, but only about 30% onVideo
.I suspect that this is more an issue with the actual rendering on the screen and not the video decoding itself. However, it is unclear to me if that is an issue with mpv or sway/wayland, or even something else.
Other apps with mpv backend (e.g. plexmediaplayer) show the same behaviour.
VLC is able to play videos without any issues
The text was updated successfully, but these errors were encountered: