Hi all,
Thanks for your tutorial Paul Davis...
I found some errors:
#include <alsa/asoundlib.h>
Opening devices at mini capture example should be:
           int err;
           if ((err = snd_pcm_open (&capture_handle, argv[1],
SND_PCM_STREAM_CAPTURE, 0)) < 0) {                  fprintf (stderr,
"cannot open audio device %s\n", argv[1]);                  exit
(1);
           }
Opening devices at miniplayback example should be:
           int err;
           if ((err = snd_pcm_open(&playback_handle, argv[1],
SND_PCM_STREAM_PLAYBACK, 0)) < 0) {                  fprintf (stderr,
"cannot open audio device %s\n", argv[1]);                  exit
(1);
           }
This 3 errors are at minifullduplex too.

Seting rate should be this way (examles: playback, capture, duplex):
snd_pcm_hw_params_set_rate_near (capture_handle, hw_params, 44100,
0);

And playback (mini playback, mini full duplex):
snd_pcm_writei(playback_handle, buf, sizeof (buf));

Record (minicapture, mini full duplex):
snd_pcm_readi (capture_handle, buf, sizeof (buf));

mini Full duplex example:
You have there two buffers:            char pbuf[4096]; char
cbuf[4096]; and you write to pbuf and capture to cbuf but these two
buffers have not any connection so it cannot work. So I used only one
buffer for both.

Both mini playback and mini capture work very well (after my
corrections) but I have problem to get work full duplex, althougth my
card it supports.
So I little experiment and found out (after changing order of
playback and capture and setting char pbuf[44000])  that it records
only one times and then it plays the same. (Next records do no
capture nothing and playback plays  still the first record). Could
you help me to get full duplex to work?                              
                                                               Pavel
Nikitenko                                       http://ampcast.com/mrpiano


_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to