Bug 438594 - CPU limit abort triggered on Core Duo 6400
Summary: CPU limit abort triggered on Core Duo 6400
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: pulseaudio
Version: 8
Hardware: All
OS: Linux
low
high
Target Milestone: ---
Assignee: Lennart Poettering
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-03-22 15:43 UTC by Dimi Paun
Modified: 2008-09-09 22:21 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-09-09 20:54:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Log of complete session of 'pulseaudio -vv' (12.92 KB, text/plain)
2008-03-22 15:43 UTC, Dimi Paun
no flags Details
Out of "ls" in "pacmd" (14.54 KB, text/plain)
2008-07-22 03:37 UTC, Dimi Paun
no flags Details

Description Dimi Paun 2008-03-22 15:43:23 UTC
Description of problem:
The pulseaudio daemon keeps crashing/exiting. Sounds stops
working properly as a result.

Version-Release number of selected component (if applicable):
pulseaudio-0.9.8-5.fc8

How reproducible:
It's been behaving like this ever since I upgraded to 0.9.8.

Steps to Reproduce:
1. Start daemon
2. Start Rythmbox, play radio station
3. Leave it running
4. After a few hours, sounds stops
  
Additional info:
To help diagnose the problem, I have started the pulseaudio 
daemon on the command line, with the -vv option. I'll attach
the output (all the way to the point it exists) since it
might be too big to inline here.

Comment 1 Dimi Paun 2008-03-22 15:43:23 UTC
Created attachment 298843 [details]
Log of complete session of 'pulseaudio -vv'

Comment 2 Lubomir Kundrak 2008-03-24 11:11:48 UTC
Dimi: I'm wondering whether you're running another sound daemon in parallel?
Please look if a system-wide pulseaudio or esd is not running.

Also, what is your hadrware configuration that might influence this, such as
sound hardware and cpu?

Does pulseaudio daemon proceed co consume large amount of CPU time when run with
--no-cpu-limit?

Comment 3 Dimi Paun 2008-03-24 15:29:07 UTC
There shouldn't be any other sound server on the system.
It's true, the Sound Preferences applet has
   Enable Software sound mixing (ESD)
but AFAIK this is how one enables pulseaudio :)
However, there's no esd running:
[dimi@dimi ~]$ ps aux | grep esd
root      4114  0.0  0.1  21876  3508 ?        SN   Mar21   0:00 /usr/bin/python
-tt /usr/sbin/yum-updatesd
dimi     26428  0.0  0.0    396   104 pts/4    R+   11:21   0:00 grep esd

Also, I just have the one pulseaudio daemon that I started with -vv after the
regular one exited:

[dimi@dimi ~]$ ps aux | grep pulseaudio
dimi     24834  0.9  0.1  56496  4480 pts/8    Sl+  Mar22  24:56 pulseaudio -vv
dimi     26390  0.0  0.0   4044   660 pts/4    R+   11:18   0:00 grep pulseaudio

This last one lasted longer than the others, which used to exit after a few
hours. This one has been up for almost 24h, but truth be told, I wasn't much at
the computer over the weekend, so I didn't play that much music.

I seem to remember seeing pulseaudio just take a lot of my CPU after hours of
listening to music, to the point where I had to restart my session. I don't know
why that was happening. I've restarted it now with the --no-cpu-limit option,
see what happens.

As for my hardware, I have Intel Core Duo 6400 @ 2.13GHz with 4GB of RAM.


Comment 4 Dimi Paun 2008-03-27 15:31:26 UTC
Yes, I just experienced the following: I was listening to some local MP3s in
Rythmbox, when pulseaudio daemon spiked to 100% CPU usage all of a sudden,
stayed there for a bit, then died. Music stopped playing (of course), and
Rythmbox started eating 100%CPU too, so I had to kill it.


Comment 5 Lubomir Kundrak 2008-03-27 17:13:42 UTC
Dimi: Nothing better comes to my mind, than trying to get a backtrace and
eventually a core dump from pulseaudio when it enters this state.

Would it be possible for you to install pulseaudio-debuginfo and either get a
core dump with gcore, and then load it in gdb and get a stack trace, or attach
gdb to pulse daemon with gdb -p and get a stack trace that way? (having a core
dump would be preferred).

Thanks

Comment 6 Dimi Paun 2008-03-27 17:59:04 UTC
Lubomir, I'm afraid that would be close to impossible to do, as it is not easy
to get it in that state, and it stays there only very little.

I can isntall the debug-info, but how would that help? A better way would be to
instrument pulseaudio to dump core instead of exiting, and then we can gather
that info.

If I get a complied .rpm with such a modification, I'd be more than willing to
give it a spin.


Comment 7 Lubomir Kundrak 2008-03-27 18:42:46 UTC
So I changed the exit() to abort() in case the limit is triggered, and commited
the change to rawhide. The build for Fedora 8 is here:
http://koji.fedoraproject.org/koji/taskinfo?taskID=534654

Please try that one. To obtain the core file, you'll likely add something like
this to your /etc/security/limits.conf:

*       -       core    unlimited

Thanks!

Comment 8 Dimi Paun 2008-03-27 19:56:36 UTC
OK, got it and running it now. BTW, where will I find the core dump?

Comment 9 Lubomir Kundrak 2008-03-27 20:05:52 UTC
$ ls -l /proc/`pidof pulseaudio`/cwd
lrwxrwxrwx 1 lkundrak lkundrak 0 2008-03-27 21:02 /proc/19289/cwd -> /
$

Uff, seems like pulseaudio chdirs to / upon startup.
Would you mind adding yourself to acl of / (assuming you know what does it mean)?

Comment 10 Dimi Paun 2008-03-27 20:43:58 UTC
I know, but never used them in Linux before... I did:

[root@dimi ~]# setfacl -m u:dimi:rwx /

So now I have"

[root@dimi ~]# getfacl /
getfacl: Removing leading '/' from absolute path names
# file: .
# owner: root
# group: root
user::rwx
user:dimi:rwx
group::r-x
mask::rwx
other::r-x


Not that I much like that...


Comment 11 Dimi Paun 2008-04-02 15:34:23 UTC
This morning I had no sound (I did for the last few days).
Sure enough, pulseaudio was gone:
[root@dimi ~]# ps aux | grep pulse
root      5895  0.0  0.0   4044   664 pts/6    R+   11:22   0:00 grep pulse
[root@dimi ~]# 

But I could find no core file in /:
[root@dimi ~]# ls -a /
.  ..  .autofsck  .autorelabel  bin  boot  dev  etc  home  lib  lost+found 
media  misc  mnt  net  opt  proc  root  sbin  selinux  .spamassassin  srv 
.suspended  sys  tmp  usr  var


I have the right permissions:
[root@dimi ~]# getfacl /
getfacl: Removing leading '/' from absolute path names
# file: .
# owner: root
# group: root
user::rwx
user:dimi:rwx
group::r-x
mask::rwx
other::r-x

The right limits:
[root@dimi ~]# grep core /etc/security/limits.conf 
#        - core - limits the core file size (KB)
#*               soft    core            0
*                -       core            unlimited

BTW, do I need to reboot to have these limits applied?

I have the correct one installed:
[root@dimi ~]# rpm -qa | grep pulse
pulseaudio-libs-0.9.8-5.fc8.abort1
pulseaudio-module-jack-0.9.8-5.fc8.abort1
pulseaudio-module-zeroconf-0.9.8-5.fc8.abort1
pulseaudio-module-x11-0.9.8-5.fc8.abort1
pulseaudio-libs-glib2-0.9.8-5.fc8.abort1
pulseaudio-utils-0.9.8-5.fc8.abort1
pulseaudio-debuginfo-0.9.8-5.fc8.abort1
pulseaudio-core-libs-0.9.8-5.fc8.abort1
pulseaudio-module-bluetooth-0.9.8-5.fc8.abort1
pulseaudio-libs-zeroconf-0.9.8-5.fc8.abort1
pulseaudio-module-lirc-0.9.8-5.fc8.abort1
pulseaudio-0.9.8-5.fc8.abort1
pulseaudio-module-gconf-0.9.8-5.fc8.abort1
alsa-plugins-pulseaudio-1.0.15-3.fc8.1
pulseaudio-esound-compat-0.9.8-5.fc8.abort1


I have restarted it with -vv in a terminal. Do I need to tweak anything else?


Comment 12 Dimi Paun 2008-04-04 13:19:16 UTC
OK, the thing keeps dying, yet I found no core file anywhere (I even rebooted
the box in the meantime). It is interesting to note that it seems pulseaudio
dies sometimes during the night when no music is playing. For example, last
night I _paused_ Rythmbox before going to bed, in the morning the daemon was
dead. However, I started it in a console with -vv, to get more info (still no
core file anywhere that I can find). These are the last few lines:

I: sink-input.c: Created input 99 "ALSA Playback" on
alsa_output.pci_8086_284b_alsa_playback_0 with sample spec s16le 2ch 44100Hz and
channel map front-left,front-right
D: memblockq.c: memblockq requested: maxlength=52920, tlength=35280, base=4,
prebuf=33516, minreq=1764
D: memblockq.c: memblockq sanitized: maxlength=52920, tlength=35280, base=4,
prebuf=33516, minreq=1764
I: sink-input.c: Freeing output 99 "ALSA Playback"
I: module-volume-restore.c: Restoring sink for <pulsecore/protocol-native.c$ALSA
plug-in [rhythmbox]>
I: module-volume-restore.c: Restoring volume for
<pulsecore/protocol-native.c$ALSA plug-in [rhythmbox]>
D: module-suspend-on-idle.c: Sink alsa_output.pci_8086_284b_alsa_playback_0
becomes busy.
I: sink-input.c: Created input 100 "ALSA Playback" on
alsa_output.pci_8086_284b_alsa_playback_0 with sample spec s16le 2ch 44100Hz and
channel map front-left,front-right
D: memblockq.c: memblockq requested: maxlength=52920, tlength=35280, base=4,
prebuf=33516, minreq=1764
D: memblockq.c: memblockq sanitized: maxlength=52920, tlength=35280, base=4,
prebuf=33516, minreq=1764
I: sink-input.c: Freeing output 100 "ALSA Playback"
I: module-volume-restore.c: Restoring sink for <pulsecore/protocol-native.c$ALSA
plug-in [rhythmbox]>
I: module-volume-restore.c: Restoring volume for
<pulsecore/protocol-native.c$ALSA plug-in [rhythmbox]>
D: module-suspend-on-idle.c: Sink alsa_output.pci_8086_284b_alsa_playback_0
becomes busy.
I: sink-input.c: Created input 101 "ALSA Playback" on
alsa_output.pci_8086_284b_alsa_playback_0 with sample spec s16le 2ch 44100Hz and
channel map front-left,front-right
D: memblockq.c: memblockq requested: maxlength=52920, tlength=35280, base=4,
prebuf=33516, minreq=1764
D: memblockq.c: memblockq sanitized: maxlength=52920, tlength=35280, base=4,
prebuf=33516, minreq=1764
D: module-hal-detect.c: dbus: interface=org.freedesktop.Hal.Device,
path=/org/freedesktop/Hal/devices/usb_device_47f_ca1_00100_0429034410003_V060000A_if3_logicaldev_input,
member=Condition
Soft CPU time limit exhausted, terminating.
Hard CPU time limit exhausted, terminating forcibly.
Aborted


Comment 13 Jakub 'Livio' Rusinek 2008-04-07 20:27:20 UTC
for me, gdm starts its own pulseaudio, while my gnome starts another.

and, true, mine pulse crashes when using some multimedia app. for rhythmbox,
causes memory leak.

Comment 14 Lennart Poettering 2008-04-07 20:30:13 UTC
What kind of soundcard is this? Which driver does this use?

Does it need the "multi" plugin from ALSA?

Comment 15 Dimi Paun 2008-04-07 20:49:25 UTC
[root@dimi ~]# lspci | grep -i audio
00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller
(rev 02)

[root@dimi ~]# lsmod | grep -i snd
snd_hda_intel         297441  5 
snd_seq_dummy           6725  0 
snd_usb_audio          79681  4 
snd_seq_oss            31553  0 
snd_seq_midi_event      9665  1 snd_seq_oss
snd_seq                48945  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
snd_pcm_oss            44353  0 
snd_mixer_oss          17217  3 snd_pcm_oss
snd_pcm                70981  4 snd_hda_intel,snd_usb_audio,snd_pcm_oss
snd_timer              21317  2 snd_seq,snd_pcm
snd_usb_lib            18241  1 snd_usb_audio
snd_rawmidi            22465  1 snd_usb_lib
snd_page_alloc         11593  2 snd_hda_intel,snd_pcm
snd_seq_device         10317  4 snd_seq_dummy,snd_seq_oss,snd_seq,snd_rawmidi
snd_hwdep              10693  2 snd_hda_intel,snd_usb_audio
snd                    48325  26
snd_hda_intel,snd_seq_dummy,snd_usb_audio,snd_seq_oss,snd_seq,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_usb_lib,snd_rawmidi,snd_seq_device,snd_hwdep
soundcore               9505  3 snd


Comment 16 Dimi Paun 2008-05-21 13:16:04 UTC
Lennart, I have no idea what this "multi" plugin for ALSA is. You mentioned
aplay -v, this is what I have:
[dimi@dimi ~]$ aplay -v ~/music/Smooth.mp3 
Playing raw data '/home/dimi/music/Smooth.mp3' : Unsigned 8 bit, Rate 8000 Hz, Mono
ALSA <-> PulseAudio PCM I/O Plugin
Its setup is:
  stream       : PLAYBACK
  access       : RW_INTERLEAVED
  format       : U8
  subformat    : STD
  channels     : 1
  rate         : 8000
  exact rate   : 8000 (8000/1)
  msbits       : 8
  buffer_size  : 4000
  period_size  : 1000
  period_time  : 125000
  tick_time    : 0
  tstamp_mode  : NONE
  period_step  : 1
  sleep_min    : 0
  avail_min    : 1000
  xfer_align   : 1000
  start_threshold  : 4000
  stop_threshold   : 4000
  silence_threshold: 0
  silence_size : 0
  boundary     : 2097152000


Comment 17 Lennart Poettering 2008-05-21 14:02:29 UTC
Are you using stock PA config files? Or did you modify them in any way?

Comment 18 Dimi Paun 2008-05-21 14:12:37 UTC
AFAIR I am using stock PA config files. I'm fairly certain I did not touch them
by hand, but it's been a long time and I can not be 100% sure. Just let me know
if you need to look at any of them.



Comment 19 Lennart Poettering 2008-05-21 14:39:45 UTC
Di you toggle any of the checkboxes of paprefs?

Comment 20 Dimi Paun 2008-05-21 14:47:23 UTC
All are checked with the exception of first one "Show notifications for
discovered servers" which is unchecked.


Comment 21 Lennart Poettering 2008-05-21 23:34:09 UTC
paprefs, not padevchooser.

padevchooser is mostly obsolete.

Comment 22 Dimi Paun 2008-05-21 23:49:01 UTC
Nothing is checked, except under "Simultaneous Output" the "Add virtual output
device for ...". But it had the exact same problem when this was unchecked.


Comment 23 Lennart Poettering 2008-05-22 00:30:28 UTC
Make sure to disable simultaneous output. Edit deamon.conf and enable
'no-cpu-limit'. This will cause PA to continue running when we eat 100% CPU.
Then, try to reproduce the issue and paste the output of "ls" in "pacmd". (pacmd
might take a while to start when we use 100% CPU, so please be patient, it
should react eventually)

Comment 24 Dimi Paun 2008-07-22 03:37:43 UTC
Created attachment 312309 [details]
Out of "ls" in "pacmd"

Comment 25 Dimi Paun 2008-07-22 03:46:46 UTC
Hm, I think this was not quite right: this time around it was mixer_applet2
(gnome-applets-2.20.1-1.fc8) that was using 100% CPU. Also, I have noticed that
lately PA no longer crashes so easily, I can now listen for hours on end without
it dying. Unfortunately I can say more than this as I have given up music on my
box for more than a month, so I'm not quite sure when the problem got fixed.

I'll keep an eye open, as I now run PA with the "no-cpu-limit" option.


Comment 26 Lennart Poettering 2008-09-09 20:54:37 UTC
Closing this bug now.


Note You need to log in before you can comment on or make changes to this bug.