Map V4L2 EBUSY to a distinct DeviceError::Busy #47
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
zensight-sensor
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
marcpardo/parallax#47
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
EBUSYis the characteristic V4L2 failure — a secondopen()of a camera another process (or another pipeline) already holds. It currently lands in the generic catch-all.src/elements/device/v4l2.rs:295-303:NotFoundandPermissionDenied— the two other "the operator did something recoverable" cases — get named variants. Busy doesn't, so a caller cannot distinguish "this camera is in use, close the other stream or wait" from any other ioctl failure without string-matching the io error.Ask
Add
DeviceError::Busy(String)and mapErrorKind::ResourceBusy(or raw errno 16) to it.Why it matters
The zensight sensor hits exactly this: opening an H.264 profile and a JPEG preview profile on the same camera opens the device twice, and most UVC cameras reject the second open. It's a documented limitation there, and the error it surfaces today is undiagnosable. (The proper fix is a single-open fan-out graph — see the head-of-line-blocking issue — but a legible error is worth having regardless, since two processes can always collide.)