Device is recognized but no data transfer

Hi,

I am using virtualhere to connect a pulse reading device on a RaspberryPi 4 that would usually connect to a computer using USB. The pulse reader connects to its own software. When I connect the device to the computer using direct USB, the software has no problem and continuously reads. When I use virtualhere, the software recognizes the device, connects to it, reads data for around 9-12 seconds then stops. I tried to debug the situation and learned the following:

  1. When I manually disconnect/reconnect the USB device, the program automatically resumes.
  2. When I bind/unbind from virtualhere client, the device only loses connection then reconnects but no data resumes
  3. When I restart the program software it works.
  4. At 9-12 seconds and every 9-12 seconds, I see a latency spike in the statistics that goes up to 200ms after running at < 10ms. After continuous observation, this seems to be the trigger (but again I may not be accurate and it is just mere coincidence)

     

  • First Question: The spikes are not an issue and I presume these will always come up regardless. So, my inquiry is more towards looking for a fallback solution. I have seen that there are scripts that can be configured in virtualhere. In this case, would it make sense to write a script that reads the latency spike and once it reads a spike, it forces a USB plug/unplug of the raspberrypi as if I am manually removing/connecting the USB device?
  • Second Question: Is there any difference in the way the computer or any software recognizes the USB device when connected directly to the computer vs. connected to RPi4's VH?
  • Third Question: Are there any other tests that I should do to better understand the problem?

 

Image of latencies: https://ibb.co/5hZTwfZ

Any hint or support on this matter is greatly appreciated!

 

Thanks

#2

It almost looks like the device is going to sleep. 

 

Use the device via virtualhere and then on the client machine open up Windows Device Manager->View -> By Connection. Find "VirtualHere USB 3 eXtensible Host Controller" and find the device under there. Right click on the device and select Properties and see if it has a Power Events tab. IF so UNcheck "Allow windows to manage device power" or similar wording. Also make sure to run the very latest COM port drivers on the client side (assuming your device is a USB<->Serial adapter)

 

#3

Thank you for responding Michael!
Unfortunately, there was no Power Events tab and I just went through the cycle of updating the USB drivers altogether to the latest. The issue remains. I investigated further and took these snapshots. Maybe they say something? 

https://imgur.com/a/XxE2Y82

What puzzles me is that it works for 10-12 seconds then stops. Does VirtualHere reassign a different ID to the connected USB device?

Thanks!

#4

No , virtualhere doesnt assign a different id to a connected device and always passes through exactly the data received from the usb device with no dropped packets and no corruption.

Maybe it is the 200ms latency spike that might overflow a hardware buffer inside the device perhaps.  Anyway i assume the pi is connected via wifi? Can you try ethernet and see if its stable. If so then it is that latency spike (200ms is very high,even for wifi).

#5

Thanks! Yes indeed, I believe it may be a hardware buffer overflow as well. After further testing, I noticed that after 10-12s, that mechanism kicks in and it continues to record data locally (which is a fail-safe system in case network is lost). I also switched the Pi to ethernet connection (I continue to see those spikes). I tried it at a different location as well and the behavior is the same. If virtualhere doesnt make any change then its probably related to the system itself and not an issue of VirtualHere. Otherwise, if you have any ideas to override it, I would really appreciate it. 

Thanks for the support anyways, I appreciate it!