snd_dmaengin...rom_dai_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

snd_dmaengine_pcm_set_config_from_dai_data β€” bestie, this one sets up your DMA slave config using the DAI DMA data. Like, it literally initializes a dma slave config from DAI DMA data. That's the whole gig. Periodt.

Welcome to the Kernel API Manual, babes β€” this page is called snd_dmaengin...rom_dai_data(9) (yes the name got truncated, she's mysterious like that ✨).


✨ SYNOPSIS ✨

void snd_dmaengine_pcm_set_config_from_dai_data (const struct
    snd_pcm_substream *substream , const struct snd_dmaengine_dai_dma_data
    *dma_data , struct dma_slave_config *slave_config );

No return value, she just does the thing. Void queen πŸ‘‘.


πŸŽ€ ARGUMENTS πŸŽ€

  • substream β€” the PCM substream. Your main character, honestly.
  • dma_data β€” the DAI DMA data. The vibe source.
  • slave_config β€” the DMA slave configuration. The glow-up target, she's getting filled in.

🌸 DESCRIPTION 🌸

Okay so here's the tea πŸ“: this function initializes the {dst,src}_addr, {dst,src}_maxburst, and {dst,src}_addr_width fields of the DMA slave config β€” and it pulls them straight from the same fields in the DAI DMA data struct. Copy-paste energy, but make it kernel.

Which fields get set? Depends on the direction of the substream, and she's very intentional about it:

  • If the substream is a playback stream β†’ the dst fields get initialized πŸ’…
  • If it's a capture stream β†’ the src fields get initialized πŸ¦‹

Now, the {dst,src}_addr_width field is a little picky, ngl. It only gets initialized if:

  1. the SND_DMAENGINE_PCM_DAI_FLAG_PACK flag is set, or
  2. the addr_width field of the DAI DMA data struct is not equal to DMA_SLAVE_BUSWIDTH_UNDEFINED.

And if both of those conditions are met? πŸ‘€ The latter takes priority. No cap, that's just the rule. Remember it.


πŸ”₯ SEE ALSO πŸ”₯

The kernel file that's giving source-of-truth, no cap:

  • ./sound/core/pcm_dmaengine.c

And the whole friend group 🫢 β€” go say hi:


Okay bye bestie, go configure those DMA slaves πŸ’œβœ¨ This page lives in ./sound/core, dated October 2026, and it's brought to you by the Kernel API Manual β€” slay, read responsibly, and remember: the dst fields are for playback, the src fields are for capture, and DMA_SLAVE_BUSWIDTH_UNDEFINED is not the vibe. πŸŽ€πŸ‘‘

πŸ“¦ where this page comes from