diff options
| author | HiFiPHile <[email protected]> | 2026-08-25 09:29:07 +0200 |
|---|---|---|
| committer | HiFiPHile <[email protected]> | 2026-08-25 09:29:07 +0200 |
| commit | ea7d4ef12a4cd2b6fb6986a091888bc838b12574 (patch) | |
| tree | 95c485b8e14ab714010a04a9bea1bf2c40695b2d /examples/host | |
| parent | ad9ecddd7f51ede415992397b82399d7a2639c0f (diff) | |
fix(audio): discard capture data without playback
Continue draining the capture FIFO but skip channel conversion and writes when playback is unavailable or intentionally stopped. This keeps capture running safely in microphone-only phases.
Signed-off-by: HiFiPHile <[email protected]>
Diffstat (limited to 'examples/host')
| -rw-r--r-- | examples/host/audio_host/src/audio_app.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/host/audio_host/src/audio_app.c b/examples/host/audio_host/src/audio_app.c index 0c4ed8a23..3102c28c9 100644 --- a/examples/host/audio_host/src/audio_app.c +++ b/examples/host/audio_host/src/audio_app.c @@ -287,6 +287,9 @@ void audio_app_task_read(void) { if (frames == 0) { return; } + if (!spk_ready) { + return; // capture-only device or playback intentionally stopped + } if (spk_config.channels == mic_config.channels) { memcpy(spk_samples, mic_samples, frames * mic_config.channels * sizeof(int16_t)); |
