Version: 2.1.1 (using KDE 4.2.4) Installed from: Gentoo Packages I've seen several times the following happen: - Track A is played - The lyrics for track A are fetched (but not showed yet - the script is still fetching them...) - I switch to track B before the lyrics of track A are shown - Amarok fetches now + shows the lyrics for track B - After some seconds Amarok finishes fetching the lyrics of track A - Amarok shows now the lyrics of track A instead of the currently playing track B This happens especially if you're on a slow internet connection - it's not really easy to reproduce but I think the problem in the code logic shouldn't be that hard to find.
Could this be related to bug 186021?
Hm, just had a duplicate with Amarok 2.2, changing version
*** Bug 211242 has been marked as a duplicate of this bug. ***
Leo, any news on this?
*** Bug 215958 has been marked as a duplicate of this bug. ***
Changing version from duplicate.
Is this still valid for Amarok 2.2.2 or in current git?
Yes. I updated from git a few days ago, and I can still confirm the problem. It is a bit hard to reproduce (you have to change track twice in rapid succession), but I have managed to reproduce it three times just now.
Thank you for the fast feedback, updating version.
*** Bug 225852 has been marked as a duplicate of this bug. ***
*** Bug 222885 has been marked as a duplicate of this bug. ***
I see this as well, on amarok-2.3.0.
*** Bug 234134 has been marked as a duplicate of this bug. ***
(In reply to comment #13) > *** Bug 234134 has been marked as a duplicate of this bug. *** Sorry, that dupe was mine. Didn't find this when I searched originally. Just a note on reproducing the bug. As mentioned in my original bug, it's very easy to reproduce by writing a small script which calls qdbus org.kde.Amarok /TrackList AddTrack filename.mp3 multiple times in quick succession. Doing this causes all the lyrics to become mismatched to the wrong songs.
Hi, the real issue is in the lyrics script: the lyrics script calls Amarok.Lyrics.showLyrics() unconditionally (other Amarok.Lyrics.* may also be called unconditionally). The problem is: Amarok.Lyrics.showLyrics() can not know the current track is still the same track for which the lyrics were fetched. The safest way is probably removing Amarok.Lyrics.showLyrics() and using Amarok.Lyrics.setLyricsForTrack() instead (that method also takes the track's URL - so it's not affected by the described race condition). Unfortunately there's a small issue: The current code would not show the lyrics when just calling setLyricsForTrack. I already fixed that in my "improve-lyrics-handling" branch on gitorious, but I cannot merge this to amarok's master (I have to wait until 2.3.2 is released). My branch can be found here: http://gitorious.org/~xdarklight/amarok/xdarklights-clone/commits/improve-lyrics-handling So here's a quick summary of what would have to be done in the lyrics script that is shipped with amarok: -one has to remember the track's URL when getLyrics() is called -onLyricsReceived() and onHelpReceived() need to know to which track that event belongs. If the event is not for the current track then Amarok.Lyrics.showLyricsError (or any other Amarok.Lyrics.* method) should not be called -in any case: if lyrics were found Amarok.Lyrics.setLyricsForTrack() has to be called (only after my branch has been merged). The trackUrl has to be taken from step #1. Regards, Martin
I could reproduce it under 2.4-GIT, too, so the bug isn't fixed so far.
bumping version.
Is this still reproducible with current git? I tried to reproduce it but maybe my internet connection is too fast.
I'm no Amarok user anymore, but reproducing this could be done by using trickle to simulate a slow internet connection. trickle is available here: http://monkey.org/~marius/pages/?page=trickle It could be used like this: trickle -u 5 -d 5 amarok to restrict the up-/download bandwidth of Amarok to 5kB/s.
Martin: do you still have that fix? Please submit it to reviewboard.kde.org
Hi Myriam, I never wrote this code for the default lyrics script (as I was using the UltimateLyrics script back then instead of the default lyrics script we're talking about here). I think the UltimateLyrics developer used my steps from above to implement a fix. If anyone wants to take a look (I'm not using Amarok anymore, so I can't fix it): - Amarok.Lyrics.showLyrics() only works for the current track (that is *playing* at the time the lyrics are received) - if there is a short song where fetching lyrics takes a long time Amarok continues from track A (for which the lyrics were requested) to track B (which is now playing, where showLyrics is called). - using Amarok.Lyrics.setLyricsForTrack() is a safe way, because it sets the lyrics for a specific track (of which you need to know the URL). The lyrics applet is automatically updated if setLyricsForTrack() is called for the "currently playing" track (that was the fix I mentioned back then).
Thank you for the feedback. I change this to LATER so we don't miss the information in it.