Video playback problems (Intel UHD 750)
I've got a PC with Intel 11500 CPU which works nicely with Windows, but some strange things happen when I try to watch videos with it in Linux. The Linux Desktop works fine, and I've updated Ubuntu. But Videos get stuck, even small and low quality videos with 360p, even in a relatively small window.
It's using the onboard graphics UHD 750, connected via Displayport to one 4k Monitor from LG. What I noticed was, when I first tried to install Linux Mint, the text mode screen for booting Linux had one second input lag. The same happened when I installed Ubuntu.
And Mint couldn't set scaling to 200%, it showed an error when I hit the apply button. Ubuntu 20.04.2.0 LTS does 200% without any problem. Mint showed my display as 88 Hz display. In Ubuntu xrandr tells me the same, 4k resolution with 88 Hz, which looks odd to me. Vsynctester.com jitters a lot, but overall the picture keeps moving there, so my PC is not completely freezing or something like that, I think.
Mp4 and ogv videos from my SSD are played very sluggish (5 to 20 fps maybe) by the Ubuntu Videos application, same with Firefox when I give it a local video file. I tried ffplay which worked really good (40 fps?) in a small window, it never got stuck, but there was no sound output. Youtube in Firefox works as bad as playing video files in 'Videos'. Twitch in Firefox plays streams with fewer problems, but it one time it got stuck too.
In any case, at some point video playing often will halt all together, and then each time I seek into a different playback position it will play another few frames, getting slower each frame until it is stuck. Restarting the PC makes it work again.
What kind of speeds video playback up is when I make the window as small as 1000x1000 pixels. Using HDMI seems to make no difference.
I've tried SMPlayer, it gets stuck too. VLC works, but there is no sound.
I've struggled with the problem 'sluggish video playback in firefox and other browsers' for a few days now and literally tried every possible fix.
But now i have found a real solution and wanted to share it.
My system: Linux Mint 18.3 Intel Core i5-8100 (3.6 Ghz) NVIDIA GTX1050Ti
The reason for these problems is the CPU power-management feature of the linux kernel, which uses the 'intel_pstate' driver by default for frequency scaling. Actually, the default behaviour of that driver is a bit conservative. That is, it saves a lot of power.
Monitoring the CPU frequencies, i observed that most of the time all 4 CPU core frequencies get agressively scaled down until 800 Mhz are reached. As a result, every random amounts of seconds the next 'stuck' or interrupt of the video playback happened.
For me, the solution was to add 'intel_pstate=disable' to the kernel boot options (/etc/default/grub). This leads to the usage of the 'acpi-cpufreq' driver instead. This finally resolves all the strange behaviours in my case.
Further clarification of the issue:
https://silvae86.github.io/2020/06/13/switching-to-acpi-power/
https://www.phoronix.com/scan.php?page=article&item=intel_pstate_linux315&num=1