[alsa-devel] Alsa asynchonus playnback
Hello,
I want to play audiodata using alsa and do as it is explained in http://alsa.opensrc.org/Asynchronous_Playback_%28Howto%29 http://equalarea.com/paul/alsa-audio.html#interruptex 1. open device 2 define a callback
void MyCallback(snd_async_handler_t *pcm_callback) { ... }
err = snd_async_add_pcm_handler(&pcm_callback, pcm_handle, MyCallback, NULL); if(err<0){ fprintf (stderr, "err = %d --> snd_async_add_pcm_handler: (%s)\n",err,snd_strerror (err)); }
return -38 ( function is not implemented )???
i a loop I generate the audiodata
void produce_audiodata(short* left, short *right) {
for(int k = 0; k< max;k++){ audio[2*k]= left[k]; audio[2*k+1]= right[k]; } Mycallback(...) is it the right place to call it ? }
thanks
Martin schmidt wrote:
I want to play audiodata using alsa and do as it is explained in http://alsa.opensrc.org/Asynchronous_Playback_%28Howto%29 http://equalarea.com/paul/alsa-audio.html#interruptex
These links describe two different mechanisms.
return -38 ( function is not implemented )???
This is one of the reasons why you shouldn't use async notifications.
Is there a reason why you do want to use them?
Regards, Clemens
participants (2)
-
Clemens Ladisch
-
Martin schmidt