Re: [Ftdi-usb-sio-devel] latency on serial port
Brought to you by:
bryder
|
From: Tao J. <jin...@gm...> - 2010-06-24 20:49:36
|
Hi guys,
Here is some update.
1) I tried setserial low_latency on my linksys router, which has
onboard serial port. It works and the RTT time is reduced down to
below 1ms
2) I tried setserial on PC with a FTDI-serial device, it doesn't work
at all. I think I might need to modify the FTDI driver?
Hi Bill,
Here is the strace log. If you could take a look at this, I would
really appreciate it!
$ sudo strace -v setserial /dev/ttyUSB0 low_latency
execve("/bin/setserial", ["setserial", "/dev/ttyUSB0", "low_latency"],
["TERM=xterm", "LS_COLORS=rs=0:di=01;34:ln=01;36"...,
"PATH=/usr/local/sbin:/usr/local/"..., "LANG=en_US.utf8",
"HOME=/home/taojin", "DISPLAY=:0.0",
"XAUTHORITY=/var/run/gdm/auth-for"..., "COLORTERM=gnome-terminal",
"SHELL=/bin/bash", "LOGNAME=root", "USER=root", "USERNAME=root",
"SUDO_COMMAND=/usr/bin/strace -v "..., "SUDO_USER=taojin",
"SUDO_UID=1000", "SUDO_GID=1000"]) = 0
brk(0) = 0x2319000
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7fb9f504c000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat(3, {st_dev=makedev(8, 1), st_ino=31328821, st_mode=S_IFREG|0644,
st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=216,
st_size=109259, st_atime=2010/06/24-11:36:40,
st_mtime=2010/06/22-11:33:39, st_ctime=2010/06/22-11:33:39}) = 0
mmap(NULL, 109259, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7fb9f5031000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0`\355\1\0\0\0\0\0"...,
832) = 832
fstat(3, {st_dev=makedev(8, 1), st_ino=59638010, st_mode=S_IFREG|0755,
st_nlink=1, st_uid=0, st_gid=0, st_blksize=4096, st_blocks=3064,
st_size=1568136, st_atime=2010/06/23-17:09:20,
st_mtime=2010/05/21-05:06:49, st_ctime=2010/06/10-16:47:40}) = 0
mmap(NULL, 3676200, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x7fb9f4aac000
mprotect(0x7fb9f4c24000, 2097152, PROT_NONE) = 0
mmap(0x7fb9f4e24000, 20480, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x178000) = 0x7fb9f4e24000
mmap(0x7fb9f4e29000, 18472, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7fb9f4e29000
close(3) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7fb9f5030000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7fb9f502f000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x7fb9f502e000
arch_prctl(ARCH_SET_FS, 0x7fb9f502f700) = 0
mprotect(0x7fb9f4e24000, 16384, PROT_READ) = 0
mprotect(0x604000, 4096, PROT_READ) = 0
mprotect(0x7fb9f504e000, 4096, PROT_READ) = 0
munmap(0x7fb9f5031000, 109259) = 0
open("/dev/ttyUSB0", O_RDWR|O_NONBLOCK) = 3
ioctl(3, TIOCGSERIAL, 0x7fff97a2bea0) = 0
ioctl(3, TIOCSSERIAL, 0x7fff97a2be50) = 0
close(3) = 0
exit_group(0) = ?
On Wed, Jun 23, 2010 at 2:47 AM, Bill Ryder <bil...@gm...> wrote:
> Y
>
> On Wed, Jun 23, 2010 at 5:36 PM, Tao Jin <jin...@gm...> wrote:
>>
>> Hi Bill,
>>
>> Thanks a lot for your quick response! I set VMIN=1, VTIME=0 so the
>> serial device works in block mode.
>>
>> I just tried the serial echo test on my linksys linux router, which
>> has onboard serial port. setserial works for me and the RTT latency
>> can be reduced down to below 1ms
>>
>> But when I did the same test on my laptop with a FT232RL usb-to-serial
>> adapter, the setserial doesn't work. Probably the usb serial device
>> works in different way? Sorry I am new to Linux kernel
>
> Y ou could try using stty instead of setserial.
>
> I can't remember the calls setserial makes. It's possible one is not
> supported by the driver.
>
> I think stty does it using supported calls.
>
>
> If you could send an output of
>
> strace -v setserial what ever options you used
>
> it'll give me a hint.
>
> Also you might need to hold the device open. (in a separate window run
> cat > /dev/ttyUSBthenumberoftheport
> and just leave it running - it's doing nothing except holding the port open)
>
> then try setserial or stty and your test program
>
>
>
>
>
>>
>> Thanks again!
>>
>> jintao
>>
>> On Wed, Jun 23, 2010 at 1:14 AM, Bill Ryder <bil...@gm...>
>> wrote:
>> > Have a look at this:
>> >
>> > http://www.tldp.org/HOWTO/Serial-Programming-HOWTO/index.html
>> >
>> > You are probably setup to do 0.1s timeout when reading the port which is
>> > the
>> > default.
>> >
>> > you need to set VMIN/VTIME properly.
>> >
>> >
>> >
>> >
>> > On Wed, Jun 23, 2010 at 4:57 PM, Tao Jin <jin...@gm...> wrote:
>> >>
>> >> Dear all,http://www.tldp.org/HOWTO/Serial-Programming-HOWTO/index.html
>> >>
>> >> I am trying to get my laptop running Ubuntu to communicate with a
>> >> sensor through serial interface. I used usb-to-serial adapter to
>> >> connect the laptop and sensor serial RX/TX pins. I observed a long
>> >> latency when I do a one-byte serial echo test, around 10ms.
>> >>
>> >> I googled a bit, and seems a lot of people had the same issue. someone
>> >> said setserial /dev/ttyS* low_latency can get the serial device work
>> >> in low latency mode, with higher CPU load. I tried, that doesn't work
>> >> for me.
>> >>
>> >> Anyone here know about this latency issue on serial link? Could you
>> >> please provide some guidance to resolve this issue?
>> >>
>> >> Thanks a lot in advance!
>> >>
>> >> jintao
>> >>
>> >>
>> >>
>> >> ------------------------------------------------------------------------------
>> >> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> >> lucky parental unit. See the prize list and enter to win:
>> >> http://p.sf.net/sfu/thinkgeek-promo
>> >> _______________________________________________
>> >> Ftdi-usb-sio-devel mailing list
>> >> Ftd...@li...
>> >> https://lists.sourceforge.net/lists/listinfo/ftdi-usb-sio-devel
>> >
>> >
>
>
|