Forum

snd_dma, snd_mem and snd_mix

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

snd_dma, snd_mem and snd_mix

Postby JasonX » Sun Apr 13, 2014 8:08 pm

What are the purpose of those sound files? Is DMA really necessary?
JasonX
 
Posts: 415
Joined: Tue Apr 21, 2009 2:08 pm

Re: snd_dma, snd_mem and snd_mix

Postby Spike » Sun Apr 13, 2014 8:48 pm

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.
Spike
 
Posts: 2911
Joined: Fri Nov 05, 2004 3:12 am
Location: UK


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest