STRUCT SND_COMPR_OPS(9)
π struct snd_compr_ops(9) β compressed path DSP operations π
okay bestie, welcome to the Kernel API Manual β¨ this page is literally all about struct snd_compr_ops, aka the compressed path DSP operations squad. it's giving βdriver callback central,β and we are going through every single member with zero skips, fr fr π
π NAME π
struct snd_compr_ops β compressed path DSP operations. iconic. no notes. πΈ
β¨ SYNOPSIS β¨
here's the whole struct, copied exactly so nobody comes for me:
struct snd_compr_ops {
int (*open)(struct snd_compr_stream *stream);
int (*free)(struct snd_compr_stream *stream);
int (*set_params)(struct snd_compr_stream *stream, struct
snd_compr_params *params);
int (*get_params)(struct snd_compr_stream *stream, struct snd_codec
*params);
int (*set_metadata)(struct snd_compr_stream *stream, struct
snd_compr_metadata *metadata);
int (*get_metadata)(struct snd_compr_stream *stream, struct
snd_compr_metadata *metadata);
int (*trigger)(struct snd_compr_stream *stream, int cmd);
int (*pointer)(struct snd_compr_stream *stream, struct
snd_compr_tstamp64 *tstamp);
int (*copy)(struct snd_compr_stream *stream, char __user *buf,
size_t count);
int (*mmap)(struct snd_compr_stream *stream, struct vm_area_struct
*vma);
int (*ack)(struct snd_compr_stream *stream, size_t bytes);
int (*get_caps) (struct snd_compr_stream *stream, struct
snd_compr_caps *caps);
int (*get_codec_caps) (struct snd_compr_stream *stream, struct
snd_compr_codec_caps *codec);
#if IS_ENABLED(CONFIG_SND_COMPRESS_ACCEL);
int (*task_create) (struct snd_compr_stream *stream, struct
snd_compr_task_runtime *task);
int (*task_start) (struct snd_compr_stream *stream, struct
snd_compr_task_runtime *task);
int (*task_stop) (struct snd_compr_stream *stream, struct
snd_compr_task_runtime *task);
int (*task_free) (struct snd_compr_stream *stream, struct
snd_compr_task_runtime *task);
#endif;
};
πΈ Members πΈ
member-by-member, no skips, let's go π«Ά
openβ Open the compressed stream. This callback is mandatory and shall keepdspready to receive the stream parameter πfreeβ Close the compressed stream. mandatory. yes bestie, it's required πset_paramsβ Sets the compressed stream parameters. mandatory. This can be called during stream creation only, to set codec params and the stream properties β¨get_paramsβ retrieve the codec parameters. mandatory π₯set_metadataβ Set the metadata values for a stream π¦get_metadataβ retrieves the requested metadata values from stream. no cap πtriggerβ Trigger operations like start, pause, resume, drain, stop. This callback is mandatory βpointerβ Retrieve current h/w pointer information. Mandatory. periodt πcopyβ Copy the compressed data to/from userspace. Optional. Can't be implemented if DSP supportsmmapπ«Άmmapβ DSPmmapmethod tommapDSP memory πackβ Ack for DSP when data is written to audio buffer. Optional. Not valid ifcopyis implemented πget_capsβ Retrieve DSP capabilities. mandatory πget_codec_capsβ Retrieve capabilities for a specific codec. mandatory πtask_createβ Create a set of input/output buffers for accel operations π§task_startβ Start (queue) a task for accel operations π¦task_stopβ Stop (dequeue) a task for accel operations πtask_freeβ Free a set of input/output buffers for accel operations π
π SEE ALSO π
Kernel file ./include/sound/compress_driver.h plus the whole squad: struct snd_compr_task_runtime(9), struct snd_compr_runtime(9), struct snd_compr_stream(9), struct snd_compr(9), snd_compr_use_pause_in_draining(9), snd_compr_set_runtime_buffer(9). go read up, iykyk π
xoxo, your kernel bestie π
β source/version: ./include/sound, dated October 2026 π
π¦ 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