You are not logged in.

#1 2016-02-07 22:57:16

Pulec
Member
Registered: 2014-07-06
Posts: 20

[SOLVED] Logitech Driving Force USB-Passthrough for Windows in qemu

So I managed to get Windows 7 running with VGA-Passthrough without any big issues, except I can't get pass Logitech Driving Force Pro to Windows.
My specs are:

  • CPU: i7-3770

  • MB: Asus P8Z77-V Pro

  • GPU: Sapphire HD 7950 Vapor-X OC (Boost)

Since HD 7950's BIOS does not support UEFI it runs with SeaBIOS, but I doubt its important.

I am using linux-vfio kernel (4.4.0-4) and I am using these boot parameters:

rw i915.enable_hd_vgaarb=1 intel_iommu=on intel_iommu=igfx_off

The script I am running the VM with:

#04f2:0116 chicony white keyboard
#1131:1001 bluetooth dongle
#054c:0268 ps3

echo "turning off main monitor so it can switch to displayport"
QEMU_AUDIO_DRV=pa
QEMU_PA_SERVER=localhost
PULSE_SERVER=localhost
QEMU_PA_SAMPLES=16
sudo xrandr --output HDMI3 --off --output HDMI1 --auto
sudo qemu-system-x86_64 \
  -enable-kvm \
  -m 10240 \
  -cpu host,kvm=off \
  -smp 4,sockets=1,cores=4,threads=1 \
  -vga none \
  -rtc base=localtime \
  -device ich9-usb-uhci3,id=uhci \
  -device usb-ehci,id=ehci \
  -device nec-usb-xhci,id=xhci \
  -soundhw hda \
  -device vfio-pci,host=01:00.0,x-vga=on,multifunction=on \
  -device vfio-pci,host=01:00.1 \
  -drive file=/motherstorage/KVM/windows7.img,format=raw,if=none,id=drive-ide0-1-0 \
  -device ide-hd,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 \
  -drive file=/motherstorage/KVM/data_games.img,format=raw,if=none,id=drive-ide0-1-1 \
  -device ide-hd,bus=ide.1,unit=1,drive=drive-ide0-1-1,id=ide0-1-1 \
  -usbdevice host:04f2:0116 \
  -usbdevice host:1131:1001 \
  -usbdevice host:054c:0268 \
  -netdev user,id=vmnic -device virtio-net,netdev=vmnic

#on igpu main monitor
xrandr --output HDMI3 --auto --right-of HDMI1
echo "turning main monitor back on"
xrandr --output HDMI3 --auto

I use some old Bluetooth Dongle(host:1131:1001) and DualShock 3 (host:054c:0268) with XInput Wrapper for DS3 and it works perfectly. Although I have to sometimes reconnect Bluetooth Dongle so it loads properly, but I have to do the same thing on native Windows, so that is expected.
I also tried Thrustmaster T1600M, no issues.

But Windows just can't get detect the Logitech Driving Force(046d:c294) which is probably the wheel locked in 270 degrees mode and Logitech Driving Force Pro(046d:c298) which is 900 degrees mode.
I probably got my wheel somehow stuck in 900 degrees mode, although I can lock to 270 degree with pushing Select R3+R1, after reconnecting (which also means using usb_add command in QEMU monitor when VM is running) it always switches back to 900 degrees mode.

Here is what I tried:

  • 1. Different USB ports, always using -usbdevice host:046d:c298 parameter

  • 2. Same USB ports, with number of hostadrdesses, with using number of hostaddresses so:
    -usb -device usb-host,hostbus=2,hostaddr=6
    -usb -device usb-host,hostbus=2,hostaddr=7
    -usb -device usb-host,hostbus=2,hostaddr=8
    -usb -device usb-host,hostbus=2,hostaddr=9
    -usb -device usb-host,hostbus=2,hostaddr=10

  • 3. Trying point 1 and 2 things with -M q35 (default is i440fx) and on Windows 10
    I could not use these parameters with q35 chipset:
      -device ich9-usb-uhci3,id=uhci \
      -device usb-ehci,id=ehci \
      -device nec-usb-xhci,id=xhci \
    Windows failed to boot with them
    and:
      -drive file=/motherstorage/KVM/data_games.img,format=raw,if=none,id=drive-ide0-1-1 \
      -device ide-hd,bus=ide.1,unit=1,drive=drive-ide0-1-1,id=ide0-1-1 \
    error with IDE, since I already used it for my system

I always got the same result.
1. Connect the wheel to the host
    1.1 when I tried using Same USB port with number of hostaddresses the wheel gets detected on Bus 002 with specific Device Number(hostaddr), I pass this to the VM script
2. Launch the VM, when using number hostaddresses I had the parameter directly in the script, but when using -usbdevice host:$vendor:$product I didn't notice any difference when the parameter is in the script or I use usb_add host:$vendor:$product when Windows boots
3. When the qemu tries to "catch the wheel" its gets reconnected and tries to calibrate itself as it always does and when that happens script window which I launched qemu with reports something like this:

libusb: error [_get_usbfs_fd] File doesn't exist, wait 10 ms and try again
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/009: No such file or directory
libusb: error [_open_sysfs_attr] open /sys/bus/usb/devices/2-1.8/bConfigurationValue failed ret=-1 errno=2
libusb: error [_get_usbfs_fd] File doesn't exist, wait 10 ms and try again
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/011: No such file or directory
libusb: error [_get_usbfs_fd] File doesn't exist, wait 10 ms and try again
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/013: No such file or directory
libusb: error [_open_sysfs_attr] open /sys/bus/usb/devices/2-1.5/bConfigurationValue failed ret=-1 errno=2
libusb: error [_get_usbfs_fd] File doesn't exist, wait 10 ms and try again
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/017: No such file or directory
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/019: No such device
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/021: No such device
libusb: error [_get_usbfs_fd] File doesn't exist, wait 10 ms and try again
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/023: No such file or directory
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/025: No such device
libusb: error [_get_usbfs_fd] File doesn't exist, wait 10 ms and try again
libusb: error [_get_usbfs_fd] libusb couldn't open USB device /dev/bus/usb/002/027: No such file or directory

During the calibration process (which takes about 10s) its seems that it gets disconnected and reconnected number of times and when that happens, its device number changes.

Seeing it first time I tried to use number of hostaddresses either with addresses like 08,10,12,14 or directly [08-14] and even when the script window didn't showed that the the device does not exist, it still didn't change.
In native Windows its either the 046d:c294 or 046d:c298 (after comparing two outputs from Nirsoft's USB Devices View in connected and disconnect states) the Windows in VM does not detect anything at all.

I can use my wheel without issues on the Linux host in games like Euro Truck Simulator 2 and set up the wheel with ltwheelconf so I might probably use Steam Home Streaming for the racing games (I didn't manage to setup the network bridge correctly, yet) but I am thinking of getting Logitech G27 (mention that it might work) or some similar alternative. Good wheels with 3 pedals and H-shifter are not cheap so I would like to know that they will work... I don't want to boot to Windows just because of the wheel.

Any ideas what I might try ("somehow forcing" the wheel to specific hostaddress for example?) or what kind of qemu setting might help?

Last edited by Pulec (2016-02-10 21:41:49)


IRC: pulec

Offline

#2 2016-02-10 21:41:20

Pulec
Member
Registered: 2014-07-06
Posts: 20

Re: [SOLVED] Logitech Driving Force USB-Passthrough for Windows in qemu

Thanks to Jonathan Scruggs from vfio-users mailing list I tried passing whole USB Host controller to the VM.

I used this guide https://lime-technology.com/forum/index … ic=36768.0

and in short I found out which USB ports are owned by which USB controller.
Then I add them to the vfio-pci options (on arch in /etc/modprobe.d/vfio.conf and filename is not important, more here: https://wiki.archlinux.org/index.php/PC … #vfio-pci)

The specific PCI device was in my case on Intel USB3 controller on address 00:14.0 so i added that along with the AMD graphics card.

So to  get I got iommu loaded the controller in device in group 2 (check by:ls /dev/vfio) I had to load more modules and rerun the img make with mkinitcpio.
And then I just just added to the script:
-device vfio-pci,host=00:14.0 \

00:14.0 being the address of the USB3 controller.

And once the VM boots I just had to install the USB3 drivers from ASUS and everything works. :-)

On the ASUS P8Z77-V Pro this controller has two USB3 ports, I use one for charging android devices and I just connected an USB hub for the other.
So no need to add specific usb devices, I just know that these ports are owned by the VM.

That also means I cannot use those USB ports on host, but with enough USBs, its just allright. :-)

When launching the VM I get:
qemu-system-x86_64: vfio: Cannot reset device 0000:00:14.0, no available reset mechanism.
qemu-system-x86_64: vfio: Cannot reset device 0000:00:14.0, no available reset mechanism.

And in one of the runs the VM stayed on SeaBios screen and did not move, reboot and it worked.

Last edited by Pulec (2016-02-10 21:42:01)


IRC: pulec

Offline

Board footer

Powered by FluxBB