All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] pcm-record (was cs46xx record (Thinkpad A22) => deadlock)
@ 2002-10-29 14:07 Wilfried Weissmann
  2002-10-30 18:12 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Wilfried Weissmann @ 2002-10-29 14:07 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 600 bytes --]

I dug a little around in the code. The infinitive loop was caused by 
being stuck in DRAINING mode. snd_pcm_lib_read1() returns -EPIPE in this 
case (pcm_lib.c: 2146). Then we return to snd_pcm_oss_read3() which 
continues to call this function until jdoomsday (= SysRq+b). I changed 
the code to call snd_pcm_update_hw_ptr() before that. The patch is 
attached. It *seems* to fix it. You want to have a _real_ close look at 
that if you want to apply the patch, as it is just a shot in the dark. 
At least I know now that the problem is (I figured it out by inserting 
printk).

greetings,
Wilfried

[-- Attachment #2: alsa-driver-0.9.0.rc5+loopfix.diff --]
[-- Type: text/plain, Size: 577 bytes --]

--- pcm_lib.c.bak	Tue Oct 29 13:40:50 2002
+++ pcm_lib.c	Tue Oct 29 14:44:42 2002
@@ -2138,7 +2138,7 @@
 		snd_pcm_uframes_t frames, appl_ptr, appl_ofs;
 		snd_pcm_uframes_t avail;
 		snd_pcm_uframes_t cont;
-		if (runtime->sleep_min == 0 && runtime->status->state == SNDRV_PCM_STATE_RUNNING)
+		if (runtime->sleep_min == 0 && ( runtime->status->state == SNDRV_PCM_STATE_RUNNING || runtime->status->state == SNDRV_PCM_STATE_DRAINING))
 			snd_pcm_update_hw_ptr(substream);
 		avail = snd_pcm_capture_avail(runtime);
 		if (runtime->status->state == SNDRV_PCM_STATE_DRAINING) {

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-31 10:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-29 14:07 [patch] pcm-record (was cs46xx record (Thinkpad A22) => deadlock) Wilfried Weissmann
2002-10-30 18:12 ` Takashi Iwai
2002-10-30 20:33   ` Jaroslav Kysela
2002-10-31 10:32     ` Wilfried Weissmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.