From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Devin Heitmueller <dheitmueller@kernellabs.com>
Cc: Andy Walls <awalls@md.metrocast.net>,
Hans Verkuil <hverkuil@xs4all.nl>,
Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [RFCv1 PATCH 7/7] tuner-core: s_tuner should not change tuner mode.
Date: Sun, 12 Jun 2011 11:28:31 -0300 [thread overview]
Message-ID: <4DF4CD0F.3030909@redhat.com> (raw)
In-Reply-To: <BANLkTiktMGy_7e0VDs=VDy0rb1rZwk9rXw@mail.gmail.com>
Em 12-06-2011 10:57, Devin Heitmueller escreveu:
> On Sun, Jun 12, 2011 at 9:44 AM, Andy Walls <awalls@md.metrocast.net> wrote:
>> BTW, the cx18-alsa module annoys me as a developer. PulseAudio holds
>> the device nodes open, pinning the cx18-alsa and cx18 modules in kernel.
>> When killed, PulseAudio respawns rapidly and reopens the nodes.
>> Unloading cx18 for development purposes is a real pain when the
>> cx18-alsa module exists.
>
> We've talked about this before, but something just feels wrong about
> this. I don't have this problem with other drivers that provide an
> "-alsa" module. For example, my ngene tree has four ALSA PCM devices
> and 16 mixer controls, yet PulseAudio doesn't keep the module in use.
>
> The more I think about this, the more I suspect this is just some sort
> of subtle bug in the cx18 ALSA driver where some resource is not being
> freed.
It is not just cx18 that have this trouble. All drivers under media/video
with *-alsa have this issue. Also, all sound drivers suffer from the same
issue:
# lsmod|grep snd_hda
snd_hda_codec_analog 84955 1
snd_hda_intel 25261 2
See: pulseaudio keep the device opened, so dev refcount were incremented.
# rmmod snd_hda_codec_analog snd_hda_intel
ERROR: Module snd_hda_codec_analog is in use
ERROR: Module snd_hda_intel is in use
The same happens, for example, with em28xx with snd-usb-audio:
# lsmod |grep snd
snd_usb_audio 91303 1
# rmmod snd-usb-audio
ERROR: Module snd_usb_audio is in use
What happens is that open() increments the device refcount.
Maybe the ngene has some trick for allowing it, or PulseAudio has some logic to
detect ngene (or otherwise it fails to open ngene audio nodes).
It may have some dirty ways to trick PulseAudio, for example returning -ENODEV if
the process name is pulseaudio, but I can't think on a proper kernel solution
for it.
The proper solution is to fix PulseAudio.
Cheers,
Mauro
next prev parent reply other threads:[~2011-06-12 14:28 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-11 13:34 [RFCv1 PATCH 0/7] tuner-core: fix g_freq/s_std and g/s_tuner Hans Verkuil
2011-06-11 13:34 ` [RFCv1 PATCH 1/7] tuner-core: rename check_mode to supported_mode Hans Verkuil
2011-06-11 13:34 ` [RFCv1 PATCH 2/7] tuner-core: change return type of set_mode_freq to bool Hans Verkuil
2011-06-11 13:34 ` [RFCv1 PATCH 3/7] tuner-core: fix g_frequency support Hans Verkuil
2011-06-11 13:44 ` Mauro Carvalho Chehab
2011-06-11 13:53 ` Hans Verkuil
2011-06-11 13:34 ` [RFCv1 PATCH 4/7] tuner-core: simplify the standard fixup Hans Verkuil
2011-06-11 13:34 ` [RFCv1 PATCH 5/7] tuner-core: fix s_std and s_tuner Hans Verkuil
2011-06-11 13:34 ` [RFCv1 PATCH 6/7] tuner-core: fix g_tuner Hans Verkuil
2011-06-11 13:48 ` Mauro Carvalho Chehab
2011-06-11 13:34 ` [RFCv1 PATCH 7/7] tuner-core: s_tuner should not change tuner mode Hans Verkuil
2011-06-11 13:54 ` Mauro Carvalho Chehab
2011-06-11 17:27 ` Hans Verkuil
2011-06-11 18:21 ` Andy Walls
2011-06-11 19:04 ` Mauro Carvalho Chehab
2011-06-12 11:36 ` Hans Verkuil
2011-06-12 11:59 ` Mauro Carvalho Chehab
2011-06-12 12:13 ` Mauro Carvalho Chehab
2011-06-12 12:30 ` Hans Verkuil
2011-06-12 12:53 ` Andy Walls
2011-06-12 13:23 ` Hans Verkuil
2011-06-12 13:44 ` Andy Walls
2011-06-12 13:57 ` Devin Heitmueller
2011-06-12 14:28 ` Mauro Carvalho Chehab [this message]
2011-06-12 15:34 ` Andy Walls
2011-06-12 17:38 ` Mauro Carvalho Chehab
2011-06-12 14:06 ` Hans Verkuil
2011-06-12 12:23 ` Hans Verkuil
2011-06-12 14:11 ` Mauro Carvalho Chehab
2011-06-12 14:33 ` Hans Verkuil
2011-06-12 15:29 ` Andy Walls
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DF4CD0F.3030909@redhat.com \
--to=mchehab@redhat.com \
--cc=awalls@md.metrocast.net \
--cc=dheitmueller@kernellabs.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox