module snd-atiixp issue with suspend/hibernate/resume
I have a Compaq V2000 laptop with the ATI IXP chipset and make use of the snd-atiixp module. The laptop needs to have the ac97_quirk option set to 7 to enable the mute LED. After setting this option in the /etc/modprobe.d/options.conf file, the mute LED works after a reboot. However, after a resume from suspend or hibernate, the mute LED does not work. The alsa-info.sh script reports that the quirk is still set with 7. At this point a reboot will NOT fix the problem. The only way to fix it is to remove and reinsert the module with modprobe.
This is on a fresh Ubuntu 9.04 install. Any ideas? I wasn't sure if this should be reported here or on the kernel list. I saw a similar issue with the ac97_quirk on the kernel list and they were referred here. I'm a software developer, so I'd be willing to try ideas/possible solutions if you have them.
Thanks,
Ryan
Quoted 9 lines · Ryan Dunn
I have a Compaq V2000 laptop with the ATI IXP chipset and make use of the snd-atiixp module. The laptop needs to have the
ac97_quirkoption set to 7 to enable the mute LED. After setting this option in the/etc/modprobe.d/options.conffile, the mute LED works after a reboot. However, after a resume from suspend or hibernate, the mute LED does not work. Thealsa-info.shscript reports that the quirk is still set with 7. At this point a reboot will NOT fix the problem. The only way to fix it is to remove and reinsert the module with modprobe.
Quoted 5 lines
This is on a fresh Ubuntu 9.04 install. Any ideas? I wasn't sure if this should be reported here or on the kernel list. I saw a similar issue with the
ac97_quirkon the kernel list and they were referred here. I'm a software developer, so I'd be willing to try ideas/possible solutions if you have them.
Get the Ubuntu source code for the package that owns that ALSA driver, find the place in the driver's initialization code where ac97_quirk=7 is handled, then check the driver's suspend and resume callbacks and make sure the suspend callback is correctly saving the LED state and that the resume callback is re-initializing the LED from the saved state in the same way the init code does. grep and printk() are your friends ;-)
HTH,
Lee
Thanks Lee,
I grabbed the kernel source from the repos and started perusing the code. It looks like when the module is installed, the call chain starts in atiixp.c and moves into ac97/ac97_codec.c via a call to snd_ac97_tune_hardware() which ultimately twiddles a bit in the AC97_POWERDOWN register. I'm not sure yet if the suspend method properly saves this register on suspend or not; or if the same call chain needs to be repeated on a resume. I appreciate your quick and relevant answer. When I get time, I'll start adding some debug printouts to try this out.
Also, the struct ac97_quirk ac97_quirks[] array has a couple of entries in it currently (in the atiixp.c file). How do I get the subvender/subdevice id's for my system (I didn't seem to have luck with lspci, unless I'm not looking in the right fields)? Would it be possible to edit the driver so that an explict module option would not be needed on my hardware?
Thanks,
Ryan
Quoted 35 lines · Lee Revell
Quoted 2 lines · Ryan Dunn
I have a Compaq V2000 laptop with the ATI IXP chipset and make use of the snd-atiixp module. The laptop needs to have the
ac97_quirkoption set to7
Quoted 4 lines
to enable the mute LED. After setting this option in the
/etc/modprobe.d/options.conffile, the mute LED works after a reboot. However, after a resume from suspend or hibernate, the mute LED does not work. Thealsa-info.shscript reports that the quirk is still set with7.
Quoted 1 line
At this point a reboot will NOT fix the problem. The only way to fix it
is
Quoted 3 lines
to remove and reinsert the module with modprobe.
This is on a fresh Ubuntu 9.04 install. Any ideas? I wasn't sure if
this
Quoted 1 line
should be reported here or on the kernel list. I saw a similar issue
with
Quoted 2 lines
the
ac97_quirkon the kernel list and they were referred here. I'm a software developer, so I'd be willing to try ideas/possible solutions ifyou
Quoted 1 line
have them.
Get the Ubuntu source code for the package that owns that ALSA driver, find the place in the driver's initialization code where ac97_quirk=7 is handled, then check the driver's suspend and resume callbacks and make sure the suspend callback is correctly saving the LED state and that the resume callback is re-initializing the LED from the saved state in the same way the init code does. grep and
printk()are your friends ;-)HTH,
Lee
At Thu, 30 Apr 2009 00:43:02 -0400,
Quoted 8 lines · Ryan Dunn
Thanks Lee,
I grabbed the kernel source from the repos and started perusing the code. It looks like when the module is installed, the call chain starts in
atiixp.cand moves intoac97/ac97_codec.cvia a call tosnd_ac97_tune_hardware()which ultimately twiddles a bit in theAC97_POWERDOWNregister. I'm not sure yet if the suspend method properly saves this register on suspend or not;
It should. snd_ac97_resume() writes the cached value. Check /proc/asound/card0/codec97#0/ac97#*+regs files before and after suspend. You can change the codec register value directly via proc file, e.g.
# echo 0x12 0x1234 > /proc/asound/card0/codec97#0/ac97#0-0+regs (only when you build with the debug option).
The bit 0x8000 of the power-down register should correspond to LED.
Takashi
Quoted 53 lines
or if the
same call chain needs to be repeated on a resume. I appreciate your quick and relevant answer. When I get time, I'll start adding some debug printouts to try this out.Also, the struct
ac97_quirkac97_quirks[] array has a couple of entries in it currently (in theatiixp.cfile). How do I get the subvender/subdevice id's for my system (I didn't seem to have luck with lspci, unless I'm not looking in the right fields)? Would it be possible to edit the driver so that an explict module option would not be needed on my hardware?Thanks,
RyanOn Wed, Apr 29, 2009 at 10:42 PM, Lee Revell <[email protected]> wrote:
On Wed, Apr 29, 2009 at 12:06 AM, Ryan Dunn <[email protected]> wrote:
> I have a Compaq V2000 laptop with the ATI IXP chipset and make use of the
> snd-atiixp module. The laptop needs to have theac97_quirkoption set to 7
> to enable the mute LED. After setting this option in the
>/etc/modprobe.d/options.conffile, the mute LED works after a reboot. > However, after a resume from suspend or hibernate, the mute LED does not > work. Thealsa-info.shscript reports that the quirk is still set with 7.
> At this point a reboot will NOT fix the problem. The only way to fix it is
> to remove and reinsert the module with modprobe.
>
> This is on a fresh Ubuntu 9.04 install. Any ideas? I wasn't sure if this
> should be reported here or on the kernel list. I saw a similar issue with
> theac97_quirkon the kernel list and they were referred here. I'm a > software developer, so I'd be willing to try ideas/possible solutions if you
> have them.Get the Ubuntu source code for the package that owns that ALSA driver, find the place in the driver's initialization code where ac97_quirk=7 is handled, then check the driver's suspend and resume callbacks and make sure the suspend callback is correctly saving the LED state and that the resume callback is re-initializing the LED from the saved state in the same way the init code does. grep and
printk()are your friends ;-)HTH,
Lee
Thanks Takashi,
I did a bit more testing last night. The LED does work after a reboot (I don't know what I was doing that I thought it didn't). It also retains state after a reboot if I muted it before the reboot. One thing I noticed, if I have it muted when I suspend, on resume, it looks like the mute led flashes back on for a split second, then turns off. Maybe the resume code is overwriting the register? I'll start digging through that code tonight.
Ryan
Quoted 101 lines · Takashi Iwai
At Thu, 30 Apr 2009 00:43:02 -0400,
Quoted 4 lines · Ryan Dunn
Thanks Lee,
I grabbed the kernel source from the repos and started perusing the
code. It
Quoted 1 line
looks like when the module is installed, the call chain starts in
atiixp.candQuoted 2 lines
moves into
ac97/ac97_codec.cvia a call tosnd_ac97_tune_hardware()which ultimately twiddles a bit in theAC97_POWERDOWNregister. I'm not sureyet if
Quoted 1 line
the suspend method properly saves this register on suspend or not;
It should.
snd_ac97_resume()writes the cached value. Check /proc/asound/card0/codec97#0/ac97#*+regs files before and after suspend. You can change the codec register value directly via proc file, e.g.# echo 0x12 0x1234 > /proc/asound/card0/codec97#0/ac97#0-0+regs (only when you build with the debug option).The bit
0x8000of the power-down register should correspond to LED.Takashi
Quoted 2 lines
or if the
same call chain needs to be repeated on a resume. I appreciate yourquick and
Quoted 1 line
relevant answer. When I get time, I'll start adding some debug printouts
to
Quoted 3 lines
try this out.
Also, the struct
ac97_quirkac97_quirks[] array has a couple of entriesin it
Quoted 1 line
currently (in the
atiixp.cfile). How do I get the subvender/subdeviceid's
Quoted 1 line
for my system (I didn't seem to have luck with lspci, unless I'm not
looking
Quoted 7 lines
in the right fields)? Would it be possible to edit the driver so that an explict module option would not be needed on my hardware?
Thanks,
RyanOn Wed, Apr 29, 2009 at 10:42 PM, Lee Revell <[email protected]>
Quoted 4 lines · wrote:
On Wed, Apr 29, 2009 at 12:06 AM, Ryan Dunn <[email protected]> wrote:
> I have a Compaq V2000 laptop with the ATI IXP chipset and make useof
Quoted 2 lines
the
> snd-atiixp module. The laptop needs to have theac97_quirkoptionset
Quoted 3 lines
to 7
> to enable the mute LED. After setting this option in the >/etc/modprobe.d/options.conffile, the mute LED works after areboot.
Quoted 1 line
Quoted 1 line
However, after a resume from suspend or hibernate, the mute LED
does not
Quoted 1 line
Quoted 1 line
work. The
alsa-info.shscript reports that the quirk is still setwith
Quoted 2 lines
7.
> At this point a reboot will NOT fix the problem. The only way tofix it
Quoted 4 lines
is
> to remove and reinsert the module with modprobe.
>
> This is on a fresh Ubuntu 9.04 install. Any ideas? I wasn't sureif
Quoted 2 lines
this
> should be reported here or on the kernel list. I saw a similarissue
Quoted 2 lines
with
> theac97_quirkon the kernel list and they were referred here. I'ma
Quoted 1 line
Quoted 1 line
software developer, so I'd be willing to try ideas/possible
solutions if
Quoted 4 lines
you
> have them.Get the Ubuntu source code for the package that owns that ALSA
driver,
Quoted 7 lines
find the place in the driver's initialization code where ac97_quirk=7 is handled, then check the driver's suspend and resume callbacks and make sure the suspend callback is correctly saving the LED state and that the resume callback is re-initializing the LED from the saved state in the same way the init code does. grep and
printk()are your friends ;-)Quoted 5 lines
HTH,
Lee
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Here is a diff of the registers before & after resume:
diff regs_before_suspend.txt regs_after_suspend.txt 58c58
< 0:72 = 0000
---
Quoted 1 line
0:72 = 5000
In the ac97_codec.h file, AC97_POWERDOWN = 0x26. Does this respond to 0:26 in the regs file? If so, it doesn't appear that bit 0x8000 is ever set, but the mute LED works.
Quoted 122 lines · Ryan Dunn
Thanks Takashi,
I did a bit more testing last night. The LED does work after a reboot (I don't know what I was doing that I thought it didn't). It also retains state after a reboot if I muted it before the reboot. One thing I noticed, if I have it muted when I suspend, on resume, it looks like the mute led flashes back on for a split second, then turns off. Maybe the resume code is overwriting the register? I'll start digging through that code tonight.
Ryan
Quoted 106 lines · Takashi Iwai
At Thu, 30 Apr 2009 00:43:02 -0400,
Quoted 4 lines · Ryan Dunn
Thanks Lee,
I grabbed the kernel source from the repos and started perusing the
code. It
Quoted 1 line
looks like when the module is installed, the call chain starts in
atiixp.candQuoted 1 line
moves into
ac97/ac97_codec.cvia a call tosnd_ac97_tune_hardware()which
Quoted 1 line
ultimately twiddles a bit in the
AC97_POWERDOWNregister. I'm not sureyet if
Quoted 1 line
the suspend method properly saves this register on suspend or not;
It should.
snd_ac97_resume()writes the cached value. Check /proc/asound/card0/codec97#0/ac97#*+regs files before and after suspend. You can change the codec register value directly via proc file, e.g.# echo 0x12 0x1234 > /proc/asound/card0/codec97#0/ac97#0-0+regs (only when you build with the debug option).The bit
0x8000of the power-down register should correspond to LED.Takashi
Quoted 2 lines
or if the
same call chain needs to be repeated on a resume. I appreciate yourquick and
Quoted 1 line
relevant answer. When I get time, I'll start adding some debug
printouts to
Quoted 3 lines
try this out.
Also, the struct
ac97_quirkac97_quirks[] array has a couple of entriesin it
Quoted 1 line
currently (in the
atiixp.cfile). How do I get the subvender/subdeviceid's
Quoted 1 line
for my system (I didn't seem to have luck with lspci, unless I'm not
looking
Quoted 1 line
in the right fields)? Would it be possible to edit the driver so that
an
Quoted 6 lines
explict module option would not be needed on my hardware?
Thanks,
RyanOn Wed, Apr 29, 2009 at 10:42 PM, Lee Revell <[email protected]>
Quoted 5 lines · wrote:
On Wed, Apr 29, 2009 at 12:06 AM, Ryan Dunn <[email protected]
wrote:
> I have a Compaq V2000 laptop with the ATI IXP chipset and make useof
Quoted 2 lines
the
> snd-atiixp module. The laptop needs to have theac97_quirkoptionset
Quoted 3 lines
to 7
> to enable the mute LED. After setting this option in the >/etc/modprobe.d/options.conffile, the mute LED works after areboot.
Quoted 1 line
Quoted 1 line
However, after a resume from suspend or hibernate, the mute LED
does not
Quoted 1 line
Quoted 1 line
work. The
alsa-info.shscript reports that the quirk is still setwith
Quoted 2 lines
7.
> At this point a reboot will NOT fix the problem. The only way tofix it
Quoted 4 lines
is
> to remove and reinsert the module with modprobe.
>
> This is on a fresh Ubuntu 9.04 install. Any ideas? I wasn't sureif
Quoted 2 lines
this
> should be reported here or on the kernel list. I saw a similarissue
Quoted 2 lines
with
> theac97_quirkon the kernel list and they were referred here.I'm a
Quoted 1 line
Quoted 1 line
software developer, so I'd be willing to try ideas/possible
solutions if
Quoted 4 lines
you
> have them.Get the Ubuntu source code for the package that owns that ALSA
driver,
Quoted 1 line
find the place in the driver's initialization code where
ac97_quirk=7
Quoted 4 lines
is handled, then check the driver's suspend and resume callbacks and make sure the suspend callback is correctly saving the LED state and that the resume callback is re-initializing the LED from the saved state in the same way the init code does. grep and
printk()areyour
Quoted 7 lines
friends ;-) HTH, Lee_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
I apologize for the list spam. I didn't realize that this bit is only set when the led is on. So with that here are diffs of the regs with and without mute enabled, before and after suspend.
Before suspend:
diff regs_w-quirk.txt regs_w-quirk+mute.txt
2c2
< 0:02 = 1e1e
---
Quoted 1 line
0:02 = 9e1e
20c20
< 0:26 = 000f
---
Quoted 1 line
0:26 = 800f
After resume:
diff regs_w-quirk_after_resume.txt regs_w-quirk_after_resume+mute.txt 2c2
< 0:02 = 1e1e
---
Quoted 1 line
0:02 = 9e1e
20c20
< 0:26 = 000f
---
Quoted 1 line
0:26 = 800f
So it looks as if the registers are all ok after a resume, but the LED doesn't turn back on.
Ryan
Quoted 139 lines · Ryan Dunn
Here is a diff of the registers before & after resume:
diff regs_before_suspend.txt regs_after_suspend.txt 58c58
< 0:72 = 0000
---Quoted 1 line
0:72 = 5000
In the
ac97_codec.hfile,AC97_POWERDOWN=0x26. Does this respond to 0:26 in the regs file? If so, it doesn't appear that bit0x8000is ever set, but the mute LED works.Quoted 124 lines · Ryan Dunn
Thanks Takashi,
I did a bit more testing last night. The LED does work after a reboot (I don't know what I was doing that I thought it didn't). It also retains state after a reboot if I muted it before the reboot. One thing I noticed, if I have it muted when I suspend, on resume, it looks like the mute led flashes back on for a split second, then turns off. Maybe the resume code is overwriting the register? I'll start digging through that code tonight.
Ryan
Quoted 108 lines · Takashi Iwai
At Thu, 30 Apr 2009 00:43:02 -0400,
Quoted 4 lines · Ryan Dunn
Thanks Lee,
I grabbed the kernel source from the repos and started perusing the
code. It
Quoted 1 line
looks like when the module is installed, the call chain starts in
atiixp.candQuoted 1 line
moves into
ac97/ac97_codec.cvia a call tosnd_ac97_tune_hardware()which
Quoted 1 line
ultimately twiddles a bit in the
AC97_POWERDOWNregister. I'm not sureyet if
Quoted 1 line
the suspend method properly saves this register on suspend or not;
It should.
snd_ac97_resume()writes the cached value. Check /proc/asound/card0/codec97#0/ac97#*+regs files before and after suspend. You can change the codec register value directly via proc file, e.g.# echo 0x12 0x1234 > /proc/asound/card0/codec97#0/ac97#0-0+regs (only when you build with the debug option).The bit
0x8000of the power-down register should correspond to LED.Takashi
Quoted 2 lines
or if the
same call chain needs to be repeated on a resume. I appreciate yourquick and
Quoted 1 line
relevant answer. When I get time, I'll start adding some debug
printouts to
Quoted 3 lines
try this out.
Also, the struct
ac97_quirkac97_quirks[] array has a couple of entriesin it
Quoted 1 line
currently (in the
atiixp.cfile). How do I get the subvender/subdeviceid's
Quoted 1 line
for my system (I didn't seem to have luck with lspci, unless I'm not
looking
Quoted 1 line
in the right fields)? Would it be possible to edit the driver so that
an
Quoted 6 lines
explict module option would not be needed on my hardware?
Thanks,
RyanOn Wed, Apr 29, 2009 at 10:42 PM, Lee Revell <[email protected]>
Quoted 2 lines · wrote:
On Wed, Apr 29, 2009 at 12:06 AM, Ryan Dunn <oryandunn.ml@gmail.com>
Quoted 2 lines
wrote:
> I have a Compaq V2000 laptop with the ATI IXP chipset and makeuse of
Quoted 2 lines
the
> snd-atiixp module. The laptop needs to have theac97_quirkoption set
Quoted 3 lines
to 7
> to enable the mute LED. After setting this option in the >/etc/modprobe.d/options.conffile, the mute LED works after areboot.
Quoted 1 line
Quoted 1 line
However, after a resume from suspend or hibernate, the mute LED
does not
Quoted 1 line
Quoted 1 line
work. The
alsa-info.shscript reports that the quirk is stillset with
Quoted 2 lines
7.
> At this point a reboot will NOT fix the problem. The only way tofix it
Quoted 4 lines
is
> to remove and reinsert the module with modprobe.
>
> This is on a fresh Ubuntu 9.04 install. Any ideas? I wasn'tsure if
Quoted 2 lines
this
> should be reported here or on the kernel list. I saw a similarissue
Quoted 2 lines
with
> theac97_quirkon the kernel list and they were referred here.I'm a
Quoted 1 line
Quoted 1 line
software developer, so I'd be willing to try ideas/possible
solutions if
Quoted 4 lines
you
> have them.Get the Ubuntu source code for the package that owns that ALSA
driver,
Quoted 1 line
find the place in the driver's initialization code where
ac97_quirk=7
Quoted 1 line
is handled, then check the driver's suspend and resume callbacks
and
Quoted 1 line
make sure the suspend callback is correctly saving the LED state
and
Quoted 2 lines
that the resume callback is re-initializing the LED from the saved state in the same way the init code does. grep and
printk()areyour
Quoted 7 lines
friends ;-) HTH, Lee_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
At Thu, 30 Apr 2009 22:24:35 -0400,
Quoted 20 lines · Ryan Dunn
I apologize for the list spam. I didn't realize that this bit is only set when the led is on. So with that here are diffs of the regs with and without mute enabled, before and after suspend.
Before suspend:
diff regs_w-quirk.txt regs_w-quirk+mute.txt
2c2
< 0:02 = 1e1e
---Quoted 1 line
0:02 = 9e1e
20c20
< 0:26 = 000f
---Quoted 1 line
0:26 = 800f
After resume:
diff regs_w-quirk_after_resume.txt regs_w-quirk_after_resume+mute.txt 2c2
< 0:02 = 1e1e
---
Quoted 8 lines
Quoted 1 line
0:02 = 9e1e
20c20
< 0:26 = 000f
---Quoted 1 line
0:26 = 800f
So it looks as if the registers are all ok after a resume, but the LED doesn't turn back on.
Then I'd say it's rather a BIOS problem.
Takashi
Thanks Takashi, I appreciate your help so far. I would normally agree with you that it is a BIOS issue, however, the machine is a dualboot with WinXP, where the mute LED works properly after a resume. Do you have any other suggestions on where the issue may be? I hate to keep bugging the list for such a small issue, but I'm not familiar with the code at all. When I get more free time, I'll try to trace through the resume path to see if I can find anything. How does the driver actually toggle the LED? Is the register a physical register on the card that the hardware reads? Or does the code do something else to toggle the LED?
Ryan
Quoted 39 lines · Takashi Iwai
At Thu, 30 Apr 2009 22:24:35 -0400,
Quoted 2 lines · Ryan Dunn
I apologize for the list spam. I didn't realize that this bit is only
set
Quoted 1 line
when the led is on. So with that here are diffs of the regs with and
without
Quoted 17 lines
mute enabled, before and after suspend.
Before suspend:
diff regs_w-quirk.txt regs_w-quirk+mute.txt
2c2
< 0:02 = 1e1e
---Quoted 1 line
0:02 = 9e1e
20c20
< 0:26 = 000f
---Quoted 1 line
0:26 = 800f
After resume:
diff regs_w-quirk_after_resume.txt regs_w-quirk_after_resume+mute.txt 2c2
< 0:02 = 1e1e
---Quoted 7 lines
Quoted 1 line
0:02 = 9e1e
20c20
< 0:26 = 000f
---Quoted 1 line
0:26 = 800f
So it looks as if the registers are all ok after a resume, but the LED
doesn't
Quoted 1 line
turn back on.
Then I'd say it's rather a BIOS problem.
Takashi
At Mon, 4 May 2009 20:21:24 -0400,
Quoted 10 lines · Ryan Dunn
Thanks Takashi, I appreciate your help so far. I would normally agree with you that it is a BIOS issue, however, the machine is a dualboot with WinXP, where the mute LED works properly after a resume. Do you have any other suggestions on where the issue may be? I hate to keep bugging the list for such a small issue, but I'm not familiar with the code at all. When I get more free time, I'll try to trace through the resume path to see if I can find anything. How does the driver actually toggle the LED? Is the register a physical register on the card that the hardware reads? Or does the code do something else to toggle the LED?
To be sure, you can toggle the bit of register 0x26 manually by writing the proc file. If it doesn't work, it's a BIOS issue indeed.
However, there might be some fix / workaround in the suspend part. So, after confirming that the register change doesn't work, report it on either LKML or kernel bugzilla.
Takashi
Quoted 44 lines
Ryan
On Mon, May 4, 2009 at 3:02 AM, Takashi Iwai <[email protected]> wrote:
At Thu, 30 Apr 2009 22:24:35 -0400, Ryan Dunn wrote: > > I apologize for the list spam. I didn't realize that this bit is only set > when the led is on. So with that here are diffs of the regs with and without > mute enabled, before and after suspend. > Before suspend: > diff regs_w-quirk.txt regs_w-quirk+mute.txt > 2c2 > < 0:02 = 1e1e > --- > > 0:02 = 9e1e > 20c20 > < 0:26 = 000f > --- > > 0:26 = 800f > > After resume: > diff regs_w-quirk_after_resume.txt regs_w-quirk_after_resume+mute.txt > 2c2 > < 0:02 = 1e1e > --- > > 0:02 = 9e1e > 20c20 > < 0:26 = 000f > --- > > 0:26 = 800f > > So it looks as if the registers are all ok after a resume, but the LED doesn't > turn back on. Then I'd say it's rather a BIOS problem. Takashi