Re: [linux-audio-dev] an open letter to Linus re: low latency

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] an open letter to Linus re: low latency
From: Benno Senoner (sbenno_AT_gardena.net)
Date: Sat Jun 24 2000 - 19:49:36 EEST


On Thu, 22 Jun 2000, Jay Ts wrote:>
> The folks at Precision Insight <http://www.precisioninsight.com> (with
> help from the OS community) are working to add the Direct Rendering
> Infrastructure to X and the kernel, to make 3D apps run fast, like they
> do on Windoze. This is a work in progress, and things are happening.
> IIRC, XFree 4.0 has a lot of that included with it. They are putting as
> much as they can in user space, but there are still a few things that must
> go into the kernel, to allow the X server to have a nearly direct access to
> the hardware.
>
> This is all very similar to DirectX in Windows, which supports both
> graphics and audio.

Notice that DRI although speeding up GFX, it does not make any guarantee
about frame-dropouts.
That means Quake will for example run at 100 FPS , but during disk I/O
you will lose some frames every now and then.

This is due to the scheduler being unable to reschedule the quake process
during the next 10ms ( 100Hz = 10ms per frame)

The funny thing is that if quake runs sched_fifo and you use a lowlatency
kernel then the framedropouts will probably (if the drawing loop is designed
for lowlatency) go to ZERO.

Yes DRI + lowlatency will rock , and you will be able to play your game/DVD
at full speed (assuming it uses <100% of the CPU), while your box is busy
with other background things. ( playing a game during a tape backup isn't that
bad ? :-) )

>
> So why not have the Linux kernel support high-performance audio as well?
> If it requires kernel code to ensure low latency, then that will probably be
> good for other purposes too (such as support for real time programming).
> If audio applications (including ports of the power hitters like Cubase,
> Cakewalk and Soundforge, etc.) are ever going to succeed on Linux, we
> need to have things such that people can install them on an average
> Linux system (e.g. the one they bought from Dell or IBM), without needing
> a system administrator to fix the kernel for them. Most musicians are
> not very good at doing things like that for themselves. Need I say more?

"audio-DirectX" for Linux ?

We already have it !
It's called ALSA or OSS.

When you write() (pcm_write() on ALSA) a fragment to the soundcard
you are basically writing directly from userspace mem to the soundcard's mem,
without any intermediate buffering.
Plus mmap saves you even the syscall and the copy_from_user memory copy
so it's even faster (= lower overhead for realtime apps, although I
demonstated that even when using write() , the syscall overhead on a PII machine
is negligible when using 1-2msec fragments).

Conclusion: ALSA and OSS are just fine from a "directX" POV ( direct access to
the HW, very low overhead, no intermediate buffering".

What we need is just a scheduler that gives us low-latencies under every
circumstance (high system load).

This is not an audio or video issue, it's a pure scheduler issue.
Fix the scheduler and audio , midi, video , data aquisition ecc will all ROCK.

Benno.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Sat Jun 24 2000 - 19:16:10 EEST