v4l2_subdev_enable_streams(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… v4l2_subdev_enable_streams(9) β€” the Kernel API Manual glow-up πŸŽ€

okay so bestie, welcome to the v4l2_subdev_enable_streams(9) page from the Kernel API Manual ✨ this is the one that turns streams ON, and we're gonna walk through it together, no cap 🫢


🌸 NAME 🌸

v4l2_subdev_enable_streams β€” Enable streams on a pad πŸ’«

like literally, that's the whole job. enabling streams. on a pad. iconic behavior honestly πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

int v4l2_subdev_enable_streams (struct v4l2_subdev *sd , u32 pad , u64
streams_mask );

three args, one int back, that's the vibe 😌


✨ ARGUMENTS ✨

  • sd β€” the subdevice 🧚 like, the actual thing you're poking at
  • pad β€” the pad 🌸 your chosen hangout spot on that subdevice
  • streams_mask β€” bitmask of streams to enable πŸŽ€ a whole little bitfield of besties, each bit invited to the party

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea β˜• this function enables streams on a source pad of a subdevice. the pad is identified by its index, while the streams are identified by the streams_mask bitmask. and the way this slaps? it lets you enable multiple streams on a pad at once πŸ”₯ batch mode, main character energy, we love efficiency πŸ’…

but listen β€” enabling a stream that's already enabled isn't allowed πŸ™ˆ not permitted, not happening, we don't do that here. if streams_mask contains an already enabled stream, this function returns -EALREADY without performing any operation. so it just... stops. full bail. zero side effects, at least 🫢

now for the compatibility lore 🧚 per-stream enable is only available for subdevs that implement the .enable_streams and .disable_streams operations. for other subdevs, this function implements a best-effort compatibility by calling the .s_stream operation β€” limited to subdevs that have a single source pad. best-effort, bestie. that's the key phrase. don't expect miracles πŸ’€

and hey β€” drivers that are not stream-aware shall set streams_mask to BIT_ULL(0). literally just that. one bit. that's your whole mask. don't overthink it πŸ“

🌈 RETURN 🌈

  • 0 β€” Success ✨ slay, we did it, no errors, go girl
  • -EALREADY β€” one of the streams in streams_mask is already enabled 😭 bestie it's already on, we can't turn it on again
  • -EINVAL β€” the pad index is invalid, or doesn't correspond to a source pad πŸ’€ wrong pad, wrong vibe, try again
  • -EOPNOTSUPP β€” falling back to the legacy .s_stream operation is impossible because the subdev has multiple source pads πŸ™ˆ multi-pad subdev + no stream ops = no path forward, sorry queen

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/media/v4l2-subdev.h β€” and honestly the whole extended friend group, they all said hi πŸ’–


aaaand that's the whole page bestie!! πŸŽ€ this lil masterpiece lives in ./include/media, dated October 2026, and it's filed under the name v4l2_subdev_enable_streams(9) β€” go forth and enable those streams, you're gonna eat πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from