STRUCT SOF_IPC_PCM_OPS(9)
struct sof_ipc_pcm_ops(9) β IPC-specific PCM ops π
okay so bestie, welcome to the Kernel API Manual page for struct sof_ipc_pcm_ops β literally the little struct that holds all the IPC-specific PCM callbacks. it's giving backstage-pass energy for the SOF audio stack, and you're gonna understand every single field by the end of this. no cap. π
β¨ NAME β¨
struct sof_ipc_pcm_ops β IPC-specific PCM ops πΈ
π¦ SYNOPSIS π¦
struct sof_ipc_pcm_ops {
int (*hw_params)(struct snd_soc_component *component, struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_sof_platform_stream_params *platform_params);
int (*hw_free)(struct snd_soc_component *component, struct snd_pcm_substream *substream);
int (*trigger)(struct snd_soc_component *component, struct snd_pcm_substream *substream, int cmd);
int (*dai_link_fixup)(struct snd_soc_pcm_runtime *rtd, struct snd_pcm_hw_params *params);
int (*pcm_setup)(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm);
void (*pcm_free)(struct snd_sof_dev *sdev, struct snd_sof_pcm *spcm);
int (*pointer)(struct snd_soc_component *component, struct snd_pcm_substream *substream, snd_pcm_uframes_t *pointer);
snd_pcm_sframes_t (*delay)(struct snd_soc_component *component, struct snd_pcm_substream *substream);
bool reset_hw_params_during_stop;
bool ipc_first_on_start;
bool platform_stop_during_hw_free;
bool d0i3_supported_in_s0ix;
};
like, yes, that's a lot of function pointers. don't panic. we're going through them one by one and you're gonna slay this. π
π Members π
the callbacks (function pointers, the main characters)
hw_paramsβ function pointer forhw_params. it's the one that shows up when the hardware params need setting. super chill, super important. β¨hw_freeβ function pointer forhw_free. this is the cleanup bestie, it frees the hardware-side stuff. π§Ήtriggerβ function pointer fortrigger. this is your go-to for the PCM trigger commands. πdai_link_fixupβ function pointer for DAI link fixup. lowkey the vibe-checker for the DAI link. π¦pcm_setupβ function pointer for IPC-specific PCM set up that can be used for allocating additional memory in the SOF PCM stream structure. so if SOF's PCM stream struct needs extra room, this is the girly doing the allocating. πΈpcm_freeβ function pointer for PCM free that can be used for freeing any additional memory in the SOF PCM stream structure. it's the counterpart topcm_setupβ whatever got allocated, this frees it. periodt. πpointerβ function pointer for pcm pointer. yes, the naming is exactly that unserious, and yes, it's iconic. βdelayβ function pointer for pcm delay reporting. it reports the delay, bestie. that's the whole job. π«Ά
the flags (bool squad, so fancy)
reset_hw_params_during_stopβ flag indicating whether thehw_paramsshould be reset during the STOP pcm trigger. πipc_first_on_startβ send IPC before invoking platform trigger during START/PAUSE_RELEASE triggers. order matters here, iykyk. π₯platform_stop_during_hw_freeβ invoke the platform trigger duringhw_free. this is needed for IPC4 where a pipeline is only paused during stop/pause/suspend triggers. the FW keeps the host DMA running in this case and therefore the host must do the same and should stop the DMA duringhw_free. like, the FW sets the rules and we simply must follow them. πd0i3_supported_in_s0ixβ allow DSP D0I3 during S0iX. yes queen, allow it. π
π Note π
okay this is the important one so listen up: the pointer callback may return -EOPNOTSUPP, which should be handled in a same way as if the callback is not provided.
so if you get-EOPNOTSUPPback frompointer, don't panic and don't invent new handling β treat it exactly like the callback wasn't there at all. same energy, same code path. π
π SEE ALSO π
- Kernel file
./sound/soc/sof/sof-audio.hstructsof_ipc_tplg_control_ops(9),struct sof_ipc_tplg_widget_ops(9),struct sof_ipc_tplg_ops(9),struct sof_topology_token(9),struct snd_sof_pcm_stream_pipeline_list(9)
like go read the siblings too, they're all part of the same friend group fr fr. π
and that's the whole page, bestie β you ate. π
β¨ this lil writeup lives in ./sound/soc/sof, dated October 2026, and it's filed under the Kernel API Manual (the struct sof_ipc_pcm_ops(9) entry, obviously π). mwah, go forth and trigger some PCMs responsibly. π«Άπ
π¦ 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