STRUCT SND_DMAENGINE_PCM_CONFIG(9)
π struct snd_dmaengine_pcm_config π
okay bestie, so this one is a page from the Kernel API Manual, section 9, and it's literally all about struct snd_dmaengine_pcm_config β aka the configuration data for dmaengine based PCM. That's the whole vibe. It's the little bundle of settings that tells the dmaengine PCM stuff how to behave, and honestly? Iconic. Let's get into it. π
β¨ SYNOPSIS β¨
here's the whole struct, bestie β every member, no cap:
struct snd_dmaengine_pcm_config {
int (*prepare_slave_config)(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params, struct dma_slave_config
*slave_config);
struct dma_chan *(*compat_request_channel)( struct
snd_soc_pcm_runtime *rtd, struct snd_pcm_substream *substream);
int (*process)(struct snd_pcm_substream *substream, int channel,
unsigned long hwoff, unsigned long bytes);
const char *name;
dma_filter_fn compat_filter_fn;
struct device *dma_dev;
const char *chan_names[SNDRV_PCM_STREAM_LAST + 1];
const struct snd_pcm_hardware *pcm_hardware;
unsigned int prealloc_buffer_size;
};
πΈ Members πΈ
okay so each of these is a lil' field inside the struct, and they ALL matter, so pay attention π«Ά
prepare_slave_configβ a callback you use to fill in the DMAslave_configfor a PCM substream. The way it works: it gets called from the PCM driver'shwparamscallback. so it's like, invoked at hwparams time, periodt.compat_request_channelβ a callback to request a DMA channel for platforms that don't use devicetree. compat mode energy πprocessβ a callback used to apply processing on samples transferred from/to user space. yes, from and to. both directions, bestie.nameβ the component name. and if it's null?dev_namegets used instead. default behavior slay.compat_filter_fnβ this one gets used as the filter function when requesting a channel for platforms that don't use devicetree. the filter parameter will be the DAI's DMA data. iykyk π₯dma_devβ if you set it, the DMA channel gets requested on this device rather than the DAI device. main character device energy πchan_namesβ if set, these custom DMA channel names will be requested at registration time.pcm_hardwareβ thesnd_pcm_hardwarestruct that's used for the PCM.prealloc_buffer_sizeβ the size of the preallocated audio buffer. just aunsigned int, living its life.
π Note π
listen carefully bestie, this is the important one: if bothcompat_request_channelandcompat_filter_fnare set, thencompat_request_channelis the one that gets used to request the channel β andcompat_filter_fngets ignored. π otherwise (i.e. not both), the channel is requested usingdma_request_channelwithcompat_filter_fnas the filter function. don't forget it, fr fr.
π¦ SEE ALSO π¦
- Kernel file
./include/sound/dmaengine_pcm.h snd_pcm_substream_to_dma_direction(9)struct snd_dmaengine_dai_dma_data(9)
and that's the whole page, bestie!! π this cutie lives in ./include/sound, dated October 2026 β so go read the source, mwah πβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms