Bug 434909

Summary: daemon stops working after suspend
Product: [Fedora] Fedora Reporter: Jan Hutař <jhutar>
Component: pulseaudioAssignee: Lubomir Rintel <lkundrak>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 8CC: pierre-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-03-24 10:32:22 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On: 384271    
Bug Blocks:    

Description Jan Hutař 2008-02-26 01:48:50 EST
Description of problem:
Sometimes after suspend pulseaudio daemon stops working. This usually helps me:

killall pulseaudio
pulseaudio &

But sometimes I'm not able to start pulseaudio, because I get:

** (process:28819): WARNING **: Error doing GetSessionForUnixProcess on 
ConsoleKit: org.freedesktop.DBus.GLib.UnmappedError.CkManagerError.Code0: 
Unable to find session for cookie

** (process:28819): CRITICAL **: polkit_session_set_uid: assertion `session != 
NULL' failed
E: polkit.c: Cannot set UID on session object.
N: main.c: Called SUID root and real-time/high-priority scheduling was 
requested in the configuration. However, we lack the necessary priviliges:
N: main.c: We are not in group 'pulse-rt' and PolicyKit refuse to grant us 
priviliges. Dropping SUID again.
N: main.c: For enabling real-time scheduling please acquire the appropriate 
PolicyKit priviliges, or become a member of 'pulse-rt', or increase the 
RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user.
W: main.c: setrlimit(RLIMIT_NICE, (31, 31)) failed: Operace není povolena
W: main.c: setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operace není povolena
ALSA lib pcm_hw.c:1207:(_snd_pcm_hw_open) Invalid value for card
E: alsa-util.c: Error opening PCM device hw:0: Takové zařízení neexistuje
E: module.c: Failed to load  module "module-alsa-sink" (argument: 
"device=hw:0"): initialization failed.
ALSA lib pcm_hw.c:1207:(_snd_pcm_hw_open) Invalid value for card
E: alsa-util.c: Error opening PCM device hw:0: Takové zařízení neexistuje
E: module.c: Failed to load  module "module-alsa-source" (argument: 
"device=hw:0"): initialization failed.
E: oss-util.c: open('/dev/dsp'): Přístup odmítnut
E: module.c: Failed to load  module "module-oss" (argument: "device=/dev/dsp"): 
initialization failed.
W: module-detect.c: failed to detect any sound hardware.
E: module.c: Failed to load  module "module-detect" (argument: ""): 
initialization failed.
E: main.c: Module load failed.
E: main.c: failed to initialize daemon.
process 28819: dbus_shutdown() called but connections were still live. This 
probably means the application did not drop all its references to bus 
connections.
  D-Bus not built with -rdynamic so unable to print a backtrace

[1]+  Neúspěšně ukončen (SIGABRT)        pulseaudio

This is rights for /dev/dsp:

$ ls -al /dev/dsp
crw-rw----+ 1 root root 14, 3 2008-01-31 11:23 /dev/dsp


Version-Release number of selected component (if applicable):
pulseaudio-0.9.8-5.fc8.x86_64
PolicyKit-0.6-1.fc8.x86_64
ConsoleKit-0.2.3-1.fc8.x86_64
hal-0.5.10-1.fc8.x86_64
dbus-1.1.2-7.fc8.x86_64


How reproducible:
40%


Steps to Reproduce:
1. suspend & resume
2. check that pulseaudio is not accepting connections
3. killall pulseaudio
4. pulseaudio &


Actual results:
pulseaudio does not start


Expected results:
pulseaudio starts


Additional info:
 * sometimes, `service haldaemon restart` helps
 * this could be duplicate of bug 424621
 * this could be related to bug 427992
 * maybe this is PolicyKit/ConsoleKit/hal/dbus bug, but I have seen it with 
pulseaudio
 * if this is a problem with reconnection to dbus, then this could be related: 
http://lists4.suse.de/opensuse-bugs/2006-11/msg09254.html
Comment 1 Jan Hutař 2008-02-26 12:49:53 EST
Just happened again, so before I `killall pulseaudio`, here is what mplayer 
says:


$ mplayer some.file
...
# waits for some time
...
AO: [pulse] Init failed: Timeout
Could not open/initialize audio device -> no sound.
Audio: no sound
...
#now plays but without sound


And here is pulseaudio backtrace:


# ps ax | grep pulse
 3101 ?        Sl     0:16 /usr/bin/pulseaudio --log-target=syslog
11572 pts/0    S+     0:00 grep pulse
# gdb attach 3101
...
(gdb) thread apply all bt

Thread 3 (Thread 1084229968 (LWP 3106)):
#0  0x0000003d32acbf55 in ppoll (fds=0x628080, nfds=1, timeout=0x0, 
    sigmask=0x627ec8) at ../sysdeps/unix/sysv/linux/ppoll.c:57
#1  0x0000003a6b4450c0 in pa_rtpoll_run () from /usr/lib64/libpulsecore.so.5
#2  0x00002aaaafbae80d in pa_config_parse_int ()
   from /usr/lib64/pulse-0.9/modules/module-alsa-sink.so
#3  0x0000003a6b4470ed in pa_config_parse_int () from /usr/lib64/
libpulsecore.so.5
#4  0x0000003d33606407 in start_thread () from /lib64/libpthread.so.0
#5  0x0000003d32ad4b0d in clone () from /lib64/libc.so.6

Thread 2 (Thread 1094719824 (LWP 3107)):
#0  0x0000003d32acbf55 in ppoll (fds=0x642c20, nfds=1, timeout=0x0, 
    sigmask=0x642a68) at ../sysdeps/unix/sysv/linux/ppoll.c:57
#1  0x0000003a6b4450c0 in pa_rtpoll_run () from /usr/lib64/libpulsecore.so.5
#2  0x00002aaaaffdc6f7 in pa_config_parse_int ()
   from /usr/lib64/pulse-0.9/modules/module-alsa-source.so
#3  0x0000003a6b4470ed in pa_config_parse_int () from /usr/lib64/
libpulsecore.so.5
#4  0x0000003d33606407 in start_thread () from /lib64/libpthread.so.0
#5  0x0000003d32ad4b0d in clone () from /lib64/libc.so.6

Thread 1 (Thread 46912496292400 (LWP 3101)):
#0  0x0000003d32acbd66 in __poll (fds=0x655610, nfds=12, timeout=1999)
    at ../sysdeps/unix/sysv/linux/poll.c:87
#1  0x0000003a6b413e2c in pa_mainloop_poll () from /usr/lib64/libpulsecore.so.5
#2  0x0000003a6b414c38 in pa_mainloop_iterate () from /usr/lib64/
libpulsecore.so.5
#3  0x0000003a6b414cd0 in pa_mainloop_run () from /usr/lib64/libpulsecore.so.5
#4  0x00000000004078cc in main ()
0x0000003d32acbd66      87        int result = INLINE_SYSCALL (poll, 3, CHECK_N 
(fds, nfds), nfds, timeout);


Is there anything else I can do?
Comment 2 Lubomir Kundrak 2008-02-28 12:39:30 EST
In the first case -- you seem to be in trouble with consolekit. Is it running?
Does it keep track of sessions -- haven't you restarted it or dbus?

Should that happen again, please observe "ck-list-sessions" output.

You also seem to be hitting the problem with bad ACLs on permissions. Please
note that "ls -l" is not enough to observe them -- use "getfacl". As this
happens on resumes, this is most likely caused by bug #384271.

See koji for latest hal build with my fix. Note that as you can see in the bug
referred to above it doesn't seem to have received blessing from davidz...
Comment 3 Lubomir Kundrak 2008-03-24 10:32:22 EDT
Please reopen in case you're able to reproduce this again.