RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1046574 - fail to passthrough the USB speaker redirected from usb-redir with xhci controller
Summary: fail to passthrough the USB speaker redirected from usb-redir with xhci contr...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Gerd Hoffmann
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 1103193 1146483 1146486
TreeView+ depends on / blocked
 
Reported: 2013-12-26 07:34 UTC by Sibiao Luo
Modified: 2015-03-05 08:02 UTC (History)
13 users (show)

Fixed In Version: qemu-kvm-1.5.3-76.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-03-05 08:02:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
screenshot for device management. (320.56 KB, image/png)
2013-12-26 07:38 UTC, Sibiao Luo
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0349 0 normal SHIPPED_LIVE Important: qemu-kvm security, bug fix, and enhancement update 2015-03-05 12:27:34 UTC

Description Sibiao Luo 2013-12-26 07:34:26 UTC
Description of problem:
boot a win2012R2 guest with a remote passthrough USB speaker redirected from usb-host via remote-viewer with xhci controller, but it fail to work.
BTW, if switch to use the uhci controller which it work well.

Version-Release number of selected component (if applicable):
host info:
3.10.0-64.el7.x86_64
qemu-kvm-1.5.3-30.el7.x86_64
seabios-1.7.2.2-6.el7.x86_64
guest info:
win2012R2

How reproducible:
100%

Steps to Reproduce:
1.insert a USB speaker to host via xhci physical controller.
# lsusb | grep JMTek
Bus 003 Device 004: ID 0c76:160c JMTek, LLC. 
2.remote passthrough USB speaker redirected from usb-host via remote-viewer with xhci controller.
e.g:# /usr/libexec/qemu-kvm -M pc....-device nec-usb-xhci,id=xhci0,bus=pci.0,addr=0x7 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=xhci0.0,port=1,debug=3
3.select the USB speaker in remote-viewer menu.
4.continue the VM.
(qemu) c
usbredirparser: Peer version: spice-gtk 0.20, using 64-bits ids
(qemu) qemu-kvm: usb-redir: attaching full speed device 0c76:160c version 1.0 class 00

(qemu) info usb
  Device 0.1, Port 1, Speed 12 Mb/s, Product QEMU USB Tablet
  Device 1.1, Port 1, Speed 12 Mb/s, Product USB Redirection Device
3.check the usb speaker whether work well in guest.

Actual results:
after step 3, the usb speaker controller device can be detected correctly, but the usb speaker cann't work in guest. I will attach the screen shot for it.

Expected results:
it should work well in guest.

Additional info:
# /usr/libexec/qemu-kvm -M pc -S -cpu SandyBridge,hv_spinlocks=0x1fff,hv_relaxed,hv_vapic -enable-kvm -m 2048 -smp 2,sockets=2,cores=1,threads=1 -no-kvm-pit-reinjection -usb -device usb-tablet,id=input0 -name sluo -uuid 990ea161-6b67-47b2-b803-19fb01d30d30 -rtc base=localtime,clock=host,driftfix=slew -device virtio-serial-pci,id=virtio-serial0,max_ports=16,vectors=0,bus=pci.0,addr=0x3 -chardev socket,id=channel1,path=/tmp/helloworld1,server,nowait -device virtserialport,chardev=channel1,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port1 -chardev socket,id=channel2,path=/tmp/helloworld2,server,nowait -device virtserialport,chardev=channel2,name=com.redhat.rhevm.vdsm,bus=virtio-serial0.0,id=port2 -drive file=/home/en_windows_server_2012_r2_x64.raw,if=none,id=drive-virtio-disk,format=raw,cache=none,aio=native,werror=stop,rerror=stop -device virtio-blk-pci,vectors=0,bus=pci.0,addr=0x4,scsi=off,drive=drive-virtio-disk,id=virtio-disk,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device virtio-net-pci,netdev=hostnet0,id=virtio-net-pci0,mac=2c:41:38:b6:40:11,bus=pci.0,addr=0x5 -device virtio-balloon-pci,id=ballooning,bus=pci.0,addr=0x6 -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -k en-us -boot menu=on -qmp tcp:0:4444,server,nowait -vnc :1 -spice disable-ticketing,port=5931 -vga qxl -monitor stdio -device nec-usb-xhci,id=xhci0,bus=pci.0,addr=0x7 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=xhci0.0,port=1,debug=3

Comment 1 Sibiao Luo 2013-12-26 07:35:57 UTC
My usb speaker info:

# lsusb -v
Bus 003 Device 004: ID 0c76:160c JMTek, LLC. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0c76 JMTek, LLC.
  idProduct          0x160c 
  bcdDevice            1.00
  iManufacturer           0 
  iProduct                1 USB Speaker
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          135
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      1 Control Device
      bInterfaceProtocol      0 
      iInterface              0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      1 (HEADER)
        bcdADC               1.00
        wTotalLength           40
        bInCollection           1
        baInterfaceNr( 0)       1
      AudioControl Interface Descriptor:
        bLength                12
        bDescriptorType        36
        bDescriptorSubtype      2 (INPUT_TERMINAL)
        bTerminalID             1
        wTerminalType      0x0101 USB Streaming
        bAssocTerminal          0
        bNrChannels             2
        wChannelConfig     0x0003
          Left Front (L)
          Right Front (R)
        iChannelNames           0 
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                 9
        bDescriptorType        36
        bDescriptorSubtype      3 (OUTPUT_TERMINAL)
        bTerminalID            17
        wTerminalType      0x0301 Speaker
        bAssocTerminal          0
        bSourceID              49
        iTerminal               0 
      AudioControl Interface Descriptor:
        bLength                10
        bDescriptorType        36
        bDescriptorSubtype      6 (FEATURE_UNIT)
        bUnitID                49
        bSourceID               1
        bControlSize            1
        bmaControls( 0)      0x01
          Mute Control
        bmaControls( 1)      0x02
          Volume Control
        bmaControls( 2)      0x02
          Volume Control
        iFeature                0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         1 Audio
      bInterfaceSubClass      2 Streaming
      bInterfaceProtocol      0 
      iInterface              0 
      AudioStreaming Interface Descriptor:
        bLength                 7
        bDescriptorType        36
        bDescriptorSubtype      1 (AS_GENERAL)
        bTerminalLink           1
        bDelay                  1 frames
        wFormatTag              1 PCM
      AudioStreaming Interface Descriptor:
        bLength                11
        bDescriptorType        36
        bDescriptorSubtype      2 (FORMAT_TYPE)
        bFormatType             1 (FORMAT_TYPE_I)
        bNrChannels             2
        bSubframeSize           2
        bBitResolution         16
        bSamFreqType            1 Discrete
        tSamFreq[ 0]        48000
      Endpoint Descriptor:
        bLength                 9
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            9
          Transfer Type            Isochronous
          Synch Type               Adaptive
          Usage Type               Data
        wMaxPacketSize     0x00c8  1x 200 bytes
        bInterval               1
        bRefresh                0
        bSynchAddress           0
        AudioControl Endpoint Descriptor:
          bLength                 7
          bDescriptorType        37
          bDescriptorSubtype      1 (EP_GENERAL)
          bmAttributes         0x00
          bLockDelayUnits         1 Milliseconds
          wLockDelay              1 Milliseconds
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      50
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              32
Device Status:     0x0000
  (Bus Powered)

Comment 2 Sibiao Luo 2013-12-26 07:38:13 UTC
Created attachment 841782 [details]
screenshot for device management.

Comment 3 Hans de Goede 2014-01-15 16:15:56 UTC
Since the original description mentions that the same device works well with using an emulated uhci controller rather then an emulated xhci host controller, this seems like a hcd emulation issue to me rather then a usbredir issue.

usbredir emulates a usb-device, and behaves exactly the same independent of the type of hcd emulated.

Sibiao, to further rule out usbredir being the culprit here can you please try testing with usb-host redirection rather then using spice's usbredir channel ?

Comment 4 Sibiao Luo 2014-01-16 05:45:34 UTC
(In reply to Hans de Goede from comment #3)
> Since the original description mentions that the same device works well with
> using an emulated uhci controller rather then an emulated xhci host
> controller, this seems like a hcd emulation issue to me rather then a
> usbredir issue.
> 
> usbredir emulates a usb-device, and behaves exactly the same independent of
> the type of hcd emulated.
> 
> Sibiao, to further rule out usbredir being the culprit here can you please
> try testing with usb-host redirection rather then using spice's usbredir
> channel ?
Yes, thanks for your kindly reminds. It can detect the usb controller and usb speaker device correctly if passthrough the USB speaker from usb-host directly with xhci controller, but it fail to work.
e.g:... -device nec-usb-xhci,id=xhci0,bus=pci.0,addr=0x7 -device usb-host,hostbus=3,hostaddr=3,id=usb-speaker,bus=xhci0.0

host info:
# uname -r && rpm -q qemu-kvm
3.10.0-66.el7.x86_64.debug
qemu-kvm-1.5.3-31.el7.x86_64
guest info:
win2012r2-64bit

Best Regards,
sluo

Comment 5 Hans de Goede 2014-01-16 10:35:51 UTC
Sound like a xhci emulation issue to me, moving this back to Gerd.

Comment 8 Gerd Hoffmann 2014-05-23 11:11:16 UTC
upstream commits
786ad214c72226fa5bd4ebf18aeb4c6b54d3ba80
cc03ff9d0a147a399a11c9f513afa5e06ceee453

Comment 9 Gerd Hoffmann 2014-07-04 11:38:49 UTC
Please retest with this test build:
http://people.redhat.com/ghoffman/bz1103193/

Comment 11 Miroslav Rezanina 2014-10-21 14:52:24 UTC
Fix included in qemu-kvm-1.5.3-76.el7

Comment 13 Jun Li 2014-11-07 08:24:06 UTC
Reproduce:

Version of components:
qemu-kvm-1.5.3-70.el7.x86_64
---
cli:
# /usr/libexec/qemu-kvm -M pc -m 2G -smp 2 -drive file=/home/win2012-64r2-virtio.qcow2,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,serial="QEMU-DISK1",snapshot=on -device virtio-blk-pci,bus=pci.0,drive=drive-system-disk,id=system-disk,bootindex=1 -device nec-usb-xhci,id=xhci0,bus=pci.0,addr=0x7 -chardev spicevmc,name=usbredir,id=usbredirchardev1 -device usb-redir,chardev=usbredirchardev1,id=usbredirdev1,bus=xhci0.0,port=1,debug=3 -monitor stdio -qmp tcp::8888,server,nowait -spice disable-ticketing,port=5931 -netdev tap,id=tap0,script=/etc/qemu-ifup -device virtio-net-pci,netdev=tap0,id=net0,mac=24:be:05:14:11:11 -boot menu=on -S
---
Steps are the same with comment 0. After step 3, the usb speaker controller device can be detected correctly, but the usb speaker cann't work in guest.

Based on above show, this bz has been reproduced.
===================
Verify:
Version of components:
qemu-kvm-1.5.3-77.el7.x86_64
---
cli and steps are as above show.

After step 3, the usb speaker works well. Using KMPlayer to play music sounding well. 

As above show, this bz has been verified.
=====================
Also test with qemu-kvm-rhev-2.1.2-6.el7.x86_64, works well, too.

Comment 16 errata-xmlrpc 2015-03-05 08:02:43 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0349.html


Note You need to log in before you can comment on or make changes to this bug.