GNOME Bugzilla – Bug 746165
first minute plays slowly (maybe half the normal speed), looks laggy
Last modified: 2015-04-24 00:51:02 UTC
Only happens when my computer has been running for a few days, restarting my computer temporarily fixes the problem. Doesn't happen with other players (such as VLC and MPV). Doesn't matter if the cursor is at the beginning, middle or end, the first 30~60 seconds after opening totem will be slow. I must wait for the lag go away and then everything is just as normal.
Which version of totem are you using?
(In reply to Bastien Nocera from comment #1) > Which version of totem are you using? 3.14.2
Still happens in 3.16.0 on Fedora 22. For me it happens regardless of how long my computer has been up. Some more notes: - It happens every time I start Totem. - It seems GNOME Shell doesn't know that Totem has started: it keeps showing that spinner in the top bar next to "Videos", as if the application is still loading. - The lagginess stops as soon as the spinner disappears. - When I hit the Back button in Totem and start another video, there is no new period of lagginess, which suggests that it has to do with Totem's startup. - While lagging, the system monitor shows Totem as having 120% CPU usage and continuously increasing memory usage. When lagging stops, CPU drops to 50% and memory remains stable (though sometimes increases a bit).
I also experience slowness when scrolling through the video list. It might be related. Maybe it has something to do with the thumbnails it needs to create?
I get the same thing regarding CPU usage. Starts at ~110% and drops to ~30% after 30 seconds or so. Something interesting I've noticed (now that you mention thumbnails), is that the lag happens when I launch totem from nautilus (by clicking on a video, for example) but doesn't happen when I launch totem from the terminal. Hopefully that piece of information will help us find the problem.
All of this should have been fixed by those commits (which are in 3.14.2 and 3.16.0): commit 38b03784eede89df510b0092d77d86eb5c837f3a Author: Bastien Nocera <hadess@hadess.net> Date: Tue Nov 25 17:25:39 2014 +0100 main: Pause thumbnailing when playback starts commit b3785e01e7414111feec1dd245f360d2d9500ca4 Author: Bastien Nocera <hadess@hadess.net> Date: Tue Nov 25 17:24:06 2014 +0100 main: Add helper to pause thumbnailing in grilo widget commit 8bb0a36a6a09eb95464a622da589d472cda02fb8 Author: Bastien Nocera <hadess@hadess.net> Date: Tue Nov 25 17:05:55 2014 +0100 main: Make it possible to pause icon thumbnailing Using g_thread_pool_set_max_threads() with 0 max threads, to freeze further processing until we reset the max threads count. commit 605005d657b3df0847f9841871cdef3524b08cb5 Author: Bastien Nocera <hadess@hadess.net> Date: Tue Nov 25 16:42:41 2014 +0100 main: Cancel thumbnailing on destroy Stop thumbnailing when TotemGrilo object is destroyed. But the code to pause the thumbnailing will not stop currently processed thumbnails. So, if thumbnailing is indeed the problem: - how do you start playing back videos? launch totem and select one of the videos in the list? or launch it directly from a file manager (which should mean that populating the videos list isn't even started)? - how many items do you add to the playlist? - how many items (roughly) do you have in your videos list? How many of those aren't thumbnailed yet (roughly, again)? - are you using SSDs or spinning hard disks? (this could explain why some of the actions, which are blocking, take a long time to process, and could hog the cpu)
- how do you start playing back videos? launch totem and select one of the videos in the list? or launch it directly from a file manager (which should mean that populating the videos list isn't even started)? I've tried multiple ways. "totem" (in a terminal) and click on a video: laggy "totem file.mp4" (in a terminal): not laggy double click on a video in nautilus: laggy double click on a video in dolphin (kde's file manager): not laggy 'gdbus call --session --dest org.gnome.Totem --object-path /org/gnome/Totem --method org.freedesktop.Application.Activate "{}"' (in a terminal): laggy It seems that nautilus is launching totem with dbus activation, whereas dolphin is launching it normally (the equivalent of running "totem file.mp4" in a terminal). Could it be that dbus activation is somehow starting the thumbnail generation, which doesn't happen when you run "totem file.mp4"? - how many items do you add to the playlist? I don't use the playlist. - how many items (roughly) do you have in your videos list? How many of those aren't thumbnailed yet (roughly, again)? 1053 total, and about half of them are not thumbnailed (at least not in totem). - are you using SSDs or spinning hard disks? (this could explain why some of the actions, which are blocking, take a long time to process, and could hog the cpu) I have both, the totem executable is on a SSD and the videos are on a normal HDD.
(In reply to sam113101 from comment #7) <snip> > I've tried multiple ways. > "totem" (in a terminal) and click on a video: laggy > "totem file.mp4" (in a terminal): not laggy > double click on a video in nautilus: laggy > double click on a video in dolphin (kde's file manager): not laggy > 'gdbus call --session --dest org.gnome.Totem --object-path /org/gnome/Totem > --method org.freedesktop.Application.Activate "{}"' (in a terminal): laggy > > It seems that nautilus is launching totem with dbus activation, whereas > dolphin is launching it normally (the equivalent of running "totem file.mp4" > in a terminal). Could it be that dbus activation is somehow starting the > thumbnail generation, which doesn't happen when you run "totem file.mp4"? That looks like the most likely reason, yes. Will investigate that, thanks.
Before the fixes in bug 740995, launching from the command-line, would pause properly:
+ Trace 234993
And through D-Bus, the same as without the patch. So there's 2 problems here. One is that leaving the thumbnailers carry on working while we play the video kills performance, even though we're not actually doing that much, I've filed a separate bug about that: https://bugzilla.gnome.org/show_bug.cgi?id=748370 The second bug is that, after recent patches, both command-line and D-Bus startups will enable the thumbnailers before turning them off. We need to fix those as well.
Bugzilla mangled my comment. See https://bugzilla.gnome.org/page.cgi?id=traceparser/trace.html&trace_id=234993 for the full thing.
Let me know if you get any assertions when running totem. Thanks for following up on the bug, that was very helpful. The following fixes have been pushed: 295b6d0 main: Fix thumbnailing starting when launching with a video dd2b351 grilo: Add debug statements
Created attachment 302223 [details] [review] main: Fix thumbnailing starting when launching with a video We were previously relying on optionstate.filenames being non-NULL to avoid starting thumbnailing when the user opened the player with a video, but that actually caused doubly-adding those files passed on the command-line, and didn't work when the Open() GApplication method was used. Use a separate option to keep track of whether to start populating the grilo icon view and thumbnailing, so that thumbnailing doesn't hamper playback performance.
Created attachment 302224 [details] [review] grilo: Add debug statements
Created attachment 302225 [details] [review] main: Fix Videos icon not showing in volume control Forcefully set PulseAudio icon property. Seems that PulseAudio's client libraries aren't quite working things out in some cases. https://bugzilla.gnome.org/show_bug.cgi?id=745874
I don't get any assertions, but I get hundreds of error messages. For example: totem-video-thumbnailer couldn't open file 'file:///home/sam/Videos/tV%20shows/Regular%20Show%20Season%201-4%20Complete%20+%20Specials%20(BluRay%20-%20WEB-DL)%20%5BmR12%5D/Season%202/%5B2.15%5D%20Temp%20Check.mkv' (totem:12365): GnomeDesktop-WARNING **: Unable to create an input stream for file:///home/sam/Videos/tV%20shows/Regular%20Show%20Season%201-4%20Complete%20+%20Specials%20(BluRay%20-%20WEB-DL)%20%5BmR12%5D/Season%202/%5B2.23%5D%20A%20Bunch%20Of%20Baby%20Ducks.mkv: No such file or directory (it goes on and on) I renamed the "tv shows" folder a while ago, and I think that it has invalidated all of my thumbnails/videos, yet totem is still trying to load them. I think the best thing to do for totem would be to remove the videos from the list when it can't find them on the drive.
(In reply to sam113101 from comment #15) > I don't get any assertions, but I get hundreds of error messages. For > example: That's not an assertion, it's an error. An assertion would stop totem altogether. > totem-video-thumbnailer couldn't open file > 'file:///home/sam/Videos/tV%20shows/Regular%20Show%20Season%201- > 4%20Complete%20+%20Specials%20(BluRay%20-%20WEB-DL)%20%5BmR12%5D/Season%202/ > %5B2.15%5D%20Temp%20Check.mkv' > > (totem:12365): GnomeDesktop-WARNING **: Unable to create an input stream for > file:///home/sam/Videos/tV%20shows/Regular%20Show%20Season%201- > 4%20Complete%20+%20Specials%20(BluRay%20-%20WEB-DL)%20%5BmR12%5D/Season%202/ > %5B2.23%5D%20A%20Bunch%20Of%20Baby%20Ducks.mkv: No such file or directory > > (it goes on and on) > > I renamed the "tv shows" folder a while ago, and I think that it has > invalidated all of my thumbnails/videos, yet totem is still trying to load > them. I think the best thing to do for totem would be to remove the videos > from the list when it can't find them on the drive. That's tracker not picking up the new location of the files, and isn't directly related to totem, or even grilo (the plugins of which it uses to access the Tracker database). Best file a separate bug against Tracker about that.