You are not logged in.

#1 2015-12-06 17:49:54

dcj123
Member
Registered: 2009-12-27
Posts: 58

Qemu - USB device disappears from both Host and Guest OS after a while

Hello,

I am not sure where to post this as I didn't feel like this topic belongs in the beginners forums so I apologize if this is in the wrong section. I am trying to setup a Windows gaming virtual machine on Qemu with PCI passthrough and everything works gloriously except my USB controller. The device works fine in the guest OS from anywhere from ten minutes to six hours and than the USB device drops off the face of the planet on both Arch Linux (host) and Windows (Guest). The only way to get the device to show up under lsusb again is to reboot the system. I would have assumed at this point that the controller is having a hardware problem or having a problem under the host OS but I can play Linux games with the controller and the problem doesn't take place so it definitely seems Qemu related.

Anyway, this is the only hint that Qemu gives me,

libusb: error [_open_sysfs_attr] open /sys/bus/usb/devices/10-3/bconfigurationValue failed ret=1 errno=2

and thats really all I have got to go on at this point, I googled the error and all I could find is some USB devices don't like to be reset and will fail at that point. The thread that said that, said to use a no-reset flag under -device on Qemu but it would appear thats not a valid command parameter.

lsusb shows the device as,

Bus 010 Device 002: ID 046d:c21f Logitech, Inc. F710 Wireless Gamepad [XInput Mode]

I don't know if its relevant but I have udev rules for this device so that Qemu can access the device,

KERNEL=="10-3",SUBSYSTEM=="usb",ATTRS{idVendor}=="046d",ATTRS{idProduct}=="c21f",OWNER="dcj123"

I know I am not providing much information but this is really all its giving me, I'll be more than happy to post the output of any commands you guys want.

The only other thing I can think of that might be relevant is the way I am launching Qemu,

qemu-system-x86_64 -enable-kvm -m 16384 -cpu host,kvm=off -smp cores=7 -device vfio-pci,host=09:00.0 -drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd -drive if=pflash,format=raw,file=/tmp/my_vars.fd -soundhw ac97 -hda windows.qcow -usb -device usb-host,vendorid=0x046d,productid=0xc21f

Thanks for any feedback, this problem is about the strangest one I've had in the fact that its not giving me many clues as to whats wrong. I am going to be gaming today, so if it happens again, I won't reboot so I can poke around a bit more.

Last edited by dcj123 (2015-12-06 17:52:35)

Offline

#2 2015-12-06 19:00:33

dcj123
Member
Registered: 2009-12-27
Posts: 58

Re: Qemu - USB device disappears from both Host and Guest OS after a while

Great it happened again, here is some more information, dmesg displays this after the USB controller stopped working in Windows (Guest) and disappears from Arch Linux (Host),

[ 5862.052525] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:13.0 domain=0x0010 address=0x0000000000000080 flags=0x0020]
[ 5862.053525] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:13.0 domain=0x0010 address=0x0000000000000080 flags=0x0020]
[ 5862.054467] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:13.0 domain=0x0010 address=0x0000000000000080 flags=0x0020]

And it keeps going on with that, also if I close X, the console is indefinitely displaying this error as well. I am running every command I can think of and I have unplugged and plugged in the controller and I am getting nothing. The devname is completely gone as well.

Offline

#3 2015-12-07 12:17:58

dcj123
Member
Registered: 2009-12-27
Posts: 58

Re: Qemu - USB device disappears from both Host and Guest OS after a while

Okay....

I think I have found a work around finally after resetting my computer about six times during my last gaming session. I doubt anyone is having this exact problem with this exact hardware but if you are here it is, the controller is a USB Logitech F710 gamepad which I should have mentioned earlier really and it has a switch to go between DirectInput and XInput. As you guys can see from the above lsusb command, the gamepad was in XInput mode, when I flip the switch that becomes,

Bus 011 Device 005: ID 046d:c219 Logitech, Inc. Cordless RumblePad 2

That device seems to work fine in qemu, now thats it for the Arch Linux (Host) side of things so I don't know if I should go further into explanation as Windows is obviously not supported here but you need to emulate XInput on Windows for the controller to work on modern games. I guess all I'll say here is there is a program called x360ce that seems to do this fine on Windows. I don't know 100% that this works considering how infrequent the bug is but its looks promising, I was gaming for a good four or so hours with this setup. I can't test it again for a few days, also I'll just edit this post from now on since I am having a conversation with myself (I don't mind) but hopefully this proves semi interesting to someone else and isn't just my just taking up forum space.

Anyway, even if this work around works, the original problem is not solved but at least its a lower priority for me right now.

Offline

Board footer

Powered by FluxBB