STRUCT VIRTIO_PCM_MSG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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. a size_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:

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