* calling snd_ctl_notify from mixer ctl_put
@ 2012-10-11 19:29 Ondrej Zary
2012-10-12 6:03 ` Clemens Ladisch
0 siblings, 1 reply; 4+ messages in thread
From: Ondrej Zary @ 2012-10-11 19:29 UTC (permalink / raw)
To: alsa-devel; +Cc: Clemens Ladisch
Hello,
I want to enable/disable some mixer controls based on state of another control
(switching between limiter and AGC mode). So I (re)set the
SNDRV_CTL_ELEM_ACCESS_INACTIVE flag in kctl->vd[0].access
and then call snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_INFO, &kctl->id);
Everyting from ctl_put() mixer callback.
When changing the control value in alsamixer, it crashes with:
alsamixer: simple.c:948: snd_mixer_selem_get_enum_item: Assertion
`(elem)->type == SND_MIXER_ELEM_SIMPLE' failed.
When the snd_ctl_notify() call is commented-out, it does not crash.
There is snd_ctl_activate_id() function in sound/core/control.c (not used by
any driver, btw.) which does the same, protected by card->controls_rwsem.
However, it locks up on that semaphore when called from the mixer callback.
Oxygen/Xonar WM8776 driver is doing the same thing - I wonder if I'm doing
something wrong or if that driver crashes alsamixer too?
Is there any way to do this properly?
--
Ondrej Zary
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: calling snd_ctl_notify from mixer ctl_put
2012-10-11 19:29 calling snd_ctl_notify from mixer ctl_put Ondrej Zary
@ 2012-10-12 6:03 ` Clemens Ladisch
2012-10-13 21:23 ` Ondrej Zary
0 siblings, 1 reply; 4+ messages in thread
From: Clemens Ladisch @ 2012-10-12 6:03 UTC (permalink / raw)
To: Ondrej Zary; +Cc: alsa-devel
Ondrej Zary wrote:
> I want to enable/disable some mixer controls based on state of another control
> (switching between limiter and AGC mode). So I (re)set the
> SNDRV_CTL_ELEM_ACCESS_INACTIVE flag in kctl->vd[0].access
> and then call snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_INFO, &kctl->id);
> Everyting from ctl_put() mixer callback.
>
> When changing the control value in alsamixer, it crashes with:
> alsamixer: simple.c:948: snd_mixer_selem_get_enum_item: Assertion
> `(elem)->type == SND_MIXER_ELEM_SIMPLE' failed.
Looks like a bug in alsamixer.
Regards,
Clemens
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: calling snd_ctl_notify from mixer ctl_put
2012-10-12 6:03 ` Clemens Ladisch
@ 2012-10-13 21:23 ` Ondrej Zary
2012-10-21 1:06 ` Raymond Yau
0 siblings, 1 reply; 4+ messages in thread
From: Ondrej Zary @ 2012-10-13 21:23 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: alsa-devel
On Friday 12 October 2012 08:03:13 Clemens Ladisch wrote:
> Ondrej Zary wrote:
> > I want to enable/disable some mixer controls based on state of another
> > control (switching between limiter and AGC mode). So I (re)set the
> > SNDRV_CTL_ELEM_ACCESS_INACTIVE flag in kctl->vd[0].access
> > and then call snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_INFO, &kctl->id);
> > Everyting from ctl_put() mixer callback.
> >
> > When changing the control value in alsamixer, it crashes with:
> > alsamixer: simple.c:948: snd_mixer_selem_get_enum_item: Assertion
> > `(elem)->type == SND_MIXER_ELEM_SIMPLE' failed.
>
> Looks like a bug in alsamixer.
Thanks. I've now tried some other mixers that are present in Debian and most
of them are unusable:
alsamixergui: does not understand ENUM controls
gnome-alsamixer: does not understand ENUM controls
gnome-volume-control: crashes like alsamixer
xfce4-mixer: crashes like alsamixer
kmix (TDE 3.5.13): does not update controls when switching limiter/AGC
kmix (KDE 4): crashes like alsamixer
(other mixers won't even run as they seem to be OSS-only)
But there's one that works fine: QasMixer.
--
Ondrej Zary
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: calling snd_ctl_notify from mixer ctl_put
2012-10-13 21:23 ` Ondrej Zary
@ 2012-10-21 1:06 ` Raymond Yau
0 siblings, 0 replies; 4+ messages in thread
From: Raymond Yau @ 2012-10-21 1:06 UTC (permalink / raw)
To: Ondrej Zary; +Cc: alsa-devel, Clemens Ladisch
2012-10-14 上午5:24 於 "Ondrej Zary" <linux@rainbow-software.org> 寫道:
>
> On Friday 12 October 2012 08:03:13 Clemens Ladisch wrote:
> > Ondrej Zary wrote:
> > > I want to enable/disable some mixer controls based on state of another
> > > control (switching between limiter and AGC mode). So I (re)set the
> > > SNDRV_CTL_ELEM_ACCESS_INACTIVE flag in kctl->vd[0].access
> > > and then call snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_INFO,
&kctl->id);
> > > Everyting from ctl_put() mixer callback.
> > >
> > > When changing the control value in alsamixer, it crashes with:
> > > alsamixer: simple.c:948: snd_mixer_selem_get_enum_item: Assertion
> > > `(elem)->type == SND_MIXER_ELEM_SIMPLE' failed.
> >
> > Looks like a bug in alsamixer.
>
> Thanks. I've now tried some other mixers that are present in Debian and
most
> of them are unusable:
> alsamixergui: does not understand ENUM controls
> gnome-alsamixer: does not understand ENUM controls
> gnome-volume-control: crashes like alsamixer
> xfce4-mixer: crashes like alsamixer
> kmix (TDE 3.5.13): does not update controls when switching limiter/AGC
> kmix (KDE 4): crashes like alsamixer
> (other mixers won't even run as they seem to be OSS-only)
>
> But there's one that works fine: QasMixer.
>
the alsamixer also crash only when "independent headphone" enum of ad1988
is visible in alsamixer when the analog or headphone playback stream
close/open in ubuntu 12.4
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-10-21 1:06 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-11 19:29 calling snd_ctl_notify from mixer ctl_put Ondrej Zary
2012-10-12 6:03 ` Clemens Ladisch
2012-10-13 21:23 ` Ondrej Zary
2012-10-21 1:06 ` Raymond Yau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).