Conversation

Jarkko Sakkinen

Great found the most suitable crate for my test program:

https://github.com/zesterer/euc

I.e. I can pre-render the frame to buffers and then loop those frames to "cast_fd" with a given FPS (25) so it should be fairly timing accurate.

Using rotating and shaded torus I have cyclic movement which the other side (opening /dev/video0) can then read and store a full cycle of the animation.

Client and server can be two threads in the same process, and as final step the client can compare that the read frames are close proximity enough to the pre-rendered frames.

That should create a full headless and "CI friendly" system test for v4l2-cast. Definitely still hold a bit before doing too heavy refactoring and make this happen!

I wonder can we already have Rust programs in kselftest's? My driver is in C but this could be potentially part of the kselftest (at some point).

#linux #kernel #video4linux
2
1
2
great, this is a starting point
0
0
0

@jarkko I don't know exactly what you want to do, but it reminds me of this talk, don't know if you're aware of it : https://kernel-recipes.org/en/2014/testing-video4linux-applications-and-drivers/

1
0
1
@Aissen i need to do a program that pretends to be webcam this needs a custom test
2
0
1
@Aissen so in this case i know without looking that it ain't gonna help me :-) it is not aware of my driver
0
0
0

@jarkko yeah, v4l maintainers have always refused to support that use case to prevent proprietary userspace drivers. Which is why OBS recommends https://github.com/umlaeute/v4l2loopback that is maintained out of tree.
Note that with modern webcams and libcamera, a lot of things are done in userspace anyway nowadays…

1
0
0
@Aissen i recommend not to use v4l2-loopback because it uses device model incorrectly and is a security risk. there's tons of stuff that depend on selecting camera device (like chrome when i call to a meeting).
1
0
1
@Aissen there's libcamera and pipewire etc. but what people actually use is a tainted driver ;-) in their work machines. i don't really fully believe that proprietary driver story in 2024 given how many things you can anyway do in user space so not stopping based on this doing a RFC patch TBH (if that was the recommendation).
1
0
1
@Aissen it's not paid work anyway, one needs to be have hobbies, and LKML debate, even heated is better way to use your time than any possible political debate in social media :D
1
0
1

@jarkko I wish I had more time so I could start porting userspace apps using v4l2loopback over to your new driver.

1
0
0
@Aissen It's really a project where 80% is doing other than kernel code and 20% is the kernel challenge. I pretty much know how to do the API shift but I need to finish up this test program first :-) We have done something quite close e.g. in tpm_vtpm_proxy.

And yeah, it's like the meat is great but it is surrounded by a broken framework so you need to do small steps and run the test for every single iteration. It's too easy otherwise to look at a piece of code and decide that it is crap and remove something actually relevant :-)
1
0
1
@Aissen and it would obnoxious and disrespectful for original authors, thus taking the "refactor with a tea spoon approach". They've done great work I'm just making it shine!
1
0
1
@Aissen lol and at least FSF does not have a campaign against this ;-) I don't get how they still today campaign against TPM. https://www.defectivebydesign.org/dayagainstdrm
1
0
1

@jarkko It's incredible how they mistake TPMs for DRM schemes (though to be fair, it could be used as *component* of a full DRM chain).

1
0
1
@Aissen Looking at existing code base for the loopback driver, I'd find any excuse not to review it because it would be too much work to tell all the details "what needs to be done".

So I believe that once there is a cleaner driver and easy to run test program, and legit use NON-PROPRIETARY use cases clearly explained, also maintainers give less hate :-) And today companies have started to anyway prefer in-tree drivers more, as it is just plain more practical and cheaper over long period of time. We are big enough, and your proprietary crap will be made obsolete by competitors.
1
0
1
@Aissen It is my first from scratch driver since SGX driver. That project made me so exhausted that I'm actually happier now that I do my kernel things unpaid and out of passion only...

Previously a professional kernel developer. Now probably like con artist or crypto scam specialist, since isn't everyone working blockchains something like that :-) I also have TPM2 asymmetric keys in progress but it is paused for a while (as this feels more inspiring for the moment).
0
0
1