After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 325968 - Banshee freezes when switching back to Music Library
Banshee freezes when switching back to Music Library
Status: RESOLVED FIXED
Product: banshee
Classification: Other
Component: User Interface
git master
Other All
: Normal normal
: 2.x
Assigned To: Banshee Maintainers
Banshee Maintainers
: 336664 358133 360824 363206 383551 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-01-06 10:20 UTC by Nico Kaiser
Modified: 2006-12-08 00:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to greatly speed up switching speed (21.69 KB, patch)
2006-11-27 08:01 UTC, Gabriel Burt
needs-work Details | Review

Description Nico Kaiser 2006-01-06 10:20:27 UTC
Please describe the problem:
Displaying a Playlist, sorting this list and then switching back to the Music
Library makes Banshee freeze

Steps to reproduce:
1. Create a Playlist and drop some songs
2. Select Playlist
3. Sort Playlist
4. Switch back to Music Library


Actual results:
Banshee keeps playing but the interface freezes

Expected results:
The Music Library is displayed

Does this happen every time?
Yes

Other information:
Comment 1 Aaron Bockover 2006-01-14 08:29:17 UTC
This does not happen for me, switching back to the music library works fine, and is sorted the same way that the playlist was. Here's what I did:

Created an empty playlist
Dragged a selection of songs onto that playlist (from the library)
Selected the playlist
Sorted by artist
selected the library

Comment 2 Nico Kaiser 2006-01-16 22:08:54 UTC
Still freezes. Banshee tries to acquire all CPU it can get, but as no Library is shown after some minutes I guess this is not just "slow" but "broken".

Is there any chance to debug what Banshee is doing with my CPU?
Comment 3 Aaron Bockover 2006-01-28 21:48:17 UTC
How many songs in the library? How fast is your CPU?

You can trace Banshee like this, but please don't paste it here unless you narrow down the exact code path and can cut it down (the trace output may be many MB in size):

mono --trace /usr/lib/banshee/banshee.exe
Comment 4 Aaron Bockover 2006-03-14 02:14:33 UTC
Closing due to no response on the NEEDINFO. Much has changed in the sources area of Banshee since this report. Please reopen if necessary.
Comment 5 Nico Kaiser 2006-03-14 11:59:35 UTC
The problem still exists. However I can't "--trace" Banshee, I had to stop it after having created a >10gb trace file (and still "Loading..."). Is there another way to track down this problem?
Comment 6 Aaron Bockover 2006-03-14 22:35:38 UTC
Mind answering my questions above? You can filter down the trace by namespaces:

Probably concerned with Banshee, Banshee.Base, Banshee.Gui
Comment 7 Nico Kaiser 2006-03-14 23:03:05 UTC
Sorry. My Library holds about 13000 songs, my CPU is a P4/2.8GHz.

Thanks for the namespace hint, I can create a trace now (200mb after startup). After switching to a playlist, sorting it by a different column and switching back to the library, the GUI does not react anymore and the trace file grows constantly. 

The latest few hundered mb's look like this (with different 0x* addresses):

. . . . . . . . . ENTER: Banshee.PlaylistView:PlayCountTreeIterCompareFunc (Gtk.TreeModel,Gtk.TreeIter,Gtk.TreeIter)(this:0x59e10[Banshee.PlaylistView banshee.exe], [Banshee.PlaylistModel:0x1a2f60], [61,98,c7,45,a0,6d,f9,08,88,6c,f9,08,4c,ca,85,bf,], [61,98,c7,45,88,6c,f9,08,10,ce,73,08,3c,ca,85,bf,], )
. . . . . . . . . . ENTER: Banshee.PlaylistModel:IterTrackInfo (Gtk.TreeIter)(this:0x1a2f60[Banshee.PlaylistModel banshee.exe], [61,98,c7,45,a0,6d,f9,08,88,6c,f9,08,4c,ca,85,bf,], )
. . . . . . . . . . LEAVE: Banshee.PlaylistModel:IterTrackInfo (Gtk.TreeIter)[Banshee.Base.LibraryTrackInfo:0xf287e8]
. . . . . . . . . . ENTER: Banshee.Base.TrackInfo:get_PlayCount ()(this:0xf287e8[Banshee.Base.LibraryTrackInfo banshee.exe], )
. . . . . . . . . . LEAVE: Banshee.Base.TrackInfo:get_PlayCount ()result=1
. . . . . . . . . . ENTER: Banshee.PlaylistModel:IterTrackInfo (Gtk.TreeIter)(this:0x1a2f60[Banshee.PlaylistModel banshee.exe], [61,98,c7,45,88,6c,f9,08,10,ce,73,08,3c,ca,85,bf,], )
. . . . . . . . . . LEAVE: Banshee.PlaylistModel:IterTrackInfo (Gtk.TreeIter)[Banshee.Base.LibraryTrackInfo:0xe6eb80]
. . . . . . . . . . ENTER: Banshee.Base.TrackInfo:get_PlayCount ()(this:0xe6eb80[Banshee.Base.LibraryTrackInfo banshee.exe], )
. . . . . . . . . . LEAVE: Banshee.Base.TrackInfo:get_PlayCount ()result=0
. . . . . . . . . . ENTER: Banshee.PlaylistView:LongFieldCompare (long,long)(this:0x59e10[Banshee.PlaylistView banshee.exe], 0x0000000000000001, 0x0000000000000000, )
. . . . . . . . . . LEAVE: Banshee.PlaylistView:LongFieldCompare (long,long)result=1
. . . . . . . . . LEAVE: Banshee.PlaylistView:PlayCountTreeIterCompareFunc (Gtk.TreeModel,Gtk.TreeIter,Gtk.TreeIter)result=1


I killed the process after some minutes (sorting in the library normally takes about 2-4 seconds so I don't expect it to take more than 2 minutes after switching views).

Is there anything more I can help with? If you want I'll send you the 1gb logfile (gzipped to ~20mb) or provide you a vnc session.
Comment 8 Germán Poo-Caamaño 2006-03-17 14:14:00 UTC
Nico,

Is the interface get frozen for the rest of the session or just a period of time?

I mean, If banshee is playing songs and I create an empty playing list, selected it and the delete it; the interface looks frozen.  But if I wait more or less 40 seconds interface is drawn again.  I noticed that the time with the interface frozen is almost the same time when banshee loads the first time (loading the play list).

My play list only have 1697 songs.  Probably with more songs it is slower.

Hmm... it also happen if I do not delete the play list.  It is the time the treeview gets painted.

May you try it with a reduced amount of songs?
Comment 9 Kevin Duffus 2006-03-20 03:39:49 UTC
I find the banshee playlist switching to be incredibly slow as compared to the likes of Rhythmbox and Muine. I currently have approximately 2400 songs in my music library and it takes 5-7 seconds just to switch from a small playlist of about 30 songs to the full library. Rhythmbox and Muine load their lists almost instantly. I just installed a new dual core processor and the load speed has gone down dramatically but it is still lagging behind other library based music players. Please help.
Comment 10 Paul Cutler 2006-04-06 11:14:55 UTC
Bug 336664 appears to be a duplicate of this bug.
Comment 11 Ruben Vermeersch 2006-04-06 14:37:11 UTC
*** Bug 336664 has been marked as a duplicate of this bug. ***
Comment 12 Ruben Vermeersch 2006-04-06 14:39:23 UTC
Merging info from duplicate:

Opened by Max Powers 2006-03-30 20:14 UTC
> Please describe the problem:
> Having a large music database (4500+ songs) causes Banshee to constantly > freeze and spike to 100% CPU usage when moving in between Music Library and > either playlists or devices (such as an iPod).
>
> Steps to reproduce:
> 1. Drag a song from Music Library (main database) and create a new playlist
> (OR)
> enter a song in the search field.
> 2. Go back to the Music Library
> 3. Banshee now freezes and CPU spikes too 100% for a few minutes. Banshee then> finally loads the Music Library
>
>
> Actual results:
> Banshee freezes
>
> Expected results:
> Banshee should not freeze.
>
> Does this happen every time?
> Yes
>
> Other information:
> Perhaps a better (or robust) way of caching files is needed for people with
> quite large music libraries? Banshee is really crippled due to this type of
> behaviour.


Comment #1 from Paul Cutler 2006-04-06 01:14 UTC
> I can't confirm this using Banshee 0.10.9 on Ubuntu Dapper Drake with 24,000
> songs in my database.
>
> I tried to reproduce by dragging a song from the music library to an existing
> playlist, and a second time by dragging to a new playlist.
>
> What are your PC specs, including CPU speed and memory?


Comment #2 from Paul Cutler 2006-04-06 01:39 UTC
> This also appears to be a duplicate of Bug 325968


Comment #3 from Max Powers 2006-04-06 03:43 UTC
> Paul, my specs are AMD64 3000+ and 1GB of RAM.
Comment 13 Ruben Vermeersch 2006-04-06 14:41:25 UTC
Isn't this affected by Oscar Forero's normalisation work?
Comment 14 Ruben Vermeersch 2006-04-10 17:48:30 UTC
Moving to the User Interface component.
Comment 15 aurelien 2006-09-09 13:06:18 UTC
I have a similar problem, running latest CVS on ubuntu edgy with 9000 tracks in the collection. This is on a fairly fast computer.
I tried to make  a trace, to check that it is the same problem, but after a while, banshee had still not displayed the list of songs and the output file filled more than 1.8G, against 200M after startup for the reporter (the UI had been here for about one minute, and a normal startup usually takes less than 5s!).

I am thus not sure it is the same problem, any hint to help tracking it down ?
I can provide parts of the trace file if required.

On a related note, the wiki quotes an incoming rework of the list model, is this only planned or has the developpement started ? I would happily test if it solves my problem!
Comment 16 Gabriel Burt 2006-09-26 05:33:23 UTC
I just committed a fix for bug #357743 that will at least help with this problem.  If you are running Banshee from CVS (or 0.11.1 when that comes out) please report how much if any better things are running.  There are still issues with Banshee's datamodel, but at least we're not reloading it three times on each switch now!  More details here:

http://gburt.blogspot.com/2006/09/wild-banshee.html
Comment 17 Gabriel Burt 2006-09-28 18:39:44 UTC
I have noticed that Banshee is terribly slow in switching between playlists and the library if I have Assistive Technologies turned on.
Comment 18 Gabriel Burt 2006-10-09 16:37:47 UTC
*** Bug 360824 has been marked as a duplicate of this bug. ***
Comment 19 Gabriel Burt 2006-10-20 01:42:39 UTC
*** Bug 363206 has been marked as a duplicate of this bug. ***
Comment 20 Andrew Conkling 2006-10-20 01:48:55 UTC
(In reply to comment #16)
> I just committed a fix for bug #357743 that will at least help with this
> problem.  If you are running Banshee from CVS (or 0.11.1 when that comes out)
> please report how much if any better things are running.

Just upgraded to 0.11.1.  It's still a bit slow, but it's a matter of a minute compared with around 5 before.  Significant improvement; nice work! :)
Comment 21 Gabriel Burt 2006-11-27 07:50:31 UTC
*** Bug 358133 has been marked as a duplicate of this bug. ***
Comment 22 Gabriel Burt 2006-11-27 08:01:00 UTC
Created attachment 77202 [details] [review]
Patch to greatly speed up switching speed

The problem is that each time you switch between sources, Banshee clears the TreeView's model and fills it with the new source's tracks.  If you are sorting by a column, then as it fills in each track from the new source, it sorts the entire model.  This patch fixes this by temporarily setting the sort function back to the default while reloading a source, then restoring the ordering after so the sorting is only done once, at the end.

It also adds handles the case where you send a collection of tracks in the TrackAdded and TrackRemoved events, and if there are enough tracks in such an event, it does the same sorting protection to make the changes fast.  This is used in Smart Playlists to refresh its contents, for instance.

This patch works very well for me, with the large exception of a spurious fatal error (see below).  If people can please test and confirm and if possible, debug, that would be much appreciated so we can get this in ASAP.

Gtk-ERROR **: file gtksequence.c: line 597 (_gtk_sequence_node_rotate): assertion failed: (node->parent != node)
aborting...

=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================

Stacktrace:

  at (wrapper managed-to-native) Gtk.ListStore.gtk_tree_sortable_set_sort_column_id (intptr,int,int) <0x00004>
  at (wrapper managed-to-native) Gtk.ListStore.gtk_tree_sortable_set_sort_column_id (intptr,int,int) <0xffffffff>
  at Gtk.ListStore.SetSortColumnId (int,Gtk.SortType) <0x00020>
  at Banshee.PlaylistModel.RestoreSortOrder () [0x00000] in /home/gabe/Code/banshee/src/PlaylistModel.cs:143
  at Banshee.PlayerUI.OnSourceTrackAdded (object,Banshee.Sources.TrackEventArgs) [0x000dd] in /home/gabe/Code/banshee/src/PlayerInterface.cs:1055
Comment 23 Gabriel Burt 2006-12-01 00:55:12 UTC
I reverted my patch on my local copy and reran Banshee, and got the same crasher as above...so it seems its not introduced by my changes.  Can anybody else reproduce it?
Comment 24 Gabriel Burt 2006-12-07 06:31:53 UTC
Fixed in CVS.  New release coming out soon.
Comment 25 Gabriel Burt 2006-12-08 00:54:03 UTC
*** Bug 383551 has been marked as a duplicate of this bug. ***