Anders Torger wrote: >On Saturday 27 July 2002 17.18, you wrote: >> Anders Torger wrote: >> >Does anyone have any comments on this? Is repeatable exact I/O-delay >> >possible to achieve today with current hardware (and ALSA)? >> >> It is the normal mode of operation for memory-mapped IO. > >Is it really? How do I trigger play exactly X samples after I trigger >capture? To copy samples exactly X samples into a buffer is simple, the >problem is to tell the sound card to synchronise the playback ptr with >the capture ptr, that is "start running the playback ptr exactly X >samples after the capture ptr started". The window of X samples is then >used by the software to do its magic.
The way you'd do this is to link the capture and playback streams of the device you use with snd_pcm_link(). They will start together and stay in sync (unless the hardware is broken by design). Instead of starting playback exactly 4096 frames later, you prime the playback stream with 4096 silent frames before starting it. At the first interrupt issued, there will be 2048 frames to be read from the capture stream and 2048 to write to playback. You'd read the input signal, write another 2048 silent frames, and from the next interrupt on you'll always have 2048 frames of processed signal to write, and 2048 input frames to feed to the FIR. Implementing memory-mapped IO isn't exactly what you do in a day. jackit.sf.net or the shortly-to-be-released library I'm working on will do it for you. Just replace 'interrupt' above with a 'process' callback and you don't have to care about the exact workings of mmap'd ALSA at all. tim ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel