Jump to content
  • 0

Digital Discovery slow USB enumeration/connection


JeffD

Question

Hello,

I have 3 Digital Discoveries all connected to various Windows 10 PCs and using the WaveformsSDK via Python API.  

On 2 out of 3 setups, when I run the Device_Enumeration.py example provided, it completes in ~0.3 sec.
On the 3rd setup, it takes about 6 sec to enumerate the device.

cmd /c python -m cProfile "C:\Program Files (x86)\Digilent\WaveFormsSDK\samples\py\Device_Enumeration.py"
1 6.136 6.136 6.151 6.151 Device_Enumeration.py:1(<module>)

This also holds true when trying to connect to a device automatically via:


self.hdwf = c_int()
self.dwf.FDwfDeviceOpen(c_int(-1), byref(self.hdwf))

This takes ~12 sec total, 6 for enumeration and 6 to connect to the first device.  Again, it only affects 1 out of our 3 setups.

Any idea what could be causing this slow enumeration?  It is a major runtime hit to add ~12 seconds to an otherwise 1second script.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Hi @jeff

What is the difference between setups? Are these different computers? If so, have your tried swapping the devices?

What Adept Runtime and Waveforms version are you using?

The enumeration uses the Adept Runtime, USB driver... to identify the available devices.
The FDwfDeviceOpen(-1,...) performs an enumeration before connection.
If you used FDwfEnum, you can use FDwfDeviceOpen(0,...) to connect to first device without re-enumeration.

The enumeration takes for me about 0.25s / device.

image.png.e2a3e747f29c90c8a5d79a5277668c43.png

Link to comment
Share on other sites

Two setups are individuals' laptops, and the third (slow enumeration) is a desktop PC in our lab.  They are all running Windows 10, and the same versions of WaveFormsSDK -- DWF 3.14.3

How do I check the Adept runtime version?

I have not tried swapping the Digilents themselves, but I can certainly do that.

 

Link to comment
Share on other sites

The Adept runtime is the same for all machines -- version 2.20.2.  Is it worth updating to 2.21.2?

As another data point, I tried with a completely different Digilent and PC, and got a 3sec enumeration time.  I will try swapping the 0.3 sec Digilent onto a machine that currently has a 3-6 sec enumeration time, but it seems odd that something like this would be pod-specific

Link to comment
Share on other sites

I have root caused the slow enumeration time to a USB-to-FTDI board connected to the 2 desktop machines with slow enumeration.  With that USB connection unplugged completely, enumeration takes ~0.6 seconds (seems to vary per Digilent pod), which is in-line with your results and my testing of ~0.3sec.

But, once this other device is plugged it (but has not sent any traffic yet), the enumeration increases by 2X.  Once the other device has been used once (it is necessary for a pre-requisite step to our Digilent application, so removing the connection is not an option), the enumeration time increases by up to 10X (~6 seconds) and persists until the other device is unplugged.

I have tried swapping USB ports that each device connects to on the PC, including switching from on-board ports to PCIE extension ports, but the time increase by having the non-Digilent board plugged in is always present.

Have you seen anything related to this before, either from multiple Digilents or other USB devices connected to the same host?

Is there anything we can try in the Digilent API to either prevent enumeration (or maybe run it once, and cache that information on disk -- we don't expect to move the Digilent pods from PC to PC), or prevent enumerating the full device space if we know any info about the non-Digilent board connection (also will be fixed to a given PC)?



 

Link to comment
Share on other sites

Hi @JeffD

I've noticed slow enumeration only under some old version of OSX and some virtual machine setups. (On Windows) it may be caused by some system drivers...

The enumeration (FDwfEnum) should be quick (0.3s). This uses Adept Runtime to list the USB devices and perform some EP0 transfers to identify each.
The first connection to the device (FDwfDeviceOpen) after powerup should take about 2s. This connects to, programs the device FPGA and configures the device ICs.
The further connections to the device should take about 0.5s, only the necessary ICs/interfaces are configured.
Calling the FDwfDeviceOpen(-1,...) will perform enumeration and connection.

 

@malexander

Have you seen slow enumeration issues on Windows?

Link to comment
Share on other sites

@JeffD

I don't think upgrading to Adept Runtime 2.21.2 is going to speed enumeration - if anything that version will make enumeration slower because it can also enumerate network devices.

My guess is that this issue has something to do with the FTDI driver. Being able to recreate the same behavior here would make it a lot easier to debug. Can you tell me anything about the "other device" that you are using? Which FTDI chip is it? Are you using it as a virtual comm port or are you using it in some other mode through FTD2XX?

Thanks,
Michael

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...