Dominik Riebeling | c75a844 | 2006-04-04 21:48:47 +0000 | [diff] [blame] | 1 | % $Id$ % |
Jonas Häggqvist | 6b1d2cb | 2006-11-25 09:42:06 +0000 | [diff] [blame] | 2 | \section{\label{ref:database}Database} |
Dominik Riebeling | c75a844 | 2006-04-04 21:48:47 +0000 | [diff] [blame] | 3 | |
| 4 | \subsection{Introduction} |
Jonas Häggqvist | 6b1d2cb | 2006-11-25 09:42:06 +0000 | [diff] [blame] | 5 | This chapter describes the Rockbox music database system. Using the information |
Nils Wallménius | 86171f2 | 2006-09-03 16:43:06 +0000 | [diff] [blame] | 6 | contained in the tags (ID3v1, ID3v2% |
Nils Wallménius | 12eb058 | 2008-03-23 22:07:09 +0000 | [diff] [blame] | 7 | \opt{swcodec}{, Vorbis Comments, Apev2, etc.}% |
Nils Wallménius | 86171f2 | 2006-09-03 16:43:06 +0000 | [diff] [blame] | 8 | ) in your audio files, Rockbox builds and maintains a database of the music |
Marc Guay | 65f3634 | 2008-06-24 05:46:29 +0000 | [diff] [blame] | 9 | files on your player and allows you to browse them by Artist, Album, Genre, |
| 10 | Song 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 Riebeling | c75a844 | 2006-04-04 21:48:47 +0000 | [diff] [blame] | 13 | |
Marc Guay | 65f3634 | 2008-06-24 05:46:29 +0000 | [diff] [blame] | 14 | \subsection{Initializing the Database} |
Dominik Riebeling | 97f2146 | 2007-03-14 22:16:27 +0000 | [diff] [blame] | 15 | The first time you use the database, Rockbox will scan your disk for audio files. |
| 16 | This can take quite a while depending on the number of files on your \dap{}. |
| 17 | This scan happens in the background, so you can choose to return to the |
| 18 | Main Menu and continue to listen to music. |
| 19 | If you shut down your player, the scan will continue next time you turn it on. |
| 20 | After the scan is finished you may be prompted to restart your \dap{} before |
| 21 | you can use the database. |
Dominik Riebeling | c75a844 | 2006-04-04 21:48:47 +0000 | [diff] [blame] | 22 | |
Marc Guay | 65f3634 | 2008-06-24 05:46:29 +0000 | [diff] [blame] | 23 | \subsubsection{Ignoring Directories During Database Initialization} |
Robert Kukla | 09fc078 | 2008-02-13 12:34:47 +0000 | [diff] [blame] | 24 | |
| 25 | You may have directories on your \dap{} whose contents should not be added |
| 26 | to the database. Placing a file named \fname{database.ignore} in a directory |
| 27 | will exclude the files in that directory and all its subdirectories from |
| 28 | scanning their tags and adding them to the database. This will speed up the |
| 29 | database initialization. |
| 30 | |
Alexander Levin | 5a379bc | 2010-05-20 16:35:45 +0000 | [diff] [blame] | 31 | If a subdirectory of an `ignored' directory should still be scanned, place a |
Robert Kukla | 09fc078 | 2008-02-13 12:34:47 +0000 | [diff] [blame] | 32 | file named \fname{database.unignore} in it. The files in that directory and |
| 33 | its subdirectories will be scanned and added to the database. |
| 34 | |
Jonas Häggqvist | 6b1d2cb | 2006-11-25 09:42:06 +0000 | [diff] [blame] | 35 | \subsection{\label{ref:databasemenu}The Database Menu} |
Michael DiFebbo | 642d74d | 2006-07-27 02:02:18 +0000 | [diff] [blame] | 36 | |
Martin Arver | 8570911 | 2006-08-15 10:53:14 +0000 | [diff] [blame] | 37 | \begin{description} |
Nils Wallménius | cf9af01 | 2010-10-12 13:14:17 +0000 | [diff] [blame] | 38 | \opt{tc_ramcache}{ |
Marc Guay | 65f3634 | 2008-06-24 05:46:29 +0000 | [diff] [blame] | 39 | \item[Load To RAM] |
Nils Wallménius | cf9af01 | 2010-10-12 13:14:17 +0000 | [diff] [blame] | 40 | The database can either be kept on \disk{} (to save memory), or |
Martin Arver | 8570911 | 2006-08-15 10:53:14 +0000 | [diff] [blame] | 41 | loaded into RAM (for fast browsing). Setting this to \setting{Yes} loads |
Jonas Häggqvist | 6b1d2cb | 2006-11-25 09:42:06 +0000 | [diff] [blame] | 42 | the database to RAM, allowing faster browsing and searching. Setting this |
Nils Wallménius | cf9af01 | 2010-10-12 13:14:17 +0000 | [diff] [blame] | 43 | option to \setting{No} keeps the database on the \disk{}, meaning slower |
Martin Arver | 8570911 | 2006-08-15 10:53:14 +0000 | [diff] [blame] | 44 | browsing but it does not use extra RAM and saves some battery on boot up. |
| 45 | |
Nils Wallménius | cf9af01 | 2010-10-12 13:14:17 +0000 | [diff] [blame] | 46 | \opt{HAVE_DISK_STORAGE}{ |
Jonas Häggqvist | 6b1d2cb | 2006-11-25 09:42:06 +0000 | [diff] [blame] | 47 | \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énius | cf9af01 | 2010-10-12 13:14:17 +0000 | [diff] [blame] | 50 | } |
Martin Arver | 8570911 | 2006-08-15 10:53:14 +0000 | [diff] [blame] | 51 | } |
| 52 | |
Marc Guay | 65f3634 | 2008-06-24 05:46:29 +0000 | [diff] [blame] | 53 | \item[Auto Update] |
Martin Arver | 8570911 | 2006-08-15 10:53:14 +0000 | [diff] [blame] | 54 | If \setting{Auto update} is set to \setting{on}, each time the \dap{} |
Jonas Häggqvist | 6b1d2cb | 2006-11-25 09:42:06 +0000 | [diff] [blame] | 55 | boots, the database will automatically be updated. |
Nils Wallménius | 86171f2 | 2006-09-03 16:43:06 +0000 | [diff] [blame] | 56 | |
Marc Guay | 65f3634 | 2008-06-24 05:46:29 +0000 | [diff] [blame] | 57 | \item[Initialize Now] |
Dominik Riebeling | 97f2146 | 2007-03-14 22:16:27 +0000 | [diff] [blame] | 58 | You can force Rockbox to rescan your disk for tagged files by |
Steve Bavin | 20d8e8d | 2007-03-15 13:03:37 +0000 | [diff] [blame] | 59 | using the \setting{Initialize Now} function in the \setting{Database |
Nils Wallménius | 86171f2 | 2006-09-03 16:43:06 +0000 | [diff] [blame] | 60 | Menu}. |
Steve Bavin | 20d8e8d | 2007-03-15 13:03:37 +0000 | [diff] [blame] | 61 | \warn{\setting{Initialize Now} removes all database files (removing |
Nils Wallménius | 86171f2 | 2006-09-03 16:43:06 +0000 | [diff] [blame] | 62 | runtimedb data also) and rebuilds the database from scratch.} |
Nils Wallménius | 86171f2 | 2006-09-03 16:43:06 +0000 | [diff] [blame] | 63 | |
Marc Guay | 65f3634 | 2008-06-24 05:46:29 +0000 | [diff] [blame] | 64 | \item[Update Now] |
Jonas Häggqvist | 6b1d2cb | 2006-11-25 09:42:06 +0000 | [diff] [blame] | 65 | \setting{Update now} causes the database to detect new and deleted files |
Nils Wallménius | 12eb058 | 2008-03-23 22:07:09 +0000 | [diff] [blame] | 66 | \opt{swcodec}{ |
Nils Wallménius | 86171f2 | 2006-09-03 16:43:06 +0000 | [diff] [blame] | 67 | \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 Bavin | 20d8e8d | 2007-03-15 13:03:37 +0000 | [diff] [blame] | 73 | Unlike \setting{Initialize Now}, the \setting{Update Now} function |
Martin Arver | 8570911 | 2006-08-15 10:53:14 +0000 | [diff] [blame] | 74 | does not remove runtime database information. |
| 75 | |
Marc Guay | 65f3634 | 2008-06-24 05:46:29 +0000 | [diff] [blame] | 76 | \item[Gather Runtime Data] |
Robert Kukla | 226cb7b | 2007-03-26 15:08:59 +0000 | [diff] [blame] | 77 | 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 Arver | 8570911 | 2006-08-15 10:53:14 +0000 | [diff] [blame] | 81 | |
Marc Guay | 65f3634 | 2008-06-24 05:46:29 +0000 | [diff] [blame] | 82 | \item[Export Modifications] |
Dominik Riebeling | 2e508af | 2007-03-07 15:44:03 +0000 | [diff] [blame] | 83 | This allows for the runtime data to be exported to the file \\ |
Jonas Häggqvist | 6b1d2cb | 2006-11-25 09:42:06 +0000 | [diff] [blame] | 84 | \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 Arver | 8570911 | 2006-08-15 10:53:14 +0000 | [diff] [blame] | 88 | |
Nils Wallménius | b659c0c | 2008-03-22 15:26:45 +0000 | [diff] [blame] | 89 | \item[Import Modifications.] |
Jonas Häggqvist | 6b1d2cb | 2006-11-25 09:42:06 +0000 | [diff] [blame] | 90 | Allows the \fname{/.rockbox/database\_changelog.txt} backup to be |
Dominik Riebeling | 2e508af | 2007-03-07 15:44:03 +0000 | [diff] [blame] | 91 | conveniently loaded into the database. If \setting{Auto Update} is |
Steve Bavin | 20d8e8d | 2007-03-15 13:03:37 +0000 | [diff] [blame] | 92 | enabled this is performed automatically when the database is initialized. |
Martin Arver | 8570911 | 2006-08-15 10:53:14 +0000 | [diff] [blame] | 93 | |
| 94 | \end{description} |
Michael DiFebbo | 642d74d | 2006-07-27 02:02:18 +0000 | [diff] [blame] | 95 | |
Marc Guay | 65f3634 | 2008-06-24 05:46:29 +0000 | [diff] [blame] | 96 | \subsection{Using the Database} |
| 97 | Once the database has been initialized, you can browse your music |
| 98 | by Artist, Album, Genre, Song Name, etc. To use the database, go to the |
| 99 | \setting{Main Menu} and select \setting{Database}.\\ |
Michael DiFebbo | 642d74d | 2006-07-27 02:02:18 +0000 | [diff] [blame] | 100 | |
| 101 | \note{You may need to increase the value of the \setting{Max files in dir |
Nils Wallménius | 909b946 | 2007-03-03 00:07:31 +0000 | [diff] [blame] | 102 | browser} setting (\setting{Settings $\rightarrow$ General Settings |
| 103 | $\rightarrow$ System $\rightarrow$ Limits}) in order to view long lists of |
| 104 | tracks in the ID3 database browser.\\ |
Michael DiFebbo | 642d74d | 2006-07-27 02:02:18 +0000 | [diff] [blame] | 105 | |
Jonas Häggqvist | 6b1d2cb | 2006-11-25 09:42:06 +0000 | [diff] [blame] | 106 | There is no option to turn off database completely. If you do not want |
Thom Johansen | c479b99 | 2008-02-13 13:32:44 +0000 | [diff] [blame] | 107 | to use it just do not do the initial build of the database and do not load it |
Marc Guay | 65f3634 | 2008-06-24 05:46:29 +0000 | [diff] [blame] | 108 | to RAM.}% |
| 109 | |
Dominik Riebeling | c75a844 | 2006-04-04 21:48:47 +0000 | [diff] [blame] | 110 | \begin{table} |
Alexander Levin | fb87e89 | 2009-08-24 21:22:18 +0000 | [diff] [blame] | 111 | \begin{rbtabular}{.75\textwidth}{XXX}% |
| 112 | {\textbf{Tag} & \textbf{Type} & \textbf{Origin}}{}{} |
Robert Kukla | 09fc078 | 2008-02-13 12:34:47 +0000 | [diff] [blame] | 113 | 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 Levin | fb87e89 | 2009-08-24 21:22:18 +0000 | [diff] [blame] | 137 | \end{rbtabular} |
Dominik Riebeling | c75a844 | 2006-04-04 21:48:47 +0000 | [diff] [blame] | 138 | \end{table} |