snd_sgbuf_get_addr(9)
β¨ snd_sgbuf_get_addr(9) β¨
okay so this is a page from the Kernel API Manual, and bestie, it is short but it absolutely delivers. Let's get into it π
πΈ NAME πΈ
snd_sgbuf_get_addr β literally just hands you the physical address at the matching offset. that's the whole job. iconic, honestly π
π¦ SYNOPSIS π¦
dma_addr_t snd_sgbuf_get_addr (struct snd_dma_buffer *dmab , size_t
offset );
π ARGUMENTS π
dmabβ the buffer allocation info. like, everything you need to know about how this buffer got allocated π«Άoffsetβ the offset within the ring buffer. yes, the ring buffer specifically, not just any buffer, iykyk β¨
β RETURN β
it gives you back the physical address. that's it. that's the return value. slay π
π₯ SEE ALSO π₯
this is the kernel file ./sound/core/memalloc.c, and it comes with a whole friend group π go check out:
snd_dma_alloc_dir_pages(9)snd_dma_alloc_pages_fallback(9)snd_dma_free_pages(9)snd_devm_alloc_dir_pages(9)snd_dma_buffer_mmap(9)snd_dma_buffer_sync(9)snd_sgbuf_get_page(9)snd_sgbuf_get_chunk_size(9)
lowkey a whole squad of dma helpers, and snd_sgbuf_get_addr is out here doing one (1) thing and doing it well π no cap
and that's the page, bestie! this one lives in ./sound/core, version October 2026, and it's part of the Kernel API Manual π so go forth and get those physical addresses π§ββοΈπ
π¦ 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