Every time Amarok is displaying a collection the information about tracks and albums needs to come from a source. The source can be an portable device, an Internet service or a database. For tracks that are in Local Collection folders Amarok is using a database to have fast access to the required meta-information. At first this information needs to be loaded into the database which is usually done by scanning the Local Collection directories for audio files. This process is called collection scanning.
It is useful to understand the scanning process in order to work better with Amarok.
The so-called incremental scan will check the collection directories for updates. This is done every minute ifis enabled (on by default) but can also be triggered manually by selecting from the menu.
The incremental scan will just check the modification date of every folder in the collection against the last known modification time. This has a couple of implications:
touch /path/to/directoryin the console).
If you have problems with deleted tracks still appearing in the collection, or you want to update album covers (which are not updated by a mere) then you can use the option in the settings dialog. will not care about modification dates. It will not delete statistics of existing files; it will, however, delete statistics of tracks that disappeared from the currently mounted collection folders. Because of that it is adviseable to perform the only with all Local Collection folders mounted if you move the tracks between mounts. also updates play count if the one stored in file tags is greater, rating if the song is unrated and file tags mention rating and score (under the same circumstances).
The progress bar will show the progress of the scanning. Up to 50% the scanner will scan the file system and just buffer the result. Times above 50% indicate that the scanner is committing the results to the database. Usually the second step is much faster than the first so don't be surprised if the progress bar seems to jump. Up to 50% aborting the scan is possible. After 50%, the committing of the files cannot be stopped.
The scanning time depends on your disk speed and other factors. Usually the first scan is a lot slower than subsequent scans where the files are cached by the operating system. A scan of 10000 files should take around three minutes on a modern computer. 50000 files should be around 13 minutes. Of course with an SSD (solid state drive) this will be much faster.
With the default settings Amarok is storing all the collection information in a directory called ~.kde/share/apps/amarok/mysqle/ . It can be a good idea to make a backup of this directory from time to time, especially when you didn't enable the writing back of statistics information.
Amarok is tracking files by an id that is either stored in the audio track or computed using file metadata, tag metadata and first few kilobytes of the file. This id helps Amarok to identify tracks that are moved to other locations so that statistics information (rating, score, playcount, first & last played) are not lost. Currently Amarok will not import tracks with duplicate unique ids. This leads to the surprising behavior that copied tracks still appear only once in Amarok.
In some circumstances even different tracks can end up with the same unique id. Such a problem can be seen by the debug output (start Amarok with the --debug option in a console) while scanning.
The scanner can only read single tracks but Amarok will display those sorted by album and compilation (an album without one specific artist). Amarok can't rely on the directory in which the files are located, since directory organizational schemes vary so widely.
The scanner is therefore doing the following:
This process is quite complicated. However usually the outputs of the scanner can help in figuring out why the tracks are sorted as they are.In such a case try executing (on a command line)
amarokcollectionscanner -r ~/your/music/directory
Look for "compilation" tags and tracks with different "artist" and "albumartist" tags.You can remove the compilation tag from mp3 files with the following command:
id3v2 -r TCMP your filename here