LKML Archive on
help / color / mirror / Atom feed
* Serial port blues
@ 2007-01-19 21:37 Joe Barr
  2007-01-20 17:36 ` Willy Tarreau
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Joe Barr @ 2007-01-19 21:37 UTC (permalink / raw)
  To: Linux Kernel mailing List

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

I'm forwarding this post by the author of a great little program for
digital amateur radio on Linux, because I'm curious whether or not the
problem he is seeing can be resolved outside the kernel.

All comments welcome on/off list.

Joe Barr

It's a strange world when proprietary software is not worth stealing,
but free software is.

[-- Attachment #2: Forwarded message - FSK/CW and ioctl jitter / latency --]
[-- Type: message/rfc822, Size: 4661 bytes --]

From: w1hkj <>
To: David <>, "Dave Cooper" <>, "Phil Moore" <>, jhaynesatalumni <>, "David Karipides" <>, "Walter Fey" <>, edw3nr <>, "Mike Phipps" <>, "Rick Kunath" <>, "Brett Owen Rees VK2TMG" <>, "David Quental" <>, "Pär Crusefalk" <>, PA0R <>, "Bob Christenson" <>, "Joe Barr" <>, "Joe Veldhuis" <>, "Diane Bruce" <>, "Walter Giovanni" <>
Subject: FSK/CW and ioctl jitter / latency
Date: Fri, 19 Jan 2007 14:33:00 -0500
Message-ID: <>

I've spent the last day staring at the oscilloscope and pins RTS and DTR 
on the serial output for 4 different computers running 4 different 
versions of Linux.  Also have exhausted the search on the internet for 
information regarding both the latency and jitter associated with ioctl 
calls to the serial driver (both ttyS and ttyUSB).  I'm sure it is out 
there somewhere, I just cannot find it.

I am now convinced that the current serial port drivers available to us 
on the Linux platform WILL NOT support CW and/or RTTY that is software 
generated in a satisfactory manner.

To test the latency and jitter of the ioctl calls to set or clear RTS 
and / or DTR I built a basic square wave generator with microsecond 
timing precision.  The timing could be derived either from the select 
system call or by controlled i/o to the sound card.  Both provide very 
precise timing of the program loop.  Each time through the loop either 
the RTS/DTR was set or cleared.  The timing jitter for each 1/2 cycle 
was from 0 to +4 msec.  This varied between systems as each had 
different cpu clock rates.  The jitter is caused by the asynchronous 
response of the kernel to the request to control the port.  ioctl 
requests apparantly do not have a very high priority for the kernel.  
They are probably just serviced by a first-in first-out interrupt 
service request loop.  That type of jitter is tolerable up to about 20 
wpm CW.  It totally wipes out the ability to generate an FSK signal on 
the DTR or RTS pin.

Direct access to the serial port(s) is a kernel perogative in Linux.  
Only kernel level drivers are allowed such port access.

So ... bottom line is that all of my attempts over the past couple of 
months to provide CW and / or FSK output signal have been to fraught 
with pitfalls.  The CW seems OK for slow speed keying, but the FSK seems 
impossible to achieve.

The FSK using the UART is also limited by the Linux operating system and 
the current drivers.  That limitation excludes the use of 45 or 56 baud 

Until such time as new information becomes available I am going to 
comment out all references to CW and / or FSK via RTS/DTR.  I also 
question how useful the FSK on TxD (UART derived) might be to most users 
since the 45.45 baudrate is not available in the serial port driver.  
That function will also be commented out.

All this should not really come as a surprise since Linux is not a 
real-time operating system. By the way, I did try the tests with the 
test program running with nice -20.  Not much difference.

Sorry folks, but we win some and lose some.

73, Dave, W1HKJ

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-01-22 11:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-19 21:37 Serial port blues Joe Barr
2007-01-20 17:36 ` Willy Tarreau
2007-01-21  5:54   ` Theodore Tso
2007-01-21  7:05     ` Willy Tarreau
2007-01-21 14:04       ` Johannes Stezenbach
     [not found]         ` <>
2007-01-21 14:58           ` Willy Tarreau
     [not found]             ` <>
2007-01-21 18:52               ` Theodore Tso
     [not found]                 ` <>
2007-01-21 19:30                   ` Theodore Tso
2007-01-21 18:55       ` Theodore Tso
2007-01-21  5:09 ` Stuart MacDonald
2007-01-21  7:07 ` H. Peter Anvin
2007-01-21  7:08 ` H. Peter Anvin
2007-01-21 20:44   ` H. Peter Anvin
2007-01-22 11:37 ` Alan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).