From: Konstantin Stepaniuk <s.k.v@mail.ru>
To: Jaroslav Kysela <perex@suse.cz>
Cc: alsa-devel@lists.sourceforge.net
Subject: Re: exit() -> _exit() in pcm_direct.c
Date: Wed, 30 Jul 2003 23:21:52 +0400 [thread overview]
Message-ID: <3F281AD0.5090402@mail.ru> (raw)
In-Reply-To: <Pine.LNX.4.44.0307301918500.9821-100000@pnote.perex-int.cz>
Jaroslav Kysela wrote:
>On Wed, 30 Jul 2003, Konstantin Stepaniuk wrote:
>
>
>
>>Hello.
>>
>>My program call snd_pcm_open() with "plug:dmix" in thread.
>>Function snd_pcm_direct_server_create() hangs on waitpid() if exit() is used,
>>and server_job process keeps alive after program exit.
>>This trivial patch chages exit() to _exit() in file pcm_direct.c. In this case
>>all works ok for me.
>>
>>
>
>I'm sorry, but I still don't see a reason (I'd like to know, why the
>process hangs). Could you explain the behaviour or send me a simple test
>code to debug this thing?
>
> Jaroslav
>
>-----
>Jaroslav Kysela <perex@suse.cz>
>Linux Kernel Sound Maintainer
>ALSA Project, SuSE Labs
>
>
Here's a test:
/* dmix.c */
#define ALSA_PCM_NEW_HW_PARAMS_API
#define ALSA_PCM_NEW_SW_PARAMS_API
#include <alsa/asoundlib.h>
#include <pthread.h>
#include <stdio.h>
void *thread_routine( void *param )
{
snd_pcm_t *pcm;
int err;
err = snd_pcm_open( &pcm, "plug:dmix",
SND_PCM_STREAM_PLAYBACK, SND_PCM_NONBLOCK );
if( err < 0 )
{
fprintf( stderr, "%s\n", snd_strerror(err) );
return NULL;
}
printf( "alsa opened\n" );
snd_pcm_close( pcm );
return NULL;
}
int main( void )
{
pthread_t thread;
int i;
if( pthread_create( &thread, 0, thread_routine, NULL ) )
{
fprintf( stderr, "pthread_create failure\n" );
return -1;
}
pthread_join( thread, NULL );
return 0;
}
/*--------------------*/
This program crashes without any error message and doesn't print "alsa
opened".
sound card: intel8x0
alsa version: cvs snapshot 2003-07-30
kernel version: 2.4.21 (Debian)
glibc: 2.3.1
This works ok with cmipci card. Maybe problem with intel8x0?
P.S. Add please '\n' in aplay version string :)
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
next prev parent reply other threads:[~2003-07-30 19:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E19d8Au-00060s-00@sc8-sf-list2.sourceforge.net>
2003-07-30 16:21 ` exit() -> _exit() in pcm_direct.c Konstantin Stepaniuk
2003-07-30 17:20 ` Jaroslav Kysela
2003-07-30 19:21 ` Konstantin Stepaniuk [this message]
2003-08-05 13:51 ` Takashi Iwai
2003-08-05 18:36 ` Jaroslav Kysela
2003-08-06 12:44 Konstantin Stepaniuk
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3F281AD0.5090402@mail.ru \
--to=s.k.v@mail.ru \
--cc=alsa-devel@lists.sourceforge.net \
--cc=perex@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.