PORTS Forum

Ports and Interfaces => USB => Topic started by: WestfW on April 18, 2022, 04:03:47 am

Title: CDC/ACM host performance.
Post by: WestfW on April 18, 2022, 04:03:47 am
I have run into some disappointing performance for CDC/ACM devices using OS default drivers (OUT performance significantly poorer than IN performance, for instance.)  Before I go around trying to optimize the device code, I thought I'd do a bit of research, and I found here:

Quote
Reports are that the Windows [CDC/ACM] driver is slow (640Kbit/sec)

However, that appears to be a very old comment.  Is it still true of current Windows (W10, W11)?  What about other OS CDC/ACM drivers?  (I seem to have similar performance issues on MacOS 10.13, for instance.)

(Testing with TinyUSB on RPi Pico and SAMD cpus, BTW.)
Title: Re: CDC/ACM host performance.
Post by: Jan Axelson on April 18, 2022, 10:45:11 am
I don't know if the CDC driver's performance has improved in recent years. Alternatives include WinUSB and FTDI's chips and drivers.
Title: Re: CDC/ACM host performance.
Post by: WestfW on April 18, 2022, 04:00:27 pm
I guess a more general question:
If I have a USB device that isn't performing as well as I'd like, is there any quick way to discover whether the bottleneck is in the host code or the device code?
Title: Re: CDC/ACM host performance.
Post by: Jan Axelson on April 25, 2022, 09:51:18 am
A protocol analyzer can show timing and data such as whether the device is NAKing communication attempts.

http://janaxelson.com/development_tools.htm#analyzers
Title: Re: CDC/ACM host performance.
Post by: usbman on May 24, 2022, 06:02:32 am
I dont think thats a problem of the usbser.sys driver, especially since you are seeing bad performance in OSX too.
My guess is its your TinyUSB device, TinyUSB is that software usb on Atmels right?

If so thats a lowspeed design and does not report bulkEps with 0x40 size. Bulk EPs are not allowed for lowspeed devices acording to the USB spec, because it will lower the performance. 
Title: Re: CDC/ACM host performance.
Post by: bpaddock on May 26, 2022, 08:21:30 am
You may be thinking of V-USB which is pure software USB for AVR, or perhaps LUFA which is hardware based for AVR.

TinyUSB is not tied to any specific hardware.

I've just brought it up on my NXP KL27 project for example.
I'm not using CDC so can't comment on its performance.
In general TinyUSB is mostly well written so I'm suspect of that being the bottleneck.

What each hardware needs is a TinyUSB hardware layer interface, there could be issues there.

https://www.tinyusb.org