philippe44 5 years ago
parent
commit
8ddc2a0dc5
3 changed files with 11 additions and 2 deletions
  1. 2 2
      components/raop/rtp.c
  2. 7 0
      components/squeezelite/output_bt.c
  3. 2 0
      components/squeezelite/output_i2s.c

+ 2 - 2
components/raop/rtp.c

@@ -398,7 +398,7 @@ static void buffer_put_packet(rtp_t *ctx, seq_t seqno, unsigned rtptime, bool fi
 
 	if (!ctx->playing) {
 		if ((ctx->flush_seqno == -1 || seq_order(ctx->flush_seqno, seqno)) &&
-		   (ctx->synchro.status & (RTP_SYNC | NTP_SYNC))) {
+		   (ctx->synchro.status & RTP_SYNC) && (ctx->synchro.status & NTP_SYNC)) {
 			ctx->ab_write = seqno-1;
 			ctx->ab_read = seqno;
 			ctx->flush_seqno = -1;
@@ -641,7 +641,7 @@ static void *rtp_thread_func(void *arg) {
 					count = 3;
 				}
 
-				if (ctx->synchro.status & (NTP_SYNC | RTP_SYNC)) ctx->cmd_cb(RAOP_TIMING, NULL);
+				if ((ctx->synchro.status & RTP_SYNC) && (ctx->synchro.status & NTP_SYNC)) ctx->cmd_cb(RAOP_TIMING, NULL);
 
 				break;
 			}

+ 7 - 0
components/squeezelite/output_bt.c

@@ -19,6 +19,7 @@
  *
  */
  
+#include "driver/gpio.h"
 #include "squeezelite.h"
 #include "perf_trace.h"
 
@@ -38,6 +39,7 @@ extern u8_t *silencebuf;
 
 extern void hal_bluetooth_init(const char * options);
 extern void hal_bluetooth_stop(void);
+extern u8_t config_spdif_gpio;
 
 static log_level loglevel;
 static bool running = false;
@@ -65,6 +67,11 @@ static int _write_frames(frames_t out_frames, bool silence, s32_t gainL, s32_t g
 DECLARE_ALL_MIN_MAX;	
 	
 void output_init_bt(log_level level, char *device, unsigned output_buf_size, char *params, unsigned rates[], unsigned rate_delay, unsigned idle) {
+#ifdef CONFIG_SQUEEZEAMP
+	gpio_pad_select_gpio(config_spdif_gpio);
+	gpio_set_direction(config_spdif_gpio, GPIO_MODE_OUTPUT);
+	gpio_set_level(config_spdif_gpio, 0);
+#endif			
 	loglevel = level;
 	running = true;
 	output.write_cb = &_write_frames;

+ 2 - 0
components/squeezelite/output_i2s.c

@@ -157,6 +157,8 @@ struct tas575x_cmd_s {
 	u8_t reg;
 	u8_t value;
 };
+
+u8_t config_spdif_gpio = CONFIG_SPDIF_DO_IO;
 	
 static const struct tas575x_cmd_s tas575x_init_sequence[] = {
     { 0x00, 0x00 },		// select page 0