STRUCT SND_DMAENGINE_PCM_CONFIG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 DMA slave_config for a PCM substream. The way it works: it gets called from the PCM driver's hwparams callback. 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_name gets 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 β€” the snd_pcm_hardware struct that's used for the PCM.
  • prealloc_buffer_size β€” the size of the preallocated audio buffer. just a unsigned int, living its life.

πŸ’€ Note πŸ’€

listen carefully bestie, this is the important one: if both compat_request_channel and compat_filter_fn are set, then compat_request_channel is the one that gets used to request the channel β€” and compat_filter_fn gets ignored. 😭 otherwise (i.e. not both), the channel is requested using dma_request_channel with compat_filter_fn as the filter function. don't forget it, fr fr.

πŸ¦‹ SEE ALSO πŸ¦‹


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