libftdi Archives

Subject: Reducing latency on asynchronous read with libftdi

From: Heinrich du Toit <hdutoit@xxxxxxxxxxx>
To: "libftdi@xxxxxxxxxxxxxxxxxxxxxxx" <libftdi@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 21 May 2018 06:15:03 +0000

Hi

 

I am using libFTDI on a FT4232H device.

We are attempting to read a stream of serial data that consist out of different packets being sent at roughly 50Hz.

Meaning 50 packets (each about 25 bytes) every 5msecs.

 

I’m using the asynchronous read API.

 

What I noticed is that the asynchronous read will tend to fill up the buffer I give it before completion.

So if I give it a buffer of 1024 bytes it will remain reading until all 1024 bytes are received.

This is not ideal for our case as I would like the read to complete ideally after the first 25 bytes have been received.

(I’ve set the latency timer value to “2” currently)

 

I realize this has something to do with how asynchronous I/O works in libusb but would it be possible to modify this behaviour in some way?

I am willing to change the code of libftdi as I’m already running a slightly modified version of it for reasons.

I am even willing to modify libusb if that would fix the issue but would prefer that not being necessary.

 

Any advise to where I should be looking for a solution would be appreciated.

Thank you

Heinrich du Toit

Specialist Engineer: Software


Disclaimers are available at: http://www.s-plane.com/disclaimer



libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx


Current Thread
  • Reducing latency on asynchronous read with libftdi, Heinrich du Toit <=