From 8625665a417080d854e1f7023b59f7db0f4fa3f8 Mon Sep 17 00:00:00 2001 From: clement Date: Sun, 21 Jun 2026 21:48:36 +0200 Subject: [PATCH] refactor(audio): retire l'instrumentation SCO de debug --- components/audio_router/audio_router.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/components/audio_router/audio_router.c b/components/audio_router/audio_router.c index f5e6a55..4f686b7 100644 --- a/components/audio_router/audio_router.c +++ b/components/audio_router/audio_router.c @@ -194,17 +194,12 @@ int audio_router_get_aec(void) { return s_aec_mode; } int audio_router_get_play_gain(void) { return s_play_gain; } int audio_router_get_mic_gain(void) { return s_mic_gain; } -/* --- Compteurs de diagnostic SCO (temporaires) --- */ -static volatile uint32_t s_dbg_in_bytes = 0; /* PCM recu du BT (feed_playback) */ -static volatile uint32_t s_dbg_cap = 0; /* frames micro capturees */ - static void tone_task(void *a) { (void)a; int16_t buf[FRAME * 2]; uint32_t ph = 0; int64_t t = 0; /* ms écoulées dans l'état courant */ - uint32_t sco_it = 0, sco_play = 0, sco_under = 0; static int16_t sco_acc[FRAME]; /* accumulateur mono SCO */ int sco_acc_n = 0; @@ -271,15 +266,7 @@ static void tone_task(void *a) esp_err_t wr = i2s_channel_write(hal_i2s_spk_handle(), buf, sizeof(buf), &written, pdMS_TO_TICKS(50)); sco_acc_n = 0; - sco_play++; - if (++sco_it % 100 == 0) { - ESP_LOGI(TAG, "SCO diag: in=%u play=%u under=%u cap=%u wrote=%u wr=%s", - (unsigned)s_dbg_in_bytes, (unsigned)sco_play, - (unsigned)sco_under, (unsigned)s_dbg_cap, - (unsigned)written, esp_err_to_name(wr)); - } - } else { - sco_under++; /* pas encore une frame complete */ + (void)wr; } continue; } @@ -369,7 +356,6 @@ static void sco_mic_task(void *a) int64_t e = 0; int n = hal_i2s_capture_read_frame(mono, FRAME, &e); if (n <= 0) { vTaskDelay(pdMS_TO_TICKS(5)); continue; } - s_dbg_cap++; /* 0) NLMS (mode 2) : recupere la frame de reference (downlink joue, * alignee par le ring + le retard) et annule l'echo sur le micro brut. */ @@ -479,7 +465,6 @@ void audio_router_sco_end(void) void audio_router_sco_feed_playback(const uint8_t *pcm, uint32_t len) { if (s_sco_play_rb && s_sco_active) { - s_dbg_in_bytes += len; xRingbufferSend(s_sco_play_rb, pcm, len, 0); } }