sound driver for RTAI

Markus Meyer meyer at mesw.de
Thu Jul 28 20:51:36 CEST 2005


Hi Michael,

sound processing (on general purpose OSs like Linux) has traditionally 
been regarded as a soft-real-time application, and experience has indeed 
shown that sound processing can be handled without problems using 
standard OS calls. Even high-end commercial sequencers and harddisk 
recording programs do not use any special realtime support, although 
they may use high-priority tasks and other soft-realtime services 
supported by vanilla Linux/Windows/Mac OS. One reason for this is that 
you can usually set buffer sizes high enough for the given task as to 
prevent any overflows. Also, systems used for audio are usually used in 
a specialized environment, and can be configured, administered and 
policed by the user in a way which prevents catastrophic failures. 
(E.g., most audio users know that they shouldn't burn a CD and encode a 
MP3 while they do recording on the same computer.) Finally, to really 
leverage the power of a hard-realtime environment, you would have to 
make everything hard-realtime (meaning all the effects, mixing 
algorithms, sound card drivers etc.), which would be a very 
time-consuming task (in terms of development time), and may even be 
impossible if you need to support third-party plugins, like VST, or 
third-party sound card drivers, where the source code isn't available.

That said, your idea is certainly appealing, but I think in the end the 
advantages offered by a "real hard-realtime" audio processing system are 
to little to justify the development time and cost.

Just my two cents...


Markus

Michael Beckinger schrieb:

> Hi,
>
> I want to use a professional soundcard with RTAI. The application is 
> similar to a audio mixing console running on a PC. The DSP algorithm 
> running on the PC is very calculation power consuming. The maximum IRQ 
> latency time should be less than 1-1.5msec to minimize throughput 
> latency of the mixing console. (48 KHz sampling frequency, 64 samples 
> buffer)
>
> So here are my questions:
> It seems that there is no hard realtime soundcard support in RTAI?
>
> How could I port an ALSA driver to RTAI?
>
> Is there any documentation on writing an RTAI hardware driver available?
>
>
> Some guy on the music-dsp mailinglist wrote to this topic:
>
> "However, in the case of soundcards, you can probably get away with
> setting the card up in DMA mode and hook into the soundcard's IRQ
> with an RTL/RTAI ISR. That way, you're using the standard Linux
> (OSS/Free or ALSA) driver to set up the audio I/O, but once it's
> running, you're only using the IRQ and the DMA buffers. You just put
> your RT code in an RTL/RTAI periodic (timer driven) thread, and
> adjust the timing based on the IRQs, so you can update N fragments of
> the DMA buffer per soundcard IRQ."
>
> Is this a possible way to proceed?
>
>
> Michael
>
>
>
> _______________________________________________
> RTAI mailing list
> RTAI at rtai.org
> https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai
>





More information about the Rtai mailing list