0x6a77 / JD2XX

A JD2XX fork that supports OS X (x86_64) and Linux (x86, x86_64, arm7hf, arm7sf)
10 stars 10 forks source link

Data transfer speed is limited to 8MByte/s with FT232H in Synchronous FIFO style #9

Open tohyf opened 5 years ago

tohyf commented 5 years ago

Hi, I tried your library and miraculously it works straight away on Ubuntu 18.04, unlike other java D2XX libraries that are no longer maintained. I am transferring hundreds of MByte data to the PC, and looks like it is somehow capped at 8MByte/s. There is no data loss, and I have confirmed that the FT232H chip is somehow throttling the data write as the TXE signal is deasserted for significant amount of time. I tried with read sizes from 1024 of up to 16384 bytes but it didn't change the transfer speed, and is capped at almost exactly 8MB/s. Is there any "buffer" or "timers" i need to set to make it transfer faster?

Merry christmas to you.

tohyf commented 5 years ago

I tested my same Java test application on windows 10 and it seems to achieve about 44MB/s, what a huge difference. The FTDI D2XX library version included in your project looks a bit old, compared to the ones currently hosted on the FTDI website. And the newer one seems to use the libusb1.0 instead of the libusb0.1 Let me try replacing the .so files and see if it would work better (or not at all, haha).

tohyf commented 5 years ago

I replaced the D2XX library with the newest one, made some changes to the makefile, it can compile eventually. However the speed is still the same. In addition, there are some data loss if i don't read the data from USB fast enough. Seems like there is some bug with the FTDI's D2XX in linux and they have no plan to fix it, see this : https://www.ftdicommunity.com/index.php?topic=40.0 Probably have to use the open source libftdi. Plus they seems to mention that it can achieve 40MBps as well. Do you know any implementation of JNI wrapper for the libftdi?