fsl_dma_open(9)
β¨ fsl_dma_open(9) β¨
okay bestie, welcome to the Kernel API Manual entry for fsl_dma_open β like, the whole manual, and this is the page we're doing π
πΈ NAME πΈ
fsl_dma_open β open a new substream. that's it, that's the vibe π«Ά
π¦ SYNOPSIS π¦
int fsl_dma_open (struct snd_soc_component *component , struct
snd_pcm_substream *substream );
π ARGUMENTS π
componentβ honestly? the manpage says -- undescribed -- π so like. it exists. that's what we know.substreamβ same situation bestie, -- undescribed -- π«
no cap, the docs literally leave these two blank. iconic of them, honestly.
π DESCRIPTION π
so here's the tea: every single substream gets its own DMA buffer. one per substream, no sharing, no borrowing, periodt β¨
ALSA splits that DMA buffer into N periods. we then make NUM_DMA_LINKS link descriptors that ping-pong from one period to the next π like, literally ping-pong, that's the whole bit.
fr fr, if there are six periods and two link descriptors, this is what it looks like before playback even starts:
The last link descriptor ____________ points back to the first |
| V | ___ ___ | | |->| |->| |___| |___| | | |
| V V _________________________________________ | | |
| | | | The DMA buffer is | | | | |
| | divided into 6 parts
|______|______|______|______|______|______|
and here's the after photo πΈ β this is how they look once the first period has finished playing:
____________ | | V | ___ ___ | | |->|
|->| |___| |___| | | |______________ | | V V
_________________________________________ | | | | |
| | | | | | | | | |
|______|______|______|______|______|______|
so the first link descriptor is now pointing at the third period. meanwhile the DMA controller is out there living its best life playing the second period πΆ and the moment it finishes? it jumps right back to the first descriptor and plays the third period. main character energy, truly π
π why do we even do all this
there are four reasons, and yes i'm listing all four because they ate:
- The only way to get the DMA controller to automatically restart the transfer when it gets to the end of the buffer is to use chaining mode. Basic direct mode doesn't offer that feature. so like. it's not optional, bestie.
- We need to receive an interrupt at the end of every period. The DMA controller can generate an interrupt at the end of every link transfer (aka segment). Making each period into a DMA segment will give us the interrupts we need. π
- By creating only two link descriptors, regardless of the number of periods, we do not need to reallocate the link descriptors if the number of periods changes. lowkey genius, no notes π
- All of the audio data is still stored in a single, contiguous DMA buffer, which is what ALSA expects. We're just dividing it into contiguous parts, and creating a link descriptor for each one. best of both worlds fr π
π₯ SEE ALSO π₯
go read these next, they're all in the kernel file ./sound/soc/fsl/fsl_dma.c:
fsl_dma_abort_stream(9)fsl_dma_update_pointers(9)fsl_dma_isr(9)fsl_dma_new(9)fsl_dma_hw_params(9)fsl_dma_pointer(9)fsl_dma_hw_free(9)fsl_dma_close(9)find_ssi_node(9)
π friendly reminder that this whole page lives under ./sound/soc/fsl β that's the directory, she's the source, she's the moment.
and that's the whole page bestie!! π§π it's dated October 2026 and it comes to you straight from the source tree at ./sound/soc/fsl β so like, go forth, open those substreams, and slay π
β¨π
π¦ 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