From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Jiang Subject: Re: Have multiple opens removed on one device? Date: Thu, 1 Sep 2011 11:43:09 +0800 Message-ID: References: <20110822112143.GB9232@opensource.wolfsonmicro.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-qy0-f172.google.com (mail-qy0-f172.google.com [209.85.216.172]) by alsa0.perex.cz (Postfix) with ESMTP id BEBB824630 for ; Thu, 1 Sep 2011 05:43:10 +0200 (CEST) Received: by qyk34 with SMTP id 34so3917153qyk.17 for ; Wed, 31 Aug 2011 20:43:09 -0700 (PDT) In-Reply-To: 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: Mark Brown Cc: Takashi Iwai , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org 2011/8/29 Scott Jiang : > > Indeed we use dmix. But now we can't open the same device twice. > Our alsa lib and utils version is 1.0.18. > The test command: aplay 1.wav &; aplay 1.wav > In 2.6.34, strace > open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = 4 > open("/dev/snd/pcmC0D0p", O_RDWR|O_APPEND|O_NONBLOCK) = 4 > > In 3.0, strace > open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = 4 > open("/dev/snd/pcmC0D0p", O_RDWR|O_NONBLOCK) = -1 EBUSY (Device or > resource busy) > > The O_APPEND flag missed in new kernel. But we use the same lib and > utils. It's strange. > And I found the prefer subdevice changes from 0 to -1. These two > changes cause kernel return device busy. > > Mark, can you do this simple test on your board? I appreciate your > help. Thank you very much. > I know the reason. The card config file didn't read properly. Asoc doesn't copy codec name to card->driver now. I guess it is because multiple codecs are supported. I add driver_name in my snd_soc_card to solve this bug. But I scan other drivers in asoc, nobody did this. Maybe nobody are aware of this. Are there any better way to solve this bug? Regards, Scott