mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Denys Vlasenko <vda.linux@googlemail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: sound: -EPERM on first mplayer invocation
Date: Mon, 03 Aug 2009 08:55:42 +0200	[thread overview]
Message-ID: <s5hr5vt8jyp.wl%tiwai@suse.de> (raw)
In-Reply-To: <200908022336.48898.vda.linux@googlemail.com>

At Sun, 2 Aug 2009 23:36:48 +0200,
Denys Vlasenko wrote:
> 
> Hi,
> 
> For a long time I observe the following nuisance:
> when I run mplayer for the very first time after boot,
> I can't adjust the volume. mplayer spews this to stderr:
> 
> alsa-control: error setting left channel, Operation not permitted
> 
> This happens even if I login as root and run mplayer as root.
> 
> I tracked it down to snd_ctl_elem_write in sound/core/control.c
> 
> static int snd_ctl_elem_write(struct snd_card *card, struct snd_ctl_file *file,
>                               struct snd_ctl_elem_value *control)
> {
>         struct snd_kcontrol *kctl;
>         struct snd_kcontrol_volatile *vd;
>         unsigned int index_offset;
>         int result;
> 
>         down_read(&card->controls_rwsem);
>         kctl = snd_ctl_find_id(card, &control->id);
>         if (kctl == NULL) {
>                 result = -ENOENT;
>         } else {
>                 index_offset = snd_ctl_get_ioff(kctl, &control->id);
>                 vd = &kctl->vd[index_offset];
>                 if (!(vd->access & SNDRV_CTL_ELEM_ACCESS_WRITE) ||
>                     kctl->put == NULL ||
>                     (file && vd->owner && vd->owner != file)) {
>  printk("EPERM:\n");
>  printk("vd->access & SNDRV_CTL_ELEM_ACCESS_WRITE:%x\n", vd->access & SNDRV_CTL_ELEM_ACCESS_WRITE);
>  printk("kctl->put:%p\n", kctl->put);
>  printk("file:%p vd->owner:%p\n", file, vd->owner);
>                         result = -EPERM;
>                 } else {
> 
> The above printk triggers and prints:
> 
> EPERM:
> vd->access & SNDRV_CTL_ELEM_ACCESS_WRITE:2
> kctl->put:ffffffffa009e8de
> file:ffff88007c56a5c0 vd->owner:ffff88007bc34740
> 
> Thus, vd->owner != file.
> 
> As I said, it only happens on very first run of mplayer,
> and it isn't a recent change, I think I saw it at least
> for one year with different kernels.
> 
> Takashi, any idea what might be happening here?
> How can I help you more with tracking it down?

This implies that another process (e.g. a sound daemon like PA)
already opened the device and locked this specific control element.
If so, this is no bug but the right behavior.
Check "fuser /dev/snd/controlC*".


Takashi

  reply	other threads:[~2009-08-03  6:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-02 21:36 Denys Vlasenko
2009-08-03  6:55 ` Takashi Iwai [this message]
2009-08-04  9:01   ` Denys Vlasenko
2009-08-04  9:16     ` Takashi Iwai
2009-08-05  2:32       ` Denys Vlasenko
2009-08-05  5:37         ` Takashi Iwai
2009-08-05  5:41           ` Takashi Iwai
2009-08-05  8:50             ` Clemens Ladisch
2009-08-05 22:00             ` Denys Vlasenko

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=s5hr5vt8jyp.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vda.linux@googlemail.com \
    /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

all inboxes | Powered by JetHome®