Jump to content

Does selecting a USB device on the VM manager not actually give the VM full ownership? I'm seeing micro-drops in one of my USB devices


Recommended Posts

I am trying to pass through a Mayflash 4-port Gamecube adapter to my windows 10 VM and it is working but im noticing the controllers sometime register a downward press on the joystick when playing games via the Dolphin emulator. This doesnt happen on other games that use the mayflash adapter (Slap City, via steam) and it doesnt happen on my windows 10 laptop with the same version of Dolphin.

 

I did some searching and it seems like this is an issue caused when "something else is interfering with Dolphin, stealing the adapter, which makes Dolphin temporarily unable to read inputs."

 

Right now i am not passing the entire USB controller since it seems like i cannot select it to bind to VFIO, and ACS override wont split it up even on "both" setting; so instead i just select the mayflash adapater USB device to pass to the windows VM.

 

I am wondering if passing the device this way is causing it to not be fully owned by the windows VM and thus leading to the issue where something is interfering with it very momentarily, causing dolphin to not read in the inputs. Which apparently manifests as a "down" on the joystick...

 

Do you think if i purchased a PCIE USB controller (so i could pass the whole thing to the windows vm via VFIO binding) that would resolve it?

Edited by Taako
Link to comment

 

33 minutes ago, Taako said:

Do you think if i purchased a PCIE USB controller (so i could pass the whole thing to the windows vm via VFIO binding) that would resolve it?

possibly

 

The issue here is that the USB controller is being generated in software by the KVM emulation, so the more resources you can give to the host and remove from the VM the better. Only give the VM the bare minimum to run well, no more.

Link to comment
11 minutes ago, JonathanM said:

 

possibly

 

The issue here is that the USB controller is being generated in software by the KVM emulation, so the more resources you can give to the host and remove from the VM the better. Only give the VM the bare minimum to run well, no more.

 

thanks for the info, i have an i5-10400 and am giving the VM 4 cores (8 threads), leaving 2 cores (4 threads) for unraid itself. The system has 48GB of DDR4-3200 RAM and only 16GB is going to the VM. I guess i can try reduce the number of cores/threads the VM gets but i dont wanna hamper it too much.

 

If i get a PCIE usb controller and manage to bind it to the VFIO at boot (like i'm doing with the GPU) does this mean the KVM won't have to emulate that USB controller any longer?

Link to comment
1 hour ago, JonathanM said:

Correct, it will just be emulating the PCI or PCIe slot, depending on which machine type the VM is using.

Just to confirm,  since my knowledge of VMs and how they work is severely lacking. Will emulating the PCI/PCIe slot be less resource intensive than emulating the controller? I just want to avoid these dropouts

 

Btw im using Q35-5.1 right now, i was using i440fx-5.1 when i initially created the VM but i switched to Q35 to see if it helped, it didn't. Not sure if i should switch back, everything seems to be working the exact same with Q35 and the machine type is (supposedly) newer. but that doesn't necessarily mean better. I just don't really know the pros/cons of each.

Link to comment

Thanks! You've been a great help. I'll start looking for a USB pcie card and bind the whole thing to vfio.

 

Maybe a separate question but do you think CPU pinning/isolation would help here or is that unlikely since our believe it's a host side issue emulating the device.

 

I have the 4 cores (8threads) pinned for the VM (the other two cores (4 threads) are pinned to docker so they don't overlap. But I didn't isolate those 4 cores fro unRAID. So if I understand pinning/isolation correctly it means the VM is only using those 4 cores but the host can use all of the cores on the machine unless I isolate them

Edited by Taako
Link to comment
On 7/11/2022 at 7:31 AM, JonathanM said:

yes, it's already emulating the pcie bus in either case.

Well I got this USB controller:

Inateck PCI-E to USB 3.0 (5 Ports) PCI Express Card and 15-Pin Power Connector https://a.co/d/8z92cz8

 

and I bound it to VFIO and passed it through to the and it did the trick! You were on the money with your conclusion because after it plugged the mayflash adapter in it worked flawlessly, no weird ghost inputs or any errors from the Dolphin Log

 

Thanks a ton for the help! It's great having a dedicated USB controller too, makes hotplugging stuff dead simple!

 

 

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...