From f56a421a2df29f21be2f8bcc568f599201a5a578 Mon Sep 17 00:00:00 2001 From: Karl Osterseher Date: Sun, 4 Feb 2024 19:58:42 +0100 Subject: [PATCH] fix #55 Signed-off-by: Karl Osterseher --- components/lightsnapcast/player.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/lightsnapcast/player.c b/components/lightsnapcast/player.c index 2c6dbf0..09e797a 100644 --- a/components/lightsnapcast/player.c +++ b/components/lightsnapcast/player.c @@ -39,6 +39,14 @@ static const char *TAG = "PLAYER"; +#if USE_SAMPLE_INSERTION +const uint32_t SHORT_OFFSET = 128; +const uint32_t MINI_OFFSET = 64; +#else +const uint32_t SHORT_OFFSET = 2; +const uint32_t MINI_OFFSET = 1; +#endif + /** * @brief Pre define APLL parameters, save compute time. They are calculated in * player_setup_i2s() | bits_per_sample | rate | sdm0 | sdm1 | sdm2 | odir @@ -1530,8 +1538,8 @@ static void player_task(void *pvParameters) { const bool enableControlLoop = true; - const int64_t shortOffset = 2; // µs, softsync - const int64_t miniOffset = 1; // µs, softsync + const int64_t shortOffset = SHORT_OFFSET; // µs, softsync + const int64_t miniOffset = MINI_OFFSET; // µs, softsync const int64_t hardResyncThreshold = 10000; // µs, hard sync if (initialSync == 1) {