Skip to contentSkip to conversation

pcm-record (was cs46xx record (Thinkpad A22) => deadlock)

PATCH In review Wilfried Weissmann 3 participants 4 messages Oct 29, 2002 – Oct 31, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pcm-record (was cs46xx record (Thinkpad A22) => deadlock)

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

pcm_lib.c renamed from pcm_lib.c.bak +1 -1
@@ -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) {
#1 lore raw

At Tue, 29 Oct 2002 15:07:41 +0100,

Quoted 11 lines · Wilfried Weissmann

[1 <text/plain; us-ascii (7bit)>]
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).

looks correct. applied to cvs now.
thanks!

Takashi

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

#2 lore raw
Quoted 14 lines · Takashi Iwai

At Tue, 29 Oct 2002 15:07:41 +0100,

Quoted 11 lines · Wilfried Weissmann

[1 <text/plain; us-ascii (7bit)>]
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).

Quoted 1 line

looks correct. applied to cvs now.

It's wrong. I reverted the change and included new updated code for the OSS emulation.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

-------------------------------------------------------
This sf.net email is sponsored by: Influence the future of Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) program now.
http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en

#3 lore raw
Quoted 10 lines · Jaroslav Kysela
Quoted 6 lines · Takashi Iwai

At Tue, 29 Oct 2002 15:07:41 +0100,

Quoted 2 lines · Wilfried Weissmann

[1 <text/plain; us-ascii (7bit)>]
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).

looks correct. applied to cvs now.

It's wrong. I reverted the change and included new updated code for the OSS emulation.

I just tested the new patch. It works perfectly. Thanks all.

bye,
Wilfried

-------------------------------------------------------
This sf.net email is sponsored by: Influence the future of Java(TM) technology. Join the Java Community Process(SM) (JCP(SM)) program now. http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en