snd_pcm_hw_c...raint_single(9)
π NAME π
snd_pcm_hw_c...raint_single β constrain parameter to a single value
okay so bestie, welcome to the Kernel API Manual β¨ (yes that's the manual we're in, and yes it's a whole vibe). This page is about one little function that does exactly one thing and does it iconically: it pins a parameter down to one single value. No range, no "eh somewhere in between", just this value, periodt. π
β¨ SYNOPSIS β¨
int snd_pcm_hw_constraint_single (struct snd_pcm_runtime *runtime ,
snd_pcm_hw_param_t var , unsigned int val );
that's it, that's the whole signature π«Ά (and yeah, the spacing there is exactly how the page shows it β we don't touch it, we respect it)
π ARGUMENTS π
runtimeβ the PCM runtime instance π like, the actual live object this whole thing is running on, main character energyvarβ thehw_paramsvariable you're constraining π the thing you're about to lock invalβ the value you're constraining it to π― the one and only answer bestie
β RETURN β
So what comes back? Depends on the vibe check π
- Positive β if the value is changed π₯
- Zero β if it's not changed π
- Negative β that's an error code, and no, that's not a slay π
π¦ SEE ALSO π¦
Kernel file ./include/sound/pcm.h β that's the one, go look π§
and like, literally the entire PCM friend group shows up here, no cap:
snd_pcm_stream_linked(9)snd_pcm_stream_lock_irqsave(9)snd_pcm_stream_lock_irqsave_nested(9)snd_pcm_group_for_each_entry(9)snd_pcm_running(9)__snd_pcm_set_state(9)bytes_to_samples(9)bytes_to_frames(9)samples_to_bytes(9)frames_to_bytes(9)frame_aligned(9)snd_pcm_lib_buffer_bytes(9)snd_pcm_lib_period_bytes(9)snd_pcm_playback_avail(9)snd_pcm_capture_avail(9)snd_pcm_playback_hw_avail(9)snd_pcm_capture_hw_avail(9)snd_pcm_playback_ready(9)snd_pcm_capture_ready(9)snd_pcm_playback_data(9)snd_pcm_playback_empty(9)snd_pcm_capture_empty(9)snd_pcm_trigger_done(9)params_channels(9)params_rate(9)params_period_size(9)params_periods(9)params_buffer_size(9)params_buffer_bytes(9)snd_pcm_format_cpu_endian(9)snd_pcm_set_sync(9)snd_pcm_set_runtime_buffer(9)snd_pcm_gettime(9)snd_pcm_set_fixed_buffer(9)snd_pcm_set_fixed_buffer_all(9)snd_pcm_sgbuf_get_addr(9)snd_pcm_sgbuf_get_chunk_size(9)snd_pcm_limit_isa_dma_size(9)snd_pcm_direction_name(9)snd_pcm_stream_str(9)snd_pcm_chmap_substream(9)pcm_format_to_bits(9)pcm_for_each_format(9)
ngl the whole "positive / zero / negative" return thing is the important bit β check it, don't assume it, or you'll be debugging at 3am crying π
okay that's the page!! πΈ source lives under ./include/sound and this cutie is dated October 2026 β so like, it's from the future, we stan a timeless icon ππ bye bestie, go constrain some parameters π«Ά
π¦ 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