blob: 35c7224b52b1c8a8b7bdb63a97bd195b30fc7ab0 [file] [log] [blame]
Dominik Riebelingc75a8442006-04-04 21:48:47 +00001% $Id$ %
Jonas Häggqvist6b1d2cb2006-11-25 09:42:06 +00002\section{\label{ref:database}Database}
Dominik Riebelingc75a8442006-04-04 21:48:47 +00003
4\subsection{Introduction}
Jonas Häggqvist6b1d2cb2006-11-25 09:42:06 +00005This chapter describes the Rockbox music database system. Using the information
Nils Wallménius86171f22006-09-03 16:43:06 +00006contained in the tags (ID3v1, ID3v2%
Nils Wallménius12eb0582008-03-23 22:07:09 +00007 \opt{swcodec}{, Vorbis Comments, Apev2, etc.}%
Nils Wallménius86171f22006-09-03 16:43:06 +00008) in your audio files, Rockbox builds and maintains a database of the music
Marc Guay65f36342008-06-24 05:46:29 +00009files on your player and allows you to browse them by Artist, Album, Genre,
10Song Name, etc. The criteria the database uses to sort the songs can be completely
11 customised. More information on how to achieve this can be found on the Rockbox
12 website at \wikilink{DataBase}.
Dominik Riebelingc75a8442006-04-04 21:48:47 +000013
Marc Guay65f36342008-06-24 05:46:29 +000014\subsection{Initializing the Database}
Dominik Riebeling97f21462007-03-14 22:16:27 +000015The first time you use the database, Rockbox will scan your disk for audio files.
16This can take quite a while depending on the number of files on your \dap{}.
17This scan happens in the background, so you can choose to return to the
18Main Menu and continue to listen to music.
19If you shut down your player, the scan will continue next time you turn it on.
20After the scan is finished you may be prompted to restart your \dap{} before
21you can use the database.
Dominik Riebelingc75a8442006-04-04 21:48:47 +000022
Marc Guay65f36342008-06-24 05:46:29 +000023\subsubsection{Ignoring Directories During Database Initialization}
Robert Kukla09fc0782008-02-13 12:34:47 +000024
25You may have directories on your \dap{} whose contents should not be added
26to the database. Placing a file named \fname{database.ignore} in a directory
27will exclude the files in that directory and all its subdirectories from
28scanning their tags and adding them to the database. This will speed up the
29database initialization.
30
Alexander Levin5a379bc2010-05-20 16:35:45 +000031If a subdirectory of an `ignored' directory should still be scanned, place a
Robert Kukla09fc0782008-02-13 12:34:47 +000032file named \fname{database.unignore} in it. The files in that directory and
33its subdirectories will be scanned and added to the database.
34
Jonas Häggqvist6b1d2cb2006-11-25 09:42:06 +000035\subsection{\label{ref:databasemenu}The Database Menu}
Michael DiFebbo642d74d2006-07-27 02:02:18 +000036
Martin Arver85709112006-08-15 10:53:14 +000037\begin{description}
Nils Wallméniuscf9af012010-10-12 13:14:17 +000038 \opt{tc_ramcache}{
Marc Guay65f36342008-06-24 05:46:29 +000039 \item[Load To RAM]
Nils Wallméniuscf9af012010-10-12 13:14:17 +000040 The database can either be kept on \disk{} (to save memory), or
Martin Arver85709112006-08-15 10:53:14 +000041 loaded into RAM (for fast browsing). Setting this to \setting{Yes} loads
Jonas Häggqvist6b1d2cb2006-11-25 09:42:06 +000042 the database to RAM, allowing faster browsing and searching. Setting this
Nils Wallméniuscf9af012010-10-12 13:14:17 +000043 option to \setting{No} keeps the database on the \disk{}, meaning slower
Martin Arver85709112006-08-15 10:53:14 +000044 browsing but it does not use extra RAM and saves some battery on boot up.
45
Nils Wallméniuscf9af012010-10-12 13:14:17 +000046 \opt{HAVE_DISK_STORAGE}{
Jonas Häggqvist6b1d2cb2006-11-25 09:42:06 +000047 \note{If you browse your music frequently using the database, you should
48 load to RAM, as this will reduce the overall battery consumption because
49 the disk will not need to spin on each search.}
Nils Wallméniuscf9af012010-10-12 13:14:17 +000050 }
Martin Arver85709112006-08-15 10:53:14 +000051 }
52
Marc Guay65f36342008-06-24 05:46:29 +000053\item[Auto Update]
Martin Arver85709112006-08-15 10:53:14 +000054 If \setting{Auto update} is set to \setting{on}, each time the \dap{}
Jonas Häggqvist6b1d2cb2006-11-25 09:42:06 +000055 boots, the database will automatically be updated.
Nils Wallménius86171f22006-09-03 16:43:06 +000056
Marc Guay65f36342008-06-24 05:46:29 +000057\item[Initialize Now]
Dominik Riebeling97f21462007-03-14 22:16:27 +000058 You can force Rockbox to rescan your disk for tagged files by
Steve Bavin20d8e8d2007-03-15 13:03:37 +000059 using the \setting{Initialize Now} function in the \setting{Database
Nils Wallménius86171f22006-09-03 16:43:06 +000060 Menu}.
Steve Bavin20d8e8d2007-03-15 13:03:37 +000061 \warn{\setting{Initialize Now} removes all database files (removing
Nils Wallménius86171f22006-09-03 16:43:06 +000062 runtimedb data also) and rebuilds the database from scratch.}
Nils Wallménius86171f22006-09-03 16:43:06 +000063
Marc Guay65f36342008-06-24 05:46:29 +000064\item[Update Now]
Jonas Häggqvist6b1d2cb2006-11-25 09:42:06 +000065 \setting{Update now} causes the database to detect new and deleted files
Nils Wallménius12eb0582008-03-23 22:07:09 +000066 \opt{swcodec}{
Nils Wallménius86171f22006-09-03 16:43:06 +000067 \note{Unlike the \setting{Auto Update} function, \setting{Update Now}
68 will update the database regardless of whether the \setting{Directory Cache}
69 is enabled. Thus, an update using \setting{Update now} may take a long
70 time.
71 }
72 }
Steve Bavin20d8e8d2007-03-15 13:03:37 +000073 Unlike \setting{Initialize Now}, the \setting{Update Now} function
Martin Arver85709112006-08-15 10:53:14 +000074 does not remove runtime database information.
75
Marc Guay65f36342008-06-24 05:46:29 +000076\item[Gather Runtime Data]
Robert Kukla226cb7b2007-03-26 15:08:59 +000077 When enabled, rockbox will record how often and how long a track is being played,
78 when it was last played and its rating. This information can be displayed in
79 the WPS and is used in the database browser to, for example, show the most played,
80 unplayed and most recently played tracks.
Martin Arver85709112006-08-15 10:53:14 +000081
Marc Guay65f36342008-06-24 05:46:29 +000082\item[Export Modifications]
Dominik Riebeling2e508af2007-03-07 15:44:03 +000083 This allows for the runtime data to be exported to the file \\
Jonas Häggqvist6b1d2cb2006-11-25 09:42:06 +000084 \fname{/.rockbox/database\_changelog.txt}, which backs up the runtime data in
85 ASCII format. This is needed when database structures change, because new
86 code cannot read old database code. But, all modifications
87 exported to ASCII format should be readable by all database versions.
Martin Arver85709112006-08-15 10:53:14 +000088
Nils Wallméniusb659c0c2008-03-22 15:26:45 +000089\item[Import Modifications.]
Jonas Häggqvist6b1d2cb2006-11-25 09:42:06 +000090 Allows the \fname{/.rockbox/database\_changelog.txt} backup to be
Dominik Riebeling2e508af2007-03-07 15:44:03 +000091 conveniently loaded into the database. If \setting{Auto Update} is
Steve Bavin20d8e8d2007-03-15 13:03:37 +000092 enabled this is performed automatically when the database is initialized.
Martin Arver85709112006-08-15 10:53:14 +000093
94\end{description}
Michael DiFebbo642d74d2006-07-27 02:02:18 +000095
Marc Guay65f36342008-06-24 05:46:29 +000096\subsection{Using the Database}
97Once the database has been initialized, you can browse your music
98by Artist, Album, Genre, Song Name, etc. To use the database, go to the
99 \setting{Main Menu} and select \setting{Database}.\\
Michael DiFebbo642d74d2006-07-27 02:02:18 +0000100
101\note{You may need to increase the value of the \setting{Max files in dir
Nils Wallménius909b9462007-03-03 00:07:31 +0000102browser} setting (\setting{Settings $\rightarrow$ General Settings
103$\rightarrow$ System $\rightarrow$ Limits}) in order to view long lists of
104tracks in the ID3 database browser.\\
Michael DiFebbo642d74d2006-07-27 02:02:18 +0000105
Jonas Häggqvist6b1d2cb2006-11-25 09:42:06 +0000106There is no option to turn off database completely. If you do not want
Thom Johansenc479b992008-02-13 13:32:44 +0000107to use it just do not do the initial build of the database and do not load it
Marc Guay65f36342008-06-24 05:46:29 +0000108to RAM.}%
109
Dominik Riebelingc75a8442006-04-04 21:48:47 +0000110\begin{table}
Alexander Levinfb87e892009-08-24 21:22:18 +0000111 \begin{rbtabular}{.75\textwidth}{XXX}%
112 {\textbf{Tag} & \textbf{Type} & \textbf{Origin}}{}{}
Robert Kukla09fc0782008-02-13 12:34:47 +0000113 filename & string & system \\
114 album & string & id tag \\
115 albumartist & string & id tag \\
116 artist & string & id tag \\
117 comment & string & id tag \\
118 composer & string & id tag \\
119 genre & string & id tag \\
120 grouping & string & id tag \\
121 title & string & id tag \\
122 bitrate & numeric & id tag \\
123 discnum & numeric & id tag \\
124 year & numeric & id tag \\
125 tracknum & numeric & id tag/filename \\
126 autoscore & numeric & runtime db \\
127 lastplayed & numeric & runtime db \\
128 playcount & numeric & runtime db \\
129 Pm (play time - min) & numeric & runtime db \\
130 Ps (play time - sec) & numeric & runtime db \\
131 rating & numeric & runtime db \\
132 commitid & numeric & system \\
133 entryage & numeric & system \\
134 length & numeric & system \\
135 Lm (track len - min) & numeric & system \\
136 Ls (track len - sec) & numeric & system \\
Alexander Levinfb87e892009-08-24 21:22:18 +0000137 \end{rbtabular}
Dominik Riebelingc75a8442006-04-04 21:48:47 +0000138\end{table}