STRUCT VIRTIO_PCM_MSG(9)
π struct virtio_pcm_msg(9) π
okay so bestie, welcome to the Kernel API Manual β today's main character is struct virtio_pcm_msg, and no cap, it's literally the little envelope that carries your audio data around in VirtIO land. π
β¨ NAME β¨
struct virtio_pcm_msg β a VirtIO I/O message. that's it, that's the vibe. one struct, one job, and it does it flawlessly. π
πΈ SYNOPSIS πΈ
okay here's the whole thing laid out, look at her:
struct virtio_pcm_msg {
struct virtio_pcm_substream *substream;
struct virtio_snd_pcm_xfer xfer;
struct virtio_snd_pcm_status status;
size_t length;
struct scatterlist sgs[];
};
ngl, that trailing sgs[] is giving flexible array member energy and we stan. π¦
π§ MEMBERS π§
time for the member-by-member vibe check, bestie β every single one, no skipping:
substreamβ the VirtIO PCM substream. like, which stream is this message even for? this one. she's the reference back home. πxferβ the request header payload. this is what you're asking the other side to do. the ask, the slay. β¨statusβ the response header payload. the clapback. the receipts. the "did it work tho" energy. πlengthβ data length in bytes. asize_t, because we're not monsters. π₯sgsβ payload scatter-gather table. iconic, scattered, gathered, exactly as intended. π
π SEE ALSO π
the whole friend group, fr fr β Kernel file ./sound/virtio/virtio_pcm_msg.c plus:
enum pcm_msg_sg_index(9)virtsnd_pcm_sg_num(9)virtsnd_pcm_sg_from(9)virtsnd_pcm_msg_alloc(9)virtsnd_pcm_msg_free(9)virtsnd_pcm_msg_send(9)virtsnd_pcm_msg_pending_num(9)virtsnd_pcm_msg_complete(9)virtsnd_pcm_notify_cb(9)virtsnd_pcm_tx_notify_cb(9)virtsnd_pcm_rx_notify_cb(9)virtsnd_pcm_ctl_msg_alloc(9)
like, go read them, they're all part of the same squad. π«Ά
bestie reminder: this is the whole page, so if you were hoping for more lore, the lore is the struct. go read the SEE ALSOs, iykyk. π
and that's a wrap, periodt! π this absolute banger of a page lives in ./sound/virtio (that's the source/version, mwah π) and it's dated October 2026, so she's fresh. bye bestie, go make some audio messages! π¦β
struct virtio_pcm_msg(9) π
π¦ 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