Re: Bad MIDI performance : 10ms latency instead of the expected 1-1.5ms

Benno Senoner (sbenno@gardena.net)
Thu, 26 Aug 1999 22:42:16 +0200


On Thu, 26 Aug 1999, Brian Perkins wrote:
> Sounds like you're running into context switch time overhead, since
> I've seen similar things when trying to sleep less than 10 ms on a
> pentium 200 (i.e. you can't unless it's a busy sleep).
>
> Your test will probably fail no matter what you do. I'd bet you'll
> get a similar value if you do
>
> time1=gettime()
> syscall()
> syscall()
> time2=gettime()
>
> where syscall is some sort of syscall that requires little time to
> complete ( like nanosleep for 1 nanosecond).

Ok, sleeping is a case apart, it has some limitations.
(Mingo is working on a method for sleeping down to 1ms in non-busywaiting mode)

But other syscalls work just nicely:

for example in my latencytest ( PCM audio), the
write() to /dev/dsp returns after 30-50 usecs if the audio buffer is empty, or
if after an entire fragment is freed ( you can use 1ms fragments, and it works
just nicely)

>
> How to improve this sort of depends on what you're trying to do.

Jaroslav says this is a TX FIFO limitation of the MPU401 hardware,
so the only solution is to poll the FIFO with a bigger frequency.

regard,
Benno.

-
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/