[alsa-devel] Third time: Unlink PCM resource ?

Takashi Iwai tiwai at suse.de
Tue May 26 07:53:09 CEST 2009

At Mon, 25 May 2009 20:39:45 +0200 (CEST),
Jaroslav Kysela wrote:
> On Mon, 25 May 2009, Takashi Iwai wrote:
> > At Mon, 25 May 2009 20:27:14 +0200,
> > Werner Van Belle wrote:
> >>
> >> Takashi Iwai wrote:
> >>> You can control it via fcntl().  See fcntl(2) man page.
> >>>
> >> I looked at that but I didn't find any place in alsalib (or libalsa
> >> whatever the order of those two words), where I can obtain the file
> >> handle. They are all of type pcm_something_t. I found a file handle
> >> quite deep in this library but there seems no way to actually obtain
> >> that handle.
> >
> > OK, I see the problem now, too.  In practice, you can get a file
> > descriptor from poll descriptor, but this doesn't cover all underlying
> > fds.  A new API function or an additional SND_PCM_* flag for
> > snd_pcm_open() would be needed, indeed.
> The question is if it's not better to free also allocated memory 
> associated to the pcm handle in child process - so snd_pcm_close() 
> call in child is not a bad idea.

OK, in a case without exec, we need an explicit call.
But I guess snd_pcm_close() isn't appropriate (as Werner experienced)
since it calls snd_pcm_drop() there.  I guess this call isn't needed
as the driver itself takes care?


More information about the Alsa-devel mailing list