On Sat, 12 Jul 2003, Carlo Wood wrote: > On Sat, Jul 12, 2003 at 02:08:34PM +0200, Carlo Wood wrote: > > Hence, the problem is now reduced to the question: > > Why is snd_pcm_update_hw_ptr_interrupt not called anymore > > after we did run into an xrun? > > I added a few more printk's and already I can guess > what is the reason that the 'blackbox' (the rest) > stops calling snd_pcm_update_hw_ptr_interrupt: > > I thought it was said that an xrun should simply be ignored?
Yes, but at another level - in the OSS emulation code. > What is the correct way to recover from this, to continue > recording in this case, after the xrun? Call read() or poll(POLLIN) again. I think that your problem might be that poll(POLLIN) does not trigger the input in the current ALSA code. Please, try this patch with ViaVoice (the patch is also in the ALSA CVS tree): Index: pcm_oss.c =================================================================== RCS file: /cvsroot/alsa/alsa-kernel/core/oss/pcm_oss.c,v retrieving revision 1.38 diff -u -r1.38 pcm_oss.c --- pcm_oss.c 4 Jul 2003 08:49:53 -0000 1.38 +++ pcm_oss.c 12 Jul 2003 18:54:30 -0000 @@ -1990,12 +1990,20 @@ } if (csubstream != NULL) { snd_pcm_runtime_t *runtime = csubstream->runtime; + enum sndrv_pcm_state ostate; poll_wait(file, &runtime->sleep, wait); snd_pcm_stream_lock_irq(csubstream); - if (runtime->status->state != SNDRV_PCM_STATE_RUNNING || + if ((ostate = runtime->status->state) != SNDRV_PCM_STATE_RUNNING || snd_pcm_oss_capture_ready(csubstream)) mask |= POLLIN | POLLRDNORM; snd_pcm_stream_unlock_irq(csubstream); + if (ostate != SNDRV_PCM_STATE_RUNNING && runtime->oss.trigger) { + snd_pcm_oss_file_t ofile; + memset(&ofile, 0, sizeof(ofile)); + ofile.streams[SNDRV_PCM_STREAM_CAPTURE] = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE]; + runtime->oss.trigger = 0; + snd_pcm_oss_set_trigger(&ofile, PCM_ENABLE_INPUT); + } } return mask; Jaroslav ----- Jaroslav Kysela <[EMAIL PROTECTED]> Linux Kernel Sound Maintainer ALSA Project, SuSE Labs ------------------------------------------------------- This SF.Net email sponsored by: Parasoft Error proof Web apps, automate testing & more. Download & eval WebKing and get a free book. www.parasoft.com/bulletproofapps1 _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel