Repository navigation
fix(audio): preserve partial streaming PCM writes - #739
MrKitty871 wants to merge 1 commit into
Conversation
|
🤖 Hermes-Relay automated PR intake Thanks for the streaming PCM fix! Intake sees an Android audio change in This targets Still missing from the template: Changes, Screenshots or an explicit "No visual change", Compatibility / risk, Lineage / contributor credit, and Checklist. A maintainer will review the base branch and the missing intake evidence. |
|
Thanks @MrKitty871 - the 192,800-byte chunk and 33,600-byte buffer reproduction was useful. I compared this with #747, including cancellation and the post-stop amplitude race. The implementation now on dev covers those paths and retries the PCM tail in bounded writes, so I'm closing this as overlapping work. It isn't in an Android release yet, and I haven't repeated your Samsung listening test on that implementation. |
Summary
AudioTrack.write(..., WRITE_BLOCKING)accepts only a prefix before playback startsstop()to release the activeAudioTrackwithout waiting for the writer lockReproduction
On a Samsung device, the first synthesized TTS delta contained 192,800 bytes of 24-kHz mono PCM while the fast-path
AudioTrackbuffer held 33,600 bytes (700 ms). The stopped streaming track accepted only that prefix. Relay treated the positive partial return as completion, discarded the remaining 159,200 bytes, and subsequently logged playback underruns. The spoken answer therefore began late and skipped multiple lines.Verification
:app:testSideloadDebugUnitTest --tests 'com.hermesandroid.relay.audio.RealtimePcmBufferPolicyTest':app:assembleSideloadCandidategit diff --check