diff options
-rw-r--r-- | apps/settings_list.c | 36 | ||||
-rwxr-xr-x | manual/configure_rockbox/system_options.tex | 19 |
2 files changed, 40 insertions, 15 deletions
diff --git a/apps/settings_list.c b/apps/settings_list.c index 1bf8b4202f..0ea6026346 100644 --- a/apps/settings_list.c +++ b/apps/settings_list.c | |||
@@ -354,6 +354,31 @@ static const char graphic_numeric[] = "graphic,numeric"; | |||
354 | # endif | 354 | # endif |
355 | #endif | 355 | #endif |
356 | 356 | ||
357 | /* | ||
358 | * Total buffer size due to this setting = max files in dir * 52 bytes | ||
359 | * Keep this in mind when selecting the maximum - if the maximum is too | ||
360 | * high it's possible rockbox could hit OOM and become unusable until | ||
361 | * the config file is deleted manually. | ||
362 | * | ||
363 | * Note the FAT32 limit is 65534 files per directory, but this limit | ||
364 | * also applies to the database browser so it makes sense to support | ||
365 | * larger maximums. | ||
366 | */ | ||
367 | #if MEMORYSIZE >= 16 | ||
368 | # define MAX_FILES_IN_DIR_DEFAULT 5000 | ||
369 | # define MAX_FILES_IN_DIR_MAX 100000 | ||
370 | # define MAX_FILES_IN_DIR_STEP 1000 | ||
371 | #elif MEMORYSIZE >= 8 | ||
372 | # define MAX_FILES_IN_DIR_DEFAULT 5000 | ||
373 | # define MAX_FILES_IN_DIR_MAX 40000 | ||
374 | # define MAX_FILES_IN_DIR_STEP 500 | ||
375 | #else | ||
376 | /* historical defaults, only for 2 MiB targets these days */ | ||
377 | # define MAX_FILES_IN_DIR_DEFAULT 1000 | ||
378 | # define MAX_FILES_IN_DIR_MAX 10000 | ||
379 | # define MAX_FILES_IN_DIR_STEP 50 | ||
380 | #endif | ||
381 | |||
357 | #if LCD_DEPTH > 1 | 382 | #if LCD_DEPTH > 1 |
358 | static const char* list_pad_formatter(char *buffer, size_t buffer_size, | 383 | static const char* list_pad_formatter(char *buffer, size_t buffer_size, |
359 | int val, const char *unit) | 384 | int val, const char *unit) |
@@ -1028,13 +1053,10 @@ const struct settings_list settings[] = { | |||
1028 | "max files in playlist", UNIT_INT, 1000, 32000, 1000, | 1053 | "max files in playlist", UNIT_INT, 1000, 32000, 1000, |
1029 | NULL, NULL, NULL), | 1054 | NULL, NULL, NULL), |
1030 | INT_SETTING(F_BANFROMQS, max_files_in_dir, LANG_MAX_FILES_IN_DIR, | 1055 | INT_SETTING(F_BANFROMQS, max_files_in_dir, LANG_MAX_FILES_IN_DIR, |
1031 | #if MEMORYSIZE > 1 | 1056 | MAX_FILES_IN_DIR_DEFAULT, "max files in dir", UNIT_INT, |
1032 | 1000, | 1057 | MAX_FILES_IN_DIR_STEP /* min */, MAX_FILES_IN_DIR_MAX, |
1033 | #else | 1058 | MAX_FILES_IN_DIR_STEP, |
1034 | 200, | 1059 | NULL, NULL, NULL), |
1035 | #endif | ||
1036 | "max files in dir", UNIT_INT, 50, 10000, 50, | ||
1037 | NULL, NULL, NULL), | ||
1038 | /* use this setting for user code even if there's no exchangable battery | 1060 | /* use this setting for user code even if there's no exchangable battery |
1039 | * support enabled */ | 1061 | * support enabled */ |
1040 | #if BATTERY_CAPACITY_INC > 0 | 1062 | #if BATTERY_CAPACITY_INC > 0 |
diff --git a/manual/configure_rockbox/system_options.tex b/manual/configure_rockbox/system_options.tex index 336b0dd84d..ba80a6e6e4 100755 --- a/manual/configure_rockbox/system_options.tex +++ b/manual/configure_rockbox/system_options.tex | |||
@@ -102,18 +102,21 @@ This sub menu relates to limits in the Rockbox operating system. | |||
102 | \begin{description} | 102 | \begin{description} |
103 | \item [Max Entries in File Browser.] This setting controls the limit on | 103 | \item [Max Entries in File Browser.] This setting controls the limit on |
104 | the number of files that you can see in any particular directory in the | 104 | the number of files that you can see in any particular directory in the |
105 | file browser. You can configure the size to be between 50 and | 105 | file browser. \opt{HAVE_DISK_STORAGE}{Higher values will shorten the music |
106 | 10,000 files in steps of 50. The default is 400. \opt{HAVE_DISK_STORAGE}{ | 106 | buffer, which can negatively affect battery life by forcing the disk to |
107 | Higher values will shorten the music buffer, which can negatively affect | 107 | spin up more often. Increase this setting \emph{only} if you need to.} |
108 | battery life by forcing the disk to spin up more often. Increase this | 108 | |
109 | setting \emph{only} if you need to.} | 109 | \note{This setting also affects the maximum number of tracks that can |
110 | be handled by the database browser. If you find that long lists are not | ||
111 | being sorted correctly in the database browser you may need to increase | ||
112 | this setting.} | ||
110 | 113 | ||
111 | \item [Max Playlist Size.] This setting controls the maximum size of | 114 | \item [Max Playlist Size.] This setting controls the maximum size of |
112 | a playlist. The playlist size can be between 1,000 and 32,000 files, | 115 | a playlist. The playlist size can be between 1,000 and 32,000 files, |
113 | in steps of 1,000 (default is 10,000). \opt{HAVE_DISK_STORAGE}{Higher | 116 | in steps of 1,000 (default is 10,000). \opt{HAVE_DISK_STORAGE}{Higher |
114 | values will shorten the music buffer, which can negatively affect battery | 117 | values will shorten the music buffer, which can negatively affect |
115 | life by forcing the disk to spin up more often. Increase this setting | 118 | battery life by forcing the disk to spin up more often. Increase this |
116 | \emph{only} if you use very large playlists.} | 119 | setting \emph{only} if you use very large playlists.} |
117 | 120 | ||
118 | \item [Glyphs To Cache.] This sets the default memory allocation size | 121 | \item [Glyphs To Cache.] This sets the default memory allocation size |
119 | for fonts in unique glyphs. This should be set to the number of unique | 122 | for fonts in unique glyphs. This should be set to the number of unique |