From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: rtcw,quake3 hang on exit Date: Tue, 09 Apr 2002 10:37:33 +0200 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: References: <1016654302.933.2.camel@mjo> <1018296113.12764.0.camel@mjo> Mime-Version: 1.0 (generated by SEMI 1.14.3 - "Ushinoya") Content-Type: multipart/mixed; boundary="Multipart_Tue_Apr__9_10:37:33_2002-1" In-Reply-To: <1018296113.12764.0.camel@mjo> Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Michael Jochum Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org --Multipart_Tue_Apr__9_10:37:33_2002-1 Content-Type: text/plain; charset=US-ASCII 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 --Multipart_Tue_Apr__9_10:37:33_2002-1 Content-Type: application/octet-stream Content-Disposition: attachment; filename="oss-mmap-fix.dif" Content-Transfer-Encoding: 7bit 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) --Multipart_Tue_Apr__9_10:37:33_2002-1--