Subject: Re: audio(9) question
To: Jared D. McNeill <>
From: Nathan J. Williams <nathanw@MIT.EDU>
List: tech-kern
Date: 06/25/2001 12:46:09
"Jared D. McNeill" <> writes:

> The trigger_output function is supposed to supply a "circular buffer" that
> contains data to be transfered to the sound card.
> My question is, once I get to the end of this buffer, how do I load more
> data to it? Simply reading from the beginning again makes the sound loop.

The higher-level audio code calls trigger_output with a callback
routine (audio_pint()) that will be called after each "blksize" chunk
is transferred to the device. The audio_pint() routine takes care of
keeping the circular buffer filled.

Note that normally the size of the buffer (end - start) is larger than
blksize, so that audio_pint() will get several chances to do refilling
before the device gets to the end of the buffer and wraps around.

        - Nathan