Bug 277021

Summary: Album applet (often) hangs Amarok on song change
Product: [Applications] amarok Reporter: Sven Krohlas <sven>
Component: Context View/AlbumsAssignee: Amarok Developers <amarok-bugs-dist>
Status: RESOLVED FIXED    
Severity: normal CC: lfranchi, simon.esneault, vianasw
Priority: NOR    
Version: 2.4-GIT   
Target Milestone: 2.4.2   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In: 2.4.2

Description Sven Krohlas 2011-07-03 18:02:12 UTC
Version:           2.4-GIT (using KDE 4.6.4) 
OS:                Linux

On song changes Amarok sometimes hangs for about 50 seconds. The GUI is completely frozen. This is due to a weird performance problem in (or triggered by) the album applet.

This happens for specific artists every time, for others never. So test different artists when trying to reproduce this bug.

Reproducible: Sometimes

Steps to Reproduce:
1. activate the album applet
2. go to another song in the playlist

Actual Results:  
For some (maybe 50% here) artists: Amarok hangs for about 50 seconds.

Expected Results:  
Well... ;-)

I tried to debug it. By adding a lot of debug to the Album Applet I could verify, that in src/context/applets/albums/Albums.cpp:

1. Line 166: Meta::TrackList tracks = albumPtr->tracks(); sometimes takes about 8.5 seconds here
2. Line 178: qStableSort( tracks.begin(), tracks.end(), Meta::Track::lessThan ); then takes about 1 second
3. Line 181: foreach( Meta::TrackPtr trackPtr, tracks ){...} then takes about 40 seconds!

So very likely the problem lies somewhere behind step 1... but I don't get it. ;-)

KRF on IRC was able to see this, too.
Comment 1 Sven Krohlas 2011-07-03 21:33:45 UTC
Git commit 55873d1a9423ddc151879151f2c2a7ef4a46f619 by Sven Krohlas.
Committed on 03/07/2011 at 23:28.
Pushed by krohlas into branch 'master'.

Don't let the album applet freeze Amarok for ages

We tried to show ALL tracks from ALL artists, that do not belong to an
album, if some track from the currently playing artist did not have an
album set. Took about 50 seconds for me on track change...

TODO: show all tracks from this artist that are not part of an album.

BUG: 277021
BUG: 260810
FIXED-IN: 2.4.2

M  +1    -0    ChangeLog     
M  +5    -0    src/context/applets/albums/Albums.cpp     

http://commits.kde.org/amarok/55873d1a9423ddc151879151f2c2a7ef4a46f619