Solved firefox: lag video playback

Hi, I'm running FreeBSD 13.0 with NVidia drivers on a GTX 980.
When I watch a video on youtube, the video lags. If I try on chromium, its much less lag.
Strangely if I run the glxgears program next to the video on firefox and chromium the lags disappear.

I also tested firefox on a laptop with NVIDIA drivers, same problem.

With the glxgears program launched the videos are more fluid but after 10-15 minutes, there is a big drop in fps then it becomes fluid again.
Does anyone have an NVIDIA card with the same problem?

thank you.
 
Last edited:
Strange.

Which version of FreeBSD, exactly?

freebsd-version -kru ; uname -aKU

Any better with FreeBSD 13.1-RELEASE?

Packages from latest or quarterly?

pkg -vv | grep -e url -e enabled

I don't see lag with YouTube in Firefox.

Code:
% pkg info -x firefox
firefox-100.0.1,2
% pkg -vv | grep -e url -e enabled
    url             : "pkg+http://pkg0.pkt.freebsd.org/FreeBSD:14:amd64/latest",
    enabled         : yes,
    url             : "https://alpha.pkgbase.live/current/FreeBSD:14:amd64/latest",
    enabled         : no,
    url             : "file:///usr/local/poudriere/data/packages/main-default",
    enabled         : yes,
% uname -aKU
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #11 main-n255588-01235012e5b-dirty: Thu May 12 21:45:43 BST 2022     root@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 1400058 1400058
%
 
$ freebsd-version -kru ; uname -aKU

13.1-RELEASE
13.1-RELEASE
13.1-RELEASE
FreeBSD ryzen3950x 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC amd64 1301000 1301000

$ pkg info -x firefox

firefox-100.0.1,2
$ pkg -vv | grep -e url -e enabled

url : "pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly",
enabled : yes,

I have two monitors set to 120Hz with ForceCompositionPipeline=On, ForceFullCompositionPipeline=On.
Same problem with freebsd 13.1
 
Thank you very much for the tip, after modifying the value of kern.sched.steal_thresh the videos no longer lag.
The old value of kern.sched.steal_thresh was 2.
 
Ok. So I only know that fix because I had it for months until I found this message thread Ryzen microstutter , if you care to check that out.

I forgot that the fix should be 0 OR 1, mine worked on 1, so lucky yours was too.

The person that was trying to help diagnose the issue on that message suggested to run dtrace, which made the issue go away. Likely, according to them, because it added an extra load on the cpu. It seemed like your problem was similar because glxgears had a similar effect; and I have had this setting for the past 3 releases. So we will probably need it until there is a change.
 
Last edited:
Back
Top