All of lore.kernel.org
 help / color / mirror / Atom feed
* Can not rmmod snd_hda_codec_hdmi
@ 2014-12-23 11:07 Xuebing Wang
  2014-12-23 16:21 ` Clemens Ladisch
  0 siblings, 1 reply; 10+ messages in thread
From: Xuebing Wang @ 2014-12-23 11:07 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org
  Cc: ; Takashi Iwai, Anssi Hannula, ; Libin Yang, ; Fengguang Wu,
	; Mengdong Lin

Hi community,

I am trying to implement the function of streaming SACD music over HDMI,
my PC is Intel Haswell based CPU (Intel i7 4770).

When I am trying to 'rmmod snd_hda_codec_hdmi', I get the prompt that
this module is in use (detailed message as below) 
rmmod: ERROR: Module snd_hda_codec_hdmi is in use

Is it possible that workqueue [hd-audio] is using this kernel module
(snd_hda_codec_hdmi)?

Can I use rmmod / insmod as the way to debug this module?

Thanks.
Xuebing Wang

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can not rmmod snd_hda_codec_hdmi
  2014-12-23 11:07 Can not rmmod snd_hda_codec_hdmi Xuebing Wang
@ 2014-12-23 16:21 ` Clemens Ladisch
  2014-12-24  9:49   ` Xuebing Wang
  0 siblings, 1 reply; 10+ messages in thread
From: Clemens Ladisch @ 2014-12-23 16:21 UTC (permalink / raw)
  To: Xuebing Wang, alsa-devel@alsa-project.org
  Cc: ; Takashi Iwai, Anssi Hannula, ; Libin Yang, ; Fengguang Wu,
	; Mengdong Lin

Xuebing Wang wrote:
>rmmod: ERROR: Module snd_hda_codec_hdmi is in use

rmmod snd-hda-intel first.


Regards,
Clemens

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can not rmmod snd_hda_codec_hdmi
  2014-12-23 16:21 ` Clemens Ladisch
@ 2014-12-24  9:49   ` Xuebing Wang
  2014-12-24  9:57     ` Anssi Hannula
  0 siblings, 1 reply; 10+ messages in thread
From: Xuebing Wang @ 2014-12-24  9:49 UTC (permalink / raw)
  To: Clemens Ladisch
  Cc: ; Libin Yang, alsa-devel@alsa-project.org, ; Takashi Iwai,
	; Mengdong Lin, Anssi Hannula, ; Fengguang Wu

Clemens, thanks for your help.

I am using Fedora 21 (Ubuntu 14.04.1 has the same problem).

'rmmod snd-hda-intel' shows this module is in use too. 

'modinfo snd-hda-intel', nor file /lib/modules/.../modules.dep shows that any kernel modules depends
on snd-hda-intel or snd_hda_codec_hdmi.

Is it possible that a kernel thread is using these 2 modules?

Any ideas? Thanks.


On Tue, 2014-12-23 at 17:21 +0100, Clemens Ladisch wrote:
> Xuebing Wang wrote:
> >rmmod: ERROR: Module snd_hda_codec_hdmi is in use
> 
> rmmod snd-hda-intel first.
> 
> 
> Regards,
> Clemens
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can not rmmod snd_hda_codec_hdmi
  2014-12-24  9:49   ` Xuebing Wang
@ 2014-12-24  9:57     ` Anssi Hannula
  2014-12-24 11:54       ` Xuebing Wang
  0 siblings, 1 reply; 10+ messages in thread
From: Anssi Hannula @ 2014-12-24  9:57 UTC (permalink / raw)
  To: Xuebing Wang
  Cc: ; Libin Yang, alsa-devel@alsa-project.org, ; Takashi Iwai,
	; Mengdong Lin, Clemens Ladisch, ; Fengguang Wu

24.12.2014, 11:49, Xuebing Wang kirjoitti:
> On Tue, 2014-12-23 at 17:21 +0100, Clemens Ladisch wrote:
>> Xuebing Wang wrote:
>>> rmmod: ERROR: Module snd_hda_codec_hdmi is in use
>>
>> rmmod snd-hda-intel first.
>>
> Clemens, thanks for your help.
> 
> I am using Fedora 21 (Ubuntu 14.04.1 has the same problem).
> 
> 'rmmod snd-hda-intel' shows this module is in use too. 
> 
> 'modinfo snd-hda-intel', nor file /lib/modules/.../modules.dep shows that any kernel modules depends
> on snd-hda-intel or snd_hda_codec_hdmi.
> 
> Is it possible that a kernel thread is using these 2 modules?
> 
> Any ideas? Thanks.

Run this to see if some userspace process is using the ALSA devices:
fuser -v /dev/snd/*

-- 
Anssi Hannula

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can not rmmod snd_hda_codec_hdmi
  2014-12-24  9:57     ` Anssi Hannula
@ 2014-12-24 11:54       ` Xuebing Wang
  2014-12-24 12:28         ` Takashi Sakamoto
  0 siblings, 1 reply; 10+ messages in thread
From: Xuebing Wang @ 2014-12-24 11:54 UTC (permalink / raw)
  To: Anssi Hannula
  Cc: ; Libin Yang, alsa-devel@alsa-project.org, ; Takashi Iwai,
	; Mengdong Lin, Clemens Ladisch, ; Fengguang Wu

On Wed, 2014-12-24 at 11:57 +0200, Anssi Hannula wrote:
> 24.12.2014, 11:49, Xuebing Wang kirjoitti:
> > On Tue, 2014-12-23 at 17:21 +0100, Clemens Ladisch wrote:
> >> Xuebing Wang wrote:
> >>> rmmod: ERROR: Module snd_hda_codec_hdmi is in use
> >>
> >> rmmod snd-hda-intel first.
> >>
> > Clemens, thanks for your help.
> > 
> > I am using Fedora 21 (Ubuntu 14.04.1 has the same problem).
> > 
> > 'rmmod snd-hda-intel' shows this module is in use too. 
> > 
> > 'modinfo snd-hda-intel', nor file /lib/modules/.../modules.dep shows that any kernel modules depends
> > on snd-hda-intel or snd_hda_codec_hdmi.
> > 
> > Is it possible that a kernel thread is using these 2 modules?
> > 
> > Any ideas? Thanks.
> 
> Run this to see if some userspace process is using the ALSA devices:
> fuser -v /dev/snd/*
> 

Anssi, thanks for your help.

1) In Fedora 21 (kernel 3.17.4), 
'fuser -v /dev/snd/*' shows below:
/dev/snd/controlC0:  xbing      2400 F.... pulseaudio
/dev/snd/controlC1:  xbing      2400 F.... pulseaudio
/dev/snd/pcmC0D3p:   xbing      2400 F...m pulseaudio
/dev/snd/pcmC1D0c:   xbing      2400 F...m pulseaudio
/dev/snd/pcmC1D0p:   xbing      2400 F...m pulseaudio

After 'pulseaudio --kill' to kill pulseaudio (after disable autospawn),
lsmod shows refcount of snd_hda_intel is down from 7 to 2 as below:
$ lsmod | grep hda_intel
snd_hda_intel          30479  2

'rmmod snd_hda_intel' still shows this module is in use.

2) But, in Ubuntu 14.04.1 (kernel 3.13.0) DOES work after 'pulseaudio --kill', because lsmod shows refcount of snd_hda_intel is 5.

Any suggestions? Could it be because of kernel difference 3.17.4 vs 3.13.0?

Thanks.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can not rmmod snd_hda_codec_hdmi
  2014-12-24 11:54       ` Xuebing Wang
@ 2014-12-24 12:28         ` Takashi Sakamoto
  2014-12-24 13:07           ` Xuebing Wang
  0 siblings, 1 reply; 10+ messages in thread
From: Takashi Sakamoto @ 2014-12-24 12:28 UTC (permalink / raw)
  To: Xuebing Wang, Anssi Hannula
  Cc: ; Libin Yang, alsa-devel@alsa-project.org, ; Takashi Iwai,
	; Mengdong Lin, Clemens Ladisch, ; Fengguang Wu

On Dec 24 2014 20:54, Xuebing Wang wrote:
> Anssi, thanks for your help.
> 
> 1) In Fedora 21 (kernel 3.17.4), 
> 'fuser -v /dev/snd/*' shows below:
> /dev/snd/controlC0:  xbing      2400 F.... pulseaudio
> /dev/snd/controlC1:  xbing      2400 F.... pulseaudio
> /dev/snd/pcmC0D3p:   xbing      2400 F...m pulseaudio
> /dev/snd/pcmC1D0c:   xbing      2400 F...m pulseaudio
> /dev/snd/pcmC1D0p:   xbing      2400 F...m pulseaudio
> 
> After 'pulseaudio --kill' to kill pulseaudio (after disable autospawn),
> lsmod shows refcount of snd_hda_intel is down from 7 to 2 as below:
> $ lsmod | grep hda_intel
> snd_hda_intel          30479  2
> 
> 'rmmod snd_hda_intel' still shows this module is in use.
> 
> 2) But, in Ubuntu 14.04.1 (kernel 3.13.0) DOES work after 'pulseaudio --kill', because lsmod shows refcount of snd_hda_intel is 5.
> 
> Any suggestions? Could it be because of kernel difference 3.17.4 vs 3.13.0?

In Ubuntu, pulseaudio process re-run even if you kill the process. See:
https://wiki.ubuntu.com/PulseAudio/Log

But in this case, you don't need to kill pulseaudio. You just set 'off'
for card profile, or unload alsa-card module. Then these character
devices are released.

The way to set card profile:
$ pactl list cards | grep Card
Card #3
$ pactl set-card-profile 3 off

Or use 'configuration' tab in pavucontrol GUI. In Ubuntu, this
application is released by 'pavucontrol' package.

The way to unload alsa-card module:
$ pactl list modules | grep alsa
(... you can see module-alsa-card is loaded.)
$ pactl unload-module module-alsa-card
$ pactl list modules | grep alsa
(... you can see module-alsa-card is unloaded.)


Regards

Takashi Sakamoto
o-takashi@sakamocchi.jp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can not rmmod snd_hda_codec_hdmi
  2014-12-24 12:28         ` Takashi Sakamoto
@ 2014-12-24 13:07           ` Xuebing Wang
  2014-12-24 13:21             ` Takashi Sakamoto
  0 siblings, 1 reply; 10+ messages in thread
From: Xuebing Wang @ 2014-12-24 13:07 UTC (permalink / raw)
  To: Takashi Sakamoto
  Cc: ; Libin Yang, alsa-devel@alsa-project.org, ; Takashi Iwai,
	; Mengdong Lin, Clemens Ladisch, Anssi Hannula, ; Fengguang Wu

On 三, 2014-12-24 at 21:28 +0900, Takashi Sakamoto wrote:
> On Dec 24 2014 20:54, Xuebing Wang wrote:
> > Anssi, thanks for your help.
> > 
> > 1) In Fedora 21 (kernel 3.17.4), 
> > 'fuser -v /dev/snd/*' shows below:
> > /dev/snd/controlC0:  xbing      2400 F.... pulseaudio
> > /dev/snd/controlC1:  xbing      2400 F.... pulseaudio
> > /dev/snd/pcmC0D3p:   xbing      2400 F...m pulseaudio
> > /dev/snd/pcmC1D0c:   xbing      2400 F...m pulseaudio
> > /dev/snd/pcmC1D0p:   xbing      2400 F...m pulseaudio
> > 
> > After 'pulseaudio --kill' to kill pulseaudio (after disable autospawn),
> > lsmod shows refcount of snd_hda_intel is down from 7 to 2 as below:
> > $ lsmod | grep hda_intel
> > snd_hda_intel          30479  2
> > 
> > 'rmmod snd_hda_intel' still shows this module is in use.
> > 
> > 2) But, in Ubuntu 14.04.1 (kernel 3.13.0) DOES work after 'pulseaudio --kill', because lsmod shows refcount of snd_hda_intel is 5.
> > 
> > Any suggestions? Could it be because of kernel difference 3.17.4 vs 3.13.0?
> 
> In Ubuntu, pulseaudio process re-run even if you kill the process. See:
> https://wiki.ubuntu.com/PulseAudio/Log
> 
> But in this case, you don't need to kill pulseaudio. You just set 'off'
> for card profile, or unload alsa-card module. Then these character
> devices are released.
> 
> The way to set card profile:
> $ pactl list cards | grep Card
> Card #3
> $ pactl set-card-profile 3 off
> 
> Or use 'configuration' tab in pavucontrol GUI. In Ubuntu, this
> application is released by 'pavucontrol' package.
> 
> The way to unload alsa-card module:
> $ pactl list modules | grep alsa
> (... you can see module-alsa-card is loaded.)
> $ pactl unload-module module-alsa-card
> $ pactl list modules | grep alsa
> (... you can see module-alsa-card is unloaded.)

Sakamoto-san, thank you very much for your sophisticated way, it helps.

1) I am sorry that I forgot to mention that I disabled 'pulseaudio
autospawn' in Ubuntu too, as I disabled 'pulseaudio autospawn' in
Fedora. Both simply 'pulseaudio --kill' (after disable autospawn) and
your sophisticated way can get down refcount of snd_hda_intel from 5 to
0, then I can rmmod snd_hda_intel.

2) However, in Fedora, 'pulseaudio --kill' or your way can get refcount
of snd_hda_intel from 7 to 2 (5 decreased). Any suggestions how to
decrease the rest 2 refcount?

3) I did try to build tag 3.13 from mainline kernel (using Fedora 3.17.4
config file) and tried 3.13 kernel on Fedora, and got the same result
(refcount of snd_hda_intel is down from 7 to 2).

It seems something in Fedora (either Fedora kernel or application) is
using snd_hda_intel.

Thanks again.


> Regards
> 
> Takashi Sakamoto
> o-takashi@sakamocchi.jp
> 


_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can not rmmod snd_hda_codec_hdmi
  2014-12-24 13:07           ` Xuebing Wang
@ 2014-12-24 13:21             ` Takashi Sakamoto
  2014-12-24 13:27               ` Xuebing Wang
  0 siblings, 1 reply; 10+ messages in thread
From: Takashi Sakamoto @ 2014-12-24 13:21 UTC (permalink / raw)
  To: Xuebing Wang
  Cc: ; Libin Yang, alsa-devel@alsa-project.org, ; Takashi Iwai,
	; Mengdong Lin, Clemens Ladisch, Anssi Hannula, ; Fengguang Wu

On Dec 24 2014 22:07, Xuebing Wang wrote:
> 2) However, in Fedora, 'pulseaudio --kill' or your way can get refcount
> of snd_hda_intel from 7 to 2 (5 decreased). Any suggestions how to
> decrease the rest 2 refcount?
> 
> 3) I did try to build tag 3.13 from mainline kernel (using Fedora 3.17.4
> config file) and tried 3.13 kernel on Fedora, and got the same result
> (refcount of snd_hda_intel is down from 7 to 2).

Hm. In this case that the refcount is down to 2, how is the output of
'fuser' command? If any applications use these character devices, we can
see the name of command.


Regards

Takashi Sakamoto
o-takashi@sakamocchi.jp

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can not rmmod snd_hda_codec_hdmi
  2014-12-24 13:21             ` Takashi Sakamoto
@ 2014-12-24 13:27               ` Xuebing Wang
  2014-12-24 19:02                 ` Jaroslav Kysela
  0 siblings, 1 reply; 10+ messages in thread
From: Xuebing Wang @ 2014-12-24 13:27 UTC (permalink / raw)
  To: Takashi Sakamoto
  Cc: ; Libin Yang, alsa-devel@alsa-project.org, ; Takashi Iwai,
	; Mengdong Lin, Clemens Ladisch, Anssi Hannula, ; Fengguang Wu

On Wed, 2014-12-24 at 22:21 +0900, Takashi Sakamoto wrote:
> On Dec 24 2014 22:07, Xuebing Wang wrote:
> > 2) However, in Fedora, 'pulseaudio --kill' or your way can get refcount
> > of snd_hda_intel from 7 to 2 (5 decreased). Any suggestions how to
> > decrease the rest 2 refcount?
> > 
> > 3) I did try to build tag 3.13 from mainline kernel (using Fedora 3.17.4
> > config file) and tried 3.13 kernel on Fedora, and got the same result
> > (refcount of snd_hda_intel is down from 7 to 2).
> 
> Hm. In this case that the refcount is down to 2, how is the output of
> 'fuser' command? If any applications use these character devices, we can
> see the name of command.

Sakamoto-san, thanks for your help.

I found out that it is alsactl in Fedora. After kill alsactl, refcnt is
now down to 0, and both snd_hda_intel and snd_hda_codec_hdmi can be
rmmod'ed. 'fuser -v /dev/snd' does not reveal alsactl.

Thanks again.


> Regards
> 
> Takashi Sakamoto
> o-takashi@sakamocchi.jp
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Can not rmmod snd_hda_codec_hdmi
  2014-12-24 13:27               ` Xuebing Wang
@ 2014-12-24 19:02                 ` Jaroslav Kysela
  0 siblings, 0 replies; 10+ messages in thread
From: Jaroslav Kysela @ 2014-12-24 19:02 UTC (permalink / raw)
  To: Xuebing Wang, Takashi Sakamoto
  Cc: ; Libin Yang, alsa-devel@alsa-project.org, ; Takashi Iwai,
	; Mengdong Lin, Clemens Ladisch, Anssi Hannula, ; Fengguang Wu

Dne 24.12.2014 v 14:27 Xuebing Wang napsal(a):
> On Wed, 2014-12-24 at 22:21 +0900, Takashi Sakamoto wrote:
>> On Dec 24 2014 22:07, Xuebing Wang wrote:
>>> 2) However, in Fedora, 'pulseaudio --kill' or your way can get refcount
>>> of snd_hda_intel from 7 to 2 (5 decreased). Any suggestions how to
>>> decrease the rest 2 refcount?
>>>
>>> 3) I did try to build tag 3.13 from mainline kernel (using Fedora 3.17.4
>>> config file) and tried 3.13 kernel on Fedora, and got the same result
>>> (refcount of snd_hda_intel is down from 7 to 2).
>>
>> Hm. In this case that the refcount is down to 2, how is the output of
>> 'fuser' command? If any applications use these character devices, we can
>> see the name of command.
> 
> Sakamoto-san, thanks for your help.
> 
> I found out that it is alsactl in Fedora. After kill alsactl, refcnt is
> now down to 0, and both snd_hda_intel and snd_hda_codec_hdmi can be
> rmmod'ed. 'fuser -v /dev/snd' does not reveal alsactl.
> 
> Thanks again.


The command should be:

$ fuser /dev/snd/*

And you can stop the alsa state service in Fedora using:

$ systemctl stop alsa-state.service

					Jaroslav

---
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project; Red Hat, Inc.

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-12-24 19:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-23 11:07 Can not rmmod snd_hda_codec_hdmi Xuebing Wang
2014-12-23 16:21 ` Clemens Ladisch
2014-12-24  9:49   ` Xuebing Wang
2014-12-24  9:57     ` Anssi Hannula
2014-12-24 11:54       ` Xuebing Wang
2014-12-24 12:28         ` Takashi Sakamoto
2014-12-24 13:07           ` Xuebing Wang
2014-12-24 13:21             ` Takashi Sakamoto
2014-12-24 13:27               ` Xuebing Wang
2014-12-24 19:02                 ` Jaroslav Kysela

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.