[alsa-devel] [Alsa-user] Read and write with different output sizes

Elias Kokkinis ekokkinis at upatras.gr
Tue Jan 17 17:31:06 CET 2012


Dear all,

after some further research into the matter, it seems I have to do some asynchronous capture/playback with ALSA.

I have searched for examples and found this site:
http://alumnos.elo.utfsm.cl/~yanez/alsa-sample-programs/
where two example programs are included.

microphone.c and speaker.c which use almost all available input/output modes in ALSA. The interesting thing is that you can run both programs concatenated since they write and read to the standard output and create a simple audio loop-back. 

I have tested different configurations and the configuration I want works with direct and asynchronous read/write with mmap and read/write with poll.

Now I have taken the bits and pieces of those to programs and I have tried to create a single program that will read and write with different buffer sizes. I can't seem to be able to "reroute" the write from the standard output [these programs use write() and read()] to a buffer, or the read from the standard input to a buffer. 

Any ideas? Comments? 

I thank everyone for their time,
Elias

On 16 Jan 2012, at 12:53, Elias Kokkinis wrote:

> Hello all,
> 
> I am posting a question I previously posted in alsa-devel, but did not get the expected feedback.
> 
> I am using alsa drivers in an OMAP3530 processor to do some audio processing. I am implementing a typical speech enhancement algorithm with overlap-add. I use a window length of 2048 samples and an overlap of 1024 samples. That means I need to use an input (capture) buffer of 2048 and an output (playback) buffer of 1024. Can this be configured in alsa? Can the playback and capture streams have different buffer sizes, but operate at the same sample rate (e.g. 44100Hz)?
> 
> Best regards,
> Elias
> ------------------------------------------------------------------------------
> RSA(R) Conference 2012
> Mar 27 - Feb 2
> Save $400 by Jan. 27
> Register now!
> http://p.sf.net/sfu/rsa-sfdev2dev2
> _______________________________________________
> Alsa-user mailing list
> Alsa-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-user



More information about the Alsa-devel mailing list