Ticket #357 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

random deadlock in pulseaudio

Reported by: baszoetekouw Owned by: lennart
Milestone: Component: daemon
Keywords: Cc:

Description

When playing a movie with mplayer using pulseaudio, pulseaudio randomly deadlocks after a while (can be 2 minutes, can be half an hour). The issue seems to occur more often of I use 6 channel output, and also more often if the machien is more loaded (e.g., if a large compilation job is running in the background).

The gdb backtrace (attached) shows that pulseaudio is deadlocked in pa_semaphore_wait().

Attachments

backtrace.txt (2.6 kB) - added by baszoetekouw 3 years ago.
gdb backtrace
pulseaudio.sinc (92.1 kB) - added by yar1984 3 years ago.
log of playing about 60 seconds of 2-channel flac with rhythmbox and pulseaudio-0.9.13 and 48000/2ch/src-sinc-best-quality resampling
pulseaudio.speex (19.2 kB) - added by yar1984 3 years ago.
log of playing about 60 seconds of 2-channel flac with rhythmbox and pulseaudio-0.9.13 and 48000/2ch/speex-float-3 resampling
pulseaudio.sinc6 (63.1 kB) - added by yar1984 3 years ago.
log of playing about 60 seconds of 2-channel flac with rhythmbox and pulseaudio-0.9.13 and 48000/6ch/src-sinc-best-quality resampling

Change History

Changed 3 years ago by baszoetekouw

gdb backtrace

  Changed 3 years ago by baszoetekouw

oh, btw, this is in pulseaudio 0.9.10 (current version in Debian)

  Changed 3 years ago by lennart

  • status changed from new to closed
  • resolution set to fixed
  • milestone set to 0.9.11

This is a know bug in < 0.9.11. If a lot of messages are sent internally in PA in a very short timefrime PA might lockup. This is fixed in 0.9.11.

  Changed 3 years ago by yar1984

  • status changed from closed to reopened
  • resolution fixed deleted

I reopened this, because I see same bug in 0.9.13. I play with

mplayer -vo pulse somefile.flac

and after some short time mplayer freezes. It happens with this:

resample-method = src-sinc-...
default-sample-channels = 6
default-sample-rate = 48000

in my daemon.conf.

Also there are clicks in sound with

resample-method = src-sinc-...
default-sample-rate = 48000

in my daemon.conf

Maybe, it's because I use BOINC full-time

  Changed 3 years ago by yar1984

I found this in verbose log of pulseaudio

Soft CPU time limit exhausted, terminating.
E: cpulimit.c: Recevied request to terminate due to CPU overload.

It's when I use 48000/6ch/src-sinc

  Changed 3 years ago by yar1984

And when I changed daemon.conf to 48000/2ch/src-sinc-best-quality, and played same flac with mplayer, it freezes, but pulseaudio don't crash

  Changed 3 years ago by yar1984

So, the problem is (probably) conflicting BOINC and pulseaudio with src-sinc-best-quality resampler

  Changed 3 years ago by yar1984

Hmmm, I disabled BOINC, and there is same problem - pulseaudio crashes after some time with

resample-method = src-sinc-...
default-sample-channels = 6
default-sample-rate = 48000

in daemon.conf

  Changed 3 years ago by yar1984

BTW, in 0.9.9 I can use mplayer with pulseaudio with 48000/2ch/src-sinc-best-quality without problems

  Changed 3 years ago by yar1984

I use gentoo amd64 (with some ~amd64 ebuilds) MPlayer dev-SVN-r28058-4.2.4 (C) 2000-2008 MPlayer Team CPU: Pentium(R) Dual-Core CPU E5200 @ 2.50GHz (Family: 6, Model: 23, Stepping: 6) Sound - Onboard ALC1200 (which detected as ALC888)

  Changed 3 years ago by yar1984

Also, I hear clicks with 48000/6ch/src-sinc-best-quality,pulseadio-0.9.13 and rhythmbox, and when I press the 'Next' button, rhythmbox freezes

  Changed 3 years ago by coling

While it's probably a different bug your getting than this particular one, what system are you using your 0.9.13 on? The reason I ask is that there are several patches needed on top of 0.9.13 for it to be stable and you should make sure you have these patches.

Please see the fedora 10 package to see which patches are needed (assuming you're not using it already ;)

  Changed 3 years ago by yar1984

No, I'm using gentoo, but thanks for advice, I will test those patches

  Changed 3 years ago by yar1984

No, patches doesn't work. I also see many messages in puseaudio log, when I heared clicks:

D: sink.c: Processing rewind...
D: sink-input.c: Have to rewind 6740 bytes on render memblockq.
D: protocol-native.c: Requesting rewind due to end of underrun.
D: module-alsa-sink.c: Requested to rewind 8204 bytes.
D: module-alsa-sink.c: Limited to 8204 bytes.
D: module-alsa-sink.c: before: 2051
D: module-alsa-sink.c: after: 2051
D: module-alsa-sink.c: Rewound 8204 bytes.
D: sink.c: Processing rewind...
D: sink-input.c: Have to rewind 8204 bytes on render memblockq.
D: protocol-native.c: Requesting rewind due to end of underrun.
D: module-alsa-sink.c: Requested to rewind 8424 bytes.
D: module-alsa-sink.c: Limited to 8424 bytes.
D: module-alsa-sink.c: before: 2106
D: module-alsa-sink.c: after: 2106
D: module-alsa-sink.c: Rewound 8424 bytes.
D: sink.c: Processing rewind...
D: sink-input.c: Have to rewind 8424 bytes on render memblockq.
D: protocol-native.c: Requesting rewind due to end of underrun.
D: module-alsa-sink.c: Requested to rewind 26628 bytes.
D: module-alsa-sink.c: Limited to 24736 bytes.
D: module-alsa-sink.c: before: 6184
D: module-alsa-sink.c: after: 6184
D: module-alsa-sink.c: Rewound 24736 bytes.

I see this with and without patching pulseaudio sources with fedora 11 patches

follow-up: ↓ 15   Changed 3 years ago by coling

Whilst I'm not expert enough to know more, the stuttering and the rewind requests may be due to buggy alsa driver. Pulse is using some fairly bleeding edge stuff from alsa and not all drivers handle it well yet. Hopefully Lennart can advise better than me in due course.

in reply to: ↑ 14   Changed 3 years ago by yar1984

Replying to coling:

Whilst I'm not expert enough to know more, the stuttering and the rewind requests may be due to buggy alsa driver. Pulse is using some fairly bleeding edge stuff from alsa and not all drivers handle it well yet. Hopefully Lennart can advise better than me in due course.

But with speex resampler there is no clicks!

Changed 3 years ago by yar1984

log of playing about 60 seconds of 2-channel flac with rhythmbox and pulseaudio-0.9.13 and 48000/2ch/src-sinc-best-quality resampling

Changed 3 years ago by yar1984

log of playing about 60 seconds of 2-channel flac with rhythmbox and pulseaudio-0.9.13 and 48000/2ch/speex-float-3 resampling

Changed 3 years ago by yar1984

log of playing about 60 seconds of 2-channel flac with rhythmbox and pulseaudio-0.9.13 and 48000/6ch/src-sinc-best-quality resampling

  Changed 3 years ago by yar1984

This is logs of pulseaudio: pulseaudio.sinc - clicks, no crash pulseaudio.speex - no clicks, no crash pulseaudio.sinc6 - clicks, crash

  Changed 3 years ago by lennart

  • milestone 0.9.11 deleted

  Changed 3 years ago by yar1984

Strange thing - when I disable hal detection and load alsa sink with load-module module-alsa-sink there are no clicks with 48000/2ch/src-sinc-best-quality and only 2 messages of

Requesting rewind due to latency change.

With 48000/6ch/speex-float-3 there are no clicks also, but with 48000/6ch/src-sinc-best-quality there are clicks, lot of rewinding messages and freeze of playing after some time (without any message in pulseaudio log)

  Changed 3 years ago by lennart

  • status changed from reopened to closed
  • resolution set to fixed

yar1984, please don't hijack bug reports. What you describe is certainly no deadlock. For you PA doesn't hang, it terminates. And most likely that is the case because you use the resampler that is most CPU intensive and use it for 6ch audio. That causes PA to use a lot of CPU time that in the end causes the CPU load monitor to become active and kill PA.

Again, please don't hijack bug reports: unless you are certain that your bug is the same as someone else's, create a new bug report instead of hijacking. THank you.

  Changed 3 years ago by yar1984

Sorry for inconvenience, opened #458

Note: See TracTickets for help on using tickets.