Re: Serial transfer data loss

From: sleeper75se (sleeper75se_at_yahoo.se)
Date: 2002-03-14 19:33:54


Hi all,

thanks for your comments, and especiall Jim for going ahead and
testing!

Allow me to suggest some more tests:

What happens if you let the receiver run X-windows and you start
dragging windows around, as well as changing virtual screens?
Anything that is heavy on non-preemptible kernel resources is
good...er, I mean bad. :-)

Anyway, here are a couple of remedies you can try:

Increasing the priority of the serial port IRQ on Linux
http://cae.best.vwh.net/irqtune/

Patching the Linux kernel (v2.4.x) so that its latency is reduced.
You have three patches to choose from:
http://www.linuxdj.com/audio/lad/resourceslatency.php3#L4

Windows users are left with the IRQ priority tweak:

Create this key in the registry (and the PriorityControl folder if it
is not present), and reboot:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\PriorityControl
IRQ#priority=dword:00000001

Replace the #-sign with the number of your serial port IRQ (probably
2 or 3)

For a more detailed description look here: (you need to scroll down a
bit - to the "REAL TIME PRIORITY" heading.
http://members.aol.com/axcel216/newtip21.htm

> What happened to that great TOSLINK idea? with a totally
> different type of IO the loss of character problem might be
> completely different.

Yep, expect no losses. However, you are limited to two channels per
sound card. I'm not sure there's an easy hardware-only solution to
multiple (surround sound) channels or even if it is supported.

However, I expect the only other things you you might need for
biofeedback except EEG, is temperature, respiration, heartrate and
ESR/GSR. Those need very little in the way of transmission speed and
can be transmitted with 9600bps on a serial port. You could probably
use the sideband channel in the spdif-interface as well, but I'd need
to sign an NDA and be approved as a developer by Creative Labs (or
Yamaha, another major sound-chip manufacturer) to take advantage of
that. And I'm not sure I qualify.

Anyway, I'm working on the layout now, for Jim Meissner to build and
test. (Others are welcome too)

> Ditto for USB - I would strongly suspect that a USB serial port
> is not subject to the same problems as the legacy serial port.

I'm afraid that is not true. According to an engineer at
http://www.ftdichip.com (USB-chip maker) you can expect 120ms,
(perhaps more) latencies, worst case. The only solution is to add a
big buffer (perhaps 4kb) to the receiver hardware. I estimate a USB
receiver with FTDI's USB chip, an Atmel AVR 8535 and 8k of SRAM will
cost around $20-$30)

Tuning the USB IRQ priority probably works too, though I suspect your
system would be severely bogged down if you have high-speed devices
connected. They would probably make the USB-interface request
interrupts every millisecond. :-)

Regards,

Andreas



This archive was generated by hypermail 2.1.4 : 2002-07-27 12:28:41 BST