2004-03-31 03:37:21

by Rajsekar

[permalink] [raw]
Subject: alsamixer muting when restoring from suspend.


This I think is not a problem but rather a subtle bug.

Alsamixer by default mutes all channels when loaded.
So when I `swsusp' my comp while I listen to music and restore the music
plays from where it left alright, but the channels are muted.
Is there a way to unmute them implicitly when restoring.

--
M Rajsekar
IIT Madras


2004-04-01 09:33:27

by Takashi Iwai

[permalink] [raw]
Subject: Re: alsamixer muting when restoring from suspend.

At Wed, 31 Mar 2004 08:27:42 +0530,
Rajsekar wrote:
>
>
> This I think is not a problem but rather a subtle bug.
>
> Alsamixer by default mutes all channels when loaded.
> So when I `swsusp' my comp while I listen to music and restore the music
> plays from where it left alright, but the channels are muted.
> Is there a way to unmute them implicitly when restoring.

which driver?
not all drivers have suspend/resume callbacks.


Takashi

2004-04-02 21:33:10

by Pavel Machek

[permalink] [raw]
Subject: Re: alsamixer muting when restoring from suspend.

Hi!

> > This I think is not a problem but rather a subtle bug.
> >
> > Alsamixer by default mutes all channels when loaded.
> > So when I `swsusp' my comp while I listen to music and restore the music
> > plays from where it left alright, but the channels are muted.
> > Is there a way to unmute them implicitly when restoring.
>
> which driver?
> not all drivers have suspend/resume callbacks.

Could it be solved at higher layer, perhaps? Setting volume is common
to all drivers, and some kind of generic_alsa_suspend every alsa
driver would call might help...
Pavel
PS: I know very little about alsa.

--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

2004-04-03 12:05:32

by Takashi Iwai

[permalink] [raw]
Subject: Re: alsamixer muting when restoring from suspend.

At Fri, 2 Apr 2004 22:57:23 +0200,
Pavel Machek wrote:
>
> Hi!
>
> > > This I think is not a problem but rather a subtle bug.
> > >
> > > Alsamixer by default mutes all channels when loaded.
> > > So when I `swsusp' my comp while I listen to music and restore the music
> > > plays from where it left alright, but the channels are muted.
> > > Is there a way to unmute them implicitly when restoring.
> >
> > which driver?
> > not all drivers have suspend/resume callbacks.
>
> Could it be solved at higher layer, perhaps? Setting volume is common
> to all drivers, and some kind of generic_alsa_suspend every alsa
> driver would call might help...

the problem is also that you need to reinitialize the chip after
resume. the restoration of mixer config could be done by calling
"alsactl store" at the suspend and "alsactl restore" at the resume in
the user space. can apmd work for such a purpose even for software
suspend?


Takashi

2004-04-03 15:22:44

by Pavel Machek

[permalink] [raw]
Subject: Re: alsamixer muting when restoring from suspend.

Hi!

> > > > This I think is not a problem but rather a subtle bug.
> > > >
> > > > Alsamixer by default mutes all channels when loaded.
> > > > So when I `swsusp' my comp while I listen to music and restore the music
> > > > plays from where it left alright, but the channels are muted.
> > > > Is there a way to unmute them implicitly when restoring.
> > >
> > > which driver?
> > > not all drivers have suspend/resume callbacks.
> >
> > Could it be solved at higher layer, perhaps? Setting volume is common
> > to all drivers, and some kind of generic_alsa_suspend every alsa
> > driver would call might help...
>
> the problem is also that you need to reinitialize the chip after
> resume. the restoration of mixer config could be done by calling
> "alsactl store" at the suspend and "alsactl restore" at the resume in
> the user space. can apmd work for such a purpose even for software
> suspend?

Userspace should not be involved in suspend/resume. Having in-kernel
equivalent of alsactl store / alsactl restore might help alsa driver
authors... And might be enough for suspend-to-disk to +/- work. (Well,
unless sound was playing when user requested suspend, that one needs
proper support).

Pavel
--
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]