Hi there,
I've done a lot of troubleshooting on this issue.
At first I thought it was just the controller but used another controller and same issue.
I have a Raspberry Pi3 connected via LAN cable and is on a VLAN to the windows system -- there is no other traffic on this link and is dedicated to VirtualHere communication.
This works perfectly and latency is minimal if any at all and in the PI I have a powered USB hub plugged in with the following:
- Bluetooth module
- UGREEN Bluetooth 5.4 Adapter for PC
- https://www.amazon.co.uk/dp/B0CJXVM1JJ
- Wireless Keyboard
- Wireless Mouse
- I do plug in controllers/etc. at times via USB cable (more on that later).
As a note the Raspberry Pi is only used for VirtualHere, nothing else is running on it bar the default OS installed items.
What happens is the controller seemingly disconnects -- or gets confused, while on Bluetooth but the really odd thing here is it only seems to happen -- or I have only noticed it in, Hollow Knight (the first one). It a random occurance as well but pretty consistent in that it happens over and over.
Troubleshooting:
- Tried different controllers to rule that out.
- Connected the controller to the windows PC directly with the on-board Bluetooth - no issue controller.
- Connected the controller to the windows PC with the Bluetooth module - no issue with the controller.
- Tried a USB 2.0 extension cable direct to the Pi to move the module away from the USB 3.0 stuff - has the same issue.
- Turned off the Wireless Keyboard and Mouse - same issue.
- I even turned off 2.4GHz on my access points - same issue.
It seems to point to the communication via VirtualHere but on that:
- There is no disconnects/outage on the network link or no events on device disconnects.
- I have added the command line switches --- it happens before or after adding these:
- UseCompression=0
- OptimizeForSpeed=1
- DirectConnect=1
I am at a loss here as to why.
What is really confusing here is that playing Call of Duty etc. with the controller over Bluetooth there is no issue at all.
Also, if I play with the controller plugged in via USB - over VirtualHere, there is no issue at all.
Any ideas on this? Or what can I give you that might help track down the issue.
Edit:
The only thing I haven't ruled out is the Raspberry Pi itself - and perhaps removing ESET on windows (but I have whitelisted VirtualHere as much as I can).
For the Raspberry Pi at least, I could rig up VirtualHere on another device I have and see but I don't reckon the Pi is the issue here.
.
It almost sounds like its a network bandwidth and/or CPU starvation issue.
Remember on the pi3 everything goes through a single USB port including the networking. So its majorly bandwidth constrained especially if you are running busy games and the cpu% is high. Have a look at
toporhtopand see what that shows when virtualhere is dropping."Remember on the pi3…
"Remember on the pi3 everything goes through a single USB port including the networking."
I did not know that and it makes sense - that it is all connected via USB.
So while my actual network has adequate capacity and no interference -- being a VLAN, it could very well be a capacity issue on the "port" on the pi.
I'll have to check what you suggested.
Do you know if the later pi revisions have the same bottlenecking issue - do they also connect via a single port or perhaps might have bandwidth.
I tried the Bluetooth…
I tried the Bluetooth adaptor on another system - much more powerful than the Pi, and had the same issue.
I've ordered a new one - 6.0 spec this time, so I'll see if changing the adaptor makes a difference.
.
The pi4 uses a separate USB system to the network system (using a VIA PCIe chip). And the pi5 is even better and completely separates the USB subsystems from each other using a custom RP1 chip.
Depsite the new Bluetooth…
Depsite the new Bluetooth module on the way.
I did a bit more testing.
I watched htop [pi] and performance [windows] and looked at the network traffic up to, during and after the issue. For the most part traffic just drops yet if I move the mouse etc. that works fine so the connection is still there.
I then tested with Airpods connected to the module listening to the sound from the game -- music etc., and it never stopped or hissed/crackled etc. so this then also suggests the connection to the system is not stopping either.
Once I get the other dongle I will be able to see if that makes a difference -- it could end up being interference maybe.
I got the new dongle and had…
I got the new dongle and had the same issue.
It seems to be something then with VirtualHere maybe -- is there a way to enable verbose logging in Windows and on Linux?
.
You can use wireshark on windows and/or Linux and install the USB traffic capture option. usbpcap on windows included during install and modprobe usbmon on Linux you have to do manually. On windows you will need to find the correct host controller of virtualhere. (Use something via virtualhere and see which usbpcap interface gets busy or click the wheel settings button next to it and see what it shows as connected)
Then you can watch every single packet being transferred. The issue is there will be a lot of packets. But you could skip to the part where the bluetooth drops and look what happens there. If this is just silence or if there are a lot of "RESET" packets or "CLEAR HALT".
Same issue
Hi Omegawkd,
I have almost exactly the same issue. The only differences are that I'm using an Android TV as the host and an official Microsoft USB Xbox Adapter for the gamepads. Two of my controllers are the newer Bluetooth-enabled ones, while the other two are older wireless models without Bluetooth. Any of these 4 may randomly disconnect for a second or two every hour or so.
Let me know if you’ve managed to figure this out — it really messes up the gaming experience in some games :(
Possible Fix
I only got a chance to look at this again over the weekend.
Going on from comments from Michael and stumbling on the answer via ChatGPT, I reckon I found the fix.
For me it was a two device issue:
This is where the clue was ...
It is that but more specifically it is that at times there could be too much burst traffic from the sending system and because "USB" protcol or signaling expect a steady stream of data -- not like what a network connection can send, it overwhelms the USB2 system.
So bascially, there is too much coming in at once for the USB stack to handle and it gets confused, but it only applys to non-buffer type traffic. So media/music etc. is fine with USB-over-IP as the stream often runs with X amount of buffer. It is real-time input that goes haywire and more so HID devices like controllers as they have tight timing.
So after a bit of eductation from ChatGPT you can fix this by actually forcing a maximum transmit size/speed on a USB2 stack (or one that shares bandwidth) -- on the recieving device. There are various ways to accomplish this from shaping the egress traffic on a (managed) switch port -- I did consider doing this, but ended up with the following command on Debian.
sudo tc qdisc add dev eth0 root handle 1: tbf rate 60mbit burst 32kbit latency 5ms
The key being limiting the network interface to 60Mbps and enforcing a cut off of 5ms of a buffer. Anything that saturates the connection over 60Mbps gets stalled, everything before it gets through and the idea is if there is a burst it won't send the stack/CPU nuts. That command is not persistent so you would have to script it for boot time.
That in itself was likely the fix, in fact after the many, many queries and scenerios I put to ChatGPT about that it was very adamant that it would resolve the issue.
But... there is more.
USB Ethernet Adaptors are heavily reliant on the CPU on the system they are plugged into and are NOT low latency/low jitter devices -- this is purely due to how they work.
So, despite the above fix likely resolving the issue, I then went and combined my VLANs into the one on-motherboard 2.5Gbps ethernet connection.
Again, I was sceptical about this being a better solution for low latency/low jitter -- as why wouldn't a seperate connection be better for that specific traffic. ChatGPT -- after much interrogation, once again corrected me and explained that the switch will manage the VLAN traffic and will adequately allocate time for each VLAN and there is then effectively no congestion or jitter (due to the full duplex nature of the connection).
The added benifit then of getting rid of the USB Adaptor is further reducing jitter for VirtualHere -- a win win.
In my case I can add a Thunderbolt 4 card to my PC and that would be orders better than plain USB adaptors -- using Intel based Thunderbolt 4 adaptors instead, and in fact would be better (not night and day) than the onboard Ethernet - lower latency and jitter; I may end up doing this anyway but for now it is fine.
Aside:
It would be worth noting that Michael is also bang on about the Pi3, where if I had a Pi 4 or 5 I probably would not have had this issue anyway -- I would also not have found out about plain USB Ethernet adaptors being higher latency/jitter.
Another Possible Fix for Windows-sender
Thanks for sharing your fix, that is helpful. In my case it seems the issue is a bit different. I have not confirmed it 100% yet, but I noticed that exactly at the moment when my gamepads connection drops, I get the following messages in Windows system logs:
Detected unrecognized USB driver (\Driver\vhusb3hc)
Detected unrecognized USB driver (\Driver\PnpManager)
Given the timing, it is very likely the root cause. It looks to be related to having VMware Workstation Player I have installed on my gaming PC, and it seems its USB service "VMware USB Arbitration Service" is causing the problem. I have temporarily disabled this service and it really looks like this might fix it. I will post an update here later.
Funny how completely different root causes can result in the same behavior :)