Re: Yet another low latency patch

From: Benno Senoner (sbenno@gardena.net)
Date: Sat Aug 12 2000 - 14:22:06 EST


On Sat, 12 Aug 2000, Andrew Morton wrote:

>
> - Benno's `latencytest' tool is odd. It claims that it sees ~30
> millisecond scheduling bumps. Same with Ingo's patch. It is not
> obvious what is going on here. When his background workload is run
> against `amlat' everything is fine.

What does mean "odd" ?
These 30msec are for REAL, believe me !

Flat latencytest diagrams is a
necessary condition to ensure that "realtime multimedia" apps never see high
latency spikes.

How much times should I repeat it:

the audio version does:
while(1) {
 - waste 80% of the time it takes to play an audio fragment
    using a calibrated busywait loop

 - write() audio fragment to /dev/dsp
}

the RTC version works in a similar way except that it waits for signal
from the RTC device.

I am doing nothing magic in my code , and if amalt reports 2msec
then your tool does not tell us the whole truth.
(I haven't studied the code)

I use TSC to measure timings, thus there are no places on non-determinism
inside the main loop.

Both the audio and RTC tests perform well (1.8msec under insane load) using
Ingo's lowlatency-2.2.15 patch.

Andrew, if you think that my tool is flawed, then write a little app which
opens the audio device with 3x256 buffers ( = 4.4msec buffersize),
read a wav into mem, call mlockall() and then play simply from ram
eg:
( buffer[] contains the wave (array of shorts))
offset=0;
while(1) {
  write(audio_fd, &buffer[offset], 256);
  offset += 256;
}

excatly when latencytest registers greater than 4.4msec peaks you will hear
crackles, skips and pops.

But as we all know the ear is not that precise in detecting the lenght of skips
and/or dropout compared to precise latencydiagrams obtained using the TSC
which can basically deliver 20nsec precision, so I prefer looking at diagrams
rather than listening a few mins to a boring audio signal.

comments ?

Benno.

>
> Patch against 2.4.0-test6 is attached.
>
> The patch will be maintained at
>
> http://www.uow.edu.au/~andrewm/linux/schedlat.html#downloads
>
> That site also holds various testing and measurement tools which were
> developed to support this effort.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Aug 15 2000 - 21:00:27 EST