Bug 229239 - Start-up takes way too long, scans wrong files
Summary: Start-up takes way too long, scans wrong files
Status: RESOLVED NOT A BUG
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.2.90
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-03 12:24 UTC by Wonko
Modified: 2010-04-22 16:26 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
part of log file (28.44 KB, application/x-bzip)
2010-03-03 16:33 UTC, Wonko
Details
Wonko's amarokrc file (22.36 KB, application/x-bzip)
2010-03-20 21:14 UTC, Wonko
Details
Wonkos amarokrc (4.24 KB, text/plain)
2010-03-23 14:29 UTC, Wonko
Details
Output of "SELECT * FROM directories;" (166.40 KB, text/plain)
2010-03-23 14:33 UTC, Wonko
Details
Another amarok -d --nofork log (296.25 KB, text/plain)
2010-03-23 17:50 UTC, Wonko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wonko 2010-03-03 12:24:58 UTC
Version:           2.2.2.90 (using 4.4.00 (KDE 4.4.0), Gentoo)
Compiler:          i686-pc-linux-gnu-gcc
OS:                Linux (i686) release 2.6.32-tuxonice-r5

Wow, starting amarok takes 7 minutes here. Calling it with -d nofork I see that during startup it mainly scans my /data/incoming directory, which is not along my collection folders (most other folders in /data/mp3 are selected, but this one is not). This stuff does not appear in my collection afterwards, so the content is ignored, but why is it scanned in the first place? And why is anything being scanned at all? If amarok wants to check for new stuff, why not compare the directory modification date with previous scans and only inspect the MP3s when the directory was modified?

In previous versions, sometimes also my /data/mp3/incoming directory was scanned when doing a full scan, messing up my collection, but this does not happen with this version. But still the initial scan is annoying, so I do not want amarok to start when I log into KDE4.
Comment 1 Jeff Mitchell 2010-03-03 15:32:27 UTC
I can't make heads nor tails of this bug report.
Comment 2 Wonko 2010-03-03 16:33:25 UTC
Created attachment 41290 [details]
part of log file

Log of 'amarok -d --nofork', showing plqylists and their files being accessed.
Comment 3 Wonko 2010-03-03 16:34:17 UTC
Okay, I'll try again.

I was disappointed by amarok taking about seven minutes to start. When I want to hear music, I do not want to wait such a long time for my favorite audio player. I do not start it automatically at login time, because of disk I/O it creates.

Then I wondered what the heck amarok is doing during this time, so I ran it with debug output. And saw it accessing many files in /data/mp3/incoming, a folder that is not selected to be part of my collection.

Now I inspected the log a little more. Looks like amarok is looking for playlists, and then scans the audio files of that playlists. By scanning I mean accessing, not putting them into my collection. Most of my collection is fully tagged, so I have few playlists left, except for my incoming folder which has lots.

So, why does amarok access any files in folders I did not select as my collection? And even if they were, why are all those files being accessed before amarok starts, taking so much time?
Comment 4 Markus_2889 2010-03-20 20:20:17 UTC
I've a similar problem. I've update amarok to 2.3.0 version but it takes more than 4 minutes to start up! In the previous version I don't find this problem..
I'm using ubuntu 9.10 64 bit. The entire music collection si mounted with nfs because is on another computer. I don't know if this could be interesting for this bug.

What i can do to give you more information of this problem?

Ask me if you don't understand my bad English! :)
Comment 5 Jeff Mitchell 2010-03-20 20:42:08 UTC
Wonko, can you attach your amarokrc file (careful, look for passwords in it before posting)? It should be somewhere like ~/.kde/share/config/amarokrc. Also, are you using the embedded or external database?

Thanks.
Comment 6 Wonko 2010-03-20 21:14:26 UTC
Created attachment 41794 [details]
Wonko's amarokrc file
Comment 7 Wonko 2010-03-20 21:20:27 UTC
I am using the external database, with mysql 5.1.44.
Comment 8 Jeff Mitchell 2010-03-20 22:38:15 UTC
Did you need to bz2 a text file?  :-(

Can you please attach it as a plain text file?

Also, since you're using the external database, that makes another thing easier: from your mysql command line, USE your amarok database, then paste (as text!) the output of "SELECT * FROM directories;"

Thanks.
Comment 9 Wonko 2010-03-23 14:29:26 UTC
Created attachment 42200 [details]
Wonkos amarokrc

Sorry for the .bz2 last time, I thought I's save some space.
Comment 10 Wonko 2010-03-23 14:33:54 UTC
Created attachment 42201 [details]
Output of "SELECT * FROM directories;"
Comment 11 Jeff Mitchell 2010-03-23 15:56:23 UTC
The output of both looks sane. I'm still not sure I actually understand what the problem is. Amarok doesn't scan folders that aren't in your collection, with the possible exception of your XDG-defined music directory (usually ~/Music). The evidence from the database backs this up; if it was scanning some directory with "incoming" in the name it would have been added to the directories in the database.
Comment 12 Wonko 2010-03-23 17:07:32 UTC
The problem is NOT that Amarok adds music from folders I did not select to the database. Well, this had happened before with a previous version, but it is no longer the case.

But what I experience is that Amarok DOES look into folders I did not select, when they contain *.m3u playlists. See the first log file I added (sorry, it's also bzipped). Look around the [...] line in line 463. You see paths like /data/mp3/untagged/ or /data/mp3/incoming/, and they are NOT selected as collection folders. I actually have LOTS of these playlists, most of them I don't even know of, the incoming folder has many stuff I did not look at yet.

So, the question is: Why does Amarok look at all into folders I did not select for scanning, and why does it scan every playlist on startup, so it takes 7 minutes to come up?
Comment 13 Wonko 2010-03-23 17:50:10 UTC
Created attachment 42207 [details]
Another amarok -d --nofork log

I just ran amarok -d --nofork again, now using Amarok 2.3.0. With similar
result. This log was stripped down from 7M to 300K, the [...] parts stand for
many many many lines of similar content.

BTW, Amarok really gets on my nerves, I experienced so many bugs and annoyances
of all different kinds. And still, I like it best, and do not switch to another
one. Amarok really is a great player, and once the bugs are gone it will be
sooo cool.
Comment 14 Jeff Mitchell 2010-03-23 19:26:49 UTC
Bart, can you look at this? Playlists are your area of expertise...
Comment 15 Bart Cerneels 2010-03-23 19:31:25 UTC
Hey Wonko

Please attach the output of `ls -lh $KDE/.kde/share/apps/amarok/playlists > playlists.txt`

From the amarokrc you pasted I can tell those playlists that are suspected to be the cause are not in your collection folder. So collectionscanner is not involved.
Comment 16 Wonko 2010-03-23 20:14:11 UTC
My ~/.kde4/share/apps/amarok/playlists folder does not contain any files at all.
Comment 17 Wonko 2010-04-22 16:18:43 UTC
Update: I just installed Amarok 2.3.0.90, and startup is much faster now, around half a minute. When started with the -d option, I do no longer see any playlist scanning. Hooray!
Comment 18 Jeff Mitchell 2010-04-22 16:26:38 UTC
Cool, closing.