STRUCT SND_COMPR_TSTAMP(9)
π 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_framesis for progress-monitoring only. timing estimates from it = undefined behaviour in spirit. usepcm_io_framesand 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
- 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