QubesOS/qubes-issues

Cannot use a USB camera

abis866i opened this issue ยท 73 comments

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:

  1. I attach the camera PCI to the "personal" VM using the Qubes Manager

  2. 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

  3. 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

  4. 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

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
BACKEND:DEVID DESCRIPTION USED BY
dom0:00_00.0 Host bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers
dom0:00_02.0 VGA compatible controller: Intel Corporation HD Graphics 530
dom0:00_08.0 System peripheral: Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model
dom0:00_14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller sys-net (no-strict-reset=True)
dom0:00_14.2 Signal processing controller: Intel Corporation Sunrise Point-H Thermal subsystem
dom0:00_15.0 Signal processing controller: Intel Corporation Sunrise Point-H Serial IO I2C Controller #0
dom0:00_15.1 Signal processing controller: Intel Corporation Sunrise Point-H Serial IO I2C Controller #1
dom0:00_16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1
dom0:00_17.0 SATA controller: Intel Corporation Sunrise Point-H SATA controller [AHCI mode]
dom0:00_1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1
dom0:00_1c.2 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #3
dom0:00_1c.5 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #6
dom0:00_1c.7 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #8
dom0:00_1d.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #9
dom0:00_1d.2 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #11
dom0:00_1d.3 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #12
dom0:00_1d.4 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #13
dom0:00_1e.0 Signal processing controller: Intel Corporation Sunrise Point-H Serial IO UART #0
dom0:00_1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller
dom0:00_1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC
dom0:00_1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio
dom0:00_1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus
dom0:02_00.0 USB controller: ASMedia Technology Inc. ASM1142 USB 3.1 Host Controller sys-net (no-strict-reset=True)
dom0:03_00.0 USB controller: Renesas Technology Corp. uPD720202 USB 3.0 Host Controller
dom0:04_00.0 Network controller: Qualcomm Atheros AR93xx Wireless Network Adapter sys-net
dom0:06_00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge
dom0:07_01.0 Multimedia audio controller: C-Media Electronics Inc CMI8738/CMI8768 PCI Audio
dom0:08_00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller sys-net
dom0:09_00.0 Non-Volatile memory controller: Samsung Electronics Co Ltd NVMe SSD Controller SM961/PM961

[user@dom0 ~]$ qvm-pci attach --persistent --option permissive=true --option no-strict-reset=true work dom0:03_00.0
Can't attach PCI device to VM in pvh mode

Right. PVH-mode VMs can't do PCI-passthrough.

You need to set it to hvm instead:

[user@dom0 ~]$ qvm-prefs some-vm virt_mode hvm

To set it back to default (pvh):

[user@dom0 ~]$ qvm-prefs -D some-vm virt_mode

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:

  • created new appvm based on fedora, called "temp"
  • changed the virtualization mode to hvm for "temp"
  • attached the whole PCI card to the "temp" appvm
  • ran "cheese" in "temp" and camera worked this time.

What do you advise I do, change the virtualization mode to my AppVMs to make it work?
Thank you!

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 (qvm-clone temp temp-client should do fine) and try to use qvm-usb to pass it from temp to temp-client, and use the same "cheese" app in temp-client (which we just confirmed working in temp)?

Additionally, I believe it should be by default in fedora templates, but confirm you have qubes-usb-proxy available in temp (meaning, installed in its template). Something like:

[user@temp ~]$ sudo dnf list installed | grep qubes-usb-proxy
qubes-usb-proxy.noarch                     1.0.18-1.fc26                @qubes-vm-r4.0-current
  1. Yes, I was able to use the cheese with the "temp" AppVM if the virtualization was "hvm"

  2. Here is my "qubes-usb-proxy". I have noticed that your output says "fc26" while mine is "fc25". Currently, I have Fedora 28 template installed.

[user@dom0 ~]$ sudo dnf list installed | grep qubes-usb-proxy
qubes-usb-proxy-dom0.noarch 1.0.18-1.fc25 @qubes-dom0-cached

  1. Cloning went OK. Virtualization method for "temp-client" is still "hvm" should I change it to "pvh"?

[user@dom0 ~]$ qvm-clone temp temp-client
temp-client: Cloning private volume

  1. Attach the camera from temp to temp-client:

[user@dom0 ~]$ qvm-usb
BACKEND:DEVID DESCRIPTION USED BY
temp:1-2 046d_0825_A83B6C60
[user@dom0 ~]$ qvm-usb attach temp-client temp:1-2

  1. In temp-client run "cheese". It did not work, result is that I get a message "no device found". Output is similar to the one in 3. of my initial post.

Just a note on the post above:
I can use my camera with "cheese" in the "temp" appvm when I start the appvm. But, if I attach the camera to "temp-client", try to use it in the "temp-client" with "cheese" , and then detach it, I will not be able to use it in "temp" anymore.

virt_mode for the VM getting the USB device passed to it does not matter. The USB traffic comes in over qrexec and gets injected to USBIP - there is no PCI device involved. virt_mode=hvm is only required for the device which actually has the USB controller PCI device assigned to it.

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 no-strict-reset and could restarting just that USB vm would be meaningful.

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:

  • Intel Core i3-6100 SkyLake 3.7 GHz LGA 1151
  • MSI Z170A PC Mate LGA 1151 ATX Intel Motherboard
  • Crucial Ballistix Sport LT 64GB 4 x 16GB DDR4-2400 PC4-19200 CL16 Dual Channel

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:

lspci -vv -s 00:14.0
lspci -vv -s 02:00.0
lspci -vv -s 03:00.0

Specifically, I'm interested if the output contains FLReset for any of the devices.

[user@dom0 ~]$ lspci -vv -s 00:14.0
00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31) (prog-if 30 [XHCI])
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7971
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- SERR- <PERR- INTx-
Latency: 0
Interrupt: pin A routed to IRQ 16
Region 0: Memory at df510000 (64-bit, non-prefetchable) [size=64K]
Capabilities:
Kernel driver in use: pciback
Kernel modules: xhci_pci

[user@dom0 ~]$ lspci -vv -s 02:00.0
02:00.0 USB controller: ASMedia Technology Inc. ASM1142 USB 3.1 Host Controller (prog-if 30 [XHCI])
Subsystem: Micro-Star International Co., Ltd. [MSI] Device 7971
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 18
Region 0: Memory at df400000 (64-bit, non-prefetchable) [size=32K]
Capabilities:
Kernel driver in use: pciback
Kernel modules: xhci_pci

[user@dom0 ~]$ lspci -vv -s 03:00.0
03:00.0 USB controller: Renesas Technology Corp. uPD720202 USB 3.0 Host Controller (rev 02) (prog-if 30 [XHCI])
Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- SERR- <PERR- INTx-
Interrupt: pin A routed to IRQ 17
Region 0: Memory at df300000 (64-bit, non-prefetchable) [disabled] [size=8K]
Capabilities:
Kernel driver in use: pciback
Kernel modules: xhci_pci

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,
I have had a similar issue. I can fairly easily attach my USB devices to my Debian AppVMs for scanning and video conferencing, but haven't had much luck connecting them to my Fedora AppVMs.

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
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 1e4e:0110 Cubeternet
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

[user@work ~]$ cheese
(cheese:12365): Gtk-WARNING **: 10:40:36.146: 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:12365): cheese-WARNING **: 10:40:37.284: Could not read from resource.: gstv4l2bufferpool.c(1032): gst_v4l2_buffer_pool_poll (): /GstCameraBin:camerabin/GstWrapperCameraBinSrc:camera_source/GstBin:bin35/GstV4l2Src:v4l2src1:
poll error 1: Invalid argument (22)

[user@work ~]$ 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

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'm trying to use a C920 USB camera on a Thinkpad X1 Carbon 6gen, latest Qubes4. The VM is running debian-9, but i also tried fedora-26. I tried both connecting the camera directly to a USB port of the Thinkpad and via a powered USB hub.

I attach it to my VM:

user@browser $ lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 012: ID 046d:082d Logitech, Inc. HD Pro Webcam C920
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

user@browser $ ll /dev/video0
crw-rw----+ 1 root video 81, 0 Oct 30 13:30 /dev/video0

user@browser $ cheese

(cheese:3812): 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:3812): 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:3812): cheese-CRITICAL **: cheese_camera_device_get_name: assertion 'CHEESE_IS_CAMERA_DEVICE (device)' failed

(cheese:3812): GLib-CRITICAL **: g_variant_new_string: assertion 'string != NULL' failed

(cheese:3812): GLib-GIO-CRITICAL **: g_settings_schema_key_type_check: assertion 'value != NULL' failed

(cheese:3812): GLib-CRITICAL **: g_variant_get_type_string: assertion 'value != NULL' failed

(cheese:3812): 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:3812): CRITICAL **: cheese_preferences_dialog_setup_resolutions_for_device: assertion 'device != NULL' failed
^C

user@browser $ 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

user@browser $ ll /dev/video0
ls: cannot access '/dev/video0': No such file or directory

user@browser $ sudo dmesg
[...]
[ 1067.111409] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1067.999310] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1068.887291] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1069.775325] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1069.776403] usb 1-1: USB disconnect, device number 12
[ 1070.671126] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1071.559252] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1071.559340] usb usb1-port1: attempt power cycle
[ 1072.759348] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1073.647189] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1073.647296] usb usb1-port1: unable to enumerate USB device

Qubes shows the device as still being attached to the VM. I can detach and reattach without problems.

Forwarding the Thinkpad's internal camera works fine.

Should I open a separate ticket for this?

Should I open a separate ticket for this?

Let's keep it on this (reopened) issue for now (unless or until it's determined to be a separate bug).

Any updates? I've been trying to attach the same camera, the problem I have is that I only have one USB controller on my box, and attaching it in HVM-mode will crash mouse and keyboard.

I'm affected by this too (for both of my webcams), and wonder if it has anything to do with using a USB-2.0 webcam on a USB-3.0 bus. I might try and dig up a USB-2.0-only card to test this theory later.

Also, I think that an earlier comment kerned out some important dmesgs, in particular all the Not yet implemented messages:

[   25.256452] vhci_hcd vhci_hcd.0: USB/IP Virtual Host Controller
[   25.256502] vhci_hcd vhci_hcd.0: new USB bus registered, assigned bus number 1
[   25.256523] vhci_hcd: created sysfs vhci_hcd.0
[   25.256558] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 4.19
[   25.256574] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   25.256590] usb usb1: Product: USB/IP Virtual Host Controller
[   25.256603] usb usb1: Manufacturer: Linux 4.19.81-1.pvops.qubes.x86_64 vhci_hcd
[   25.256618] usb usb1: SerialNumber: vhci_hcd.0
[   25.256684] hub 1-0:1.0: USB hub found
[   25.256697] hub 1-0:1.0: 8 ports detected
[   25.256836] vhci_hcd vhci_hcd.0: USB/IP Virtual Host Controller
[   25.256868] vhci_hcd vhci_hcd.0: new USB bus registered, assigned bus number 2
[   25.256892] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[   25.256921] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 4.19
[   25.256937] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   25.256952] usb usb2: Product: USB/IP Virtual Host Controller
[   25.256965] usb usb2: Manufacturer: Linux 4.19.81-1.pvops.qubes.x86_64 vhci_hcd
[   25.256980] usb usb2: SerialNumber: vhci_hcd.0
[   25.257036] hub 2-0:1.0: USB hub found
[   25.257049] hub 2-0:1.0: 8 ports detected
[   26.167104] vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(0)
[   26.167123] vhci_hcd vhci_hcd.0: devid(131094) speed(3) speed_str(high-speed)
[   26.385790] usb 1-1: new high-speed USB device number 2 using vhci_hcd
[   26.503840] usb 1-1: SetAddress Request (2) to port 0
[   28.741723] usb 1-1: New USB device found, idVendor=046d, idProduct=082d, bcdDevice= 0.11
[   28.741807] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=1
[   28.741937] usb 1-1: Product: HD Pro Webcam C920
[   28.742019] usb 1-1: SerialNumber: 83CD87DF
[   28.785829] media: Linux media interface: v0.10
[   28.789937] videodev: Linux video capture interface: v2.00
[   28.796312] uvcvideo: Found UVC 1.00 device HD Pro Webcam C920 (046d:082d)
[   28.801421] uvcvideo 1-1:1.0: Entity type for entity Processing 3 was not initialized!
[   28.801443] uvcvideo 1-1:1.0: Entity type for entity Extension 6 was not initialized!
[   28.801459] uvcvideo 1-1:1.0: Entity type for entity Extension 12 was not initialized!
[   28.801474] uvcvideo 1-1:1.0: Entity type for entity Camera 1 was not initialized!
[   28.801499] uvcvideo 1-1:1.0: Entity type for entity Extension 8 was not initialized!
[   28.801528] uvcvideo 1-1:1.0: Entity type for entity Extension 9 was not initialized!
[   28.801550] uvcvideo 1-1:1.0: Entity type for entity Extension 10 was not initialized!
[   28.801573] uvcvideo 1-1:1.0: Entity type for entity Extension 11 was not initialized!
[   28.801642] input: HD Pro Webcam C920 as /devices/platform/vhci_hcd.0/usb1/1-1/1-1:1.0/input/input1
[   28.801703] usbcore: registered new interface driver uvcvideo
[   28.801717] USB Video Class driver (1.1.1)
[   29.176572] usbcore: registered new interface driver snd-usb-audio
[   29.191016] audit: type=1130 audit(1574513530.709:71): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=alsa-state comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[   29.202093] vhci_hcd: unlink->seqnum 59
[   29.202106] vhci_hcd: urb->status -104
[   29.232011] audit: type=1106 audit(1574513530.749:72): pid=1078 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:session_close grantors=pam_keyinit,pam_limits,pam_systemd,pam_unix,pam_umask,pam_lastlog acct="root" exe="/usr/lib/qubes/qrexec-agent" hostname=? addr=? terminal=? res=success'
[   29.608276] usb usb1: Not yet implemented
[   29.609356] usb usb1: Not yet implemented
[   29.610350] usb usb1: Not yet implemented
[   29.611277] usb usb1: Not yet implemented
[   29.612255] usb usb1: Not yet implemented
[   29.613255] usb usb1: Not yet implemented
[   29.614249] usb usb1: Not yet implemented
[   29.615269] usb usb1: Not yet implemented
[   29.616263] usb usb1: Not yet implemented
[   29.617277] usb usb1: Not yet implemented
[   34.609891] vhci_get_frame_number: 4992 callbacks suppressed
[   34.609898] usb usb1: Not yet implemented
[   34.611116] usb usb1: Not yet implemented
[   34.612113] usb usb1: Not yet implemented
[   34.612918] usb usb1: Not yet implemented
[   34.614174] usb usb1: Not yet implemented
[   34.615009] usb usb1: Not yet implemented
[   34.618497] vhci_hcd: unlink->seqnum 5092
[   34.618543] vhci_hcd: unlink->seqnum 5093
[   34.618578] vhci_hcd: unlink->seqnum 5094
[   34.618613] vhci_hcd: unlink->seqnum 5095
[   34.618648] vhci_hcd: unlink->seqnum 5096
[   34.618719] vhci_hcd: the urb (seqnum 5096) was already given back
[   34.618886] vhci_hcd: unlink->seqnum 5092
[   34.618922] vhci_hcd: unlink->seqnum 5093
[   34.618957] vhci_hcd: unlink->seqnum 5094
[   34.618992] vhci_hcd: unlink->seqnum 5095
[   34.619028] vhci_hcd: unlink->seqnum 5097
[   34.619064] vhci_hcd: the urb (seqnum 5097) was already given back
[   34.619122] vhci_hcd: unlink->seqnum 5092
[   34.619159] vhci_hcd: urb->status -104
[   34.619197] vhci_hcd: unlink->seqnum 5093
[   34.619233] vhci_hcd: urb->status -104
[   34.619271] vhci_hcd: unlink->seqnum 5094
[   34.619307] vhci_hcd: urb->status -104
[   34.619344] vhci_hcd: unlink->seqnum 5095
[   34.619379] vhci_hcd: urb->status -104
[   34.619416] vhci_hcd: unlink->seqnum 5098
[   34.619483] vhci_hcd: urb->status -104
[   34.619521] vhci_hcd: unlink->seqnum 5099
[   34.619556] vhci_hcd: urb->status -104
[   34.619593] vhci_hcd: unlink->seqnum 5100
[   34.619630] vhci_hcd: urb->status -104
[   34.619667] vhci_hcd: unlink->seqnum 5101
[   34.619703] vhci_hcd: urb->status -104
[   34.619799] vhci_hcd: unlink->seqnum 5102
[   34.619836] vhci_hcd: urb->status -104
[   34.619876] vhci_hcd: unlink->seqnum 5103
[   34.619923] vhci_hcd: urb->status -104
[   38.472013] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[   39.359966] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[   40.247998] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[   41.136080] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[   41.136243] usb 1-1: USB disconnect, device number 2
[   42.039816] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[   42.928001] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[   42.928094] usb usb1-port1: attempt power cycle
[   44.127965] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[   45.016620] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[   45.016719] usb usb1-port1: unable to enumerate USB device
[   57.041109] kauditd_printk_skb: 1 callbacks suppressed

this looks like another case of #3778

the combination of "unlinking urbs" (which is a sign of the usb device being reset) followed by the "cable is bad" (indicating it never came back from that reset).

I am also facing this issue.

I found a strange phenomenon however:

  1. Attach usb webcam to computer (on a usb3 port)
  2. via sys-usb attach the webcam device to a debian 10 vm
  3. Run guvcview immediately after the device is passed-through

And it works! I've let it run several hours and it works fine.

However as soon as I exit/restart guvcview, it errors with "no video device found" and dmesg is back to:

[  983.828969] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  984.717012] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  985.605069] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  986.493024] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  986.497395] usb 1-1: USB disconnect, device number 12
[  987.404873] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  988.293040] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  988.293121] usb usb1-port1: attempt power cycle
[  989.493080] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  990.380956] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[  990.381036] usb usb1-port1: unable to enumerate USB device

I had this issue reappear a few weeks ago (after an update, from what I can determine), but it appears to have been fixed with the latest update (interesting an issue I noticed reconnecting a printer from one AppVM to another that was only solved by power cycling the printer).

Hopefully this update solved you issue as well? Prior to the first update I did not have any issue connecting my camera.

@abeluck, @Osndok, @hpaolini @olekli: Did the latest update also fix this for you?

Hi,

I'm sorry, but I'm afraid I have to report this is still an open issue for me. I am able to semi-reliably access my camera via guvcview, however it doesn't seem any other application (I've tried using a browser chat system and MS Teams) can (I should note MS Teams does detect the camera, but transmits no video).

It does seem that the USB camera only temporarily is detected...it's better (in that I can get the camera to sometimes work in guvcview), but still not fully functional.

FYI, in most trouble cases with webcam we`ve seen it needs more ram at sys-usb. At least 400mb looks ok.

@jevank I have 1024MB of RAM for sys-usb, should I increase that?

@e6lk7dqzm83p: I would say yes. In my case for a HD webcam without setting 4GB of memory it makes crashing the webcam when attaching it to other VM (I've also several devices attached to sys-usb) while using it.

@fepitre, I'll try that. I should point out that this had previously worked with my current setup and it was only recently that this became an issue.

@jevank I have 1024MB of RAM for sys-usb, should I increase that?

I have not come across such options, but give it a try. If camera works fine in sys-usb (simple check with cheese app), kernel versions in sys-usb and appvm are the same (at least appvm not newer) everything usually works in my cases.

So, I've increased my ram to 4096GB and it has had no impact. I can still get a camera feed in guvcview, but I can't get any other apps (i.e. actual video conferencing apps) to work. This has previously been working and I suspect one of the recent Qubes updates broke this.

Ok, some more information. I swapped out my old webcam (a Logitech Orbit, which output 720p video) and tried a camera through a video capture card (which is 1080p). I can get video working in the guvcview and the Zoom app, but video through a website is weird; the video is slow and choppy generally (that's probably more of a systems resource thing). I can't get the video feed working at all in MS Teams (which I think had worked with the orbit previously) with either setup.

I also have found the capture card to be continuously detected by the AppVM (i.e. it shows up when I run lsusb); this doesn't happen with the Logitech Orbit.

More information:
-The old Logitech Orbit does work on a Windows machine; for some reason it cannot be consistently detected in Qubes (it appears and then disappears in lsusb); given I can't replicate this with any other camera I'm guessing this is an issue with the old Logitech Orbit

-Everything works fine with my built in, extremely low quality, laptop camera (which runs over USB), including MS Teams.

-The camera capture card is consistently detected, but it appears that only some local apps (e.g., guvcview, Zoom) have no issues, others (e.g., MS Teams) cannot. The issue I had with a browser seems to be a formatting issues (it appears the browser is reading the video feed as YU12 or YV12 which I haven't figured out how to fix).

All of this is to say that it appears I can only reproduce this USB connection issue with an old webcam and it appears everything otherwise seems to be working. Given the age of the problematic camera I think we can discount this issue and considered it closed (at least from my end).

Sorry for all the posts....

Thanks for the update, @e6lk7dqzm83p. Before closing this issue, I'd like to hear back from the other users who reported it above to see whether it has been resolved for them too.

Hi
I am still struggling to use my Logitech C270 in Qubes. It runs only in guvcview under debian. It doesn't work in fedora or zoom.
Interesting observation might be that if I attach camera, run guvcview, exit guvcview and run it again. It works only for the first time. Second time it will show no cameras attached.
It might suggest that it is not a problem with forwarding the video stream but in device closure.
Anyway for me the issue is still open.

It's still a pretty hard fail over here. Just updated everything & rebooted (to make sure the updates took). My convenient test vectors find that *native" fedora-31 works with my two connected webcams. Likewise, both work well enough in sys-usb (maybe some 2d image copy lag), but when forwarded to another qube it falls flat on its face.

Version numbers (in case it helps):
4.19.128-1.pvops.qubes.x86_64 - dom0 - fedora-25
5.6.16-1.qubes.x86_64 - sys-usb - fedora-32
5.6.16-1.qubes.x86_64 - disposable vm - fedora-32

Somewhere between "fails miserably" & "fails spectacularly", as it seems that everything is left in an inconsistent state: the webcam(s), the source vm (sys-usb), the target vm... maybe even the usb hub?!? From this state trying to connect or disconnect other usb devices may experience minutes worth of latency before qubes picks them up (if ever), sometimes the webcams don't work quite right afterwards (hard/unplug reset), reboot computer, etc. I'm not sure, but it might have even permanently upset the white-balance on one of them (not sure which tool to use to reset it to defaults).

I even tried the "four gigs of memory" thing, but that didn't seem to help at all.

usb-ip, used in qubes for usb forwarding, continues to be an unreliable mess. If possible on your hardware, consider attaching the pci device that is the usb Controller directly to the VM that needs the camera (Iljust be sure your keyboard, etc. doesnโ€™t go through that controller).

Thanks for all the suggestions but ...

  • Cheese behaves the same way as guvcview and installing it do not change anything in general.
  • I wish I could connect my usb hub with camera directly to AppVM but unfortunately all of my devices are connected to one usb hub.

It would be useful to have some kind of poll / survey of other Qubes
users using external webcams. Which ones work perfectly? Please reply.

I have a Logitech C210 and it does not work. cheese and https://meet.jit.si are unreliable and Slack doesn't work at all. The webcam disappears, and I get similar errors to those noted above (Cannot enable. Maybe the USB cable is bad?)

I have a built-in webcam and it works very reliably for everything. It is a Acer, Inc BisonCam, NB Pro.

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:

[15520.996910] vhci_hcd vhci_hcd.0: pdev(0) rhport(0) sockfd(0)
[15520.996934] vhci_hcd vhci_hcd.0: devid(131076) speed(3) speed_str(high-speed)
[15521.214772] usb 1-1: new high-speed USB device number 13 using vhci_hcd
[15521.331779] usb 1-1: SetAddress Request (13) to port 0
[15523.697520] usb 1-1: New USB device found, idVendor=046d, idProduct=0843, bcdDevice= 0.13
[15523.697555] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=1
[15523.697580] usb 1-1: Product: Logitech Webcam C930e
[15523.697596] usb 1-1: SerialNumber: 92509E6E
[15523.704792] uvcvideo: Found UVC 1.00 device Logitech Webcam C930e (046d:0843)
[15523.769178] input: Logitech Webcam C930e as /devices/platform/vhci_hcd.0/usb1/1-1/1-1:1.0/input/input3
[15524.091599] vhci_hcd: unlink->seqnum 120610
[15524.091618] vhci_hcd: urb->status -104
[15524.121988] audit: type=1106 audit(1609472858.700:144): pid=8328 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:session_close grantors=pam_keyinit,pam_l
imits,pam_systemd,pam_unix,pam_umask,pam_lastlog acct="root" exe="/usr/lib/qubes/qrexec-agent" hostname=? addr=? terminal=? res=success'
[15524.216158] vhci_get_frame_number: 1345 callbacks suppressed
[15524.216160] usb usb1: Not yet implemented
[15524.217156] usb usb1: Not yet implemented
[15524.218298] usb usb1: Not yet implemented
[15524.219203] usb usb1: Not yet implemented
[15524.220419] usb usb1: Not yet implemented
[15524.221197] usb usb1: Not yet implemented
[15524.222179] usb usb1: Not yet implemented
[15524.223118] usb usb1: Not yet implemented
[15524.224121] usb usb1: Not yet implemented
[15524.225233] usb usb1: Not yet implemented
[15524.414046] vhci_hcd: unlink->seqnum 120834
[15524.414072] vhci_hcd: urb->status -104
[15524.414721] vhci_hcd: unlink->seqnum 120837
[15524.414736] vhci_hcd: urb->status -104
[15524.415370] vhci_hcd: unlink->seqnum 120839
[15524.415386] vhci_hcd: urb->status -104
[15524.416116] vhci_hcd: unlink->seqnum 120842
[15524.416131] vhci_hcd: urb->status -104
[15524.416725] vhci_hcd: unlink->seqnum 120844
[15524.416739] vhci_hcd: urb->status -104
[15524.418253] vhci_hcd: unlink->seqnum 120848
[15524.418267] vhci_hcd: urb->status -104
[15524.428056] vhci_hcd: unlink->seqnum 120860
[15524.428078] vhci_hcd: urb->status -104
[15524.429002] vhci_hcd: unlink->seqnum 120863
[15524.429025] vhci_hcd: urb->status -104
[15524.430118] vhci_hcd: unlink->seqnum 120865
[15524.430145] vhci_hcd: urb->status -104
[15529.217741] vhci_hcd: unlink->seqnum 125654
[15529.217764] vhci_hcd: urb->status -104
[15529.217780] vhci_hcd: unlink->seqnum 125655
[15529.217795] vhci_hcd: urb->status -104
[15529.217809] vhci_hcd: unlink->seqnum 125656
[15529.217823] vhci_hcd: urb->status -104
[15529.217868] vhci_hcd: unlink->seqnum 125657
[15529.217883] vhci_hcd: urb->status -104
[15529.217897] vhci_hcd: unlink->seqnum 125658
[15529.217915] vhci_hcd: urb->status -104
[15529.217930] vhci_hcd: unlink->seqnum 125659
[15529.217947] vhci_hcd: urb->status -104
[15529.217963] vhci_hcd: unlink->seqnum 125660
[15529.217978] vhci_hcd: urb->status -104
[15529.217992] vhci_hcd: unlink->seqnum 125661
[15529.218010] vhci_hcd: urb->status -104
[15529.218024] vhci_hcd: unlink->seqnum 125662
[15529.218039] vhci_hcd: urb->status -104
[15529.218052] vhci_hcd: unlink->seqnum 125663
[15529.218066] vhci_hcd: urb->status -104
[15529.218081] vhci_hcd: unlink->seqnum 125664
[15529.218095] vhci_hcd: urb->status -104
[15529.218110] vhci_hcd: unlink->seqnum 125665
[15529.218125] vhci_hcd: urb->status -104
[21651.422530] kauditd_printk_skb: 1 callbacks suppressed
[21651.422531] audit: type=1130 audit(1609478986.001:146): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=qubes-sync-time comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[21651.584666] audit: type=1131 audit(1609478987.009:147): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=qubes-sync-time comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[22713.939650] audit: type=1130 audit(1609480049.364:148): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[22743.977155] audit: type=1131 audit(1609480079.402:149): pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=systemd-hostnamed comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
[22823.052802] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[22823.940799] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[22824.828788] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[22825.716809] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[22825.716966] usb 1-1: USB disconnect, device number 13
[22825.724855] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.724887] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.724909] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.725053] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.725132] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.725356] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.725386] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.725409] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.725476] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.725546] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.725845] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.725900] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.725952] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.726051] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.726173] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.726637] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.726696] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.726849] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.726995] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.727122] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.728898] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.728926] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.728947] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.729112] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.729210] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.729527] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.729565] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.729597] usb 1-1: 3:4: usb_set_interface failed (-19)
[22825.729707] usb 1-1: 3:4: usb_set_interface failed (-19)
[22826.620782] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[22827.508785] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[22827.508812] usb usb1-port1: attempt power cycle
[22828.084793] audit: type=1101 audit(1609480163.510:150): pid=17126 uid=1000 auid=1000 ses=1 msg='op=PAM:accounting grantors=pam_unix acct="user" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/3 res=success'
[22828.084839] audit: type=1123 audit(1609480163.510:151): pid=17126 uid=1000 auid=1000 ses=1 msg='cwd="/home/user" cmd="dmesg" exe="/usr/bin/sudo" terminal=pts/3 res=success'
[22828.084922] audit: type=1110 audit(1609480163.510:152): pid=17126 uid=0 auid=1000 ses=1 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/3 res=success'
[22828.086591] audit: type=1105 audit(1609480163.511:153): pid=17126 uid=0 auid=1000 ses=1 msg='op=PAM:session_open grantors=pam_keyinit,pam_limits,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/3 res=success'
[22828.092523] audit: type=1106 audit(1609480163.517:154): pid=17126 uid=0 auid=1000 ses=1 msg='op=PAM:session_close grantors=pam_keyinit,pam_limits,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/3 res=success'
[22828.092590] audit: type=1104 audit(1609480163.517:155): pid=17126 uid=0 auid=1000 ses=1 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/3 res=success'
[22828.708786] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[22829.596773] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[22829.596801] usb usb1-port1: unable to enumerate USB device
[22829.978896] audit: type=1101 audit(1609480165.404:156): pid=17133 uid=1000 auid=1000 ses=1 msg='op=PAM:accounting grantors=pam_unix acct="user" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/3 res=success'
[22829.978948] audit: type=1123 audit(1609480165.404:157): pid=17133 uid=1000 auid=1000 ses=1 msg='cwd="/home/user" cmd="dmesg" exe="/usr/bin/sudo" terminal=pts/3 res=success'
[22829.979030] audit: type=1110 audit(1609480165.404:158): pid=17133 uid=0 auid=1000 ses=1 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/3 res=success'
[22829.981063] audit: type=1105 audit(1609480165.406:159): pid=17133 uid=0 auid=1000 ses=1 msg='op=PAM:session_open grantors=pam_keyinit,pam_limits,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/3 res=success'
[22970.666367] kauditd_printk_skb: 2 callbacks suppressed
[22970.666368] audit: type=1101 audit(1609480306.091:162): pid=17168 uid=1000 auid=1000 ses=1 msg='op=PAM:accounting grantors=pam_unix acct="user" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/3 res=success'
[22970.666427] audit: type=1123 audit(1609480306.091:163): pid=17168 uid=1000 auid=1000 ses=1 msg='cwd="/home/user" cmd="dmesg" exe="/usr/bin/sudo" terminal=pts/3 res=success'
[22970.666504] audit: type=1110 audit(1609480306.091:164): pid=17168 uid=0 auid=1000 ses=1 msg='op=PAM:setcred grantors=pam_env,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/3 res=success'
[22970.668408] audit: type=1105 audit(1609480306.093:165): pid=17168 uid=0 auid=1000 ses=1 msg='op=PAM:session_open grantors=pam_keyinit,pam_limits,pam_keyinit,pam_limits,pam_systemd,pam_unix acct="root" exe="/usr/bin/sudo" hostname=? addr=? terminal=/dev/pts/3 res=success'

@ccdunder Are there any notable logs in sys-usb?

Possibly related.
I have recently experienced issues with USB webcams that worked before. [Have been using it for a year. I stopped working recently... after some update perhaps]

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 sudo dmesg in both sys-usb and the appvm

https://pastebin.com/pL9JgPHp

Update:
Kept trying and got to this crashlog on sys-usb: https://pastebin.com/xRjsYYMZ

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 user is a member of the video group?

@DemiMarie I added user to video group and it doesn't help, dmesg show these complaints: https://pastebin.com/3Kp5hBP3

getting this error

[  993.507974] vhci_hcd: urb->status -104
[  993.507989] vhci_hcd: unlink->seqnum 10210
[  993.508000] vhci_hcd: urb->status -104
[  993.508010] vhci_hcd: unlink->seqnum 10211
[  993.508020] vhci_hcd: urb->status -104
[  993.508032] vhci_hcd: unlink->seqnum 10212
[  993.508042] vhci_hcd: urb->status -104
[ 1007.196853] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1008.084849] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1008.972928] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1009.860892] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1009.860943] usb 1-1: USB disconnect, device number 7
[ 1010.772940] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1011.661844] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1011.661876] usb usb1-port1: attempt power cycle
[ 1012.860840] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1013.748858] usb usb1-port1: Cannot enable. Maybe the USB cable is bad?
[ 1013.748890] usb usb1-port1: unable to enumerate USB device

the camera works fine on manjaro

I have also tried adding user to video group with no success.
dmesg from AppVM shows https://pastebin.com/g01HxtGn
dmesg from sys-usb shows https://pastebin.com/m3CwG7yb

I can see the device connected, but can't interact with it at the terminal level.

user@work:~$ v4l2-ctl --list-devices
C922 Pro Stream Webcam (usb-vhci_hcd.0-1):
	/dev/video1

Failed to open /dev/video0: Device or resource busy
user@work:~$ v4l2-ctl -d /dev/video1 --list-ctrls
Cannot open device /dev/video1, exiting.

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.

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)

@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!!

I'm still experiencing this issue using the camera Logitech C270, with the same error logs as shown in #4035 (comment)

Increasing the memory for sys-usb made no difference (I stopped at 3gb)

I managed to find a work around using ffmpeg and v4l2loopback:

  • install ffmpeg both on sys-usb and your target vm
  • install v4l2loopback on target vm and load the module

Execute the following from dom0

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

  1. capture your webcam video output using ffmpeg in sys-usb into a pipe
  2. pipe that through to another vm using qubes qvm-run command
  3. on target vm, ffmpeg will read the pipe and send it to the v4l2loopback device

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 Logitech C170 camera too. Behaviour and errors in dmesg are the same as above. The camera worked several weeks ago and this issue must have hit me during updates at some point. Unfortunately i cannot tell the exact date. I may be able to "jump back in time" with my old qubes install media and a second hard drive, to provide more debug delta data, if this is of any help. But i have to find some time for this.

Increasing memory does not help out.
I also will try the qubes-video-comanion solution when i have time.

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 cheese but not with Element messenger or Firefox or anything else than cheese. Increasing the memory assigned to sys-usb from 300 MiB to 1200 MiB solved the problem for me.

(works with Debian 11 AppVMs on Qubes R4.1 beta)

It would be useful to have some kind of poll / survey of other Qubes
users using external webcams. Which ones work perfectly? Please reply.

I have a Logitech C210 and it does not work. cheese and https://meet.jit.si are unreliable and Slack doesn't work at all. The webcam disappears, and I get similar errors to those noted above (Cannot enable. Maybe the USB cable is bad?)

I have a built-in webcam and it works very reliably for everything. It is a Acer, Inc BisonCam, NB Pro.

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.

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 :)

QubesOS/qubes-linux-kernel@476eabb

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.