snd_soc_dai_set_tdm_slot(9)
π snd_soc_dai_set_tdm_slot(9)
okay so bestie, this is a page from the Kernel API Manual and it's about snd_soc_dai_set_tdm_slot β literally the glow-up your DAI needs to go full TDM mode β¨ grab a strawberry drink and let's get into it π
β¨ NAME β¨
snd_soc_dai_set_tdm_slot β configures a DAI for TDM operation π
πΈ SYNOPSIS πΈ
int snd_soc_dai_set_tdm_slot (struct snd_soc_dai *dai , unsigned int
tx_mask , unsigned int rx_mask , int slots , int slot_width );
no cap, that's the whole signature β five args, one int coming back at you π
π¦ ARGUMENTS π¦
daiβ the DAI you're configuring, i.e. the main character of this whole function πtx_maskβ bitmask representing active TX slots π₯rx_maskβ bitmask representing active RX slots πslotsβ number of slots in useslot_widthβ width in bits for each slot π
π§ DESCRIPTION π§
so this function configures the DAI you passed in for TDM operation, periodt β¨
slot contains the total number of slots of the TDM stream, and slot_with the width of each slot in bit clock cycles πΈ (yes, the manual literally writes slot_with there β not me, not fixing it, copying it exactly, iykyk π).
tx_mask and rx_mask are bitmasks specifying the active slots of the TDM stream for the specified DAI β as in, which slots the DAI should write to or read from π«Ά. The bit rules, bestie, are giving extremely clean logic:
- if a bit is set, the corresponding slot is active β
- if a bit is cleared, the corresponding slot is inactive β
- bit 0 maps to the first slot, bit 1 to the second slot, and so on π’
- the first active slot maps to the first channel of the DAI, the second active slot to the second channel, and so on π―
π¨ and here's the escape hatch: TDM mode can be disabled by passing0forslots. In this casetx_mask,rx_maskandslot_widthwill be ignored β like, fully ignored, don't even worry about them π
returns 0 on success, a negative error code otherwise π (so 0 = slay, negative = not slay)
π SEE ALSO π
kernel file ./sound/soc/soc-dai.c plus the whole friend group bestie:
snd_soc_dai_set_sysclk(9)snd_soc_dai_set_clkdiv(9)snd_soc_dai_set_pll(9)snd_soc_dai_set_bclk_ratio(9)snd_soc_dai_set_bclk_clk(9)snd_soc_dai_set_fmt(9)snd_soc_xlate_tdm_slot_mask(9)snd_soc_dai_set_tdm_idle(9)snd_soc_dai_set_channel_map(9)snd_soc_dai_get_channel_map(9)snd_soc_dai_set_tristate(9)snd_soc_dai_digital_mute(9)
and that's the page babes π this lil manual lives at ./sound/soc and it's dated October 2026 β screenshot it, cite it, cite me, mwah π go configure some slots π¦β¨
π¦ 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