tasdevice_se...e_profile_id(9)
π tasdevice_set_capture_profile_id
okay so first things first, bestie β this page lives in the Kernel API Manual, and the function we're stanning today is tasdevice_set_capture_profile_id. say it with me: set. capture. profile. id. slay. π
β¨ NAME β¨
tasdevice_set_capture_profile_id β sets the runtime capture profile index via an ALSA control, and honestly? it's giving gatekeeper-but-make-it-helpful π
πΈ SYNOPSIS πΈ
int tasdevice_set_capture_profile_id (struct snd_kcontrol *kcontrol ,
struct snd_ctl_elem_value *ucontrol );
like yes that's the whole signature, no cap, two args and a dream β¨
π¦ ARGUMENTS π¦
kcontrolβ the ALSA kcontrol handle, aka the little guy who triggers this whole operation. main character energy fr π₯ucontrolβ the user space control value, and it's literally carrying the brand-new profile index in its lil hands π«Ά
π DESCRIPTION π
okay so here's the vibe check on what this mixer control handler actually does:
it takes the capture profile ID the user handed over and validates it against the maximum valid index β and that max? it was parsed from the loaded DSP firmware, so it's not just vibes, it's data. then it updates the runtime-stored capture profile ID, but only if the new value differs from the current active one. like, if you're not changing anything, why are you even here? π
and if the submitted profile ID falls outside the valid range? immediate -EINVAL, no hesitation, no second chances. and yes, that includes the edge case where no valid configuration blocks are detected in firmware at all β that's also -EINVAL city, sorry bestie π
π¨ lowkey important: no actual DSP register write happens in this handler. none. zero. it's not that kind of function. the updated profile ID gets applied to the hardware when the next ALSA capture stream starts up, so it's more of a "save it for later" situation π
and the caller doesn't need to take any extra codec lock here β the ALSA control core already guarantees serialized execution, so you can put that lock down, it's handled, we're fine, everything's fine π§β¨
β RETURN β
1β the profile ID value was changed, we did the thing, iconic behavior π0β no modification needed, nothing to see here, we stay unbothered π-EINVALβ the input profile ID is out of valid range. respectfully? rejected. π
π SEE ALSO π
- Kernel file
./sound/soc/codecs/tas2781-i2c.c tas2781_digital_getvol(9)tasdevice_get_capture_profile_id(9)β the sibling, the counterpart, the other half of this duo π«Ά
and that's the page, bestie! stay hydrated, keep your profile IDs in range, and remember this came to you from ./sound/soc/codecs, dated October 2026 β yes, the future, we're ahead of schedule, periodt ππΈπ¦
π¦ 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