sta32x_set_dai_sysclk(9)
β¨ sta32x_set_dai_sysclk(9) β¨
okay bestie, so this one lives in the Kernel API Manual and honestly? it's giving "small function, big responsibilities" π it's a kernel function, it's about clocking, and you're gonna want to read the whole thing before you go poking at your machine driver. no cap.
πΈ NAME πΈ
sta32x_set_dai_sysclk β configure MCLK π
π¦ SYNOPSIS π¦
int sta32x_set_dai_sysclk (struct snd_soc_dai *codec_dai , int clk_id ,
unsigned int freq , int dir );
π ARGUMENTS π
codec_daiβ the codec DAI, literally the thing you're configuring π«Άclk_idβ the clock ID. and yes, it's ignored. she's there, she's pretty, she does nothing πfreqβ the MCLK input frequency, i.e. the number that actually matters π₯dirβ the clock direction. also ignored. also just vibing π
β DESCRIPTION β
so here's the tea β β the value of MCLK is used to determine which sample rates the STA32X supports, and it does that by checking the mclk_ratios table. that's the whole vibe check right there.
π important: this function must be called by the machine driver's 'startup' function. otherwise the list of supported sample rates won't be available in time for ALSA. no startup call, no supported rates, no slay. periodt.
and now for the flexible-clock girlies β¨ β for setups with variable MCLKs, pass 0 as the 'freq' argument. that will cause the theoretically possible sample rates to be enabled. then call it again with a proper value set once the external clock is set (most probably you would do that from a machine's driver 'hw_param' hook). yes gorl, you're calling it twice, and that's iconic of you π
π SEE ALSO π
β¦all hanging out in the kernel file ./sound/soc/codecs/sta32x.c π§ iykyk.
aaaand that's the whole page bestie!! π this lil masterpiece comes to you from ./sound/soc/codecs, October 2026 edition, and it's the sta32x_set_dai_sysclk(9) moment. drink some water, go call your startup function, and stan a well-clocked codec for me ππβ¨
π¦ 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