-
Notifications
You must be signed in to change notification settings - Fork 534
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
[rfc/wip] split device #359
Conversation
42b9346
to
2da512a
Compare
ACK
fully ACK ;-)
I don't care
ah well.
not sure i understand this
not sure i know what "this" and "the transition" refer to right now (if "this" is "getting rid single-device support" and the "transition" is "dynamic device management" then you are probably right.
in all cases: ACK
obviously this is (only) an implication of disallowing single-device. so: go ahead ;-) |
c8db769
to
014227c
Compare
Is this still WIP or has it stalled? |
Hi, sorry, mostly stalled as we focus on the stable release 0.12.5 to implement camera relay. |
I would contribute but the effort to grok existing code is probably prohibitive. I am looking forward to not having to restart Zoom each time I pull out the green screen. |
cool, go ahead ;-)
however, here zoom works without split-devices; so i wonder why you think you need it. |
I don't have OBS Studio Virtual Cam running all the time, it eats CPU. Zoom does not detect a newly started Virtual Cam, so I need to restart Zoom. Teams too. After restart they do find the Virtual Cam. |
I looked at the code. Besides one obvious place (line 2307) where "device->" should be "dev->" I cannot help much, apologies. |
bfce2d7
to
0f16525
Compare
What is the point of split devices? Is it so that a different device node is used for the capture dev and the output dev? |
13ce229
to
447d702
Compare
Update a few more works on this. Rebased to current devel branch HEAD and picked some useful commits from https://github.com/umlaeute/v4l2loopback/tree/feature/split-device. I have no intention to support any form of joined device as that's just impossible for vb2 framework, and it has bring all kinds problems/limitations to me. If that's unacceptable, then maybe you'd like to close this PR directly. It's also based on the first commit of #414 that updates clang-formated source, and I think I'll need #415 to correctly handle frame sizes/intervals queries. |
447d702
to
ac6439b
Compare
|
When either vfh->ctrl_handler or vfd->ctrl_handler is non-null, it will shadow vidioc_queryctl. Signed-off-by: You-Sheng Yang <[email protected]>
Fix incorrect format introduced in umlaeute#416 commit a572a4f ("report video-devices allocated at module-load time via sysfs"). Signed-off-by: You-Sheng Yang <[email protected]>
Converting function v4l2loopback_cd2dev and v4l2loopback_getdevice searches v4l2loopback_index_idr with device number retrieved from video_device drvdata, but this could be time consuming and creates unecessary complexity. And since we may need to retrieve v4l2_loopback_device address from callbacks shared between capture and output devices, this patch reuses video_device drvdata instead of struct member offsets. Signed-off-by: You-Sheng Yang <[email protected]>
Signed-off-by: You-Sheng Yang <[email protected]>
Signed-off-by: You-Sheng Yang <[email protected]>
Signed-off-by: You-Sheng Yang <[email protected]>
Since we have already instantiated an output video device, use its `num` field instead. Signed-off-by: You-Sheng Yang <[email protected]>
These ioctls are only called as output role. Omit output/capture checks. Signed-off-by: You-Sheng Yang <[email protected]>
ac6439b
to
2daef4f
Compare
|
Signed-off-by: You-Sheng Yang <[email protected]>
According to V4L2 documentation: Applications can assume that the enumeration data does not change without any interaction from the application itself. This means that the enumeration data is consistent if the application does not perform any other ioctl calls while it runs the frame size enumeration. This change always returns all supported formats. Signed-off-by: You-Sheng Yang <[email protected]>
Signed-off-by: You-Sheng Yang <[email protected]>
Signed-off-by: You-Sheng Yang <[email protected]>
Signed-off-by: You-Sheng Yang <[email protected]>
Signed-off-by: You-Sheng Yang <[email protected]>
Signed-off-by: You-Sheng Yang <[email protected]>
2daef4f
to
a11fa3f
Compare
your commit style is great (i wish everybody would commit like this). however, if possible please don't |
Hi, sorry for taking your extra time. Like what you have seen here, I'm picky at my own commits and always want to make them compact and self-explaining as possible. However this is still not a complete PR, therefore I mark it as WIP/RFC, and it has many aspects to be polished, re-organized, even re-written. So applies to the git commits, they just cannot meet my own expect yet, and many more works remain to be done at odd moments. I think I will do one more rebase when it's full ready for your review. Thank you. |
Yes, it's mostly halted as I'm more or less looking forward to pipewire/libcamera to serve as a similar role. |
fwiw, it looks like https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/707 tracks the work for pipewire. It sounds like userspace is ~mostly working, but requires applications to update to support it. |
I don't have the time or inclination to continue this. the pipewire
solution seems to be the way of the future.
wt
…On Mon, Mar 13, 2023 at 2:00 PM Norman Rasmussen ***@***.***> wrote:
fwiw, it looks like
https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/707 tracks the
work for pipewire. It sounds like userspace is ~mostly working, but
requires applications to update to support it.
—
Reply to this email directly, view it on GitHub
<#359 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADFT7ZRICTF4T42AWMBAGDW36DG5ANCNFSM4SSI2FSQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
You're More Amazing Than You Think! ymatyt.com
|
Here is my initial attempt to try implementing device split. Still in the very early stage, but I'd like to have your opinions before jumping too far or in the wrong direction.
The main idea/goal is to:
remove single device code completely.
Single device is the root of all evil so far, and there probably has no reason to do this, especially switching device capabilities at runtime. This can, probably has to, be done after the transition. Module parameter exclusive_caps will be removed; assign identical device number to output and capture devices simultaneously becomes illegal.
keep the ability to instantiate multiple devices through module parameters.
Currently module parameter output_nr is added for this purpose.
rewrite buffer management with video videobuf2.
embed
video_device
inv4l2_loopback_device
This can simplify many struct pointer resolutions and memory leaks.