Web browser's (Firefox) video playback is laggy

Checking the Xorg logs, the modesetting driver is already loaded by default, as driver 0.

Sorry, but there’s dozens of esoteric tweaks like this suggested all over the forum. None of them work! And they all seem to ignore the fact that this is specific to Firefox. It’s not specific to Youtube, Xorg settings, HTML5 videoplayers in general, or the hardware specs. This is because with all those variables being the same, for most people Brave performs without any issues at all (that means not just a little bit better).

So personally I think it’s in Firefox settings where we should look for a solution.

I don’t think you could tweak poor memory and cpu handling of firefox in settings.
When I open TrueNAS web interface in firefox in qube with 8gb ram and 4 vCPUs it uses 70-80% of it right away.

I’ve done a test in the Whonix Workstation template.

The Torbrowser build, which ships with WW, also plays videos fine. On the other hand, standard Firefox installed in WW, has the kind of performance issues that people usually complain about.

This is a pretty important finding. It shows that the issue is specific just to the standard (debian?) build of Firefox. In other words, it shows that it’s possible to have a Firefox build without those issues.

Any suggestions for where to go from here?

Could someone please check if they can reproduce the issue in a Fedora template, with standard Firefox installed from their package manager? I don’t have that template installed.

It would need standarized test, it’s personal fealings otherwise.

Like 2 vCPU, memory balancing 1->2 gb, and particular web test that returns numbers.
Is there web playback test somwhere?

As a preliminary test, maybe just check if frames per second drop in the single digits and if CPU usage jumps 10x.

Where you see frame per seconds drop in YT? There is total frames droped in nerd statistics only.

It’s just an approximate counting of how many times per second the image is changing.

with 60fps YT? Are you serious?

Actual video playback gets as bad as ~5 fps; either way, in the single digits.

No, it’s not.
If you have 5 fps windowed or fullscreen then you have something really wrong with system.
Playback might be little choppy but not 5 fps. It’s might be more like 10-20 fps with some frame drops every 2-3 seconds but not 5 fps.
I’ve had this in fullscreen with i915 driver on Iris Xe gfx on i5-1245U

PS: don’t use whonix or debian at all

Telling people their problem doesn’t exist isn’t very productive.

Not sure why you suggest to avoid the debian template, but it obviously ignores the fact that video playback works fine in debian, in either brave or the torbrowser build.

Because 5fps is ridiculus.
If it’s only under FF and other browsers works normal then it’s some other problems, not simple performance settings.

So, maybe it’s debian ff build that’s buggy?

I’ve made test under fedora dispvm (4 vCPU, 4GB ram) with ungoogled chromium and firefox on a site:
https://ytlr-cert.appspot.com/2019/main.html?test_type=playbackperf-test

30fps test is irrelevant to me as it just works and passes but 60fps are interesting:

default small window playback:

chromium - VP9_1080p60 = 385 frames drop
chromium - H264_1080p60 = 379 frames drop
ff - VP9_1080p60 = 12 frames drop
ff - H264_1080p60 = 9 frames drop

It seems that in a small windows playback Firefox is a winner

Now in full window widnowed playback:

chromium - VP9_1080p60 = 379 frames drop
chromium - H264_1080p60 = 407 frames drop
ff - VP9_1080p60 = 549 frames drop
ff - H264_1080p60 = 549 frames drop

This is significant performance drop for Firefox compared to chromium.

And then full screen playback:

chromium - VP9_1080p60 = 408 frames drop
chromium - H264_1080p60 = 567 frames drop
ff - VP9_1080p60 = 562 frames drop
ff - H264_1080p60 = 592 frames drop

It also shows performance drop for Firefox.

As for 5fps experience with FF and whonix - test it under normal debian. Maybe FF have some trouble with streams over tor? or broadly trouble with tor?