Explorar o código

optimizations - release

Philippe G %!s(int64=4) %!d(string=hai) anos
pai
achega
8c0e766cd7

+ 1 - 1
components/display/display.c

@@ -135,7 +135,7 @@ void display_init(char *welcome) {
 		displayer.by = 2;
 		displayer.pause = 3600;
 		displayer.speed = 33;
-		displayer.task = xTaskCreateStatic( (TaskFunction_t) displayer_task, "displayer_thread", DISPLAYER_STACK_SIZE, NULL, ESP_TASK_PRIO_MIN + 1, xStack, &xTaskBuffer);
+		displayer.task = xTaskCreateStatic( (TaskFunction_t) displayer_task, "common_displayer", DISPLAYER_STACK_SIZE, NULL, ESP_TASK_PRIO_MIN + 1, xStack, &xTaskBuffer);
 		
 		// set lines for "fixed" text mode
 		GDS_TextSetFontAuto(display, 1, GDS_FONT_LINE_1, -3);

+ 1 - 1
components/squeezelite/displayer.c

@@ -353,7 +353,7 @@ bool sb_displayer_init(void) {
 		
 	// create displayer management task
 	displayer.mutex = xSemaphoreCreateMutex();
-	displayer.task = xTaskCreateStatic( (TaskFunction_t) displayer_task, "displayer_thread", SCROLL_STACK_SIZE, NULL, ESP_TASK_PRIO_MIN + 1, xStack, &xTaskBuffer);
+	displayer.task = xTaskCreateStatic( (TaskFunction_t) displayer_task, "squeeze_displayer", SCROLL_STACK_SIZE, NULL, ESP_TASK_PRIO_MIN + 1, xStack, &xTaskBuffer);
 	
 	// chain handlers
 	slimp_handler_chain = slimp_handler;

+ 4 - 4
components/squeezelite/output_i2s.c

@@ -357,8 +357,8 @@ void output_init_i2s(log_level level, char *device, unsigned output_buf_size, ch
 	{
 		static DRAM_ATTR StaticTask_t xTaskBuffer __attribute__ ((aligned (4)));
 		static DRAM_ATTR StackType_t xStack[OUTPUT_THREAD_STACK_SIZE] __attribute__ ((aligned (4)));
-		output_i2s_task = xTaskCreateStatic( (TaskFunction_t) output_thread_i2s, "output_i2s", OUTPUT_THREAD_STACK_SIZE, 
-											  NULL, CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT + 1, xStack, &xTaskBuffer );
+		output_i2s_task = xTaskCreateStaticPinnedToCore( (TaskFunction_t) output_thread_i2s, "output_i2s", OUTPUT_THREAD_STACK_SIZE, 
+											  NULL, CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT + 1, xStack, &xTaskBuffer, 0 );
 	}
 	
 	// do we want stats
@@ -420,9 +420,9 @@ static int _i2s_write_frames(frames_t out_frames, bool silence, s32_t gainL, s32
 	}
 
 	// don't update visu if we don't have enough data in buffer
-	if (_buf_used(outputbuf) > outputbuf->size >> 2) {
+	if (silence || _buf_used(outputbuf) > outputbuf->size >> 2) {
 		output_visu_export(obuf + oframes * BYTES_PER_FRAME, out_frames, output.current_sample_rate, silence, (gainL + gainR) / 2);
-	}	
+	}
 		
 	oframes += out_frames;
 	

+ 1 - 1
components/squeezelite/stream.c

@@ -331,7 +331,7 @@ static void *stream_thread() {
 					if (stream.meta_interval) {
 						space = min(space, stream.meta_next);
 					}
-					
+
 					n = _recv(ssl, fd, streambuf->writep, space, 0);
 					if (n == 0) {
 						LOG_INFO("end of stream (%u bytes)", stream.bytes);