-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linux-v4l2: Fix virtual camera start failure #11906
base: master
Are you sure you want to change the base?
Conversation
Skip the non-compliant usage of STREAMON ioctl when loopback module version is newer than 0.13.2
For clarification, is there a reason to hold on to the old behavior for older versions? If the issue is stricter requirements on the v4l2loopback side, wouldn't this just be a backwards compatible change? What breaks in the old versions with this change, or is that untested and just an attempt to not change what has been working? |
The existing behaviour should be kept when using loopback <= 0.13.2, otherwise there'll be regression to #4808 An alternative solution: Simply ignore any errors from STREAMON or STREAMOFF. In a way; this would be cleaner - but there is a relatively harmless issue where, say, a user has an older loopback module and STREAMON fails for a legitimate reason. In that case - presumably the next call to |
I just remembered I forgot to close the file pointer. Such a noob mistake! |
I'm mostly just confused by the presentation of what this is actually fixing. It sounds like this is actually resulting from what was a bug in v4l2loopback, and we had previously put a workaround in place for, and now that bug is fixed (in the name of better compliance, presumably) and the workaround is now causing issues. |
Yes. Sorry, I should have answered your quetion. That is exactly the issue.
Happy to change approach with this PR if needed. |
I'll leave the technical specifics to others to comment on, we were just a bit confused on the context around this. Makes perfect sense now, thanks! |
I can relate. It took me a ridiculously long time to get my head about the loopback module as I was updating it. Thanks for your questions! |
Skip the non-compliant usage of STREAMON ioctl when loopback module version is newer than 0.13.2
Description
When starting (or stopping) the virtual camera:
/sys/modules/v4l2loopback/version
;Motivation and Context
Almost fixes #11891.
v4l2loopback source was recently updated to have stronger compliance with V4L2 UAPI; thus, the invocation of STREAMON by OBS when no streaming I/O buffers have been negotiated (e.g. via REQBUFS) results in an error. If a user has the newer v4l2loopback, then OBS needs to skip the old STREAMON kludge (see #4808 and fca624e). If the user has the older v4l2loopback (version 0.13.2 or earlier); then the existing behaviour should be maintained.
Why does this only partially fix the issue? Because v4l2loopback > 0.13.2 hasn't been released yet (will contact maintainer).
How Has This Been Tested?
Built on Ubuntu 24.04, x64 machine, with the latest v4l2loopback source and:
Types of changes
Checklist: