-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Cannot use a USB camera #4035
Comments
Might this be an issue with the client you are trying to use to interact with your camera? Have you tried passing the PCI device to a VM with the same template to confirm whether qubes-usb-proxy is in fact the issue? I've used usb-passthrough for a webcam recently and it worked for me. Closing and re-opening the device can sometimes leave it in an inconsistent state and unable to use, but I've never had trouble with the first consumer of a device on a given boot. |
Thank you for looking into this. Here is my setting: personal and untrusted VMs are using the Debian template while the rest are using the Fedora template. I have to admit that I do not have too much knowledge into the Linux area so, please guide me through the process. I have removed the PCI from the sys-net where it was attached before. In this case, I try to attach the PCI to the "work" VM which is Fedora, but I get an error. Please see below. [user@dom0 ~]$ qvm-pci [user@dom0 ~]$ qvm-pci attach --persistent --option permissive=true --option no-strict-reset=true work dom0:03_00.0 |
Right. PVH-mode VMs can't do PCI-passthrough. You need to set it to hvm instead:
To set it back to default (pvh):
I'd probably create a new VM for this testing purpose, but it's not strictly necessary. |
Yes, that worked. Here is what I did:
What do you advise I do, change the virtualization mode to my AppVMs to make it work? |
So far this only confirms the problem is with qubes' USB passthrough layer or dependencies / configuration in the templates you were using before, and rules out your camera app, USB controller itself, etc. Now, what happens if you make another VM based on the same template as temp ( Additionally, I believe it should be by default in fedora templates, but confirm you have
|
[user@dom0 ~]$ sudo dnf list installed | grep qubes-usb-proxy
[user@dom0 ~]$ qvm-clone temp temp-client
[user@dom0 ~]$ qvm-usb
|
Just a note on the post above: |
From everything you describe, this indeed sounds like a bug in the USB passthrough code. As a workaround, you can use "cheese" directly in the VM which has your USB device attached. So long as the camera is the only device on that USB bus, then the security benefit from further isolating cheese and providing only that USB device is unclear. If you are care about security implications, then making your USB vm disposable and restarting your computer[1] between uses of your USB device will eliminate persistence of attacks originating over video-conferencing software (or similar) unless they re-write firmware on your USB controller (unclear if it has any) or camera (probably has some, but would likely be equally attackable regardless of whether the USB device is passed individually or not). This is admittedly inconvenient, so evaluate for your own threat model. [1]: restarting your whole computer (not just the VM to which the USB controller is assigned) is required to reset your USB controller unless your USB controller supports function-level-reset at the PCI level, which is rare from what I've seen |
Hmm, Xeon processor? If this is a server or workstation or something, then simply buying another USB PCI card and using it exclusively for a (camera, vm) pair would be ideal from a security perspective. Additionally, if the card supports function-level-reset (I wish I knew which chipsets did...) then you wouldn't need |
Not sure if I actually have have a security model in mind. But I am fascinated by the fact that I can take resources and temporarily assign them to different vms. For example, I use Google Hangouts only for work, so in that case I would assign the camera to the "work" vm for that. For conversations with family/friends, I use Wire, so I would attach it to the personal. |
Sure... but depending on your threat model, that can only go so far. If you're worried about any of the video conferencing applications getting owned and the attacker persisting to webcam firmware, then you're probably still screwed. See, e.g.:
There's a place for separate hardware too. |
That's also an argument for some higher-level unidirectional-video-stream-only implementation within Qubes. Maybe one day... |
No server here, it is just a system I built myself from parts from MicroCenter. Here is what I have:
I built it in preparation for Qubes OS 4.0 as the laptop I have used with 3.2 did not pass the hardware requirements. Since camera never worked on this computer, I got a PCI card to be used only with hoping I can pass it easier. As I said, I have no specific security concerns, it is just a fascination with the model. |
Interesting, you say it's a Core-i3 but the PCI devs show as Xeon-E3 ¯_(ツ)_/¯ Would you mind sharing output of:
Specifically, I'm interested if the output contains |
[user@dom0 ~]$ lspci -vv -s 00:14.0 [user@dom0 ~]$ lspci -vv -s 02:00.0 [user@dom0 ~]$ lspci -vv -s 03:00.0 |
The usb camera is attached to the 03:00.0 USB controller: Renesas Technology Corp card and it is the only USB device on the card. |
Yup. Looks like all of them need no-strict-reset :( The quest to find a recommendable USB controller continues... |
Hi, As an example, Simple-Scan and guvcview seem to be able to use my scanner/camera without issue in my Debian AppVM (note that the scanning is a bit temperamental). |
Just an update on this issue. I bought a very cheap DI ChatCam webcam, like $8 new, and I tried it as well. I still cannot get it to work but it seems that the error is different. When I run "cheese" the error is "There was an error playing video from the webcam". [user@work ~]$ lsusb [user@work ~]$ cheese [user@work ~]$ lsusb |
Hi, Any luck figuring out this issue? It would great to have consistent USB behavior, is there anything I can do to help diagnose this? Thank you! |
As a matter of fact, after e6lk7dqzm83p asked the question, I tried one more time. In between several updates happened in dom0 and guess what? It is working now. I guess the Qubes OS team did its magic. For me this is a closed issue. |
@e6lk7dqzm83p, is this now working for you, too? |
@andrewdavidwong, I still have issues with my USB devices (cameras, microphones, etc) being detected in my Fedora based AppVM (even though they are connected via the HW manager). When the HW manager detects my Debian AppVM I can connect the devices without issue and use them in applications (e.g. Camera, App, Wire, simple-scan, etc). |
@andrewdavidwong, disregard my previous post. The latest version in testing appears to have solved this. Thanks! |
Closing this as "resolved." If you believe the issue is not yet resolved, or if anyone is still affected by this issue, please leave a comment, and we'll be happy to reopen this. Thank you. |
I have the same experience with a Logitech C930e. Does anyone know how to determine if this is an issue in qubes or usbip? Does anyone know what logs would be useful? dmesg (clipped) from domU (Fedora 32) on 4.0R4:
|
@ccdunder Are there any notable logs in sys-usb? |
Possibly related. Now what happens is: I can attach the webcam to my app vm, but as soon as I try to access it, it disconnects again. AppVm and sys-usb are both based on debian 10. Here are the outputs of Update: Update 2: works in a different USB socket... so forget all that, I guess. |
I'm facing the same problem with Logitech C922. It works fine in sys-usb, but apparently, usbip is the problem. |
Ditto. Logitech C922. |
Can you check that |
@DemiMarie I added |
getting this error
the camera works fine on manjaro |
I have also tried adding user to video group with no success. I can see the device connected, but can't interact with it at the terminal level.
I will also add that once I try to do anything with the device (use cheese, list it in the terminal), next time I list devices it's gone. Still attached from the dom0 GUI, but the only way to show it again is to disconnect and reconnect it to the appVM. |
I've had a similar problem which I've fixed by assigning more memory to sys-usb. |
Great! Then the solution is similar to #6200 (comment) |
I've had a similar problem which I've fixed by assigning more memory to
sys-usb.
Same here. Need to have at least 600 MB memory on debian-minimal for the
webcam use case (all other use cases worked fine with half that).
|
@AlxHnr can you provide the camera vendor and product id for reference? |
Update: Increasing the sys-usb VM memory to 1gb works to keep the webcam attached and works with Cheese. However, (probably a separate user error on my part now), Zoom, Chrome, and Firefox don't see the camera. Doesn't work on Fedora 32, 33 or Debian. |
Update: Messing around with it a bit but not changing settings, the webcam started working in Chrome and Firefox reliably but not Zoom. Works in the browser in both Debian and Fedora. Zoom works in neither Fedora or Debian. So I have to believe the issue is more non-qubes related software. Thanks for the help!! |
Effectively solve the following issues: QubesOS/qubes-issues#4035 QubesOS/qubes-issues#2079 QubesOS/qubes-issues#6426
I'm still experiencing this issue using the camera Increasing the memory for I managed to find a work around using
Execute the following from SYS_USB_VIDEO="/dev/video4"
TARGET_VM="video-calls"
LOOPBACK_VIDEO="/dev/video0"
qvm-run -p sys-usb "ffmpeg -fflags nobuffer -flags low_delay -an -i $SYS_USB_VIDEO -f avi -" | qvm-run -p $TARGET_VM "ffmpeg -fflags nobuffer -flags low_delay -f avi -i - -f v4l2 $LOOPBACK_VIDEO" In summary, this will
Image quality is not the best at the expense of reducing delay time. YMMV |
This is project that potentially can solve those issues: https://github.com/elliotkillick/qubes-video-companion |
I'm experiencing this issue with a Increasing memory does not help out. Regards. |
I have a similar problem, but only with my two new FullHD webcams. My old HD ready webcam worked well. Actually, my FullHD webcams worked well with (works with Debian 11 AppVMs on Qubes R4.1 beta) |
I don't know what changed, but my Logitech C210 now works quite reliably. I use it with a non-template based VM running Fedora 34 for Zoom, Google Meet (in Firefox), and Slack. My dom0 kernel is 5.15.14-1.fc25.qubes.x86_64. |
That might be my patch works :) |
I confirm that mine Logitech C270 works too. Thanks @jevank :) |
Thanks, @jevank! Closing as resolved. If anyone believes this issue is not yet resolved, or if anyone is still affected by this issue, please leave a comment, and we'll be happy to reopen it. Thank you. |
Qubes OS version:
R4.0
Affected component(s):
USB Camera
I am not able to use my usb camera (Logitech C270)
Camera is the only usb device on a PCI card.
Steps to reproduce the behavior:
I attach the camera PCI to the "personal" VM using the Qubes Manager
Check if camera is available in Personal VM and it seems it is attached according to second line in result.
user@personal:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 046d:0825 Logitech, Inc. Webcam C270
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Use 'cheese' application to see if camera is working but i does not.
user@personal:~$ cheese
(cheese:2274): Gtk-WARNING **: Theme parsing error: cheese.css:7:35: The style property GtkScrollbar:min-slider-length is deprecated and shouldn't be used anymore. It will be removed in a future version
(cheese:2274): GStreamer-CRITICAL **: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed
** Message: cheese-application.vala:211: Error during camera setup: No device found
(cheese:2274): cheese-CRITICAL **: cheese_camera_device_get_name: assertion 'CHEESE_IS_CAMERA_DEVICE (device)' failed
(cheese:2274): GLib-CRITICAL **: g_variant_new_string: assertion 'string != NULL' failed
(cheese:2274): GLib-GIO-CRITICAL **: g_settings_schema_key_type_check: assertion 'value != NULL' failed
(cheese:2274): GLib-CRITICAL **: g_variant_get_type_string: assertion 'value != NULL' failed
(cheese:2274): GLib-GIO-CRITICAL **: g_settings_set_value: key 'camera' in 'org.gnome.Cheese' expects type 's', but a GVariant of type '(null)' was given
** (cheese:2274): CRITICAL **: cheese_preferences_dialog_setup_resolutions_for_device: assertion 'device != NULL' failed
Check again if camera is available in Personal VM and it seems it is not attached anymore.
user@personal:~$ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Expected behavior:
I would like to use my camera with Wire, Google Hangouts and eventually Skype.
Actual behavior:
Wire says there is no camera installed.
General notes:
I have tried to find an answer to this online but, unfortunately, I could not. It is probably that I am doing something wrong but I do not know how to fix this.
Related issues:
NA
The text was updated successfully, but these errors were encountered: