No Sound after Resume on some HP Laptops

Bug #151111 reported by LinuxBladeGuy
30
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Linux
Expired
Medium
alsa-driver (Ubuntu)
Fix Released
Low
Daniel T Chen
linux (Ubuntu)
Invalid
Undecided
Unassigned
linux-source-2.6.22 (Ubuntu)
Won't Fix
Undecided
Unassigned
linux-ubuntu-modules-2.6.24 (Ubuntu)
Fix Released
Medium
Stefan Bader

Bug Description

Binary package hint: linux-source-2.6.22

This bug has been around for the past two Ubuntu versions (Feisty, Gutsy). It was fixed for a while but came back again...

The problem:

Sound on at least these laptop models

HP Compaq nc6220
HP Compaq nw8240

works fine before suspend, but after resume the internal speakers do not work. The headphone jack still functions, volume controls, etc all work fine but the internal speakers won't work no matter what. Someone else has done some investigation and discovered that the power to the built-in audio amplifier is not on after resume. This link describes the problem in detail:

http://hpwiki.cactii.net/hpwiki/nw8240

Also contains a fix - apparently this started happening after a patch in 2.6.18 (which explains why it affects Feisty too, but not Edgy)

Revision history for this message
LinuxBladeGuy (spam-nashira) wrote :

Some more info and a couple of comments:

- This bug is specific to HP/Compaq laptops - if another similar seeming bug is described that affects OTHER brands it is NOT the same bug
- Restarting things like alsa, etc have no impact since the whole sound subsystem is "working", there's just no power to the amplifier

Apparently the patch that broke things is:

--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -2470,7 +2470,10 @@ static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state)
        }
        pci_disable_device(pci);
        pci_save_state(pci);
- pci_set_power_state(pci, pci_choose_state(pci, state));
+ /* The call below may disable built-in speaker on some laptops
+ * after S2RAM. So, don't touch it.
+ */
+ /* pci_set_power_state(pci, pci_choose_state(pci, state)); */
        return 0;
 }

Un-aplying this patch supposedly fixes things....

Revision history for this message
LinuxBladeGuy (spam-nashira) wrote :
Revision history for this message
LinuxBladeGuy (spam-nashira) wrote :
Revision history for this message
LinuxBladeGuy (spam-nashira) wrote :

Confirmed that reversing the above patch fixes the issue on an nc6220.

Revision history for this message
bojo42 (bojo42) wrote :

This bug has survived from Feisty https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.15/+bug/21574.

Fixing is too hard for newbies! Could this be included in the next kernel update?

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Care to open an upstream bug report at http://bugzilla.kernel.org. It is a lot of extra work for the Ubuntu kernel team to maintain out of tree patches. As such they require evidence of upstream submission before considering to maintain community patches locally. However, reading the comment in the code: "The call below may disable built-in speaker on some laptops after S2RAM. So, don't touch it.", it would seem that enabling this for you will cause regressions for others :(

Changed in linux-source-2.6.22:
status: New → Incomplete
Revision history for this message
Ewen McNeill (ewen) wrote :

I can confirm that on a HP NC6220 after resume with the -generic Ubuntu Gutsy kernel (2.6.22-14.47) the internal speakers are mute (but playback to external speakers and/or headphones is fine).

After reverting the patch mentioned earlier in this bug, at comment:

https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.22/+bug/151111/comments/1

the internal speakers work after suspend to RAM and resume (in fact the sound continues playing even before the screen is reset).

Looking at the line that is re-enabled by reverting that patch, it appears that on the HP NC6220 the internal amplifier does not get powered on again unless the sound card is powered off at suspend time (without that it appears that whatever turns the power to the amplifier back on again doesn't get run when the sound card is powered up again in the resume code). Given the comment in the patch mentioned above I guess in some other laptops the power on code doesn't work at all, so if it's powered down it never gets powered up.

So the best fix is probably to put that particular power down line under the control of a kernel module option, so on the HP NC6220, etc, the card can be properly powered down at suspend so it powers up fully at resume, but on other laptops where that causes problems the power down can be skipped.

FTR (in case it helps someone else) it appears to be sufficient (after installing the packages needed to compile a kernel) to do:

    apt-get source linux-image-2.6.22-14-generic
    cd linux-source-2.6.22-2.6.22
    cp /boot/config-`uname -r` .config
    make oldconfig
    make sound/pci/snd-intel8x0.ko
    make sound/pci/snd-intel8x0m.ko
    # Make a backup of the existing sound modules if desired then...
    cp -p sound/pci/snd*ko /lib/modules/`uname -r`/kernel/sound/pci/

and then reboot to use the new modules.

Ewen

Revision history for this message
DocHoliday52090 (docholiday52090) wrote :

I tried the above, and the process didn't work correctly. All seemed well until:

  CC [M] sound/pci/via82xx_modem.o
  CC [M] sound/pci/via82xx.o
  LD [M] sound/pci/snd-intel8x0.o
/bin/sh: cannot create .tmp_versions/snd-intel8x0.mod: Directory nonexistent
make[1]: *** [sound/pci/snd-intel8x0.o] Error 2
make: *** [sound/pci/snd-intel8x0.ko] Error 2
Holiday@laptop:~/linux-source-2.6.22-2.6.22/linux-source-2.6.22-2.6.22$ make sound/pci/snd-intel8x0m.ko

Revision history for this message
Ewen McNeill (ewen) wrote :

Ah, yes, I'd forgotten I'd done that:

mkdir .tmp_versions

(somewhere after cd'ing into the directory with the source and before running "make...".)

After you run the mkdir you can just run "make ...." again, and it'll continue from where it left off.

Apologies for the confusion.

Ewen

Revision history for this message
DocHoliday52090 (docholiday52090) wrote :

No luck.

I finished the module replacement successfully, restarted, and began a media player (Exaile). During play, I suspended the nc6220. Upon resume - no sound.

Revision history for this message
Ewen McNeill (ewen) wrote :

This might seem really obvious, but you did make (the opposite of) change listed in this comment:

https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.22/+bug/151111/comments/1

before you built the modules, right? Ie, you have to uncomment the line:

pci_set_power_state(pci, pci_choose_state(pci, state));

In the ..._suspend() function. (The change in that patch commented out the line, which is a call to control the power to the sound card -- the HP NC6220 appears to need that call for audio to work on resume.)

If you just rebuild without making that change, you'll get exactly what shipped with Ubuntu Gutsy, which as we know doesn't work.

If you didn't make that change, try making that change, rebuilding (run the "make ..." lines again and make sure it compiles sound/pci/intel8x0.c and the *.ko files again, then copy them back over and restart.

(My list of things to do wasn't intended to be an exhaustive list of all the steps required, just to indicate that it wasn't necessary to fully rebuild the kernel -- which takes a long time -- only the modules.)

Ewen

Revision history for this message
DocHoliday52090 (docholiday52090) wrote :

Woops, no,

How do I go about doing that? Is it a text file that is modified using gedit? Where?

Revision history for this message
DocHoliday52090 (docholiday52090) wrote :

Never mind that, I figured it out. Reading does wonders.

SUCCESS!

Ubuntu now works 100 percent on my laptop.

Revision history for this message
ubertoo (ubertoo) wrote :

I too can confirmed that reversing the above patch fixes the issue on an nc6230 on a Hardy Heron Kernel (2.6.24-5-generic).

I opened a bug report at kernel bug tracker: http://bugzilla.kernel.org/show_bug.cgi?id=9890

Hope they don't eat me alive, I used a mailinator address because I don't want spam, I also didn't follow their rules.... they say to report bugs in distribution patched kernels to the distribution maintainers, oh well.... it's only one line of code that's changed!

Thank you LinuxBladeGuy, Ewen McNeill

Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

Just adding a note that I updated this report to target the Hardy kernel. I also added a bugwatch for the upstream kernel bugzilla report. Against linux-source-2.6.22 this does not qualify for an SRU and is being closed. You can learn more about the stable release update process at https://wiki.ubuntu.com/StableReleaseUpdates . Thanks!

Changed in linux:
assignee: nobody → ubuntu-kernel-team
importance: Undecided → Medium
status: New → Triaged
Changed in linux-source-2.6.22:
status: Incomplete → Won't Fix
Changed in linux:
status: Unknown → Confirmed
Revision history for this message
Tim Gardner (timg-tpi) wrote :

Can someone attach the output of 'lspci -vvnn' for the NC6220 and NW8240 laptops? Given that uncommenting the call to pci_set_power_state() works on these platforms, I can implement quirk support for it.

Changed in linux:
assignee: ubuntu-kernel-team → timg-tpi
status: Triaged → In Progress
Revision history for this message
LinuxBladeGuy (spam-nashira) wrote :

As requested...

Revision history for this message
ubertoo (ubertoo) wrote :

As requested on a HP / Compaq nc6230

Revision history for this message
LinuxBladeGuy (spam-nashira) wrote :

Forgot to mention, my attachment is for an nc6220...

Revision history for this message
Ewen McNeill (ewen) wrote :

lspci -vvnn on HP NC6220 laptop attached, as requested.

Revision history for this message
Luka Renko (lure) wrote :

lspci -vvnn on HP nw8240

Revision history for this message
Tim Gardner (timg-tpi) wrote :

Implemented quirk support for these 2 HP platforms.

Changed in linux:
milestone: none → hardy-alpha-6
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux-ubuntu-modules-2.6.24 - 2.6.24-11.15

---------------
linux-ubuntu-modules-2.6.24 (2.6.24-11.15) hardy; urgency=low

  [Tim Gardner]

  * Fix ATI HDMI oops
    - LP: #196026
  * ifdef and net_ratelimit() iwlwifi debug messages
    - LP: #190475
  * SAUCE: Implemented suspend quirk support for HP NC6220 and NW8240
    - LP: #151111
  * Removed ivtv driver
    - LP: #197089

 -- Tim Gardner <email address hidden> Thu, 28 Feb 2008 13:53:20 -0700

Changed in linux-ubuntu-modules-2.6.24:
status: Fix Committed → Fix Released
Revision history for this message
Daniel T Chen (crimsun) wrote :

Tim, the added quirk appears to only be enabled for Luka's model (0x103c0934).

Changed in linux-ubuntu-modules-2.6.24:
status: Fix Released → Triaged
Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

closing 'linux' task as this is against 'linux-ubuntu-modules-2.6.24'. thanks.

Changed in linux:
status: New → Invalid
Daniel T Chen (crimsun)
Changed in alsa-driver:
assignee: nobody → crimsun
importance: Undecided → Low
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package alsa-driver - 1.0.16-0ubuntu4

---------------
alsa-driver (1.0.16-0ubuntu4) hardy; urgency=low

  * Patches (debian/patches/):
    - post_16_20080307.patch (obsoletes post_16_20080226) adds shadowed
      variable and integer as NULL pointer fixes and HDA quirks,
    - add_suspend_quirk_hp_nc6220_nw8240.patch fully fixes LP: #151111,
    - readd refix_lp_68659_by_disabling_dxs_for_0x1458a002.patch to
      close LP: #68659. This patch apparently never made it into Feisty,
      Gutsy, or Hardy.

 -- Daniel T Chen <email address hidden> Sat, 08 Mar 2008 20:11:33 -0500

Changed in alsa-driver:
status: In Progress → Fix Released
Revision history for this message
Steve Langasek (vorlon) wrote :

If this is fixed in alsa-driver, does that mean the linux-ubuntu-modules-2.6.24 task should be marked invalid?

Revision history for this message
Daniel T Chen (crimsun) wrote :

Steve - no, it still needs to be fixed in l-u-m (and as of a few seconds ago, it still hasn't been merged). I only patched alsa-driver source for the generated alsa-source binary package (which is in universe and not used by default).

Revision history for this message
John Dong (jdong) wrote :

ALSA is not fixable through backports -- marking backports side invalid.

Changed in gutsy-backports:
status: New → Invalid
Revision history for this message
Chineseracerboi (chineseracerboi) wrote :

how do you unapply the patch? sorry i'm new to linux

Revision history for this message
Ewen McNeill (ewen) wrote :

"patch -r" (r == reverse) will unapply a patch. In this case given there's only one line changed it's actually easier just to edit the file in a text editor and uncomment the line that was commented out. If you're new to linux you may find the rest of the steps challenging too, and might be better waiting for the next Ubuntu release (Hardy Heron) which should have the fix included. It's due to be released within about 6 weeks I believe.

Ewen

Steve Langasek (vorlon)
Changed in linux-ubuntu-modules-2.6.24:
milestone: hardy-alpha-6 → ubuntu-8.04
Revision history for this message
DocHoliday52090 (docholiday52090) wrote :

Not fixed in Gutsy Beta. Can the Beta freeze be relaxed to allow this in?

Stefan Bader (smb)
Changed in linux-ubuntu-modules-2.6.24:
assignee: timg-tpi → stefan-bader-canonical
status: Triaged → In Progress
Stefan Bader (smb)
Changed in linux-ubuntu-modules-2.6.24:
status: In Progress → Fix Committed
Revision history for this message
ojve (ojve) wrote :

I'm in the Heron beta, and still no candy for me.

Is there any way someone could provide a step-by-step guide to fix this?

//T

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux-ubuntu-modules-2.6.24 - 2.6.24-14.18

---------------
linux-ubuntu-modules-2.6.24 (2.6.24-14.18) hardy; urgency=low

  [Amit Kucheria]

  * Intel WiMax stack and driver for i2400m
  * WiMAX firmware and headers

  [Colin Ian King]

  * snd_bt_sco kernel Oops at startup
    - LP: #202249

  [Mario Limonciello]

  * Switch to enable second headphone jack on Dell M09 Ignore: no This adds
    a switch that enables the second headphone jack, allowing 5.1 audio and
    also two sets of headphone at the same time.

  [Stefan Bader]

  * SAUCE: Add missing SSID for suspend quirk.
    - LP: #151111
  * SAUCE: Enable audio quirk for Aluminium iMac.
    - LP: #147087

  [Tim Gardner]

  * ifdef iwlwifi debug messages
    - LP: #190475
  * lirc_serial loads but does not work
    - LP: #182530
  * Enable front input jack on Inspiron 1420/1520

  [Upstream Kernel Changes]

  * Ubuntu: Marvell: 8688: Enable WPA/WPA2 support

 -- Tim Gardner <email address hidden> Fri, 28 Mar 2008 10:54:41 -0600

Changed in linux-ubuntu-modules-2.6.24:
status: Fix Committed → Fix Released
Revision history for this message
DocHoliday52090 (docholiday52090) wrote :

While the sound now works perfectly, I have a loud shrill screech coming from my speakers when I resume for about 3 or 4 seconds.

Any ideas?

Revision history for this message
LinuxBladeGuy (spam-nashira) wrote : Re: [Bug 151111] Re: No Sound after Resume on some HP Laptops

I have this happen with a totally different laptop as well - I think
it's to do with debugging suspend/resume as it happened in Feisty
pre-releases as well. Definitely not related to this bug...

DocHoliday52090 wrote:
> While the sound now works perfectly, I have a loud shrill screech coming
> from my speakers when I resume for about 3 or 4 seconds.
>
> Any ideas?

Revision history for this message
Alex Chiang (achiang) wrote :

Just wanted to ack that this fix worked for me.

Thanks.

Revision history for this message
Alex Chiang (achiang) wrote :

Um, duh.

That would be for an nc6220.

Sorry for the noise.

Revision history for this message
ubertoo (ubertoo) wrote :

I also wanted to acknowledge that this no longer is a issue for me on Hardy Heron - Compaq nc6230.

Thank you.

Revision history for this message
Martin Namutso (mnamutso) wrote :

hi guys, i seem to be having a similar issue with my HP Compaq 6910p.. any ideas as to how i can fix it?

Revision history for this message
jkyamog (jkyamog) wrote :

I have a 6910p, it works alright since Hardy. I am now at Intrepid.
I get occasional problems with pulseaudio when my uptime is about
weeks old. I tend to just kill the pulseaudio deamon to fix it. You
can just search google for "ubuntu 6910p" there are a couple of guides
including mine, although for Intrepid there is not much to do.

Jun

On Wed, Apr 15, 2009 at 3:54 AM, mnamutso <email address hidden> wrote:
> hi guys, i seem to be having a similar issue with my HP Compaq 6910p..
> any ideas as to how i can fix it?
>
> --
> No Sound after Resume on some HP Laptops
> https://bugs.launchpad.net/bugs/151111
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
cement_head (andorjkiss) wrote :

The only this that works for me in IBEX is to use this command

sudo alsa force-reload

Revision history for this message
cement_head (andorjkiss) wrote :

Correction, I solved the sound problem using this post here for a thinkpad http://www.thinkwiki.org/wiki/Installing_Ubuntu_on_a_ThinkPad_T23#Sound_After_Suspend

Leonard (leoh)
Changed in linux-ubuntu-modules-2.6.24 (Ubuntu):
status: Fix Released → Fix Committed
Revision history for this message
cement_head (andorjkiss) wrote :

Since the fix in post #43 I haven't had a single sound issue - this is a definite fix (Post #43).

- CH

Steve Langasek (vorlon)
Changed in linux-ubuntu-modules-2.6.24 (Ubuntu):
status: Fix Committed → Fix Released
Changed in alsa-driver (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Steve Langasek (vorlon) wrote :

Please don't change bug statuses without explanation.

Changed in alsa-driver (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
DocHoliday52090 (docholiday52090) wrote :

This is back in the latest version of Ubuntu 9.10.

Revision history for this message
Daniel T Chen (crimsun) wrote :

File a new bug report, please. ubuntu-bug alsa-base

Revision history for this message
DanielB (danielhoney2-deactivatedaccount) wrote :

+1 - The error is back in 9.10. My Computer worked Ok with 9.04, but I can't hear anything after resume on 9.10. I'll create a new bug report, if I can't find one.

Revision history for this message
Alex Chiang (achiang) wrote :

Has there been a new bug filed on this issue? If so, can someone please point me at it?

Thanks.

Revision history for this message
dennis (beastdjw) wrote :

this bug is back, after resuming no sound on my speakers. My headphone port works fine.

Revision history for this message
dennis (beastdjw) wrote :

this bug is back; after resuming no sound on my speakers. My headphone port works fine.

Revision history for this message
dennis (beastdjw) wrote :

This bug is back. after resuming no sound on my speakers. My headphone port works fine.

Revision history for this message
dennis (beastdjw) wrote :
Changed in linux:
importance: Unknown → Medium
Changed in linux:
status: Confirmed → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.