浏览代码

set default buffer sizes

philippe44 5 年之前
父节点
当前提交
ff216626fe
共有 2 个文件被更改,包括 7 次插入0 次删除
  1. 2 0
      components/squeezelite/output_i2s.c
  2. 5 0
      components/squeezelite/squeezelite.h

+ 2 - 0
components/squeezelite/output_i2s.c

@@ -264,6 +264,8 @@ static void *output_thread_i2s() {
 				LOG_INFO("Restarting I2S.");
 				i2s_start(CONFIG_I2S_NUM);
 			} 
+			
+			// TODO: synchronize sample rate change when the block is at the DAC, not added to the DMA buffer
 			if (i2s_config.sample_rate != output.current_sample_rate) {
 				LOG_INFO("changing sampling rate %u to %u", i2s_config.sample_rate, output.current_sample_rate);
 				i2s_config.sample_rate = output.current_sample_rate;

+ 5 - 0
components/squeezelite/squeezelite.h

@@ -240,8 +240,13 @@
 #endif // !LINKALL
 
 // config options
+#if !EMBEDDED
 #define STREAMBUF_SIZE (2 * 1024 * 1024)
 #define OUTPUTBUF_SIZE (44100 * 8 * 10)
+#else
+#define STREAMBUF_SIZE (480 * 1024)
+#define OUTPUTBUF_SIZE (1450 * 1024)
+#endif
 #define OUTPUTBUF_SIZE_CROSSFADE (OUTPUTBUF_SIZE * 12 / 10)
 
 #define MAX_HEADER 4096 // do not reduce as icy-meta max is 4080