FTDI LatencyTimer Driver Settings for Mac

The default driver settings for v2.2.18 of the for the FTDI Mac serial driver produce very bursty data. The latency timer by default is quite slow possibly >16ms and the gloves stream frames at intervals <16ms so the timer never times out. Instead the data pours in until the 4kb buffer is full at which time a burst of data is fed to glover resulting in really bad latency. To reduce the timeout to 1ms we needed to edit the plist file for the drivers as described here. This involves editing the file /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist. I would recommend taking a backup of this file before changing it.

It was hard to figure out which driver key was relevant for the FT232R chip “FTDI R Chip” looked likely. By default the entry looks like this:

<key>FTDI R Chip</key>
 <dict>
 <key>CFBundleIdentifier</key>
 <string>com.FTDI.driver.FTDIUSBSerialDriver</string>
 <key>IOClass</key>
 <string>FTDIUSBSerialDriver</string>
 <key>IOProviderClass</key>
 <string>IOUSBInterface</string>
 <key>bConfigurationValue</key>
 <integer>1</integer>
 <key>bInterfaceNumber</key>
 <integer>0</integer>
 <key>bcdDevice</key>
 <integer>1536</integer>
 <key>idProduct</key>
 <integer>24577</integer>
 <key>idVendor</key>
 <integer>1027</integer>
 </dict>

We changed the entry adding a ConfigData key, setting the LatencyTimer to 1ms:

<key>FTDI R Chip</key>
 <dict>
 <key>CFBundleIdentifier</key>
 <string>com.FTDI.driver.FTDIUSBSerialDriver</string>
 <key>ConfigData</key>
 <dict>
 <key>LatencyTimer</key>
 <integer>1</integer>
 </dict>
 <key>IOClass</key>
 <string>FTDIUSBSerialDriver</string>
 <key>IOProviderClass</key>
 <string>IOUSBInterface</string>
 <key>bConfigurationValue</key>
 <integer>1</integer>
 <key>bInterfaceNumber</key>
 <integer>0</integer>
 <key>bcdDevice</key>
 <integer>1536</integer>
 <key>idProduct</key>
 <integer>24577</integer>
 <key>idVendor</key>
 <integer>1027</integer>
 </dict>

Sadly this didn’t work (but that might have been for another reason), so I made the change to all of the FTDI keys, of which there were 14, this did work - I’ll report back when I figure out exactly which key was the one. To avoid any permission/timestamp issues with the driver rejecting the files I edited them inplace with vi:

sudo vi /System/Library/Extensions/FTDIUSBSerialDriver.kext/Contents/Info.plist

and then touched the kernel extensions to indicate that something had changed as suggested here.

sudo touch /System/Library/Extensions/FTDIUSBSerialDriver.kext
sudo touch /System/Library/Extensions

 
Fixed The FTDI Latency On Macs

2 Comments so far

  1. John on September 10th, 2013

    YES!

    Thank you for this!! I work with an embedded system, and I load firmware sometimes as often as 40 times a day from my Mac with an FTDI cable: with the latency timer change, my average load time went from ~100s to ~30s, literally saving me almost an hour a day of thumb twiddling! My thumbs thank you.

  2. mogs on August 29th, 2014

    Hi I just found this blog after doing something similar, and I thought I’d share how I was able to confirm which key my adapter was using.

    First of all you can narrow it down, by comparing your devices PID/VID against those in the Info.plist.
    Compare the hex values in System Report (in my case 0×6001/0×0401) with the decimal entries in Info.plist (24577/1027).
    This gave me three possibilities; FTDI R Chip, FTDI2XXAM and FTDI2XXBM.

    To figure out which one my adapter was using I simply added a PortName key so that it would show up as /dev/cu.Whatever-XXXYYY instead of /dev/cu.usbserial-XXXYYY

    PortName
    Whatever
    LatencyTimer
    1

    http://www.ftdichip.com/Support/Documents/TechnicalNotes/TN_105 Adding Support for New FTDI Devices to Mac Driver.pdf

Leave a Reply