Questions below. On 3/3/21 2:41 PM, Nicolas Dufresne wrote:
No, since m2m are instance base, you cannot have two process operating on the same node (there is only 1 streaming state). You'd probably want to look at extending the VIMC driver instead. It's a virtual media controller, it's missing few bits to make loopback possible, but would be a good fit. Note that vivid have a loopback capability, but it does not constraint the width/height/format and will produce a test pattern if you request something that differ from the source.
I am not sure which you're suggesting to use: vivid or vimc. Also, are you suggesting to extend them or use them as a template for a new module? I think you are saying that vivid can already do loopback. However vivid is a test driver and, like vim2m, doesn't ship with distribution kernels. Should I try to move it out of the test-drivers?
It is very buggy, it often return a queued buffer back, and in fact, if you try to use the queue too much it fails. Though all this would probably be fine if you port it to VB2.
I am assuming you are saying to port v4l2loopback to vb2. I am working on that right now, but I am not sure how to proceed since the vb2 needs a queue for capture and a queue for output (since they cannot be the same). I have created the queues, but I am not sure how to further integrate. Please check out the WIP here: https://github.com/wt/v4l2loopback/commit/e71b0a50427729a5e6e74443066751f7321dc404 If the m2m is the wrong approach, do you have any suggestions for how to proceed? Also, I am currently making a change for the linux kernel moving this code info drivers/media/v4l2-core/v4l2-loopback.c so that I can start iterating with your feedback. Is that a correct place to put this code? Thanks, wt