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

qvm-usb / USB passthrough fails for webcams #2594

Closed
xloem opened this issue Jan 20, 2017 · 10 comments
Closed

qvm-usb / USB passthrough fails for webcams #2594

xloem opened this issue Jan 20, 2017 · 10 comments
Labels
C: other T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists.

Comments

@xloem
Copy link

xloem commented Jan 20, 2017

Qubes OS version (e.g., R3.2):

R3.2

Affected TemplateVMs (e.g., fedora-23, if applicable):

fedora-23, dom0


Expected behavior:

Should be able to use webcams even when using a usb VM, using qvm-usb to pass them off.

Actual behavior:

My webcams only function in the VM they are connected to.

Steps to reproduce the behavior:

  1. Connect webcam to sys-usb.
  2. To verify it works, sudo gst-launch-1.0 v4l2src ! videoconvert ! ximagesink
    The webcam view should be displayed.
  3. Close popped up window
  4. In dom0, use qvm-usb to connect the webcam to sys-firewall.
  5. Now in sys-firewall, try again sudo gst-launch-1.0 v4l2src ! videoconvert ! ximagesink
    For me, the command fails with an error such as Cannot identify device '/dev/video0'.

General notes:

I have tried two different cameras. Both fail on anything but sys-usb.

dmesg for example camera on sys-usb, recording works:

[ 2479.030039] usb 3-2.3: new high-speed USB device number 8 using xhci_hcd
[ 2479.256628] usb 3-2.3: New USB device found, idVendor=046d, idProduct=0804
[ 2479.256641] usb 3-2.3: New USB device strings: Mfr=0, Product=0, SerialNumber=2
[ 2479.256650] usb 3-2.3: SerialNumber: 23375F80
[ 2479.258595] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0804)
[ 2479.299724] input: UVC Camera (046d:0804) as /devices/pci-0/pci0000:00/0000:00:00.0/usb3/3-2/3-2.3/3-2.3:1.0/input/input6
[ 2479.565109] usb 3-2.3: Warning! Unlikely big volume range (=6144), cval->res is probably wrong.
[ 2479.565126] usb 3-2.3: [5] FU [Mic Capture Volume] ch = 1, val = 1536/7680/1
# do a recording at this time
[ 2532.353184] usb 3-2.3: reset high-speed USB device number 8 using xhci_hcd

dmesg for example camera on sys-firewall, recording fails:

[ 2647.660354] vhci_hcd vhci_hcd: rhport(0) sockfd(0) devid(196617) speed(3) speed_str(high-speed)
[ 2647.864069] usb 2-1: new high-speed USB device number 107 using vhci_hcd
[ 2648.084055] usb 2-1: new high-speed USB device number 108 using vhci_hcd
[ 2648.291064] usb 2-1: new high-speed USB device number 109 using vhci_hcd
[ 2648.291084] usb 2-1: SetAddress Request (109) to port 0
[ 2648.446289] usb 2-1: New USB device found, idVendor=046d, idProduct=0804
[ 2648.446309] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=2
[ 2648.446319] usb 2-1: SerialNumber: 23375F80
[ 2648.455093] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0804)
[ 2648.497655] input: UVC Camera (046d:0804) as /devices/platform/vhci_hcd/usb2/2-1/2-1:1.0/input/input4
[ 2648.766872] usb 2-1: Warning! Unlikely big volume range (=6144), cval->res is probably wrong.
[ 2648.766889] usb 2-1: [5] FU [Mic Capture Volume] ch = 1, val = 1536/7680/1
[ 2648.844749] vhci_hcd: dequeue a urb ffff880008b15240
[ 2648.844762] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2648.847459] vhci_hcd: unlink->seqnum 10348
[ 2648.847473] vhci_hcd: urb->status -104
[ 2648.912418] hrtimer: interrupt took 4055755 ns
[ 2654.075429] vhci_hcd: dequeue a urb ffff880071650900
[ 2654.075445] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2654.075453] vhci_hcd: dequeue a urb ffff880071650a00
[ 2654.075458] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2654.075464] vhci_hcd: dequeue a urb ffff880071650b00
[ 2654.075470] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2654.075476] vhci_hcd: dequeue a urb ffff880071650c00
[ 2654.075481] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2654.075487] vhci_hcd: dequeue a urb ffff880071650d00
[ 2654.075492] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2654.075498] vhci_hcd: dequeue a urb ffff880071650e00
[ 2654.075502] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2654.075506] vhci_hcd: dequeue a urb ffff880071650f00
[ 2654.075510] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2654.075515] vhci_hcd: dequeue a urb ffff880071650800
[ 2654.075519] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2654.075524] vhci_hcd: dequeue a urb ffff880071650700
[ 2654.075529] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2654.075534] vhci_hcd: dequeue a urb ffff880071650600
[ 2654.075539] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2654.075544] vhci_hcd: dequeue a urb ffff880071650200
[ 2654.075549] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2654.075554] vhci_hcd: dequeue a urb ffff880071650100
[ 2654.075559] vhci_hcd: device ffff880008588298 seems to be still connected
[ 2654.078192] vhci_hcd: unlink->seqnum 15376
[ 2654.078204] vhci_hcd: urb->status -104
[ 2654.078210] vhci_hcd: unlink->seqnum 15377
[ 2654.078214] vhci_hcd: urb->status -104
[ 2654.078221] vhci_hcd: unlink->seqnum 15378
[ 2654.078226] vhci_hcd: urb->status -104
[ 2654.078237] vhci_hcd: unlink->seqnum 15379
[ 2654.078242] vhci_hcd: urb->status -104
[ 2654.078248] vhci_hcd: unlink->seqnum 15380
[ 2654.078253] vhci_hcd: urb->status -104
[ 2654.078258] vhci_hcd: unlink->seqnum 15381
[ 2654.078263] vhci_hcd: urb->status -104
[ 2654.078269] vhci_hcd: unlink->seqnum 15382
[ 2654.078274] vhci_hcd: urb->status -104
[ 2654.078279] vhci_hcd: unlink->seqnum 15383
[ 2654.078284] vhci_hcd: urb->status -104
[ 2654.078290] vhci_hcd: unlink->seqnum 15384
[ 2654.078295] vhci_hcd: urb->status -104
[ 2654.078300] vhci_hcd: unlink->seqnum 15385
[ 2654.078305] vhci_hcd: urb->status -104
[ 2654.078311] vhci_hcd: unlink->seqnum 15386
[ 2654.078316] vhci_hcd: urb->status -104
[ 2654.078322] vhci_hcd: unlink->seqnum 15387
[ 2654.078327] vhci_hcd: the urb (seqnum 15387) was already given back
# attempt to record
[ 2742.855069] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 2743.710083] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 2744.565081] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 2745.420086] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 2745.420148] usb 2-1: USB disconnect, device number 109
[ 2746.300062] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 2747.155064] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 2748.010061] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 2748.865116] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?
[ 2748.865145] usb usb2-port1: unable to enumerate USB device

Here is the dmesg on sys-usb while the camera is attached to sys-firewall (timestamps are not aligned):

[ 2617.353191] usb 3-2.3: reset high-speed USB device number 9 using xhci_hcd
[ 2617.611589] usbip-host 3-2.3: usbip-host: register new device (bus 3 dev 9)
[ 2617.636327] usbip-host 3-2.3: stub up
[ 2618.437095] usbip-host 3-2.3: usb_set_interface done: inf 1 alt 0
[ 2618.479051] usbip-host 3-2.3: usb_set_interface done: inf 3 alt 1
[ 2618.709965] usbip-host 3-2.3: usb_set_interface done: inf 3 alt 2
[ 2618.715438] usbip-host 3-2.3: usb_set_interface done: inf 3 alt 3
[ 2618.720936] usbip-host 3-2.3: usb_set_interface done: inf 3 alt 4
[ 2618.726796] usbip-host 3-2.3: usb_set_interface done: inf 3 alt 0
[ 2618.825122] usbip-host 3-2.3: unlink urb ffff88000056a480
[ 2618.825171] usbip-host 3-2.3: unlinked by a call to usb_unlink_urb()
[ 2618.847864] usbip-host 3-2.3: usb_set_interface done: inf 3 alt 4
[ 2618.886661] usbip-host 3-2.3: usb_set_interface done: inf 3 alt 0
[ 2618.931656] usbip-host 3-2.3: usb_set_interface done: inf 3 alt 4
[ 2624.055808] usbip-host 3-2.3: unlink urb ffff880007ab9600
[ 2624.055840] usbip-host 3-2.3: unlink urb ffff880007ab9e00
[ 2624.055861] usbip-host 3-2.3: unlinked by a call to usb_unlink_urb()
[ 2624.055883] usbip-host 3-2.3: unlink urb ffff880009f97400
[ 2624.055895] usbip-host 3-2.3: unlinked by a call to usb_unlink_urb()
[ 2624.055913] usbip-host 3-2.3: unlink urb ffff880009f97d00
[ 2624.055929] usbip-host 3-2.3: unlinked by a call to usb_unlink_urb()
[ 2624.055937] usbip-host 3-2.3: unlinked by a call to usb_unlink_urb()
[ 2624.055947] usbip-host 3-2.3: unlink urb ffff880005b86800
[ 2624.055956] usbip-host 3-2.3: unlink urb ffff880005b86a00
[ 2624.055967] usbip-host 3-2.3: unlinked by a call to usb_unlink_urb()
[ 2624.055974] usbip-host 3-2.3: unlinked by a call to usb_unlink_urb()
[ 2624.055983] usbip-host 3-2.3: unlink urb ffff880005b86b00
[ 2624.056026] usbip-host 3-2.3: unlinked by a call to usb_unlink_urb()
[ 2624.056055] usbip-host 3-2.3: unlink urb ffff880005b86100
[ 2624.056070] usbip-host 3-2.3: unlinked by a call to usb_unlink_urb()
[ 2624.056080] usbip-host 3-2.3: unlink urb ffff880009b3b300
[ 2624.056091] usbip-host 3-2.3: unlink urb ffff880009e71e00
[ 2624.056098] usbip-host 3-2.3: unlink urb ffff8800022a5600
[ 2624.056111] usbip-host 3-2.3: unlinked by a call to usb_unlink_urb()
[ 2624.056119] usbip-host 3-2.3: unlinked by a call to usb_unlink_urb()
[ 2624.056126] usbip-host 3-2.3: unlinked by a call to usb_unlink_urb()
[ 2624.059741] usbip-host 3-2.3: usb_set_interface done: inf 3 alt 0

Related issues:

@andrewdavidwong
Copy link
Member

Related: #2079

@andrewdavidwong
Copy link
Member

Apparently, some webcams do work, since that's the example used in the docs.

@andrewdavidwong andrewdavidwong added T: bug Type: bug report. A problem or defect resulting in unintended behavior in something that exists. C: other labels Jan 20, 2017
@andrewdavidwong andrewdavidwong added this to the Release 3.2 updates milestone Jan 20, 2017
@stiell
Copy link

stiell commented Feb 1, 2017

I posted instructions for passing a webcam stream from sys-usb to another appvm, moved them to related issue #2079.

@Ekleog
Copy link

Ekleog commented Mar 8, 2018

I've been hitting a similar issue, haven't tried the workaround from #2079 yet though. (basically upping this post, as it hasn't seen a message for a while)

In my case, my webcam stops sending frames to the passed-through VM after a few (~10) minutes of video streaming.

@aksiazek
Copy link

aksiazek commented Apr 2, 2018

So I'm thinking this isn't webcam-specific, rather related to high-speed USB, as my ethernet card doesn't work with the same errors in dmesg. Reverting to other kernels didn't help either

@xaki23
Copy link

xaki23 commented Dec 23, 2019

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

@andrewdavidwong
Copy link
Member

Is anyone still affected by this?

@h01ger
Copy link

h01ger commented Dec 9, 2020 via email

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: other 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

8 participants