STRUCT SND_COMPR_TSTAMP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct snd_compr_tstamp(9) β€” bestie's guide πŸ’–

okay so welcome to the kernel API manual, specifically the page for struct snd_compr_tstamp, and yes it's in section 9, and yes we're gonna get into it πŸŽ€


✨ NAME ✨

struct snd_compr_tstamp β€” the timestamp descriptor. that's it, that's the whole vibe. it's the little struct that keeps track of when and how much stuff is moving through your compressed audio stream πŸ¦‹


🌸 SYNOPSIS 🌸

here's the whole thing, no cap, exactly how it looks:

struct snd_compr_tstamp {
    __u32 byte_offset;
    __u32 copied_total;
    __u32 pcm_frames;
    __u32 pcm_io_frames;
    __u32 sampling_rate;
 };

five __u32 fields, all lined up like a little squad πŸ’…


πŸ‘‘ Members πŸ‘‘

okay this is the part where we meet each field individually. group chat introductions, let's go 🫢

  • byte_offset β€” the byte offset in the ring buffer, pointing at the DSP. like, where in the buffer is the DSP actually at rn πŸ“
  • copied_total β€” the total number of bytes copied from the ring buffer to the DSP, or to the ring buffer by the DSP. total. cumulative. the whole count πŸ’―
  • pcm_frames β€” frames decoded or encoded by the DSP. important bestie moment: this field will evolve by large steps and should only be used to monitor encoding/decoding progress. it shall not be used for timing estimates. like. don't do it. it's not that girl for timing 😭
  • pcm_io_frames β€” frames rendered or received by the DSP into a mixer or an audio output/input. this is the field you want for A/V sync or time estimates. this one ate and left no crumbs πŸ”₯
  • sampling_rate β€” the sampling rate of the audio. sample rate. of the audio. that's the whole thing 🎡
quick recap so nobody mixes them up: pcm_frames = progress monitor only (big steps, no timing), pcm_io_frames = the actual timing/sync icon. iykyk ⭐

🌈 SEE ALSO 🌈

go read these next, they're all in the kernel file ./include/uapi/sound/compress_offload.h and honestly it's giving family reunion:

  • struct snd_compressed_buffer(9)
  • struct snd_compr_params(9)
  • struct snd_compr_tstamp64(9)
  • struct snd_compr_avail(9)
  • struct snd_compr_avail64(9)
  • struct snd_compr_caps(9)
  • struct snd_compr_codec_caps(9)
  • enum sndrv_compress_encoder(9)
  • struct snd_compr_metadata(9)
  • struct snd_compr_task(9)
  • enum snd_compr_state(9)
  • struct snd_compr_task_status(9)

πŸ’€ reminder: pcm_frames is for progress-monitoring only. timing estimates from it = undefined behaviour in spirit. use pcm_io_frames and thank me later πŸ™ˆ

and that's the page!! this one lives at ./include/uapi/sound, dated October 2026, and it's filed under struct snd_compr_tstamp(9) in section 9 of the Kernel API Manual β€” mwah, drink water, go sync your A/V properly πŸ§šπŸ’œπŸ’…

πŸ“¦ where this page comes from