Skip to content
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

Webcam Vchan support #6508

Closed
ctr49 opened this issue Apr 2, 2021 · 5 comments
Closed

Webcam Vchan support #6508

ctr49 opened this issue Apr 2, 2021 · 5 comments
Labels
C: other P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. R: duplicate Resolution: Another issue exists that is very similar to or subsumes this one.

Comments

@ctr49
Copy link

ctr49 commented Apr 2, 2021

The problem you're addressing (if any)
I often have problems with passing through my USB webcam. Sometimes it works, sometimes not. Most often it works but then breaks after some time. Passing through an entire device to use its functionality is also not what I would consider "Qubes-native".

Describe the solution you'd like
Instead, the video stream (assuming people use a dedicated microphone) should be passed through a vchan, much like audio is).

Where is the value to a user, and who might that user be?
Potentially increased security from not passing the (USB) device into the target domain and imho a better stability.

Describe alternatives you've considered
Passing through the USB device. Which breaks often.

Additional context
This is a proof-of-concept that works fine for me: https://gist.github.com/ctr49/24bb4986e9878e50ceca60167f7acf67
Some fine-tuning is needed to make this work for many other environments or webcams, but it is already working fine for me.
My goal was minimal interaction (i.e. video processing) in the USB qube. That's why I use v4l-ctl to stream the raw video rather than using ffmpeg in the USB qube already.

@ctr49 ctr49 added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement labels Apr 2, 2021
@andrewdavidwong andrewdavidwong added this to the TBD milestone Apr 3, 2021
@iamahuman
Copy link

I often have problems with passing through my USB webcam. Sometimes it works, sometimes not. Most often it works but then breaks after some time.

You might have luck with increasing memory allocated to the USB VM.

This is a proof-of-concept that works fine for me: https://gist.github.com/ctr49/24bb4986e9878e50ceca60167f7acf67
Some fine-tuning is needed to make this work for many other environments or webcams,

Also, a scheme to negotiate video resolution, format and codec. I'm not sure how it should be designed, though.

My goal was minimal interaction (i.e. video processing) in the USB qube. That's why I use v4l-ctl to stream the raw video rather than using ffmpeg in the USB qube already.

How about ditching FFmpeg completely and using v4l2-ctl --stream-from=- ... from the receiving side?

@DemiMarie
Copy link

I often have problems with passing through my USB webcam. Sometimes it works, sometimes not. Most often it works but then breaks after some time.

You might have luck with increasing memory allocated to the USB VM.

This is a proof-of-concept that works fine for me: https://gist.github.com/ctr49/24bb4986e9878e50ceca60167f7acf67
Some fine-tuning is needed to make this work for many other environments or webcams,

Also, a scheme to negotiate video resolution, format and codec. I'm not sure how it should be designed, though.

Do most cameras support this natively?

My goal was minimal interaction (i.e. video processing) in the USB qube. That's why I use v4l-ctl to stream the raw video rather than using ffmpeg in the USB qube already.

How about ditching FFmpeg completely and using v4l2-ctl --stream-from=- ... from the receiving side?

👍

This might also be a motivation to improve qrexec throughput.

@iamahuman
Copy link

I often have problems with passing through my USB webcam. Sometimes it works, sometimes not. Most often it works but then breaks after some time.

You might have luck with increasing memory allocated to the USB VM.

This is a proof-of-concept that works fine for me: https://gist.github.com/ctr49/24bb4986e9878e50ceca60167f7acf67
Some fine-tuning is needed to make this work for many other environments or webcams,

Also, a scheme to negotiate video resolution, format and codec. I'm not sure how it should be designed, though.

Do most cameras support this natively?

I meant negotiation between the source VM and the destination VM. This is needed especially due to varying resolution/format support from different cameras.

My goal was minimal interaction (i.e. video processing) in the USB qube. That's why I use v4l-ctl to stream the raw video rather than using ffmpeg in the USB qube already.

How about ditching FFmpeg completely and using v4l2-ctl --stream-from=- ... from the receiving side?

👍

This might also be a motivation to improve qrexec throughput.

As far as thoughput is considered, we should use the approach taken by GUI Agent to transfer framebuffer from AppVM to GUI VM. A simple implementation would be grant refs (perhaps abstract these for other VMMs) + v4l2-ctl --stream-mmap.

@marmarek
Copy link
Member

marmarek commented Apr 3, 2021

Duplicate of #2079 ?

@andrewdavidwong
Copy link
Member

This appears to be a duplicate of an existing issue. If so, please comment on the appropriate existing issue instead. If you believe this is not really a duplicate, please leave a comment briefly explaining why. We'll be happy to take another look and, if appropriate, reopen this issue. Thank you.

@andrewdavidwong andrewdavidwong added the R: duplicate Resolution: Another issue exists that is very similar to or subsumes this one. label Apr 4, 2021
@andrewdavidwong andrewdavidwong removed this from the Release TBD milestone Jul 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: other P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. R: duplicate Resolution: Another issue exists that is very similar to or subsumes this one.
Projects
None yet
Development

No branches or pull requests

5 participants