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

Cannot use a USB camera #4035

Closed
abis866i opened this issue Jun 25, 2018 · 73 comments
Closed

Cannot use a USB camera #4035

abis866i opened this issue Jun 25, 2018 · 73 comments
Labels
C: other diagnosed Technical diagnosis has been performed (see issue comments). hardware support P: major Priority: major. Between "default" and "critical" in severity. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.

Comments

@abis866i
Copy link

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

@andrewdavidwong andrewdavidwong added T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. C: other labels Jun 26, 2018
@andrewdavidwong andrewdavidwong added this to the Release 4.0 updates milestone Jun 26, 2018
@jpouellet
Copy link
Contributor

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.

@abis866i
Copy link
Author

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

@jpouellet
Copy link
Contributor

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.

@abis866i
Copy link
Author

abis866i commented Jul 1, 2018

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!

@jpouellet
Copy link
Contributor

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

@abis866i
Copy link
Author

abis866i commented Jul 1, 2018

  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.

@abis866i
Copy link
Author

abis866i commented Jul 1, 2018

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.

@jpouellet
Copy link
Contributor

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

@jpouellet
Copy link
Contributor

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.

@abis866i
Copy link
Author

abis866i commented Jul 1, 2018

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.

@jpouellet
Copy link
Contributor

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.

@jpouellet
Copy link
Contributor

That's also an argument for some higher-level unidirectional-video-stream-only implementation within Qubes. Maybe one day...

@abis866i
Copy link
Author

abis866i commented Jul 1, 2018

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.

@jpouellet
Copy link
Contributor

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.

@abis866i
Copy link
Author

abis866i commented Jul 1, 2018

[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

@abis866i
Copy link
Author

abis866i commented Jul 1, 2018

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.

@jpouellet
Copy link
Contributor

Yup. Looks like all of them need no-strict-reset :(

The quest to find a recommendable USB controller continues...

@e6lk7dqzm83p
Copy link

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

@abis866i
Copy link
Author

abis866i commented Aug 3, 2018

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

@e6lk7dqzm83p
Copy link

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!

@abis866i
Copy link
Author

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.

@andrewdavidwong
Copy link
Member

@e6lk7dqzm83p, is this now working for you, too?

@e6lk7dqzm83p
Copy link

e6lk7dqzm83p commented Oct 10, 2018

@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).

@e6lk7dqzm83p
Copy link

@andrewdavidwong, disregard my previous post. The latest version in testing appears to have solved this.

Thanks!

@andrewdavidwong
Copy link
Member

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.

@ccdunder
Copy link

ccdunder commented Jan 1, 2021

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'

@icequbes1
Copy link

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

@cobordism
Copy link

cobordism commented Feb 3, 2021

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.

@pietrushnic
Copy link

I'm facing the same problem with Logitech C922. It works fine in sys-usb, but apparently, usbip is the problem.

@codydaig
Copy link

Ditto. Logitech C922.

@DemiMarie
Copy link

Can you check that user is a member of the video group?

@pietrushnic
Copy link

pietrushnic commented Mar 25, 2021

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

@vanerleo
Copy link

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

@codydaig
Copy link

codydaig commented Mar 26, 2021

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.

@AlxHnr
Copy link

AlxHnr commented Apr 5, 2021

I've had a similar problem which I've fixed by assigning more memory to sys-usb.

@deeplow
Copy link

deeplow commented Apr 5, 2021

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)

@SvenSemmler
Copy link

SvenSemmler commented Apr 5, 2021 via email

@pietrushnic
Copy link

@AlxHnr can you provide the camera vendor and product id for reference?

@codydaig
Copy link

codydaig commented Apr 6, 2021

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.

@codydaig
Copy link

codydaig commented Apr 6, 2021

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

ElliotKillick added a commit to ElliotKillick/qubes-video-companion that referenced this issue Apr 10, 2021
@gnorsilva
Copy link

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

@pietrushnic
Copy link

This is project that potentially can solve those issues: https://github.com/elliotkillick/qubes-video-companion

@dkarden
Copy link

dkarden commented Jun 8, 2021

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.

@ilka-schulz
Copy link

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)

@thoughtless
Copy link

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.

@jevank
Copy link

jevank commented Jan 31, 2022

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

@khisanth6
Copy link

I confirm that mine Logitech C270 works too. Thanks @jevank :)

@andrewdavidwong andrewdavidwong added diagnosed Technical diagnosis has been performed (see issue comments). and removed needs diagnosis Requires technical diagnosis from developer. Replace with "diagnosed" or remove if otherwise closed. labels Jan 31, 2022
@andrewdavidwong
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: other diagnosed Technical diagnosis has been performed (see issue comments). hardware support P: major Priority: major. Between "default" and "critical" in severity. T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.
Projects
None yet
Development

No branches or pull requests