A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita
audio
rust
zig
deno
mpris
rockbox
mpd
1% $Id$ %
2\section{\label{ref:database}Database}
3
4\subsection{Introduction}
5This chapter describes the Rockbox music database system. Using the information
6contained in the tags (ID3v1, ID3v2, Vorbis Comments, Apev2, etc.) in your
7audio files, Rockbox builds and maintains a database of the music
8files on your player and allows you to browse them by Artist, Album, Genre,
9Song Name, etc. The criteria the database uses to sort the songs can be completely
10 customised. More information on how to achieve this can be found on the Rockbox
11 website at \wikilink{DataBase}.
12
13\subsection{Initializing the Database}
14The first time you use the database, Rockbox will scan your disk for audio files.
15This can take quite a while depending on the number of files on your \dap{}.
16This scan happens in the background, so you can choose to return to the
17Main Menu and continue to listen to music.
18If you shut down your player, the scan will continue next time you turn it on.
19After the scan is finished you may be prompted to restart your \dap{} before
20you can use the database.
21
22\subsubsection{Ignoring Directories During Database Initialization}
23
24You may have directories on your \dap{} whose contents should not be added
25to the database. Placing a file named \fname{database.ignore} in a directory
26will exclude the files in that directory and all its subdirectories from
27scanning their tags and adding them to the database. This will speed up the
28database initialization.
29
30If a subdirectory of an `ignored' directory should still be scanned, place a
31file named \fname{database.unignore} in it. The files in that directory and
32its subdirectories will be scanned and added to the database.
33
34\subsubsection{Issues During Database Commit}
35
36You may have files on your \dap{} whose contents might not be displayed
37correctly or even crash the database.
38Placing a file named \fname{/.rockbox/database\_commit.ignore}
39will prevent the device from committing the database automatically
40you can manually commit the database using the db\_commit plugin in APPS
41with logging
42
43\subsection{\label{ref:databasemenu}The Database Menu}
44
45\begin{description}
46 \opt{tc_ramcache}{
47 \item[Load To RAM]
48 The database can either be kept on \disk{} (to save memory), or
49 loaded into RAM (for fast browsing). Setting this to \setting{Yes} loads
50 the database to RAM, beginning with the next reboot, allowing faster browsing and
51 searching. Setting this option to \setting{No} keeps the database on the \disk{},
52 meaning slower browsing but it does not use extra RAM and saves some battery on
53 boot up.
54
55 \opt{HAVE_DISK_STORAGE}{
56 If you browse your music frequently using the database, you should
57 load to RAM, as this will reduce the overall battery consumption because
58 the disk will not need to spin on each search.
59 }
60
61 \note{When Load to RAM is turned on, and the directory cache (see
62 \reference{ref:dircache}) is enabled as well, it may take an unexpectedly long amount
63 of time for disk activity to wind down after booting, depending on your library size
64 and player.
65
66 This can be mitigated by choosing the \setting{Quick} option instead, which causes
67 the database to ignore cached file references. In that case, you should expect brief
68 moments of disk activity whenever the path for a database entry has to be retrieved.
69
70 Setting this to \setting{On} may be preferable for reducing disk accesses if you plan to
71 take advantage of \setting{Auto Update}, have enabled \setting{Gather Runtime Data}
72 (see below for both), enabled \setting{Automatic resume} (see
73 \reference{ref:Autoresumeconfigactual}), or use a WPS that displays multiple upcoming
74 tracks from the current playlist. In the latter case, metadata will not be displayed
75 for those tracks otherwise.}
76 }
77
78\item[Auto Update]
79 If \setting{Auto update} is set to \setting{on}, each time the \dap{}
80 boots, the database will automatically be updated.
81
82\item[Initialize Now]
83 You can force Rockbox to rescan your disk for tagged files by
84 using the \setting{Initialize Now} function in the \setting{Database
85 Menu}.
86 \warn{\setting{Initialize Now} removes all database files (removing
87 runtimedb data also) and rebuilds the database from scratch.}
88
89\item[Update Now]
90 \setting{Update now} causes the database to detect new and deleted files
91 \note{Unlike the \setting{Auto Update} function, \setting{Update Now}
92 will update the database regardless of whether the \setting{Directory Cache}
93 is enabled. Thus, an update using \setting{Update now} may take a long
94 time.
95 }
96 Unlike \setting{Initialize Now}, the \setting{Update Now} function
97 does not remove runtime database information.
98
99\item[Gather Runtime Data]
100 When enabled, rockbox will record how often and how long a track is being played,
101 when it was last played and its rating. This information can be displayed in
102 the WPS and is used in the database browser to, for example, show the most played,
103 unplayed and most recently played tracks.
104
105\item[Export Modifications]
106 This allows for the runtime data to be exported to the file \\
107 \fname{/.rockbox/database\_changelog.txt}, which backs up the runtime data in
108 ASCII format. This is needed when database structures change, because new
109 code cannot read old database code. But, all modifications
110 exported to ASCII format should be readable by all database versions.
111
112\item[Import Modifications.]
113 Allows the \fname{/.rockbox/database\_changelog.txt} backup to be
114 conveniently loaded into the database. If \setting{Auto Update} is
115 enabled this is performed automatically when the database is initialized.
116
117\item[Select directories to scan.]
118 The database normally scans all directories for audio files. This setting
119 allows you to limit the scan to a specified list of directories, so only
120 files contained in one of these directories will be added to the database.
121 Scanning is recursive -- all subdirectories of a selected directory will
122 be scanned as well.
123
124\end{description}
125
126\subsection{Using the Database}
127Once the database has been initialized, you can browse your music
128by Artist, Album, Genre, Song Name, etc. To use the database, go to the
129 \setting{Main Menu} and select \setting{Database}.\\
130
131\note{You may need to increase the value of the \setting{Max Entries in File
132Browser} setting (\setting{Settings $\rightarrow$ General Settings
133$\rightarrow$ System $\rightarrow$ Limits}) in order to view long lists of
134tracks in the ID3 database browser.\\
135
136To "turn off" the database, do not initialize it, and do not load it to RAM.}%
137
138If the number of tracks you are attempting to play exceeds the value of the
139\setting{Max Playlist Size} setting (\setting{Settings $\rightarrow$ General
140Settings $\rightarrow$ System $\rightarrow$ Limits}), a randomly chosen
141subset of tracks is added to the current playlist instead. This allows you
142to play random tracks from your whole library without having to increase any
143limits that may degrade performance.
144
145\note{For your convenience, a shortcut button "Shuffle Songs" is available directly
146from the \setting{Database} menu to create and start a mix with all of your
147existing music tracks.}
148
149\begin{table}
150 \begin{rbtabular}{.75\textwidth}{XXX}%
151 {\textbf{Tag} & \textbf{Type} & \textbf{Origin}}{}{}
152 filename & string & system \\
153 album & string & id tag \\
154 albumartist & string & id tag \\
155 artist & string & id tag \\
156 comment & string & id tag \\
157 composer & string & id tag \\
158 genre & string & id tag \\
159 grouping & string & id tag \\
160 title & string & id tag \\
161 bitrate & numeric & id tag \\
162 discnum & numeric & id tag \\
163 year & numeric & id tag \\
164 tracknum & numeric & id tag/filename \\
165 autoscore & numeric & runtime db \\
166 lastplayed & numeric & runtime db \\
167 playcount & numeric & runtime db \\
168 Pm (play time -- min) & numeric & runtime db \\
169 Ps (play time -- sec) & numeric & runtime db \\
170 rating & numeric & runtime db \\
171 commitid & numeric & system \\
172 entryage & numeric & system \\
173 length & numeric & system \\
174 Lm (track len -- min) & numeric & system \\
175 Ls (track len -- sec) & numeric & system \\
176 \end{rbtabular}
177\end{table}