7

I'm using an ElmScan5 scantool which uses an FTDI USB-2-RS-232 serial-to-USB chip under Wine 1.6.2 on Ubuntu 14.04 (Trusty Tahr).

The latency is very high and I found a recommendation on how to reduce it on Windows, but I'm not sure how to do something similar on Linux.

In Windows under COM ports there is an option to reduce the latency timer:

Call Device Manager, find your USB port. (1) Call Properties; (2) Call advanced (3) Change Latency Timer from 16 to 2 or 1 ms.

In order to get the software working under Wine I had to add the following to the Wine registry file:

[Hardware\\Devicemap\\Serialcomm] 1015709345
"Serial0"="COM1"

So I don't know if this is a Linux or a Wine issue.

2 Answers 2

9

OK, so here's the answer ( haven't tested it yet but looks good):

# cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
16
# echo 1 > /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
# cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
1

The only annoying thing is that it looks like I may have to manually set it every time a unplug then plug back in the device, or at least on every reboot.

4
  • 4
    reading kernel sources (4.11) it appears that you can set the same thing from the shell (setserial /dev/ttyUSB0 low_latency), which uses the TIOCSSERIAL ioctl. Jul 5, 2017 at 12:40
  • 2
    "echo 1 >...tty..." is always denied even for sudo while "setserial /dev/ttyUSB0 low_latency" works good
    – Vit
    Mar 31, 2018 at 22:19
  • 1
    This may be a little old but can help some in the future. You cannot just append sudo to the beginning of the command. You have to type sudo sh -c 'echo 1 > /sys/bus/usb-serial/devices/ttyUSB0/latency_timer'. The former just runs echo as su, while the redirection is made by the shell, which runs as your user. Nov 29, 2021 at 20:33
  • Worked perfectly for one of my devices, but did not on other devices. Looking at the drivers, I noticed that they were not recognized as "true" ftdi devices. If I could upvote twice... I would. Thanks.
    – BaldDude
    Mar 13 at 19:42
-1
cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
sudo bash -c "echo 1 > /sys/bus/usb-serial/devices/ttyUSB0/latency_timer"
cat /sys/bus/usb-serial/devices/ttyUSB0/latency_timer
1
  • 4
    Please edit your answer and provide more details.
    – user833907
    Dec 25, 2020 at 10:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .