Update of /cvsroot/alsa/alsa-lib/src/pcm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2582/pcm
Modified Files:
pcm.c pcm_direct.c
Log Message:
A next try to fix the snd_pcm_wait() behaviour with direct plugins
Index: pcm.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm.c,v
retrieving revision 1.279
retrieving revision 1.280
diff -u -r1.279 -r1.280
--- pcm.c 23 Mar 2004 13:29:52 -0000 1.279
+++ pcm.c 24 Mar 2004 08:50:01 -0000 1.280
@@ -2082,20 +2082,10 @@
}
err = snd_pcm_poll_descriptors(pcm, &pfd, 1);
assert(err == 1);
+ __retry:
err_poll = poll(&pfd, 1, timeout);
if (err_poll < 0)
return -errno;
-#if 0 /* very useful code to test poll related problems */
- {
- snd_pcm_sframes_t delay, avail_update;
- snd_pcm_hwsync(pcm);
- avail_update = snd_pcm_avail_update(pcm);
- if (avail_update < pcm->avail_min) {
- printf("*** snd_pcm_wait() FATAL ERROR!!!\n");
- printf("avail_min = %li, avail_update = %li\n",
pcm->avail_min, avail_update);
- }
- }
-#endif
err = snd_pcm_poll_descriptors_revents(pcm, &pfd, 1, &revents);
if (err < 0)
return err;
@@ -2112,6 +2102,19 @@
return -EIO;
}
}
+ if ((revents & (POLLIN | POLLOUT)) == 0)
+ goto __retry;
+#if 0 /* very useful code to test poll related problems */
+ {
+ snd_pcm_sframes_t avail_update;
+ snd_pcm_hwsync(pcm);
+ avail_update = snd_pcm_avail_update(pcm);
+ if (avail_update < (snd_pcm_sframes_t)pcm->avail_min) {
+ printf("*** snd_pcm_wait() FATAL ERROR!!!\n");
+ printf("avail_min = %li, avail_update = %li\n",
pcm->avail_min, avail_update);
+ }
+ }
+#endif
return err_poll > 0 ? 1 : 0;
}
Index: pcm_direct.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_direct.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- pcm_direct.c 5 Mar 2004 18:36:19 -0000 1.18
+++ pcm_direct.c 24 Mar 2004 08:50:02 -0000 1.19
@@ -427,6 +427,7 @@
events = pfds[0].revents;
if (events & POLLIN) {
int empty = 0;
+ snd_pcm_avail_update(pcm);
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
events |= POLLOUT;
events &= ~POLLIN;
@@ -436,6 +437,8 @@
}
/* empty the timer read queue */
while (empty && snd_timer_read(dmix->timer, &rbuf, sizeof(rbuf)) ==
sizeof(rbuf)) ;
+ if (empty)
+ events &= ~(POLLOUT|POLLIN);
}
*revents = events;
return 0;
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog