Pulseaudio inhibits suspend and hibernate

Bug #312505 reported by Martin Emrich
38
This bug affects 4 people
Affects Status Importance Assigned to Milestone
pulseaudio (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: pulseaudio

I am running current jaunty i386. Since the upgrade from intrepid, I can no longer suspend or hibernate. I see this in /var/log/pm-suspend.log:

/usr/lib/pm-utils/sleep.d/00powersave hibernate hibernate: success.
/usr/lib/pm-utils/sleep.d/01PulseAudio hibernate hibernate: Returned exit code 1.
Tue Dec 30 19:12:33 CET 2008: Inhibit found, will not perform hibernate
Tue Dec 30 19:12:33 CET 2008: Running hooks for thaw
/usr/lib/pm-utils/sleep.d/00powersave thaw hibernate: success.
/usr/lib/pm-utils/sleep.d/00logging thaw hibernate: success.
/usr/lib/pm-utils/sleep.d/00auto-quirk thaw hibernate: success.

Related branches

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

Doubtful that pulseaudio is actually the root cause. What sound applications are active when you attempt to suspend? Which audio backend(s) are they using when you attempt to suspend?

Changed in pulseaudio:
status: New → Incomplete
Revision history for this message
Martin Emrich (emme) wrote :

There are no audio applications running (except the mixer applet which is always there). I don't know which backend it uses, as I did not change it's configuration in over a year, I assume it uses the default backend.

Ciao

Martin

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

What does invoking the following command (which is essentially what /usr/lib/pm-utils/sleep.d/01PulseAudio does) in a normal interactive terminal return?

echo 'suspend 1' | sudo -u $USER pacmd

Revision history for this message
Martin Emrich (emme) wrote :

In an interactive terminal, it returns 0, even if subsequent suspend attempts fail.

I played around with the 01PulseAudio script, and interestingly I could not determine which element returns the non-zero return value. I also notices that after several (5-10) attempts to suspend, It actually suspends.

I also tried it with Rhythmbox running. If it is not playing, it has no influence, if it is playing Rhythmbox itself inhibits suspend (including a nice bubble popup from the battery applet)

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

Please run the http://www.alsa-project.org/alsa-info.sh bash script. Also, please use: pulseaudio -k && sleep 3 && pulseaudio -vv

We likely need to peer lower into the stack at your alsa drivers, just need the input above to verify.

Revision history for this message
Martin Emrich (emme) wrote :

Hi!

The alsa-info.sh data is at http://www.alsa-project.org/db/?f=a7bb4c4bd4a218b013ad77e5d8f8d72ac2c3b59b .

Attached is the output of 'pulseaudio -k && sleep 3 && pulseaudio -vv' (The space is the point just before initiating standby). After running this command, the computer went to standby without problems, while before it refused it as described above.

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

Martin, thanks. Which pulseaudio package (apt-cache policy pulseaudio) are you using? If you log into a fresh GNOME session, is the failure to suspend-to-* reproducible? If so, if you run the `pulseaudio -k && sleep 3 && pulseaudio -vv' command, from a fresh GNOME session login, can you then reliably suspend-to-* ?

Revision history for this message
Martin Emrich (emme) wrote :

Hi!

This is my current version:

pulseaudio:
  Installiert: 0.9.13-2ubuntu5
  Kandidat: 0.9.13-2ubuntu5
  Versions-Tabelle:
 *** 0.9.13-2ubuntu5 0
        500 http://de.archive.ubuntu.com jaunty/main Packages
        100 /var/lib/dpkg/status

I created a fresh user, logged in and tried to suspend. I just locked the screen, but nothing more happened.

After running 'pulseaudio -k && sleep 3 && pulseaudio -vv', I can suspend just fine.

Daniel T Chen (crimsun)
Changed in pulseaudio:
importance: Undecided → Low
status: Incomplete → Confirmed
Revision history for this message
wulf solter (wulfsolter) wrote :

Same symptoms :(

pulseaudio:
  Installed: 0.9.13-2ubuntu6
  Candidate: 0.9.13-2ubuntu6
  Version table:
 *** 0.9.13-2ubuntu6 0

http://www.alsa-project.org/db/?f=125bd1a918f924937932d2194216a2678b3859a3

Suspends after 'pulseaudio -k && sleep 3 && pulseaudio -vv'

HIH,
wulf

Revision history for this message
Martin Emrich (emme) wrote :

Any news on this? I have a feeling that it's not necessarily a bug in a package, but maybe some wrong configuration, as not more than two people have this problem so far.

My $HOME, /var and /etc are in use since 6.06 and have surely collected much clutter over the years. Where could I look for strange configuration entries of pulseaudio or related packages?

Ciao

Martin

Revision history for this message
wulf solter (wulfsolter) wrote :

Bump.

As far as feelings go, mine is that there is a lot more than two people affected. Remember we had to look through the suspend.log to establish that it was pulseaudio - not everyone is comfortable/familiar with that kind of thing.

Happening on fresh install of intrepid that got upgraded to jaunty around alpha2.. Does not happen to me when booting of intrepid live CD, have not tried latest jaunty live CD - thought only just occured when I got emailed Martins update, so I'm downloading now and will post when I have a result. IMHO, that should be enough of a test to see whether we have latent/legacy config issues or not.. Thoughts anyone?

Starting to get to be a real PITA to run 'pulseaudio -k && sleep 3 && pulseaudio' after every cold boot...

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

Please let me know if this symptom is reproducible with my PPA packages.

Revision history for this message
Martin Emrich (emme) wrote :

Hi!

Since a week or so, I noticed that it is more stable (the normal jaunty packages). In the last few days (where I used suspend-to-RAM more often), I did not notice any problems. I'll watch out for any irregularities, but for now it seems to be fixed.

Ciao

Martin

Daniel T Chen (crimsun)
Changed in pulseaudio:
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 0.9.14-0ubuntu11

---------------
pulseaudio (0.9.14-0ubuntu11) jaunty; urgency=low

  [ Daniel T Chen ]
  * Reenable 0030_set_tsched0.patch, which re-disables glitch-free;
    too many users are reporting regressions and audio aberrations.
  * Adjust 0003_change_resample_and_buffering.patch to use linear
    resampler to work better with lack of PREEMPT in jaunty's
    -generic kernel config (LP: #207135, #322250, #332761, #335955,
    LP: #336965).
  * Last upload, specifically 0091_workaround_alsa_horkage, fixes:
    LP: #235990, #237443, #279847, #317997, #323185, #330814,
    LP: #334874.
  * sudo -H change in ubuntu6 fixed LP: #312505.
  * Closing old bugs fixed in 0.9.11+: LP: #187963, #193520, #211052.
  * Refresh 0006_regen-autotools.patch.
  * Add 0043_load_sample_dir_lazy.patch to cache
    /usr/share/sounds/ubuntu/stereo/* in default.pa.
  * debian/:
    - control: Build against libcap2-dev (LP: #339448);
    - copyright: Update copyright from Debian's 0.9.14-2;
    - rules: Add DEB_OPT_FLAG = -O3 as per recommendation from
      pulseaudio-discuss/2007-December/001017.html.
  * Refresh fixes from git HEAD:
    - 0038_handle_errno_properly.patch,
    - 0091_workaround_alsa_horkage.patch,
    - 0092_fix_null_pointer_access.patch.

  [ Luke Yelavich ]
  * Add a special case to prevent Pulseaudio from being started when the
    blindness accessibility profile has been enabled from the Ubuntu live CD,
    and for an accessibility install. Unfortunately Pulseaudio and speech do
    not currently work very well with each other, and its too late in
    the cycle to solve this problem any other way.

 -- Luke Yelavich <email address hidden> Tue, 10 Mar 2009 09:00:40 +1100

Changed in pulseaudio:
status: Fix Committed → Fix Released
Revision history for this message
Cory Maccarrone (darkstar6262) wrote :

This is not fixed for me. I'm running the latest Jaunty packages, and have to run pulseaudio -k before my system will suspend. Inspecting the suspend.log files shows that I'm getting the same results as reported in the description of this bug.

For me, I have to run the pulseaudio -k command every time I want to susend -- it reloads and takes over the hardware upon resume, preventing further suspends.

Revision history for this message
schrodycat (junk-jimandbarb) wrote :

Still a problem with Jaunty. Upgraded from Intrepid to Jaunty and suspend/resume broke. Traced it to pulseaudio. Temporarily renamed the pulseaudio binary and suspend/resume works again.

Revision history for this message
Cory Maccarrone (darkstar6262) wrote :

In /usr/lib/pm-utils/sleep.d/01PulseAudio, I noticed that the output of the function get_pulse_users() was returning my user ID as a number, not as the name of the user. Further down, that's used in the "sudh -H -u" commands, but sudo will only take a number UID if you enclose it in quotes and add a number sign:

    sudo -H -u $i pactl suspend-sink 1 &> /dev/null

becomes

    sudo -H -u "#$i" pactl suspend-sink 1 &> /dev/null

Making this change to all the instances of that made suspend start working for me every time.

Try running the command:

    ps aux | awk '/\/usr\/bin\/pulseaudio --start/ {print $1}'

It's the same as is used in that get_pulse_users() function. If it returns a number, the above fix is needed. At least, it worked for me.

Revision history for this message
schrodycat (junk-jimandbarb) wrote :

Excellent, Cory! I think you nailed it.

Revision history for this message
Justin (justin-secnix) wrote :

Hi Cory. Thanks for the fix. It worked for me on x61s.

Revision history for this message
effetto (effetto-deactivatedaccount) wrote :

Cory's fix also worked in a upgraded Jaunty on a Dell 640m.

Revision history for this message
spradders (junk-spradbery) wrote :

Fixed it for me on a Lenovo T61p - THANK YOU.

Revision history for this message
Peter Funk (pf-artcom-gmbh) wrote :

This week my HP/Compaq nw9440 notebook didn't suspend to RAM, which used to work before.
I investigated and ended up here.

Since pulseaudio gave stuttering sound after upgrading from
intrepid to jaunty I recently added the line
deb http://ppa.launchpad.net/themuso/ppa/ubuntu jaunty main
to my /etc/apt/sources.lisr in the hope 0.9.15 would improve on the stuttering
problem, which it seemed to do at least partly.

The problem with suspend started on my notebook after upgrading pulseaudio
from version 0.9.15-1ubuntu2~ppa1 to version 0.9.15-3ubuntu1~ppa2

I applied the following patch manually which fixed my suspend problem:
--- usr_lib_pm-utils_sleep.d_01PulseAudio.orig 2009-06-17 08:40:18.713832000 +0200
+++ /usr/lib/pm-utils/sleep.d/01PulseAudio 2009-06-17 08:40:51.030826966 +0200
@@ -3,7 +3,7 @@
 . "${PM_FUNCTIONS}"

 get_pulse_users() {
- ps -C pulseaudio -o uid= | tr ' ' '#'
+ ps -C pulseaudio -o user=
 }

 suspend_pulse() {

Revision history for this message
Creidieki M. Crouch (creidieki+ubuntubugs) wrote :

I'm still having this problem with the latest Jaunty packages, and several commenters above have still had the problem after the fix. Can the Status be changed to reopen the bug?

There are some suggestions and a patch above, but I don't think they've been packaged.

Revision history for this message
Cory Maccarrone (darkstar6262) wrote :

I'm having problems with this as well since the latest Jaunty packages. I vote to re-open the bug as well.

Revision history for this message
Cory Maccarrone (darkstar6262) wrote :

I've set this bug to new again. I'm having problems in the latest package:

ii pulseaudio 1:0.9.14-0ubuntu20.2

The fix I posted above again fixes the problem for me. This change was not packaged in, as after I upgraded since I first applied the fix, the old version returned, as did the broken behavior.

Changed in pulseaudio (Ubuntu):
status: Fix Released → New
Revision history for this message
Daniel T Chen (crimsun) wrote : Re: [Bug 312505] Re: Pulseaudio inhibits suspend and hibernate

It's already resolved in the Karmic packages. Please, instead of
reopening the main (Karmic) task, create/reopen a/the Jaunty one.

Revision history for this message
Cory Maccarrone (darkstar6262) wrote :

Maybe I'm missing something, but I don't see Karmic anywhere in this post...it was originally submitted against Jaunty, and there's nothing in here to suggest to me that it's anything but a Jaunty bug report. If it's resolved in Karmic, should this report not be applied to just Jaunty?

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

That's precisely what I mean by opening a Jaunty task.

Revision history for this message
Cory Maccarrone (darkstar6262) wrote :

OK, I see, I didn't realize there's a general "Pulseaudio" bug page and there's ones for specific distributions. I'll set the state back to what it was and submit a new bug against the Jaunty version of the package.

Changed in pulseaudio (Ubuntu):
status: New → Fix Released
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.