summaryrefslogtreecommitdiff
path: root/src/class/audio/audio_host.h
diff options
context:
space:
mode:
authorHiFiPHile <[email protected]>2026-08-25 09:28:12 +0200
committerHiFiPHile <[email protected]>2026-08-25 09:28:12 +0200
commitddf4bad89017dab131eddf2fa27d835218e7f72e (patch)
treee0d3fe77802c9046a811227b15604644a8454728 /src/class/audio/audio_host.h
parentdfac26a272fa7bbbca2050fbe9f1ca09008e548e (diff)
fix(audio): drive streams from transfer completion
Keep capture and playback transfers continuously armed from their completion callbacks. Capture overwrites the oldest complete frames when full, while playback sends silence on underrun without consuming partial queued audio. Signed-off-by: HiFiPHile <[email protected]>
Diffstat (limited to 'src/class/audio/audio_host.h')
-rw-r--r--src/class/audio/audio_host.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/class/audio/audio_host.h b/src/class/audio/audio_host.h
index 74dfdcdb6..9fcbe2577 100644
--- a/src/class/audio/audio_host.h
+++ b/src/class/audio/audio_host.h
@@ -45,7 +45,8 @@ extern "C" {
// Depth in bytes of the per-stream data FIFO. The FIFO decouples the
// application's read/write calls from the endpoint's isochronous polling cadence
-// and absorbs rate differences. 1024 bytes hold 4 default (256 B) packets.
+// and absorbs rate differences. Capture overwrites the oldest frames when full.
+// 1024 bytes hold 4 default (256 B) packets.
#ifndef CFG_TUH_AUDIO_STREAM_BUFSIZE
#define CFG_TUH_AUDIO_STREAM_BUFSIZE 1024
#endif
@@ -240,7 +241,8 @@ void tuh_audio_umount_cb(uint8_t idx);
void tuh_audio_capture_cb(uint8_t idx, uint8_t stream_idx, uint16_t xferred_bytes);
// Invoked when an isochronous OUT transfer completes successfully: the
-// next queued packet is submitted from the stream's playback FIFO.
+// next playback packet is submitted from the stream FIFO, or as silence when
+// a complete packet is not queued.
void tuh_audio_playback_cb(uint8_t idx, uint8_t stream_idx, uint16_t xferred_bytes);
// Invoked when an isochronous transfer fails. The stream is stopped