Repository navigation
server: realtime API: send complete after committed audio drains - #30994
Conversation
Completion is triggered when the stream runs dry, which is a timing proxy: audio appended while the tail drains leaks into the committed item, a final commit before the drain merges both items, and back to back commits collapse into one. mtmd_audio_stream_flush() records the row count at the end of the flushed audio (mtmd_audio_stream_get_n_rows_flushed), next to the rows produced so far (mtmd_audio_stream_get_n_rows). The slot keeps a FIFO of these end rows and completes each commit once every row up to it is decoded.
|
Tested on Voxtral Realtime Q8_0 with jfk.wav split at the pause: the nominal case works, but n == 0 is a timing proxy rather than the commit boundary, so three cases go wrong: audio appended while the tail drains ("Ask what you can do for your" lands in the committed item), a final commit before the drain (both items merge into one completed), and two back to back commits (one item for two commits). I pushed a fix on this branch that keeps the PR's architecture (the audio_commit_drained marker and the deferred completed in the route) and only changes what triggers the marker: the end row is recorded at flush time (two small getters in mtmd, n_samples / samples_per_tok once the padding is added) and a FIFO of targets in the slot fires it once every row up to it is decoded. This is T0mSIlver's option (a) inside your structure, all three cases are fixed, deterministic over 3 runs. |
…l-org#30994) * server: realtime API: send complete after committed audio drains * server: realtime API: complete a commit at its end row Completion is triggered when the stream runs dry, which is a timing proxy: audio appended while the tail drains leaks into the committed item, a final commit before the drain merges both items, and back to back commits collapse into one. mtmd_audio_stream_flush() records the row count at the end of the flushed audio (mtmd_audio_stream_get_n_rows_flushed), next to the rows produced so far (mtmd_audio_stream_get_n_rows). The slot keeps a FIFO of these end rows and completes each commit once every row up to it is decoded. --------- Co-authored-by: Pascal <admin@serveurperso.com>
Overview
Fix #30968
Requirements