STRUCT SOF_IPC_PCM_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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 for hw_params. it's the one that shows up when the hardware params need setting. super chill, super important. ✨
  • hw_free β€” function pointer for hw_free. this is the cleanup bestie, it frees the hardware-side stuff. 🧹
  • trigger β€” function pointer for trigger. 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 to pcm_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 the hw_params should 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 during hw_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 during hw_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 -EOPNOTSUPP back from pointer, 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.h struct sof_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