Tue, 24 Oct 2000 KEVIN ARCAS wrote:
> I want to use a graphic viewer in XWindows, so I can open two or
> three windows to plot the variables evolution in real time. The period
> time of the RTL module is about 10 ms or 1 ms (I supose it will be
> 10 ms to have CPU time to run the application). The amount of
> data is two floatting points variables for each plotting window, each
> period time (so 3 or 4 floatting variables, because x-var (time) is
> used for all the plots)
Shouldn't be a problem; I've been viewing some 6-8 variables updating at 1 kHz
with those simple tool. All there is too it is to buffer the data so that
nothing is lost even though the GUI thread can't keep up with the full data
rate. I have two programs using different solutions;
1) FIFO buffer in the kernel driver + single threaded GUI application that
basically loops { nonblocking_read_until_FIFO_empty(); refresh_display() } is
fast as it can.
2) The application has a SCHED_FIFO thread (I'm using Linux/lowlatency for
reliable sub-ms scheduling latency) that does real time signal processing
(regulation) and also stores data in buffers that it shares with the GUI
thread. The GUI thread sits in a loop checking for UI events, and refreshing
the graph display from the shared buffers.
These are very simple quick'n'dirty hacks, but demonstrate that this can be
done fairly easily. The second solution could be used in the first case as
well, as it's basically just a more robust and flexible implementation. It would
perhaps be nicer to drive the graph refreshing from some timer (rather than
pushing the system to the maximum in a loop that never sleeps!), but OTOH, that
would mean lower refresh rate.
Anyway, that kind of tweaks are easy to do once you have the RT code - be it
in the kernel or in a SCHED_FIFO thread - separated from the GUI. That
separation is the fundamental point to remember when interfacing a hard RT
world with soft RT stuff. (And this is where countless multimedia applications
go wrong... But that's another story! :-)
David Olofson
Programmer
Reologica Instruments AB
[EMAIL PROTECTED]
..- M u C o S --------------------------------. .- David Olofson ------.
| A Free/Open Multimedia | | Audio Hacker |
| Plugin and Integration Standard | | Linux Advocate |
`------------> http://www.linuxdj.com/mucos -' | Open Source Advocate |
..- A u d i a l i t y ------------------------. | Singer |
| Rock Solid Low Latency Signal Processing | | Songwriter |
`---> http://www.angelfire.com/or/audiality -' `-> [EMAIL PROTECTED] -'
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/