SIGN IN SIGN UP

ports/stm: track source position across DMA half-fills in audioio

load_dma_buffer_half() previously called audiosample_get_buffer() on
every half-fill and discarded any unconsumed bytes. Sources that return
buffers larger than AUDIOOUT_DMA_HALF_SAMPLES (e.g. a 4410-sample
RawSample) had everything past the first half-buffer worth of samples
silently dropped, producing the wrong waveform.

Track src_ptr / src_remaining_len / src_done on the object so a single
source buffer is consumed across as many half-fills as needed before
the next get_buffer call. End-of-stream (GET_BUFFER_DONE) is handled
on the next fill rather than mid-fill so any trailing data in the
current buffer is played first.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
C
Chris Nourse committed
81467e58afc999cd5b328172d85bc4358b68a93d
Parent: ff10e51