On Fri, 20 Jun 2003, [EMAIL PROTECTED] wrote:

>       while(1) {
>               
>               r = snd_pcm_readi(pcmr, buf, BUFSIZE);
> 
>               if(r != BUFSIZE) printf("rec  r=%d\n", r);
>               checkr(r);
> 
>               r = snd_pcm_writei(pcmp, buf, BUFSIZE);
> 
>               if(r != BUFSIZE) printf("play r=%d\n", r);
>               if(r == -EPIPE) {
>                       snd_pcm_prepare(pcmp);
>               } else {
>                       checkr(r);
>               }
> 
>       }


This loop is definitely wrong. I explained several times why. You cannot 
do while (1) { read(); write(); } but:

/* prefill the playback buffer with the desired latency */
while (!minimal_latency_reached)
        write();
start_capture();
start_playback();
/* normal loop */
while (1) {
        read();
        write();
}

                                                Jaroslav

-----
Jaroslav Kysela <[EMAIL PROTECTED]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs



-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to