Sunday, December 11, 2022

Ubuntu 22.04 Stuttering Video Chrome/Firefox/Totem

I was having trouble with YouTube videos stuttering.  They were NOT dropping frames, but about every 5 seconds they would freezing for 1/2 a second, then playing normally for another 5 seconds, then stutter again.  This was not affecting audio, just the video.  In addition I noticed that this was occurring in FirefoxChrome, and local videos played with Ubuntu's Totem video player. All were having the same stuttering video issue.

I tried several internet suggestions, from turning off hardware decoding support to turning off all browse extensions, nothing worked.  I then remembered that GNOME DESKTOP also had Extensions and that I had recently added one, Clipboard Indicator by Tudmotu.  I went to my Gnome Extensions and disabled Clipboard Indicator and like magic all the stuttering disappeared.  

I like having the ability to add Extension but Gnome Desktop has a very poor track record of supporting Extensions consistently from version to version.  Without exception most Gnome Desktop Extensions require some kind of update every time Gnome updates the Desktop.  

So if you're having weird, hard to figure out problems, and you've recently added any Gnome Desktop Extensions or Gnome has update Desktop, then you should disable your Extensions and see if the problems goes away.  If it does, just turn your Extensions back on, one at a time, until you find the one causing the problem.  

UPDATE:  I noticed that I was still having a stutter just not as pronounced (maybe a tenth of a second) I check to see which Nvidia Driver I was using and saw that it was Nvidia Propriety Version 510. I noticed that Version 515 and 525 were in my list of choices (as of 12-12-2022).  I went with the newest 525 driver and it seems to have fixed it.  I re-enabled Clipboard Indicator by Tudmotu and no issues. 


UPDATE #2:  12-26-2022.  I'm still getting stuttering during all video playback but only after letting the my system run for a few hours.  After a reset or restart video plays just fine for a few hours, then starts the stuttering again.  Maybe some kind of memory leaking program? Not sure now.


UPDATE #3:  1-2-2023.  I noticed that Gnome Shell was using 10GB of memory, so yes it's a memory leak and it's Gnome Shell. You can reset your computer daily or you can use ALT - F2, then type "r" and hit ENTER, which will restart Gnome Shell, which is quicker than a full computer reset.  This problem could still being caused by an Extension for Gnome Desktop but I've turned them all off with no effect on the issue.  Another solution I found was that you can use Wayland instead of X11/xorg. (Change on your login screen). I'm not sure Wayland is ready for daily use yet so I guess I'll be using the ALT-F2  r  ENTER workaround for now.  

If you want you can run this command in a Terminal window or created a Bash Script with this command in it, which also resets Gnome Shell;

killall -3 gnome-shell

UPDATE #4:  1-5-2023.  I've turned off all extension and the memory leak slows but doesn't stop.  I've made a Bash Script that executes the "killall -3 gnome-shell" command and created a desktop shortcut to it.  Now if I notice the stuttering I just click on the desktop shortcut and Gnome Shell restarts.  When It restarts it shows about 270 mb in System Monitor.  After about 12 hours of up-time it gets up to over a one Gb.  With all the Extension disabled it show about 185 mb and creeps up to 700 mb in 12 hours.     

Just after resetting Gnome Shell