* usbpassthrough of xen-4.1.2 update
@ 2012-09-25  3:17 Qian Hu
  2012-09-25  6:11 ` Pasi Kärkkäinen
  2012-09-25 14:04 ` Konrad Rzeszutek Wilk
  0 siblings, 2 replies; 8+ messages in thread
From: Qian Hu @ 2012-09-25  3:17 UTC (permalink / raw)
  To: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 879 bytes --]
Hi, everyone! The same question with updated message.
I am working on the USB passthrough of Xen-4.1.2. My host OS  is Fedora 14
and the guest OS is win7.
According to the wiki page(http://wiki.xen.org/wiki/Xen_USB_Passthrough),
xen supports passthrough of usb device from dom0 to guests. I have tried
the Xen HVM guest qemu-dm usb1.1 emulation,
by specifying "usb = 1" and "usbdevice = host:xxxx:yyyy". I have also tried
the command usb_add host:xxxx:yyyy.
But, the mouse could work, the keyboard didn't, and the usb storage
device(usb 2.0) appeared in the device manager.
While the driver is OK, it couldn't start. I can only find the message
 "The device cannot start(code 10)".
I doubt there may be something wrong with the guest OS driver, which is not
said to be needed.
I am confused and don't know how to resolve it.  Could anyone help me?
Great thanks!
huqian
[-- Attachment #1.2: Type: text/html, Size: 3231 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: usbpassthrough of xen-4.1.2 update
  2012-09-25  3:17 usbpassthrough of xen-4.1.2 update Qian Hu
@ 2012-09-25  6:11 ` Pasi Kärkkäinen
  2012-09-25  9:01   ` Qian Hu
  2012-09-25 14:04 ` Konrad Rzeszutek Wilk
  1 sibling, 1 reply; 8+ messages in thread
From: Pasi Kärkkäinen @ 2012-09-25  6:11 UTC (permalink / raw)
  To: Qian Hu; +Cc: xen-devel
On Tue, Sep 25, 2012 at 11:17:03AM +0800, Qian Hu wrote:
>    Hi, everyone! The same question with updated message.
>    I am working on the USB passthrough of Xen-4.1.2. My host OS  is Fedora 14
>    and the guest OS is win7.
>    According to the wiki
>    page([1]http://wiki.xen.org/wiki/Xen_USB_Passthrough),
>    xen supports passthrough of usb device from dom0 to guests. I have tried
>    the Xen HVM guest qemu-dm usb1.1 emulation,
>    by specifying "usb = 1" and "usbdevice = host:xxxx:yyyy". I have also
>    tried the command usb_add host:xxxx:yyyy.
>    But, the mouse could work, the keyboard didn't, and the usb storage
>    device(usb 2.0) appeared in the device manager.
>    While the driver is OK, it couldn't start. I can only find the message
>     "The device cannot start(code 10)".
>    I doubt there may be something wrong with the guest OS driver, which is
>    not said to be needed.
>    I am confused and don't know how to resolve it.  Could anyone help me?
>
It might be a bug in the USB emulation code in the old qemu-dm traditional.
Any errors in:
- "dmesg" output? 
- /var/log/xen/qemu-dm* (for the windows vm).
- "xm dmesg" output ? 
-- Pasi
^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: usbpassthrough of xen-4.1.2 update
  2012-09-25  6:11 ` Pasi Kärkkäinen
@ 2012-09-25  9:01   ` Qian Hu
  0 siblings, 0 replies; 8+ messages in thread
From: Qian Hu @ 2012-09-25  9:01 UTC (permalink / raw)
  To: Pasi Kärkkäinen; +Cc: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 4187 bytes --]
I haven't found any  obvious error infomation in the log or command output.
Below is some output message of dmesg,
which I think may be useful. The sentence "usb-storage: waiting for device
to settle before scanning" has repeated for
many times. Does it mean the missing of usb device?
[15171.175847] usb-storage: device found at 3
[15171.175851] usb-storage: waiting for device to settle before scanning
[15171.964100] usb 1-1.1: reset high speed USB device using ehci_hcd and
address 3
[15172.049744] scsi11 : SCSI emulation for USB Mass Storage devices
[15172.051087] usb-storage: device found at 3
[15172.051090] usb-storage: waiting for device to settle before scanning
[15172.190280] usb 1-1.1: reset high speed USB device using ehci_hcd and
address 3
[15172.276400] scsi12 : SCSI emulation for USB Mass Storage devices
[15172.277531] usb-storage: device found at 3
[15172.277537] usb-storage: waiting for device to settle before scanning
[15795.726914] frontend_changed: backend/vbd/2/768: prepare for reconnect
[15796.521940] eth0: port 3(vif2.0) entering disabled state
[15796.524501] eth0: port 3(vif2.0) entering disabled state
[15909.382494] device tap3.0 entered promiscuous mode
[15909.382661] eth0: port 2(tap3.0) entering forwarding state
[15909.496010] eth0: port 2(tap3.0) entering disabled state
[15909.503155] eth0: port 2(tap3.0) entering forwarding state
[15909.542545] device vif3.0 entered promiscuous mode
[15909.548416] eth0: port 3(vif3.0) entering forwarding state
[15919.952172] tap3.0: no IPv6 routers present
[15920.213066] vif3.0: no IPv6 routers present
[15921.487767] eth0: port 2(tap3.0) entering disabled state
[15921.495423] eth0: port 2(tap3.0) entering disabled state
[15922.021211] blkback: ring-ref 16383, event-channel 7, protocol 1
(unspecified, assuming native)
[15927.292273] usb 1-1.1: reset high speed USB device using ehci_hcd and
address 3
[15927.377807] scsi13 : SCSI emulation for USB Mass Storage devices
[15927.378509] usb-storage: device found at 3
[15927.378512] usb-storage: waiting for device to settle before scanning
[15928.354314] usb 1-1.1: reset high speed USB device using ehci_hcd and
address 3
[15928.440038] scsi14 : SCSI emulation for USB Mass Storage devices
[15928.441362] usb-storage: device found at 3
[15928.441366] usb-storage: waiting for device to settle before scanning
[15928.581347] usb 1-1.1: reset high speed USB device using ehci_hcd and
address 3
[15928.667401] scsi15 : SCSI emulation for USB Mass Storage devices
[15928.667840] usb-storage: device found at 3
[15928.667845] usb-storage: waiting for device to settle before scanning
[18491.761185] r8169: peth0: link down
[18491.769600] eth0: port 1(peth0) entering disabled state
[18499.958694] r8169: peth0: link up
[18499.960123] eth0: port 1(peth0) entering forwarding state
2012/9/25 Pasi Kärkkäinen <pasik@iki.fi>
> On Tue, Sep 25, 2012 at 11:17:03AM +0800, Qian Hu wrote:
> >    Hi, everyone! The same question with updated message.
> >    I am working on the USB passthrough of Xen-4.1.2. My host OS  is
> Fedora 14
> >    and the guest OS is win7.
> >    According to the wiki
> >    page([1]http://wiki.xen.org/wiki/Xen_USB_Passthrough),
> >    xen supports passthrough of usb device from dom0 to guests. I have
> tried
> >    the Xen HVM guest qemu-dm usb1.1 emulation,
> >    by specifying "usb = 1" and "usbdevice = host:xxxx:yyyy". I have also
> >    tried the command usb_add host:xxxx:yyyy.
> >    But, the mouse could work, the keyboard didn't, and the usb storage
> >    device(usb 2.0) appeared in the device manager.
> >    While the driver is OK, it couldn't start. I can only find the message
> >     "The device cannot start(code 10)".
> >    I doubt there may be something wrong with the guest OS driver, which
> is
> >    not said to be needed.
> >    I am confused and don't know how to resolve it.  Could anyone help me?
> >
>
> It might be a bug in the USB emulation code in the old qemu-dm traditional.
>
> Any errors in:
> - "dmesg" output?
> - /var/log/xen/qemu-dm* (for the windows vm).
> - "xm dmesg" output ?
>
>
> -- Pasi
>
>
[-- Attachment #1.2: Type: text/html, Size: 5208 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: usbpassthrough of xen-4.1.2 update
  2012-09-25  3:17 usbpassthrough of xen-4.1.2 update Qian Hu
  2012-09-25  6:11 ` Pasi Kärkkäinen
@ 2012-09-25 14:04 ` Konrad Rzeszutek Wilk
  2012-09-25 15:34   ` usbpassthrough of xen-4.1.2 update / Qemu-dm PulseAudio/Alsa support Pasi Kärkkäinen
  2012-09-26  8:39   ` usbpassthrough of xen-4.1.2 update Qian Hu
  1 sibling, 2 replies; 8+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-09-25 14:04 UTC (permalink / raw)
  To: Qian Hu; +Cc: xen-devel
On Tue, Sep 25, 2012 at 11:17:03AM +0800, Qian Hu wrote:
> Hi, everyone! The same question with updated message.
> 
> I am working on the USB passthrough of Xen-4.1.2. My host OS  is Fedora 14
> and the guest OS is win7.
> 
> According to the wiki page(http://wiki.xen.org/wiki/Xen_USB_Passthrough),
> 
> xen supports passthrough of usb device from dom0 to guests. I have tried
> the Xen HVM guest qemu-dm usb1.1 emulation,
> 
> by specifying "usb = 1" and "usbdevice = host:xxxx:yyyy". I have also tried
> the command usb_add host:xxxx:yyyy.
Do you also re-assign the device from the Linux kernel? Like this:
(the C408 0040 is my mouse).
 cd /sys/bus/usb/drivers/usbhid
 for a in `ls -1 | grep :`
 do
   for DEV in C408 0040
   do
        grep $DEV $a/modalias
        if [ $? -eq 0 ]; then
                echo "Unbinding $a for $DEV"
                echo $a > unbind
        fi
   done
 done
This is what the config file looks for me:
builder='hvm'
memory = 2048
name = "Windows7"
vcpus=3
disk = [ 'phy:/dev/vg_guest/Win7_Home,hda,w']
vnc=1
videoram=8
vnclisten="0.0.0.0"
vncpasswd=''
stdvga=0
serial='pty'
tsc_mode=0
usb=1
usb_add="host:045e:0040"
usbdevice='tablet'
xen_platform_pci=1
# Remember QEMU_AUDIO_DRV=pa
soundhw='es1370'
pci=['01:00.0','01:00.1','02:00.0']
^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: usbpassthrough of xen-4.1.2 update / Qemu-dm PulseAudio/Alsa support
  2012-09-25 14:04 ` Konrad Rzeszutek Wilk
@ 2012-09-25 15:34   ` Pasi Kärkkäinen
  2012-09-26 11:45     ` Konrad Rzeszutek Wilk
  2012-09-26  8:39   ` usbpassthrough of xen-4.1.2 update Qian Hu
  1 sibling, 1 reply; 8+ messages in thread
From: Pasi Kärkkäinen @ 2012-09-25 15:34 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: xen-devel
On Tue, Sep 25, 2012 at 10:04:22AM -0400, Konrad Rzeszutek Wilk wrote:
>
> # Remember QEMU_AUDIO_DRV=pa
> soundhw='es1370'
>
Hey,
This reminds me.. is qemu-dm (traditional) automatically compiled with PulseAudio support enabled these days? 
How about Alsa support? 
Or do we need Makefile tweaks before building Xen/Qemu..
-- Pasi
^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: usbpassthrough of xen-4.1.2 update
  2012-09-25 14:04 ` Konrad Rzeszutek Wilk
  2012-09-25 15:34   ` usbpassthrough of xen-4.1.2 update / Qemu-dm PulseAudio/Alsa support Pasi Kärkkäinen
@ 2012-09-26  8:39   ` Qian Hu
  2012-09-26 11:48     ` Konrad Rzeszutek Wilk
  1 sibling, 1 reply; 8+ messages in thread
From: Qian Hu @ 2012-09-26  8:39 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk; +Cc: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 2347 bytes --]
I am sorry what does the re-assign mean? By the way, where can I find the
ID C408 0040?
It seems not to be the message listed by "lsusb".
Below is my config file, similar with yours.
import os, re
arch = os.uname()[4]
if re.search('64', arch):
   arch_libdir = 'lib64'
else:
  arch_libdir = 'lib'
name = "win7"
builder = "hvm"
memory = "1024"
disk = [ 'file:/root/win7.img,hda,w',
#         'file:/mnt/win7.iso,hdc:cdrom,r',
        ]
vif = [ 'type=ioemu, mac=00:16:3e:3f:74:01 , bridge=eth0  ,model=e1000', ]
uuid = "11111111-2262-28d2-9b64-b11713adfb20"
device_model = "/home/root1/xen/xen-4.1.2/tools/ioemu-dir/i386-dm/qemu-dm"
kernel = "/usr/lib/xen/boot/hvmloader"
vnc=1
vnclisten="0.0.0.0"
vncdisplay=0
apic=1
acpi=1
pae=1
boot="dc"
vcpus=2
serial = "pty"
on_reboot='restart'
on_crash='restart'
dhcp='off'
stdvga=0
audio=1
soundhw='es1370'
videoram=16
usb=1
usb_add='host:0204:6025'
usbdevice='tablet'
2012/9/25 Konrad Rzeszutek Wilk <konrad@kernel.org>
> On Tue, Sep 25, 2012 at 11:17:03AM +0800, Qian Hu wrote:
> > Hi, everyone! The same question with updated message.
> >
> > I am working on the USB passthrough of Xen-4.1.2. My host OS  is Fedora
> 14
> > and the guest OS is win7.
> >
> > According to the wiki page(http://wiki.xen.org/wiki/Xen_USB_Passthrough
> ),
> >
> > xen supports passthrough of usb device from dom0 to guests. I have tried
> > the Xen HVM guest qemu-dm usb1.1 emulation,
> >
> > by specifying "usb = 1" and "usbdevice = host:xxxx:yyyy". I have also
> tried
> > the command usb_add host:xxxx:yyyy.
>
> Do you also re-assign the device from the Linux kernel? Like this:
>
> (the C408 0040 is my mouse).
>
>  cd /sys/bus/usb/drivers/usbhid
>  for a in `ls -1 | grep :`
>  do
>    for DEV in C408 0040
>    do
>         grep $DEV $a/modalias
>         if [ $? -eq 0 ]; then
>                 echo "Unbinding $a for $DEV"
>                 echo $a > unbind
>         fi
>    done
>  done
>
> This is what the config file looks for me:
> builder='hvm'
> memory = 2048
> name = "Windows7"
> vcpus=3
> disk = [ 'phy:/dev/vg_guest/Win7_Home,hda,w']
> vnc=1
> videoram=8
> vnclisten="0.0.0.0"
> vncpasswd=''
> stdvga=0
> serial='pty'
> tsc_mode=0
> usb=1
> usb_add="host:045e:0040"
> usbdevice='tablet'
> xen_platform_pci=1
> # Remember QEMU_AUDIO_DRV=pa
> soundhw='es1370'
> pci=['01:00.0','01:00.1','02:00.0']
>
[-- Attachment #1.2: Type: text/html, Size: 3704 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: usbpassthrough of xen-4.1.2 update / Qemu-dm PulseAudio/Alsa support
  2012-09-25 15:34   ` usbpassthrough of xen-4.1.2 update / Qemu-dm PulseAudio/Alsa support Pasi Kärkkäinen
@ 2012-09-26 11:45     ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 8+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-09-26 11:45 UTC (permalink / raw)
  To: Pasi Kärkkäinen; +Cc: xen-devel
On Tue, Sep 25, 2012 at 06:34:45PM +0300, Pasi Kärkkäinen wrote:
> On Tue, Sep 25, 2012 at 10:04:22AM -0400, Konrad Rzeszutek Wilk wrote:
> >
> > # Remember QEMU_AUDIO_DRV=pa
> > soundhw='es1370'
> >
> 
> Hey,
> 
> This reminds me.. is qemu-dm (traditional) automatically compiled with PulseAudio support enabled these days? 
Not that I know off. I had to enable it it my makefile/configure script.
But the other thing is that is a pain in the butt to work right.
You have to (as root) set these:
export PULSE_SERVER=192.168.101.16
export QEMU_AUDIO_DRV=pa
so that qemu-dm knows to use PA, and that PA knows where to send data.
And then on the client side (so ~/.pulse/default):
load-module module-native-protocol-tcp auth-ip-acl=192.168.101.0/24
and then also open a firewall port for it on the client side.
The GSOC work that was done to make a PulseAudio client for PV guests
was more promising - as it would automatically configure the host/client
(if they were running on the same machine). Granted it meant you had
to install some extra-third party under Windows. But it is not ready.
> How about Alsa support? 
Hadn't tried it. I thought that ALSA has gone out of favour and
PulseAudio is the new king?
> 
> Or do we need Makefile tweaks before building Xen/Qemu..
This was the only modification to the ioemu I had to do:
 
diff --git a/xen-setup b/xen-setup
index c3af79b..f674ba8 100755
--- a/xen-setup
+++ b/xen-setup
@@ -18,7 +18,7 @@ if test -z "${XEN_SCRIPT_DIR}"; then
 	XEN_SCRIPT_DIR="/etc/xen/scripts"
 fi
 
-${QEMU_ROOT:-.}/configure --disable-gfx-check --disable-curses --disable-slirp "$@" --prefix=${PREFIX}
+${QEMU_ROOT:-.}/configure --disable-gfx-check --disable-curses --disable-slirp "$@" --prefix=${PREFIX} --audio-drv-list=pa
 
 if [ "x$XEN_ROOT" != x ]; then
 	echo "XEN_ROOT=$XEN_ROOT" >>config-host.mak
The sound quality is not perfect - but when I play Left4Dead under Win7
(with PCI passthrough of a network card and radeon GPU) the moans
of zombies as they get whacked by my baseball is satisfyingly enough.
> -- Pasi
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
> 
^ permalink raw reply related	[flat|nested] 8+ messages in thread
* Re: usbpassthrough of xen-4.1.2 update
  2012-09-26  8:39   ` usbpassthrough of xen-4.1.2 update Qian Hu
@ 2012-09-26 11:48     ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 8+ messages in thread
From: Konrad Rzeszutek Wilk @ 2012-09-26 11:48 UTC (permalink / raw)
  To: Qian Hu; +Cc: xen-devel
On Wed, Sep 26, 2012 at 04:39:22PM +0800, Qian Hu wrote:
> I am sorry what does the re-assign mean? By the way, where can I find the
Please do not top-post.
> ID C408 0040?
<sigh> That is my mouse. Yours would be different of course. It was
an example of what you need to do.
> 
> It seems not to be the message listed by "lsusb".
> 
> Below is my config file, similar with yours.
> 
> import os, re
> arch = os.uname()[4]
> if re.search('64', arch):
>    arch_libdir = 'lib64'
> else:
>   arch_libdir = 'lib'
> 
> name = "win7"
> builder = "hvm"
> memory = "1024"
> disk = [ 'file:/root/win7.img,hda,w',
> #         'file:/mnt/win7.iso,hdc:cdrom,r',
>         ]
> vif = [ 'type=ioemu, mac=00:16:3e:3f:74:01 , bridge=eth0  ,model=e1000', ]
> uuid = "11111111-2262-28d2-9b64-b11713adfb20"
> device_model = "/home/root1/xen/xen-4.1.2/tools/ioemu-dir/i386-dm/qemu-dm"
> kernel = "/usr/lib/xen/boot/hvmloader"
> vnc=1
> vnclisten="0.0.0.0"
> vncdisplay=0
> apic=1
> acpi=1
> pae=1
> boot="dc"
> vcpus=2
> serial = "pty"
> on_reboot='restart'
> on_crash='restart'
> dhcp='off'
> stdvga=0
> audio=1
> soundhw='es1370'
> videoram=16
> usb=1
> usb_add='host:0204:6025'
> usbdevice='tablet'
> 
> 
> 
> 2012/9/25 Konrad Rzeszutek Wilk <konrad@kernel.org>
> 
> > On Tue, Sep 25, 2012 at 11:17:03AM +0800, Qian Hu wrote:
> > > Hi, everyone! The same question with updated message.
> > >
> > > I am working on the USB passthrough of Xen-4.1.2. My host OS  is Fedora
> > 14
> > > and the guest OS is win7.
> > >
> > > According to the wiki page(http://wiki.xen.org/wiki/Xen_USB_Passthrough
> > ),
> > >
> > > xen supports passthrough of usb device from dom0 to guests. I have tried
> > > the Xen HVM guest qemu-dm usb1.1 emulation,
> > >
> > > by specifying "usb = 1" and "usbdevice = host:xxxx:yyyy". I have also
> > tried
> > > the command usb_add host:xxxx:yyyy.
> >
> > Do you also re-assign the device from the Linux kernel? Like this:
> >
> > (the C408 0040 is my mouse).
> >
> >  cd /sys/bus/usb/drivers/usbhid
> >  for a in `ls -1 | grep :`
> >  do
> >    for DEV in C408 0040
> >    do
> >         grep $DEV $a/modalias
> >         if [ $? -eq 0 ]; then
> >                 echo "Unbinding $a for $DEV"
> >                 echo $a > unbind
> >         fi
> >    done
> >  done
> >
> > This is what the config file looks for me:
> > builder='hvm'
> > memory = 2048
> > name = "Windows7"
> > vcpus=3
> > disk = [ 'phy:/dev/vg_guest/Win7_Home,hda,w']
> > vnc=1
> > videoram=8
> > vnclisten="0.0.0.0"
> > vncpasswd=''
> > stdvga=0
> > serial='pty'
> > tsc_mode=0
> > usb=1
> > usb_add="host:045e:0040"
> > usbdevice='tablet'
> > xen_platform_pci=1
> > # Remember QEMU_AUDIO_DRV=pa
> > soundhw='es1370'
> > pci=['01:00.0','01:00.1','02:00.0']
> >
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply	[flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-09-26 11:48 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-25  3:17 usbpassthrough of xen-4.1.2 update Qian Hu
2012-09-25  6:11 ` Pasi Kärkkäinen
2012-09-25  9:01   ` Qian Hu
2012-09-25 14:04 ` Konrad Rzeszutek Wilk
2012-09-25 15:34   ` usbpassthrough of xen-4.1.2 update / Qemu-dm PulseAudio/Alsa support Pasi Kärkkäinen
2012-09-26 11:45     ` Konrad Rzeszutek Wilk
2012-09-26  8:39   ` usbpassthrough of xen-4.1.2 update Qian Hu
2012-09-26 11:48     ` Konrad Rzeszutek Wilk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).