Bug 1256864

Summary: webcams not working over spice/usbredir in 7.2 hosts
Product: Red Hat Enterprise Linux 7 Reporter: David Jaša <djasa>
Component: spiceAssignee: Default Assignee for SPICE Bugs <rh-spice-bugs>
Status: CLOSED DUPLICATE QA Contact: SPICE QE bug list <spice-qe-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.2CC: cfergeau, dblechte, djasa, tpelka, victortoso
Target Milestone: rc   
Target Release: 7.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-17 14:10:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
spice-gtk log with 2 redirections of the webcam none

Description David Jaša 2015-08-25 15:41:49 UTC
Created attachment 1066915 [details]
spice-gtk log with 2 redirections of the webcam

Description of problem:
webcams not working over spice/usbredir in 7.2 hosts

Version-Release number of selected component (if applicable):
spice-server-0.12.4-13.el7.x86_64
qemu-kvm-1.5.3-101.el7.x86_64 / qemu-kvm-rhev-2.3.0-18.el7.x86_64
usbredir-0.6-7.el7.x86_64
libusbx-1.0.15-4.el7.x86_64

How reproducible:
always

Steps to Reproduce:
1. install a RHEL 7 nightly host, run a VM on it with usbredir enabled
2. connect to the guest, redirect a webcam to it
3. launch a webcam using app

Actual results:
  * apps display black screen in place of video instead of some error
  * in spice-gtk debug output, libusb/usbredir messages cease after some time

Expected results:
video displays

Additional info:
  * using the same clients, connection works fine for VMs on 7.1/6.6/6.7 hosts
    while failing on 7.2 hosts
  * downgrading spice-server and qemu* packages to 7.1 versions doesn't help
    * usbredir and libusbx are unchanged
    * boot to 7.1 kernel doesn't make any change either
  * tested guests:
    * several freshly-installed RHEL 7.1
    * Windows 7

Comment 1 Christophe Fergeau 2015-09-11 20:42:20 UTC
I've managed to reproduce this with nightly RHEL7 host and a RHEL7 guest (f22 client). A f22 livecd guest (same host/same client) worked fine though.

Comment 2 Christophe Fergeau 2015-09-15 15:10:00 UTC
Actually, this was a configuration problem on my side, my VM only had a USB1 controller, not USB2. After making sure it's using a USB2 controller (uhci/ehci devices showing up in libvirt xml/qemu command line), the webcam is working fine on my 7.1 VM on a 7.2 host with f22 client.
David, can you double check your VM configuration? (or even share it as I can no longer reproduce on my side).

Comment 3 David Jaša 2015-09-16 15:57:33 UTC
Hm, it's partly caused by qemu USB controllers and partly by guest OS:
  * "Hypervisor Default" and "USB3" don't work in any guest tested
  * USB2 works in Windows 7 and 8 (not exhaustive) and don't work in RHEL 7.2


"USB2" is the default multifunction device described by Hans in his initial blog posts:
    <controller type='usb' index='0' model='ich9-ehci1'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x7'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci1'>
      <master startport='0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0' multifunction='on'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci2'>
      <master startport='2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x1'/>
    </controller>
    <controller type='usb' index='0' model='ich9-uhci3'>
      <master startport='4'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x2'/>
    </controller>


"Hypervisor default" is:
    <controller type='usb' index='0'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>

which  in guest translates to:
$ lspci -s 00:01.2 -nn
00:01.2 USB controller [0c03]: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] [8086:7020] (rev 01)


"USB3 is":
    <controller type='usb' index='0' model='nec-xhci'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0'/>
    </controller>

Comment 4 Christophe Fergeau 2015-09-17 08:44:24 UTC
(In reply to David Jaša from comment #3)
> Hm, it's partly caused by qemu USB controllers and partly by guest OS:
>   * USB2 works in Windows 7 and 8 (not exhaustive) and don't work in RHEL 7.2

By 'don't work', you mean you get the same behaviour with hypervisor default and with USB2?
Can you do
echo 0xffff > /sys/module/uvcvideo/parameters/trace, redirect the webcam, start cheese, and attach dmesg output?

Comment 5 Christophe Fergeau 2015-09-17 08:49:45 UTC
(In reply to Christophe Fergeau from comment #4)
> echo 0xffff > /sys/module/uvcvideo/parameters/trace, redirect the webcam,

Sorry, these 2 steps need to be inverted, redirect the webcam and then echo 0xfff > ...

Comment 6 David Jaša 2015-09-17 10:34:43 UTC
(In reply to Christophe Fergeau from comment #4)
> (In reply to David Jaša from comment #3)
> > Hm, it's partly caused by qemu USB controllers and partly by guest OS:
> >   * USB2 works in Windows 7 and 8 (not exhaustive) and don't work in RHEL 7.2
> 
> By 'don't work', you mean you get the same behaviour with hypervisor default
> and with USB2?

No, they're different:

Controller \ Guest  Fedora 22   RHEL 7.2    Windows 7   Windows 8
=================================================================
Hypervisor default      -------------- Error -------------
USB2 - ich*hci*       OK          Error       OK          OK
USB3 - nec-xhci         -------------- Error -------------

(In reply to Christophe Fergeau from comment #4)
...
> Can you do
> echo 0xffff > /sys/module/uvcvideo/parameters/trace, redirect the webcam,
> start cheese, and attach dmesg output?

Will try...

Comment 7 Christophe Fergeau 2015-09-17 11:01:52 UTC
(In reply to David Jaša from comment #6)
> (In reply to Christophe Fergeau from comment #4)
> > (In reply to David Jaša from comment #3)
> > > Hm, it's partly caused by qemu USB controllers and partly by guest OS:
> > >   * USB2 works in Windows 7 and 8 (not exhaustive) and don't work in RHEL 7.2
> > 
> > By 'don't work', you mean you get the same behaviour with hypervisor default
> > and with USB2?
> 
> No, they're different:
> 
> Controller \ Guest  Fedora 22   RHEL 7.2    Windows 7   Windows 8
> =================================================================
> Hypervisor default      -------------- Error -------------
> USB2 - ich*hci*       OK          Error       OK          OK
> USB3 - nec-xhci         -------------- Error -------------

I meant, in the 7.2/USB2 case, what does Error/don't work mean? That you get the same issue as in comment #0? (I assume this is what you implied, just making 100% sure)

Comment 8 David Blechter 2015-10-14 19:51:23 UTC
under investigation, not a blocker for rhel 7.2.
moving to 7.3

Comment 10 Victor Toso 2016-02-17 08:28:40 UTC
Hi David,

Could you try again with qemu-kvm-1.5.3-106.el7 as it address the problem from Bug #1268879 and I would like to be sure that the problems are unrelated? Thanks

Comment 11 David Jaša 2016-02-17 14:10:11 UTC
(In reply to Victor Toso from comment #10)
> Hi David,
> 
> Could you try again with qemu-kvm-1.5.3-106.el7 as it address the problem
> from Bug #1268879 and I would like to be sure that the problems are
> unrelated? Thanks

I tried with -108 and I didn't get any error. The VM was different though (also 7.2 but fresh install of GA) as I already didn't have the old one. USB3 controller still doesn't work.

*** This bug has been marked as a duplicate of bug 1268879 ***