From: Anders Torger Subject: Re: Re: How to support multiple open in low-level driver Date: Sun, 5 Jan 2003 15:48:31 +0100 Sender: alsa-devel-admin@lists.sourceforge.net Message-ID: <200301051548.31168.torger@ludd.luth.se> References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Return-path: Received: from mail.it4u.net (mail.it4u.net [81.8.150.196]) by alsa.alsa-project.org (8.9.3/8.9.3/SuSE Linux 8.9.3-0.1) with ESMTP id PAA12299 for ; Sun, 5 Jan 2003 15:49:08 +0100 In-Reply-To: Errors-To: alsa-devel-admin@lists.sourceforge.net List-Help: List-Post: List-Subscribe: , List-Unsubscribe: , List-Archive: To: Jaroslav Kysela Cc: "alsa-devel@alsa-project.org" List-Id: alsa-devel@alsa-project.org On Sunday 05 January 2003 15.34, Jaroslav Kysela wrote: > > I noticed that also my rme96 driver supported this sort of, > > although it probably does not feel very good about it. If the sound > > card is in ADAT mode, it is not so good if it is reopened in SPDIF > > mode from another application for example. > > > > I'd like to just return -EBUSY if it is already open, is that ok? > > If you pass value one to snd_pcm_new() - substream counts, then the > midlevel code takes care about this constraint. No special code is > required on the driver side. Ok, thanks for the information, you are being most helpful. I have another question. The rme96 driver provides two sub devices, one which is the card in adat mode, and one which is the card in spdif mode. These cannot be run at the same time. If I had written the driver today, I suppose I would have had only one device, which supports 2 or 8 channels. Do you agree that it would be a better design, than the two sub-devices I have now? I don't think I will change that now though, if you don't insist that I should (I think it will be quite easy to do the change). If I keep the two sub-devices, I suppose then returning EBUSY in the open function is the correct way if the card is busy running the ADAT subdevice when trying to open the SPDIF subdevice (or the other way around). /Anders Torger ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf