Hello!

Is there any difference if I write in my code:
        while (size > 0) {
            frames = size;
            err = snd_pcm_mmap_begin(handle, &my_areas, &offset, &frames);
            record_buffor(my_areas, offset, frames, &data->phase);
            snd_pcm_mmap_commit(handle, offset, frames);
            size -= frames;
        }
OR
        while (rest > 0) {
            size_t c = (rest <= (off64_t)chunk_bytes) ? (size_t)rest :
chunk_bytes;
            size_t f = c * 8 / bits_per_frame;
            snd_pcm_mmap_readi(audiobuf, f);
            write(fd, audiobuf, c);
            rest -= c;
        }

In the first code I use the example from alsa-lib/test/pcm.c and in the
second I use alsa-utils/aplay.c.
Is there any difference in speed, latency or somethink I don't know?
I want to have low latency capture and compute fft - is it good way to do
this?

Is true that snd_async_handler_t *ahandler is better for realtime system
than nonblocking mode?

Best wishes
Marek Michalak
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to