summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/pcmbuf.c4
-rw-r--r--apps/pcmbuf.h6
-rw-r--r--apps/playback.c12
-rw-r--r--apps/playback.h5
-rw-r--r--apps/settings.c7
5 files changed, 34 insertions, 0 deletions
diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c
index 2075fc66e7..eb8b2a3f3d 100644
--- a/apps/pcmbuf.c
+++ b/apps/pcmbuf.c
@@ -740,7 +740,11 @@ static bool prepare_insert(size_t length)
740 { 740 {
741 pcmbuf_boost(true); 741 pcmbuf_boost(true);
742 /* Pre-buffer 1s. */ 742 /* Pre-buffer 1s. */
743#if MEMORYSIZE <= 1
744 if (!LOW_DATA(1))
745#else
743 if (!LOW_DATA(4)) 746 if (!LOW_DATA(4))
747#endif
744 { 748 {
745 logf("pcm starting"); 749 logf("pcm starting");
746 pcmbuf_play_start(); 750 pcmbuf_play_start();
diff --git a/apps/pcmbuf.h b/apps/pcmbuf.h
index 15633d5214..18a6894fee 100644
--- a/apps/pcmbuf.h
+++ b/apps/pcmbuf.h
@@ -19,12 +19,18 @@
19#ifndef PCMBUF_H 19#ifndef PCMBUF_H
20#define PCMBUF_H 20#define PCMBUF_H
21 21
22#if MEMORYSIZE > 1
22#define PCMBUF_TARGET_CHUNK 32768 /* This is the target fill size of chunks 23#define PCMBUF_TARGET_CHUNK 32768 /* This is the target fill size of chunks
23 on the pcm buffer */ 24 on the pcm buffer */
24#define PCMBUF_MINAVG_CHUNK 24576 /* This is the minimum average size of 25#define PCMBUF_MINAVG_CHUNK 24576 /* This is the minimum average size of
25 chunks on the pcm buffer (or we run out 26 chunks on the pcm buffer (or we run out
26 of buffer descriptors, which is 27 of buffer descriptors, which is
27 non-fatal) */ 28 non-fatal) */
29#else
30#define PCMBUF_TARGET_CHUNK 16384
31#define PCMBUF_MINAVG_CHUNK 12288
32#endif
33
28#define PCMBUF_MIN_CHUNK 4096 /* We try to never feed a chunk smaller than 34#define PCMBUF_MIN_CHUNK 4096 /* We try to never feed a chunk smaller than
29 this to the DMA */ 35 this to the DMA */
30#define PCMBUF_MIX_CHUNK 8192 /* This is the maximum size of one packet 36#define PCMBUF_MIX_CHUNK 8192 /* This is the maximum size of one packet
diff --git a/apps/playback.c b/apps/playback.c
index 11d266b92f..04f67ef4fb 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -136,8 +136,13 @@ enum {
136}; 136};
137 137
138/* As defined in plugins/lib/xxx2wav.h */ 138/* As defined in plugins/lib/xxx2wav.h */
139#if MEMORYSIZE > 1
139#define MALLOC_BUFSIZE (512*1024) 140#define MALLOC_BUFSIZE (512*1024)
140#define GUARD_BUFSIZE (32*1024) 141#define GUARD_BUFSIZE (32*1024)
142#else
143#define MALLOC_BUFSIZE (100*1024)
144#define GUARD_BUFSIZE (8*1024)
145#endif
141 146
142/* As defined in plugin.lds */ 147/* As defined in plugin.lds */
143#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002 148#if CONFIG_CPU == PP5020 || CONFIG_CPU == PP5002
@@ -2930,11 +2935,14 @@ void audio_set_crossfade(int enable)
2930 size_t size; 2935 size_t size;
2931 bool was_playing = (playing && audio_is_initialized); 2936 bool was_playing = (playing && audio_is_initialized);
2932 size_t offset = 0; 2937 size_t offset = 0;
2938#if MEMORYSIZE > 1
2933 int seconds = 1; 2939 int seconds = 1;
2940#endif
2934 2941
2935 if (!filebuf) 2942 if (!filebuf)
2936 return; /* Audio buffers not yet set up */ 2943 return; /* Audio buffers not yet set up */
2937 2944
2945#if MEMORYSIZE > 1
2938 if (enable) 2946 if (enable)
2939 seconds = global_settings.crossfade_fade_out_delay 2947 seconds = global_settings.crossfade_fade_out_delay
2940 + global_settings.crossfade_fade_out_duration; 2948 + global_settings.crossfade_fade_out_duration;
@@ -2943,6 +2951,10 @@ void audio_set_crossfade(int enable)
2943 seconds += 2; 2951 seconds += 2;
2944 logf("buf len: %d", seconds); 2952 logf("buf len: %d", seconds);
2945 size = seconds * (NATIVE_FREQUENCY*4); 2953 size = seconds * (NATIVE_FREQUENCY*4);
2954#else
2955 enable = 0;
2956 size = NATIVE_FREQUENCY*2;
2957#endif
2946 if (pcmbuf_get_bufsize() == size) 2958 if (pcmbuf_get_bufsize() == size)
2947 return ; 2959 return ;
2948 2960
diff --git a/apps/playback.h b/apps/playback.h
index 2f4e19b04f..98e0784efe 100644
--- a/apps/playback.h
+++ b/apps/playback.h
@@ -33,7 +33,12 @@
33/* Not yet implemented. */ 33/* Not yet implemented. */
34#define CODEC_SET_AUDIOBUF_WATERMARK 4 34#define CODEC_SET_AUDIOBUF_WATERMARK 4
35 35
36#if MEMORYSIZE > 1
36#define MAX_TRACK 32 37#define MAX_TRACK 32
38#else
39#define MAX_TRACK 8
40#endif
41
37#define MAX_TRACK_MASK (MAX_TRACK-1) 42#define MAX_TRACK_MASK (MAX_TRACK-1)
38 43
39struct track_info { 44struct track_info {
diff --git a/apps/settings.c b/apps/settings.c
index 3c036d8594..87789bc617 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -269,10 +269,17 @@ static const struct bit_entry rtc_bits[] =
269 "idle poweroff", "off,1,2,3,4,5,6,7,8,9,10,15,30,45,60" }, 269 "idle poweroff", "off,1,2,3,4,5,6,7,8,9,10,15,30,45,60" },
270 {18, S_O(runtime), 0, NULL, NULL }, 270 {18, S_O(runtime), 0, NULL, NULL },
271 {18, S_O(topruntime), 0, NULL, NULL }, 271 {18, S_O(topruntime), 0, NULL, NULL },
272#if MEMORYSIZE > 1
272 {15, S_O(max_files_in_playlist), 10000, 273 {15, S_O(max_files_in_playlist), 10000,
273 "max files in playlist", NULL }, /* 1000...20000 */ 274 "max files in playlist", NULL }, /* 1000...20000 */
274 {14, S_O(max_files_in_dir), 400, 275 {14, S_O(max_files_in_dir), 400,
275 "max files in dir", NULL }, /* 50...10000 */ 276 "max files in dir", NULL }, /* 50...10000 */
277#else
278 {15, S_O(max_files_in_playlist), 1000,
279 "max files in playlist", NULL }, /* 1000...20000 */
280 {14, S_O(max_files_in_dir), 200,
281 "max files in dir", NULL }, /* 50...10000 */
282#endif
276 /* battery */ 283 /* battery */
277 {12, S_O(battery_capacity), BATTERY_CAPACITY_DEFAULT, "battery capacity", 284 {12, S_O(battery_capacity), BATTERY_CAPACITY_DEFAULT, "battery capacity",
278 NULL }, /* 1500...3200 for NiMH, 2200...3200 for LiIon, 285 NULL }, /* 1500...3200 for NiMH, 2200...3200 for LiIon,