[alsa-devel] ALSA application programming: route audio from one PCM to another

Stefan Schoenleitner dev.c0debabe at gmail.com
Wed Apr 14 10:44:50 CEST 2010


Colin Guthrie wrote:
> 'Twas brillig, and Stefan Schoenleitner at 13/04/10 16:23 did gyre and
> gimble:
>> Hi,
>>
>> I finally managed to write an ALSA I/O plugin that does what I want.
>> The plugin supports both playback and capture.
>>
>> Now I would like to write a simple audio application that takes audio
>> samples
>>
>> 	* from the microphone and plays it back on my plugin
>> and
>> 	* from the plugin (capture) and plays it back on the speakers
>>
> 
> This sounds like something that would be more appropriate for jack
> http://jackaudio.org/

Thanks for your response, that really sounds like a job for JACK.

However, due to the nature of jack it seems that running the jack-daemon
is always necessary.
As my code is supposed to work on a very small scale embedded target, I
would prefer to have a small stand-alone application that does not
require a running jack-daemon.

* Do you know if it is possible to use the jack functionality without
having to run the jack-daemon ?

>> Hence as long as the application is running, it should do the above.
>>
>> * Is there a special ALSA way to route audio from one PCM to another ?
>>
>> * If not, I suppose it would just work if I open the plugin PCM and the
>> hw PCM at the same time and copy audio frames between them ?
> 
> Dealing with this can be quite complex, especially if the pcms are
> clocked of different sources, you have to deal with a degree of
> resampling to ensure that clock skew doesn't get out of control.

Both PCMs are on the same machine, hence they should be clocked from the
same source as well ?

cheers,
stefan


More information about the Alsa-devel mailing list