snd_dma, snd_mem and snd_mix

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
JasonX
Posts: 422
Joined: Tue Apr 21, 2009 2:08 pm

snd_dma, snd_mem and snd_mix

Post by JasonX »

What are the purpose of those sound files? Is DMA really necessary?
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Re: snd_dma, snd_mem and snd_mix

Post by Spike »

dma refers to direct hardware buffer memory access instead of having to make system calls to copy data via registers etc. whether this hardware buffer is emulated by the driver at some interval doesn't matter to quake.
with actual dma, you generally want to avoid reading back. with fake audio dma you probably still want to avoid rewriting the same sample multiple times (so your buffer is always valid tones, even if your mixer fell behind somehow).

snd_dma deals with channel management (with non-dma, you'd be probably programming the hardware to play mix whatever samples itself, like midi). decides per-channel volumes.
snd_mem handles .wav loading (with resampling).
snd_mix does the actual mixing. S_TransferPaintBuffer writes to the dma buffer.
Post Reply