From: Takashi Iwai Subject: Re: Third time: Unlink PCM resource ? Date: Mon, 25 May 2009 17:43:58 +0200 Message-ID: References: <4A1AB98B.9010604@yellowcouch.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id 5F3D024399 for ; Mon, 25 May 2009 17:43:59 +0200 (CEST) In-Reply-To: <4A1AB98B.9010604@yellowcouch.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Werner Van Belle Cc: "alsa-devel@alsa-project.org" List-Id: alsa-devel@alsa-project.org At Mon, 25 May 2009 17:30:19 +0200, Werner Van Belle wrote: > > Hello, > > This is the third time I tried to get information on the same topic but > there has been no response. Since it is crucial for me to get this to > work, I really would appreciate your input. If necssary I can provide > further documentation. The problem is as follows: if a process which > opened a DSP device forks of a new process, then this child will have > the same handle towards the DSP. What I now want to do is to release the > handle in the child without closing the device for the parent as well. > So essentially the sequence below illustrates the problem if one is > unable to 'unlink' a dsp device. > > a- parent process creates and open dsp device > b- parent process forks of a child 1. Child 1 has access to the same dsp > device > c- parent process closes the DSP device > d- client process can no longer write to the DSP device (these are > already odd semantics, but okay, can live with it) > e- parent process forks of a second child. Child 2 has no dsp device > f- Child 2 tries to open the DSP device. This fails because the device, > although closed, is not released yet by Child 1. > > Is this normal behavior ? > > Is there some rigid documentation on the closing and sharing semantics > of pcm devices ? > Is there a way to unlink a device without closing it ? Unlikely. > If this is the wrong mailinglist, then who should I contact regarding > these erratic semantics ? Which API are you using? A simple test case code would be more helpful to demonstrate. But, in general, sharing the same DSP device among different processes don't sound like a good idea... Takashi