Split devices, videobuf2, upstream - plans? #617
Replies: 7 comments 45 replies
-
I'm not stuck, I just did not have bandwidth for this for a while :-) I just started looking into this this weekend again as now I have more time to work on Linux again. It has been on pause because of rush at paid work but not forgotten. I also developed a test program mainly to work as a smoke test mainly for testing incompatible API changes: The biggest struggle has been rediscovering how some of the state variables work but now I think I got the gist of them:
Any feedback on the interpretation of these state variables is welcome as they nail how streams work in the driver. I know now the semantics of ready_for_output but for that in particular I'd like to be more aware of high-level interpretation and purpose of that state variable. Sorry for rewriting this comment a few times, just wanted to nail my message and status. This is also a open for me: what is the point of SPLIT_DEVICES in the OOT driver? Why not just create as many video devices you need? It is incomplete feature, thus asking. And considering vb2_ops, which parts of the driver would it repeal and replace? What has been the major blocker for not using it so far but instead using own functionality? |
Beta Was this translation helpful? Give feedback.
-
Finally as I aim for RFC patch set, it won't be a final version, so for that you can obviously give your feedback at LKML. I can add cc on request too. That said I'm open for feedback but hanging into 100% ABI/API compatibility is not a sane goal. Using VB2 could be. Trivial example: parameters are not size-encoded (e.g. __u32) in the ioctl API, which is immediate reject. So that alone is a huge issue. |
Beta Was this translation helpful? Give feedback.
-
A vague guess re: split devices is that The out-of-tree module could have a |
Beta Was this translation helpful? Give feedback.
-
BTW, there is one really weird thing in this driver, why the heck it uses spin_lock_bh() and spin_lock(). What is the specific softirq it tries to race against? I don't see any. If the answer is no it would be better off using regular spin_lock(). Please educate me if I miss something. |
Beta Was this translation helpful? Give feedback.
-
@stephematician, BTW, do you know why does this driver need to maintain its own array of formats? That has puzzled me but have not dared to ask :-) |
Beta Was this translation helpful? Give feedback.
-
Before making any major API changes it would make whole a lot to replace legacy code with videobuf2. The benefit of my in-kernel tree is that this can be done as repeal and replace. My main goal is unfat the internals first and rework the API after that. I added a WiP branch for VB2 work which ATM has just placeholder callbacks. |
Beta Was this translation helpful? Give feedback.
-
Closing as there's a lot here already; any details from here can go in their own discussion. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Now that I'm more familiar with v4l2loopback and V4L2; I can see a path towards implementing split devices and using videobuf2. This would put v4l2loopback in a good position for in-tree.
Two things on my mind:
I notice @jarkkojs has made a start in particular, with some early updates to the API to match in-tree practise.
Not wanting to slow progress down at all; but is it possible that we can:
so that both the out-of-tree and in-tree modules work alike? Applications can then easily support out-of-tree and in-tree loopback devices.
On the internal side, there's a key feature of v4l2loopback that I'd like to preserve: it elides the copy from the OUTPUT node to the CAPTURE node; this is something that I don't believe alternatives like akvcam can do (correct me if I'm wrong). If it weren't for that feature - I'd probably switch to akvcam.
I am fairly sure we can have shared internals (slash internal API) which use videobuf2 to handle each of the queues for a pair of OUTPUT and CAPTURE nodes, that elides copies from one to the other (using a slightly stronger version of bufpos2index and the position variables), and hits all the right notes in v4l2-compliance.
I have a reasonable amount of time at the moment. I am better suited to the internal side as I have only limited knowledge about kbuild and almost no idea about in-tree development.
@jarkkojs @umlaeute @vicamo - happy to share email and/or video call to work out details.
Beta Was this translation helpful? Give feedback.
All reactions