From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: Can't Unload ALSA Driver Without Disconnecting the Device Date: Fri, 12 Jun 2015 09:01:45 +0200 Message-ID: References: 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 mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 354D1266726 for ; Fri, 12 Jun 2015 09:01:46 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Azizul Hakim Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 12 Jun 2015 02:57:27 -0400, Azizul Hakim wrote: > > I see. So in this scenario what'll be the way to unload the driver > successfully? Is there a way to stop the mixer interface? Kill pulseaudio properly. It'll auto respawn itself usually, so for killing PA, you'd have to change the PA configuration. Takashi > > On Fri, Jun 12, 2015 at 2:55 AM, Takashi Iwai wrote: > > > At Fri, 12 Jun 2015 02:51:03 -0400, > > Azizul Hakim wrote: > > > > > > I tried that command. The output is as below: > > > > > > USER PID ACCESS COMMAND > > > /dev/snd/controlC0: mhaki005 2043 F.... pulseaudio > > > /dev/snd/controlC1: mhaki005 2043 F.... pulseaudio > > > /dev/snd/pcmC0D0c: mhaki005 2043 F...m pulseaudio > > > > > > > > > I think pcmC0D0c stands for "Capture" device. My device is a playback > > > device. So I don't think it is being used by anyone. > > > > /dev/snd/controlC1 is being used. It's the mixer interface. > > > > > > Takashi > > > > > > > > > > > On Fri, Jun 12, 2015 at 2:41 AM, Takashi Iwai wrote: > > > > > > > At Fri, 12 Jun 2015 02:28:16 -0400, > > > > Azizul Hakim wrote: > > > > > > > > > > Hi, > > > > > > > > > > I've been developing a sound card driver for a USB device using > > ALSA. My > > > > > driver is almost working but I've got one small issue. If I try to > > unload > > > > > the driver module using "rmmod" command when the device is still > > > > connected > > > > > to the USB port, it says "Module is in use" even though I'm not > > playing > > > > any > > > > > sound files or anything. > > > > > > > > > > > > > > > If I try to execute the "lsmod" command I see that it is saying the > > usage > > > > > count of my driver to be 1, but it doesn't say anything about who is > > > > using > > > > > it. Once I disconnect the device from the USB port, I can easily > > unload > > > > the > > > > > module. > > > > > > > > > > > > > > > So it seems to me it won't be possible to unload a sound card driver > > if > > > > the > > > > > card is attached in the computer. Is my assumption correct? If not, > > what > > > > > might be some key points to solve the issue? > > > > > > > > Check "fuser -v /dev/snd/*" as root. Something (e.g. a mixer > > > > application or sound backend) must be accessing the device. > > > > > > > > > > > > Takashi > > > >