Re: Uninterrupted Audio tone generation

Der Herr Hofrat <[email protected]> Sat, 12 Feb 2005 10:36:03 +0100 (CET)
Newsgroups gmane.linux.real-time.rtlinux.general
Message-ID <[email protected]>
> Hi,
> 
> I need to generate audio-tones, two different-frequency tones to encode a
> binary 0 and a binary 1 such that each bit-tone occupies say 10ms exactly.
> also while playing the tones for a complete packet of data (say 50-100 bits)
> the audio-tones should not get interrupted.

depends a bit on what uninterrupted means here - if you run such a task in
RTLinux it will be interrupted atleast to process the interrupt emulation
layer on occurance of a hardware interrupt unless you disable interrupts
(which is off course posible - but for 10ms this could have side-effects)

> 
> 1. I was wondering how using rtlinux can help achieve this. to ensure
> no-interruptions, would i need to just write a tone-generation task as a
> realtime-task or would i also need to run the audio-driver as a
> realtime-task?

basically you will have to do this as a rt-driver - you might want to look
at the Realtime Audio Tool (RAT) project under development by Arvid Staub - 
http://www.opentech.at/~arvid/ - it allows running 10-in/10-out channels 
24bit audio concurrently at 48kHz (at 96kHz it has problems when writing 
to hard-disk). As it is highly modular you can add in audio drivers without
having to add in the necessary data-management layer.

> 
> 2. the second complication is that i also need to run another
> data-collection task (not necessarily real time) that collects these packets
> from a remote machine via serial-port. If i run a real-time task that needs
> to continuously generate a tone, since this cannot be interrupted, would my
> data-collection task get to run at all?

RTLinux will not allow you to allocate more than 100% CPU - so the simple
answer is - if there is any time left between the two audio outputs or if
you can allw other tasks to run between two audio samples then the user-space
process will advance - how much depends on the actuall CPU time left.

> 
> i have tried searching the archives but couldn't find much about audio. also
> iam very new to real-time systems. all and any help greatly appreciated.
>

check out the RAT - Realtime Audio Tools - also published in the proceedings
of the 5th realtime linux workshop - 
http://www.realtimelinuxfoundation.org/events/rtlws-2004/papers.html 
_______________________________________________
Rtl mailing list
[email protected]
http://www2.fsmlabs.com/mailman/listinfo/rtl