RE: Uninterrupted Audio tone generation
"Vinoo S Warrier" <[email protected]> Tue, 15 Feb 2005 20:23:11 +0530
| Newsgroups | gmane.linux.real-time.rtlinux.general |
|---|---|
| Message-ID | <[email protected]> |
Hello, >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. Thanks for your answer.My sampling frequency is 8kHz so i would need to send a sample every 0.125 millisecond to the codec. I have no idea how much of this will be eaten up in processing my interrupt and actually sending the next sample out of the buffer to the audio-card. i read that for my platform rtlinux can give me worst case 50-60 microseconds interrupt processing latency. so i guess i could ger about 50-60 microseconds between samples. Would this amount of CPU time allow my data-collection task to run in a manner that seems to be continuous? This task needs to read requests from a serial port and do some simple rpocessing involving copying of received data to several buffers. Thanks, Vinoo -----Original Message----- From: Der Herr Hofrat [mailto:[email protected]] Sent: Saturday, February 12, 2005 3:06 PM To: Vinoo S Warrier Cc: [email protected] Subject: Re: [Rtl] Uninterrupted Audio tone generation > 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 -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 2/10/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.8.7 - Release Date: 2/10/2005 _______________________________________________ Rtl mailing list [email protected] http://www2.fsmlabs.com/mailman/listinfo/rtl