snd_pcm_form...ittle_endian(9)
β¨ NAME β¨
snd_pcm_format_little_endian β bestie's lil vibe check for whether a PCM format is little-endian π
So this is a page from the Kernel API Manual (yes, that's the manual name, love that for us), and it's all about one tiny function that tells you which way your bytes are facing. π¦
πΈ SYNOPSIS πΈ
int snd_pcm_format_little_endian (snd_pcm_format_t format );
That's it. That's the whole call. One argument, one int back. Iconic, honestly. β¨
π ARGUMENTS π
formatβ the format you're checking, bestie. Hand it the PCM format you're curious about and it will absolutely judge it for you. π
π RETURN π
So here's the tea on what you get back, and there are exactly three possibilities, no cap:
1β slay! The given PCM format is little-endian. π₯³0β okay so it's big-endian instead. Different vibe, still valid. π«- a negative error code β this is the "girl, endian not specified" situation. π Not a zero, not a one, a whole negative error code, so don't go treating it like a boolean, fr fr.
Lowkey important:0is a legit answer here (big-endian), so please don't writeif (!snd_pcm_format_little_endian(f))and assume that means error. That's not the move. π
π SEE ALSO π
Grab your snacks, there's a whole friend group here. The kernel file lives at ./sound/core/pcm_misc.c, and these are all the sibling functions you should go say hi to:
snd_pcm_format_signed(9)snd_pcm_format_unsigned(9)snd_pcm_format_linear(9)snd_pcm_format_big_endian(9)snd_pcm_format_width(9)snd_pcm_format_physical_width(9)snd_pcm_format_size(9)snd_pcm_format_silence_64(9)snd_pcm_format_set_silence(9)snd_pcm_hw_limit_rates(9)snd_pcm_rate_to_rate_bit(9)snd_pcm_rate_bit_to_rate(9)snd_pcm_rate_mask_intersect(9)
Not me realizing snd_pcm_format_big_endian(9) is literally right there as the mirror twin π― β go read that one too if you want the other half of the story. π«Ά
Okay bye bestie, go check your endianness π
This lil page came out of ./sound/core, dated October 2026 β so yeah, freshly stamped, go off. πβ¨πΈ
π¦ 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