All of lore.kernel.org
 help / color / mirror / Atom feed
* rtcw,quake3 hang on exit
@ 2002-03-20 19:58 Michael Jochum
  2002-03-20 21:00 ` Steven Walter
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Michael Jochum @ 2002-03-20 19:58 UTC (permalink / raw)
  To: alsa-devel

hi!

some time back there has been a similar bug report about the same
problem:
http://www.mail-archive.com/alsa-user@lists.sourceforge.net/msg01675.html
with no response ... so i will be a bit more verbose :)

it have this problem on all computers (Athlon, P3, P4, Cleron) i have
access to. all of them have different sound cards (SB128, SB Live, AC97
Via686 and AC97 on a i845) and on all of them i have used various 0.9
betas of alsa and versions of the linux kernel (2.4.5 to 2.4.18).
no problem with the oss driver

i have done a strace run of rtcw and found some interesting things:

somewhere rtcw opens the dsp device:
open("/dev/dsp", O_RDWR)                = 16
but i cant find the coresponding
close(16)

this are the last lines of output (process locks here):

write(2, "----- CL_Shutdown -----\n", 24) = 24
write(2, "-----------------------\n", 24) = 24
fcntl64(0, F_GETFL)                     = 0x802 (flags
O_RDWR|O_NONBLOCK)
fcntl64(0, F_SETFL, O_RDWR)             = 0
write(2, "Shutdown tty console\n", 21)  = 21
ioctl(0, SNDCTL_TMR_STOP, {B38400 opost isig icanon echo ...}) = 0
_exit(0)                                = ?

i dont know much about kernel internals - but isnt _exit a kernel syscal
that is supposed to close all open devices?
so what kind of bug is this? rtcw? alsa? kernel?

this is a very anoying bug for me and it would be nice if someone could
help me with this problem. i have even mada a panel button to kill the
hanging processes :)

tia,
michael.



_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

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

* Re: rtcw,quake3 hang on exit
  2002-03-20 19:58 rtcw,quake3 hang on exit Michael Jochum
@ 2002-03-20 21:00 ` Steven Walter
  2002-03-20 21:47 ` Paul Davis
  2002-04-08 15:05 ` Takashi Iwai
  2 siblings, 0 replies; 11+ messages in thread
From: Steven Walter @ 2002-03-20 21:00 UTC (permalink / raw)
  To: Michael Jochum; +Cc: alsa-devel

I can confirm this an an Athlon with CM8738-6CH sound card, as well as
some other interesting related effects.  These problems exist even if
rtcw/q3demo are called using the "aoss" wrapper script.

On Wed, Mar 20, 2002 at 08:58:22PM +0100, Michael Jochum wrote:
> hi!
> 
> some time back there has been a similar bug report about the same
> problem:
> http://www.mail-archive.com/alsa-user@lists.sourceforge.net/msg01675.html
> with no response ... so i will be a bit more verbose :)
> 
> it have this problem on all computers (Athlon, P3, P4, Cleron) i have
> access to. all of them have different sound cards (SB128, SB Live, AC97
> Via686 and AC97 on a i845) and on all of them i have used various 0.9
> betas of alsa and versions of the linux kernel (2.4.5 to 2.4.18).
> no problem with the oss driver
> 
> i have done a strace run of rtcw and found some interesting things:
> 
> somewhere rtcw opens the dsp device:
> open("/dev/dsp", O_RDWR)                = 16
> but i cant find the coresponding
> close(16)
> 
> this are the last lines of output (process locks here):
> 
> write(2, "----- CL_Shutdown -----\n", 24) = 24
> write(2, "-----------------------\n", 24) = 24
> fcntl64(0, F_GETFL)                     = 0x802 (flags
> O_RDWR|O_NONBLOCK)
> fcntl64(0, F_SETFL, O_RDWR)             = 0
> write(2, "Shutdown tty console\n", 21)  = 21
> ioctl(0, SNDCTL_TMR_STOP, {B38400 opost isig icanon echo ...}) = 0
> _exit(0)                                = ?
> 
> i dont know much about kernel internals - but isnt _exit a kernel syscal
> that is supposed to close all open devices?
> so what kind of bug is this? rtcw? alsa? kernel?
> 
> this is a very anoying bug for me and it would be nice if someone could
> help me with this problem. i have even mada a panel button to kill the
> hanging processes :)
> 
> tia,
> michael.
> 
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel

-- 
-Steven
In a time of universal deceit, telling the truth is a revolutionary act.
			-- George Orwell
He's alive.  He's alive!  Oh, that fellow at RadioShack said I was mad!
Well, who's mad now?
			-- Montgomery C. Burns

_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

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

* Re: rtcw,quake3 hang on exit
  2002-03-20 19:58 rtcw,quake3 hang on exit Michael Jochum
  2002-03-20 21:00 ` Steven Walter
@ 2002-03-20 21:47 ` Paul Davis
  2002-03-20 21:51   ` Dan Hollis
  2002-03-20 22:05   ` Michael Jochum
  2002-04-08 15:05 ` Takashi Iwai
  2 siblings, 2 replies; 11+ messages in thread
From: Paul Davis @ 2002-03-20 21:47 UTC (permalink / raw)
  To: Michael Jochum; +Cc: alsa-devel

>i have done a strace run of rtcw and found some interesting things:
>
>somewhere rtcw opens the dsp device:
>open("/dev/dsp", O_RDWR)                = 16
>but i cant find the coresponding
>close(16)
>
>this are the last lines of output (process locks here):
>
>write(2, "----- CL_Shutdown -----\n", 24) = 24
>write(2, "-----------------------\n", 24) = 24
>fcntl64(0, F_GETFL)                     = 0x802 (flags
>O_RDWR|O_NONBLOCK)
>fcntl64(0, F_SETFL, O_RDWR)             = 0
>write(2, "Shutdown tty console\n", 21)  = 21
>ioctl(0, SNDCTL_TMR_STOP, {B38400 opost isig icanon echo ...}) = 0
>_exit(0)                                = ?
>
>i dont know much about kernel internals - but isnt _exit a kernel syscal
>that is supposed to close all open devices?

sure, it does. but strace won't see, since it all happens *inside* the
kernel's handling of sys_exit(). strace merely traces actual syscalls,
not what happens inside the kernel. _exit will call sys_close for
every file in the task's file table.

>so what kind of bug is this? rtcw? alsa? kernel?

you haven't really described the bug very much. something to do with
processes left around, etc.

does the program(s) in question use threads? if so, using _exit() will
fail to terminate all threads in the process. this is a linux issue.

_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

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

* Re: rtcw,quake3 hang on exit
  2002-03-20 21:47 ` Paul Davis
@ 2002-03-20 21:51   ` Dan Hollis
  2002-03-20 22:05   ` Michael Jochum
  1 sibling, 0 replies; 11+ messages in thread
From: Dan Hollis @ 2002-03-20 21:51 UTC (permalink / raw)
  To: Paul Davis; +Cc: Michael Jochum, alsa-devel

On Wed, 20 Mar 2002, Paul Davis wrote:
> >so what kind of bug is this? rtcw? alsa? kernel?
> you haven't really described the bug very much. something to do with
> processes left around, etc.
> does the program(s) in question use threads? if so, using _exit() will
> fail to terminate all threads in the process. this is a linux issue.

But OSS doesn't have the problem. Only ALSA with OSS emulation does.

Quite strongly points to an ALSA-specific problem.

-Dan
-- 
[-] Omae no subete no kichi wa ore no mono da. [-]


_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

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

* Re: rtcw,quake3 hang on exit
  2002-03-20 21:47 ` Paul Davis
  2002-03-20 21:51   ` Dan Hollis
@ 2002-03-20 22:05   ` Michael Jochum
  2002-03-20 23:21     ` Steven Walter
  1 sibling, 1 reply; 11+ messages in thread
From: Michael Jochum @ 2002-03-20 22:05 UTC (permalink / raw)
  To: Paul Davis; +Cc: alsa-devel

hi paul!

On Wed, 2002-03-20 at 22:47, Paul Davis wrote:
> sure, it does. but strace won't see, since it all happens *inside* the
> kernel's handling of sys_exit(). strace merely traces actual syscalls,
> not what happens inside the kernel. _exit will call sys_close for
> every file in the task's file table.
> 
> >so what kind of bug is this? rtcw? alsa? kernel?
> 
> you haven't really described the bug very much. something to do with
> processes left around, etc.
> 
> does the program(s) in question use threads? if so, using _exit() will
> fail to terminate all threads in the process. this is a linux issue.
rtcw doesn`t use threads theres only one process during the execution of
rtcw and thats the process that hangs on exit. the process can be
terminatet with Ctrl-C. 
Steven Walter reported that the problem also exists in the demo version
of the games which is aviable at various places. maybe you could debug
the problem? 
http://www.3dgamers.com/dl/games/returnwolfenstein/wolfmpdemo-linux-1.1-mp.x86.run.html
its about 66MByets to download and i understand if you don`t have the
time to do it - but maybe you can give me some hints to debug the
problem.

michael.





_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

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

* Re: rtcw,quake3 hang on exit
  2002-03-20 22:05   ` Michael Jochum
@ 2002-03-20 23:21     ` Steven Walter
  0 siblings, 0 replies; 11+ messages in thread
From: Steven Walter @ 2002-03-20 23:21 UTC (permalink / raw)
  To: Michael Jochum

On Wed, Mar 20, 2002 at 11:05:52PM +0100, Michael Jochum wrote:
[...]
> Steven Walter reported that the problem also exists in the demo version
> of the games which is aviable at various places. maybe you could debug
> the problem? 
> http://www.3dgamers.com/dl/games/returnwolfenstein/wolfmpdemo-linux-1.1-mp.x86.run.html
[...]

I actually have the full version of RtCW, but the demo of Q3.  Haven't
tested on the demo of RtCW.
-- 
-Steven
In a time of universal deceit, telling the truth is a revolutionary act.
			-- George Orwell
He's alive.  He's alive!  Oh, that fellow at RadioShack said I was mad!
Well, who's mad now?
			-- Montgomery C. Burns

_______________________________________________
Alsa-devel mailing list
Alsa-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-devel

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

* Re: rtcw,quake3 hang on exit
  2002-03-20 19:58 rtcw,quake3 hang on exit Michael Jochum
  2002-03-20 21:00 ` Steven Walter
  2002-03-20 21:47 ` Paul Davis
@ 2002-04-08 15:05 ` Takashi Iwai
  2002-04-08 20:01   ` Michael Jochum
  2 siblings, 1 reply; 11+ messages in thread
From: Takashi Iwai @ 2002-04-08 15:05 UTC (permalink / raw)
  To: Michael Jochum; +Cc: alsa-devel

Hi,

i got the point.
snd_pcm_playback_drain() (which is called at closing the pcm) never
returns when OSS is running on mmap mode. 
now fixed on cvs.  please give a try.


ciao,

Takashi


At 20 Mar 2002 20:58:22 +0100,
Michael Jochum wrote:
> 
> hi!
> 
> some time back there has been a similar bug report about the same
> problem:
> http://www.mail-archive.com/alsa-user@lists.sourceforge.net/msg01675.html
> with no response ... so i will be a bit more verbose :)
> 
> it have this problem on all computers (Athlon, P3, P4, Cleron) i have
> access to. all of them have different sound cards (SB128, SB Live, AC97
> Via686 and AC97 on a i845) and on all of them i have used various 0.9
> betas of alsa and versions of the linux kernel (2.4.5 to 2.4.18).
> no problem with the oss driver
> 
> i have done a strace run of rtcw and found some interesting things:
> 
> somewhere rtcw opens the dsp device:
> open("/dev/dsp", O_RDWR)                = 16
> but i cant find the coresponding
> close(16)
> 
> this are the last lines of output (process locks here):
> 
> write(2, "----- CL_Shutdown -----\n", 24) = 24
> write(2, "-----------------------\n", 24) = 24
> fcntl64(0, F_GETFL)                     = 0x802 (flags
> O_RDWR|O_NONBLOCK)
> fcntl64(0, F_SETFL, O_RDWR)             = 0
> write(2, "Shutdown tty console\n", 21)  = 21
> ioctl(0, SNDCTL_TMR_STOP, {B38400 opost isig icanon echo ...}) = 0
> _exit(0)                                = ?
> 
> i dont know much about kernel internals - but isnt _exit a kernel syscal
> that is supposed to close all open devices?
> so what kind of bug is this? rtcw? alsa? kernel?
> 
> this is a very anoying bug for me and it would be nice if someone could
> help me with this problem. i have even mada a panel button to kill the
> hanging processes :)
> 
> tia,
> michael.
> 
> 
> 
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-devel
> 

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

* Re: rtcw,quake3 hang on exit
  2002-04-08 15:05 ` Takashi Iwai
@ 2002-04-08 20:01   ` Michael Jochum
  2002-04-09  8:37     ` Takashi Iwai
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Jochum @ 2002-04-08 20:01 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Mon, 2002-04-08 at 17:05, Takashi Iwai wrote:
> i got the point.
> snd_pcm_playback_drain() (which is called at closing the pcm) never
> returns when OSS is running on mmap mode. 
> now fixed on cvs.  please give a try.

i tried cvs - quake3 and rtcw don`t hang on exit now - BUT there is no
sound at all during the game. there is sound during the intro and when
moving the mouse over the buttons in the main menu but no sound during
the game. maybe the intro does not use the mmap mode?

i applied your patch to 0.9.0beta12 and get the same result as with cvs.
the sound works with the original 0.9.0beta12 there is only that exit
bug.

i can not say how much i appreciate your help with this problem! i
already gave up on that matter.


ciao,
michael

btw what kind of information would help you with solving the problem?
strace? 

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

* Re: rtcw,quake3 hang on exit
  2002-04-08 20:01   ` Michael Jochum
@ 2002-04-09  8:37     ` Takashi Iwai
  2002-04-09  9:30       ` Takashi Iwai
  0 siblings, 1 reply; 11+ messages in thread
From: Takashi Iwai @ 2002-04-09  8:37 UTC (permalink / raw)
  To: Michael Jochum; +Cc: alsa-devel

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

Hi Michael,

At 08 Apr 2002 22:01:49 +0200,
Michael Jochum wrote:
> 
> On Mon, 2002-04-08 at 17:05, Takashi Iwai wrote:
> > i got the point.
> > snd_pcm_playback_drain() (which is called at closing the pcm) never
> > returns when OSS is running on mmap mode. 
> > now fixed on cvs.  please give a try.
> 
> i tried cvs - quake3 and rtcw don`t hang on exit now - BUT there is no
> sound at all during the game. there is sound during the intro and when
> moving the mouse over the buttons in the main menu but no sound during
> the game. maybe the intro does not use the mmap mode?
 
could you try the following patch?
if it's ok, i'll commit this to cvs.


Takashi

[-- Attachment #2: oss-mmap-fix.dif --]
[-- Type: application/octet-stream, Size: 1235 bytes --]

Index: alsa-kernel/core/pcm_lib.c
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-kernel/core/pcm_lib.c,v
retrieving revision 1.7
diff -u -r1.7 pcm_lib.c
--- alsa-kernel/core/pcm_lib.c	8 Apr 2002 11:42:08 -0000	1.7
+++ alsa-kernel/core/pcm_lib.c	9 Apr 2002 08:34:10 -0000
@@ -142,13 +142,17 @@
 		avail = snd_pcm_capture_avail(runtime);
 	if (avail > runtime->avail_max)
 		runtime->avail_max = avail;
-	/* here we need to check both stop_threshold and buffer_size, because
-	   OSS mmap mode sets stop_threshold as maximum (boundary size). */
-	if (avail >= runtime->stop_threshold ||
-	    avail >= runtime->buffer_size) {
+	if (avail >= runtime->stop_threshold) {
 		snd_pcm_stop(substream,
 			     runtime->status->state == SNDRV_PCM_STATE_DRAINING ?
 			     SNDRV_PCM_STATE_SETUP : SNDRV_PCM_STATE_XRUN);
+		return -EPIPE;
+	}
+	/* here need to check the avail size in draining because
+	   OSS mmap mode sets stop_threshold as maximum (boundary size). */
+	if (runtime->status->state == SNDRV_PCM_STATE_DRAINING &&
+	    avail >= runtime->buffer_size) {
+		snd_pcm_stop(substream, SNDRV_PCM_STATE_SETUP);
 		return -EPIPE;
 	}
 	if (avail >= runtime->control->avail_min)

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

* Re: rtcw,quake3 hang on exit
  2002-04-09  8:37     ` Takashi Iwai
@ 2002-04-09  9:30       ` Takashi Iwai
  2002-04-09 17:32         ` rtcw,quake3 hang on exit <<< patch is working!!!! Michael Jochum
  0 siblings, 1 reply; 11+ messages in thread
From: Takashi Iwai @ 2002-04-09  9:30 UTC (permalink / raw)
  To: Michael Jochum; +Cc: alsa-devel

Hi,

At Tue, 09 Apr 2002 10:37:33 +0200,
I wrote:
> 
> [1  <text/plain; US-ASCII (7bit)>]
> Hi Michael,
> 
> At 08 Apr 2002 22:01:49 +0200,
> Michael Jochum wrote:
> > 
> > On Mon, 2002-04-08 at 17:05, Takashi Iwai wrote:
> > > i got the point.
> > > snd_pcm_playback_drain() (which is called at closing the pcm) never
> > > returns when OSS is running on mmap mode. 
> > > now fixed on cvs.  please give a try.
> > 
> > i tried cvs - quake3 and rtcw don`t hang on exit now - BUT there is no
> > sound at all during the game. there is sound during the intro and when
> > moving the mouse over the buttons in the main menu but no sound during
> > the game. maybe the intro does not use the mmap mode?
>  
> could you try the following patch?
> if it's ok, i'll commit this to cvs.

Jaroslav already committed a better patch.
please try the cvs again.


Takashi

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

* Re: rtcw,quake3 hang on exit  <<< patch is working!!!!
  2002-04-09  9:30       ` Takashi Iwai
@ 2002-04-09 17:32         ` Michael Jochum
  0 siblings, 0 replies; 11+ messages in thread
From: Michael Jochum @ 2002-04-09 17:32 UTC (permalink / raw)
  To: alsa-devel

hi!

the cvs version is working fine now!

thanks to everybody for your help

michael.


On Tue, 2002-04-09 at 11:30, Takashi Iwai wrote:
> Hi,
> 
> At Tue, 09 Apr 2002 10:37:33 +0200,
> I wrote:
> > 
> > [1  <text/plain; US-ASCII (7bit)>]
> > Hi Michael,
> > 
> > At 08 Apr 2002 22:01:49 +0200,
> > Michael Jochum wrote:
> > > 
> > > On Mon, 2002-04-08 at 17:05, Takashi Iwai wrote:
> > > > i got the point.
> > > > snd_pcm_playback_drain() (which is called at closing the pcm) never
> > > > returns when OSS is running on mmap mode. 
> > > > now fixed on cvs.  please give a try.
> > > 
> > > i tried cvs - quake3 and rtcw don`t hang on exit now - BUT there is no
> > > sound at all during the game. there is sound during the intro and when
> > > moving the mouse over the buttons in the main menu but no sound during
> > > the game. maybe the intro does not use the mmap mode?
> >  
> > could you try the following patch?
> > if it's ok, i'll commit this to cvs.
> 
> Jaroslav already committed a better patch.
> please try the cvs again.
> 
> 
> Takashi
-- 
Michael Jochum <michael.jochum@gmx.at>       icq:   135304479
Tel.:  +43 676 3327 611 smail: A1060 Wien, Liniengasse 16/16

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

end of thread, other threads:[~2002-04-09 17:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-20 19:58 rtcw,quake3 hang on exit Michael Jochum
2002-03-20 21:00 ` Steven Walter
2002-03-20 21:47 ` Paul Davis
2002-03-20 21:51   ` Dan Hollis
2002-03-20 22:05   ` Michael Jochum
2002-03-20 23:21     ` Steven Walter
2002-04-08 15:05 ` Takashi Iwai
2002-04-08 20:01   ` Michael Jochum
2002-04-09  8:37     ` Takashi Iwai
2002-04-09  9:30       ` Takashi Iwai
2002-04-09 17:32         ` rtcw,quake3 hang on exit <<< patch is working!!!! Michael Jochum

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.