Re: DMA buffer size.

Hannu Savolainen (
Tue, 3 Dec 1996 09:21:23 +0200 (EET)

On Thu, 28 Nov 1996 wrote:

> I've never seen quake, but I had a similar problem when I wrote a simple
> audio server. I had a 64k buffer, and if the server pumped out data at
> 8kb/s, 8 seconds of sound would be buffered. So any change in the location
> of the audio sources would lag by 8 seconds. There's a SOUND_PCM_SUBDIVIDE
> ioctl which lets you use a smaller buffer, but it didn't work - there was
> still an 8 second lag. So I reduced buffer size and it worked :)
SOUND_PCM_SUBDIVIDE must be called very early. Calling it after first
read(), write() or call to SNDCTL_DSP_GETBLKSIZE doesn't have any effect.

Using SNDCTL_DSP_SETFRAGMENT should give better results than
SOUND_PCM_SUBDIVIDE. More information about programming audio can be
found from

Best regards,

Hannu Savolainen (, (my home page) (Open Sound System (OSS)) (OSS Free/TASD/VoxWare)