pulseaudio ABENDS if too many clients connect

Bug #226342 reported by Mark Falcey on 2008-05-04
54
This bug affects 1 person
Affects Status Importance Assigned to Milestone
paconfig
Invalid
Unknown
pulseaudio (Ubuntu)
Low
Unassigned

Bug Description

Hardy 8.04 LTS 386i

Rythmbox locked up the system when changing cds. Keyboard and mouse locked up. Hard reboot necessary.

The following error messages were found in the syslog on reboot:

May 3 20:50:34 mark-desktop pulseaudio[5860]: module-alsa-sink.c: Error opening PCM device front:0: Device or resource busy

May 3 20:53:00 mark-desktop pulseaudio[5860]: sink-input.c: Failed to create sink input: too many inputs per sink.

May 3 20:53:00 mark-desktop pulseaudio[5860]: sink-input.c: Failed to create sink input: too many inputs per sink.

Mark Falcey (mfalcey) wrote :

Does not seem to happen when ESD is not checked in System/Sound/Sounds. Will explore further...

Anton Belyaev (anton-belyaev) wrote :

This started to happen with me periodically after I upgraded to 8.04 LTS (Hardy):

Similar symptoms:
- sound does not work
- cannot click anything at taskbars
- same log messages

Anton Belyaev (anton-belyaev) wrote :

Can it depend on audio hardware? Mine is:

00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)

Sidarth Dasari (sirsid) wrote :

I had the same problems, and opened a bug report. Ill just link it to this one.
https://bugs.edge.launchpad.net/ubuntu/+source/pulseaudio/+bug/226654

How did you get the audio device? I think I may have the same one.

Anton Belyaev (anton-belyaev) wrote :

Sidarth Dasari,

I found my audio device in the output of lspci command.

Sidarth Dasari (sirsid) wrote :

I also have an intel sound card

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)

Sidarth Dasari (sirsid) wrote :

More then one of us have the same problem

Changed in pulseaudio:
status: New → Confirmed
Mark Falcey (mfalcey) wrote :

My audio controller is an ATI IXP SB400 AC97 so i don't think this is so much a hardware problem.

Anton Belyaev (anton-belyaev) wrote :

I've found a workaround to avoid hard reboot:

kill the pulseaudio daemon:

pulseaudio -k

Though it does not start again, but at least sound appears again.

Anton Belyaev (anton-belyaev) wrote :

Hey guys,

Do you think our bug can be a duplicate of this one?

https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/219848

Sidarth Dasari (sirsid) wrote :

I dont think so, there are still other bugs in pulesaudio. Ive done some searching and there are bugs where only one app can play sounds and so on.
The only have to have seen if his bug was the same was if there were errors in /var/log/messages.

Sidarth Dasari (sirsid) wrote :

Im also getting this error occasionally and I lose sound in all but one application

lappy pulseaudio[6296]: pstream.c: Failed to import memory block.

Sidarth Dasari (sirsid) wrote :

I came across this recently. See if it helps at all.

http://tombuntu.com/index.php/2008/05/09/stop-flash-from-locking-system-audio/

I did notice that alot of my problems started happening after I surfed the web in firefox.

Same bug on my HP dv9000 Pavilion laptop.

After using the laptop for a few minutes, I notice that
sound stops working. From then on, I can't start applications
from GNOME menu (gnome-terminal hangs from example).

I see those errors in logs:

pel@pel-laptop:~$ tail -f /var/log/messages
May 11 09:57:25 pel-laptop kernel: [ 51.276557] NET: Registered protocol family 10
May 11 09:57:25 pel-laptop kernel: [ 51.276806] lo: Disabled Privacy Extensions
May 11 09:57:39 pel-laptop pulseaudio[5937]: alsa-util.c: Device front:0 doesn't support 44100 Hz, changed to 48000 Hz.
May 11 09:57:39 pel-laptop pulseaudio[5937]: alsa-util.c: Device front:0 doesn't support 44100 Hz, changed to 48000 Hz.
May 11 09:57:39 pel-laptop pulseaudio[5937]: alsa-util.c: Cannot find fallback mixer control "Mic".
May 11 10:17:11 pel-laptop -- MARK --
May 11 10:26:14 pel-laptop pulseaudio[5937]: sink-input.c: Failed to create sink input: too many inputs per sink.
May 11 10:34:20 pel-laptop pulseaudio[5937]: sink-input.c: Failed to create sink input: too many inputs per sink.
May 11 10:37:08 pel-laptop kernel: [ 1778.924660] ALSA /build/buildd/linux-ubuntu-modules-2.6.24-2.6.24/debian/build/build-generic/sound/alsa-driver/pci/hda/../../alsa-kernel/pci/hda/hda_i>
May 11 10:37:08 pel-laptop pulseaudio[5937]: sink-input.c: Failed to create sink input: too many inputs per sink.

Here is my sound card:

$ lspci | grep -i audio
00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)

André Cruz (andrefcruz) wrote :

I also have the problems described here.

/var/log/messages
May 19 09:32:42 huge pulseaudio[31395]: pstream.c: Failed to import memory block.
May 19 09:52:38 huge -- MARK --
May 19 09:57:49 huge pulseaudio[31395]: pstream.c: Failed to import memory block.
May 19 10:06:12 huge pulseaudio[31395]: pstream.c: Failed to import memory block.
May 19 10:32:38 huge -- MARK --
May 19 10:44:41 huge pulseaudio[31395]: sink-input.c: Failed to create sink input: too many inputs per sink.
May 19 10:44:54 huge pulseaudio[31395]: sink-input.c: Failed to create sink input: too many inputs per sink.
May 19 10:47:28 huge pulseaudio[31395]: sink-input.c: Failed to create sink input: too many inputs per sink.
May 19 10:48:22 huge pulseaudio[31395]: sink-input.c: Failed to create sink input: too many inputs per sink.
May 19 10:51:43 huge pulseaudio[31395]: sink-input.c: Failed to create sink input: too many inputs per sink.

lspci:
00:1f.5 Multimedia audio controller: Intel Corporation 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller (rev 02)

Killing pulseaudio brings life again to the system but some applications (gaim) monopolize the CPU afterwards.

Vladimir Osintsev (osintsev) wrote :

I have a similar problem as well. Sound disappears, the logs look like this:

/var/log/messages:
Jun 20 01:54:27 ubuntu pulseaudio[6479]: sink-input.c: Failed to create sink input: too many inputs per sink.
Jun 20 01:54:40 ubuntu pulseaudio[6479]: sink-input.c: Failed to create sink input: too many inputs per sink.
Jun 20 02:02:23 ubuntu pulseaudio[6479]: sink-input.c: Failed to create sink input: too many inputs per sink.

/var/log/mpd/errors.log:
Jun 20 02:48: Error opening alsa device "default": Device or resource busy
ALSA lib pcm_dmix.c: 874: (snd_pcm_dmix_open) unable to open slave
Jun 20 02:48: Error opening alsa device "default": Device or resource busy
Jun 20 02:48: problems opening audio device while playing "http://205.188.215.225:8018"
ALSA lib pcm_dmix.c: 874: (snd_pcm_dmix_open) unable to open slave
Jun 20 02:48: Error opening alsa device "default": Device or resource busy
Jun 20 02:48: problems opening audio device while playing "http://205.188.215.225:8018"
ALSA lib pcm_dmix.c: 874: (snd_pcm_dmix_open) unable to open slave
Jun 20 02:48: Error opening alsa device "default": Device or resource busy
Jun 20 02:48: problems opening audio device while playing "http://205.188.215.225:8018"

lspci:
00:1 b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 02)

Looks like there should be enough information here for a developer to start working on this.

Changed in pulseaudio:
importance: Undecided → Medium
status: Confirmed → Triaged

This bug has been committed upstream as well. You can track it there at:
http://pulseaudio.org/ticket/313

Changed in paconfig:
status: Unknown → New
Changed in paconfig:
status: New → Invalid
DEXTER (mydexterid) wrote :

Yes, and it is closed as invalid:
"Closing because this is not a bug in PA. PA behaves correctly: it puts a limit on the number of clients that may connect. "

Vladimir Osintsev (osintsev) wrote :

Then there may be a some workaround?

DEXTER (mydexterid) wrote :

That is what everyone is looking for.. a working solution. But it seems that no one is interested in this among the maintainers.

Look at this: http://jeffreystedfast.blogspot.com/2008/06/pulseaudio-solution-in-search-of.html

Sidarth Dasari (sirsid) wrote :

So in otherwords...PA is doing what its supposed to do when it decides to lock up our computers.

Mark Falcey (mfalcey) wrote :

Well, here we are some six weeks later and a few PA proposed updates and some problems are solved. I have not had the original bug as I reported for weeks. But then again, I don't use a pure PA setup anymore either.

So, perhaps the devs have fixed this bug long ago and the distros are starting to catch up. Even so, I use ALSA for all the defaults and only set PA as the default sound card for ALSA. It is kind of circular but it is the only thing that works for multiple simultaneous sound without crashing. PA is using ALSA sinks and sources and ALSA is using PA.

Christopher Hübner (huebnerc) wrote :

I have extactly the same problems as described in https://bugs.edge.launchpad.net/ubuntu/+source/pulseaudio/+bug/226654.
Inability to open new applications, running applications crash and so on...
Other users on my machine don't have those problems.

lspci-Output:
00:1e.2 Multimedia audio controller: Intel Corporation 82801FB/FBM/FR/FW/FRW (ICH6 Family) AC'97 Audio Controller (rev 03)

weirdbro (wierdbro) wrote :

The reason that this freezes up all applications is because when pulseaudio is locked up, it locks up gconf, which many other applications depend upon. I've had to prevent pulseaudio from starting on my machine by removing it from the session preferences. Is there a reason that pulseaudio gets locked up by other applications. Also, has anyone else noticed that Pidgin goes wild and leaks memory at a horrendous rate once Pulseaudio is killed? Happens to me every time.

weirdbro (wierdbro) wrote :

Perhaps pidgin is one of the applications that can trigger this. Looking at the pulseaudio report, they say this is intentional. However, under no circumstances should their intentional limiting of the number of channels freeze my computer.

Sidarth Dasari (sirsid) wrote :

@weirdbro

Ive noticed that too with pidgin acting all strange.
It went away when i removed pulseaudio from my system

ward (ward-pong) wrote :

@weirdbro

<i>
The reason that this freezes up all applications is because when pulseaudio is locked up, it locks up gconf, which many other applications depend upon. I've had to prevent pulseaudio from starting on my machine by removing it from the session preferences. Is there a reason that pulseaudio gets locked up by other applications. Also, has anyone else noticed that Pidgin goes wild and leaks memory at a horrendous rate once Pulseaudio is killed? Happens to me every time.
</i>

All right - it's well into august 2008 now. I'm seeing exactly the same behavior on Hardy:

a) an application locks up the audio device (in my case, 'mpc pause')
b) no sound. Pulseaudio starts complaining.
c) after a while, large chunks of the desktop stop working - new applications can't be started, most of the panel disappears

So if you dare to kill pulsaudio (that's a kill -9, thank you, pulseaudio doesn't even respond to a gentle kill) while pidgin is running, pidgin starts leaking memory like there's no tomorrow - pretty soon (a few minutes on this machine with 2GB of ram) it eats all your ram + swap and you're dead in the water.

If you kill pidgin first, and then kill pulseaudio, suddenly sound works again.

It seems to me there are multiple bugs here:

a) pidgin should not leak memory like that. Ever.

b) pulseaudio needs to be smarter about dealing with sound devices that are locked up. If other applications are doing something they should not be (i.e. locking up the sound device) pulseaudio should deal with this gracefully. Not responding to a gentle kill? Locking gconf? Those are bugs, I'm sorry. Nasty bugs. Marking bugs like upstream #313 as invalid is ... not productive. Why is pulseaudio locking gconf?

c) mpc and friends should stop locking up audio devices. Duh.

gray (info-graydesigns) wrote :

hi just submitting some info from my install here, in the hopes that it might help...

install is from a daily CD of the 17 oct with all updates on a Pentium 4 box with 2.6 cpu and 768 megs ram - pretty entry level, but totally stable in XP, so the issue is not faulty hardware in any way.

I uploaded the same attachment in a bug report for rhythmbox, as that is the default music player.

cheers

gray (info-graydesigns) wrote :

Hi

in my present install of Intrepid (originally from a daily CD of 17 oct) the sound issue was substantially fixed by commenting out 3 lines in /etc/pulse/daemon.conf

resample-method = speex-float-1

default-fragments = 8
default-fragment-size-msec = 10

as suggested by psyke83 in the forum.

This played flawlessly for over 8 hours.

Daniel T Chen (crimsun) wrote :

These are client issues. Which client should PA deny (obviously intractable)?

Changed in pulseaudio:
importance: Medium → Wishlist
status: Triaged → Confirmed
Dima Ryazanov (dima-gmail) wrote :

The comment in the upsteam bug says:

"Some application is apparently creating a lot of streams in PulseAudio. Please use pavucontrol or "pactl list" to find out which one it is. "

I tried it:
$ pactl list
Connection failure: Timeout

So their claim that it's not a PA bug is pretty bogus.

--- On Thu, 2/5/09, Dima Ryazanov <email address hidden> wrote:
> I tried it:
> $ pactl list
> Connection failure: Timeout
>
> So their claim that it's not a PA bug is pretty bogus.

Try forcibly restarting pulseaudio first:
pulseaudio -k ; pulseaudio -D -vv

Dima Ryazanov (dima-gmail) wrote :

I tried "pulseaudio -k", but that didn't do anything - so I killed it with "kill -9".
I ran "pulseaudio -D -vv", and everything works: there's sound, and "pactl list" produces lots of output.

But killing and restarting PA isn't exactly a solution...

Daniel T Chen (crimsun) wrote :

Please let me know if you can reproduce this symptom on a current Jaunty install - you need at least pulseaudio_0.9.14-0ubuntu10.

Changed in pulseaudio:
importance: Wishlist → Low
Mark Falcey (mfalcey) wrote :
Download full text (4.8 KiB)

The problem from the OP is not present in Jaunty and has been resolved in Hardy and Intrepid but, since you ask I have experienced some other more distressing problems with pulseaudio/alsa in Jaunty. I have multiple sound devices, a mobo ALC883, a C-Media 8768 PCI card, a Plantronics USB headest that is reported as a C-Media, a HDMI output on my gpu (ati HD3650), and a Logitec USB webcam. Sound playback works Ok with any single device but when I try to use Simultaneous Output, which I am in need of, Pulseaudio is forced to exit after a few seconds and I find many of the following sort of messages in my logs.

I do not experience these problems in either Hardy or Intrepid. If you would like me to do anything to help resolve this issue please let me know.

Mar 2 09:12:43 mark-jaunty-desktop pulseaudio[4408]: asyncq.c: q overrun, queuing locally
Mar 2 09:12:43 mark-jaunty-desktop last message repeated 24 times

Feb 25 16:44:36 mark-jaunty-desktop pulseaudio[5553]: asyncq.c: q overrun, queuing locally
Feb 25 16:44:46 mark-jaunty-desktop last message repeated 31 times
Feb 25 16:44:46 mark-jaunty-desktop pulseaudio[5553]: cpulimit.c: Received request to terminate due to CPU overload.
Feb 25 16:44:47 mark-jaunty-desktop pulseaudio[6100]: alsa-util.c: Device hw:3 doesn't support 2 channels, changed to 1.
Feb 25 16:44:47 mark-jaunty-desktop pulseaudio[6100]: alsa-util.c: Device hw:2 doesn't support 44100 Hz, changed to 16000 Hz.
Feb 25 16:44:47 mark-jaunty-desktop pulseaudio[6100]: alsa-util.c: Device hw:2 doesn't support 2 channels, changed to 1.
Feb 25 16:44:57 mark-jaunty-desktop pulseaudio[6100]: cpulimit.c: Received request to terminate due to CPU overload.
Feb 25 16:50:02 mark-jaunty-desktop /USR/SBIN/CRON[6141]: (root) CMD ([ -x /usr/sbin/update-motd ] && /usr/sbin/update-motd 2>/dev/null)
Feb 25 16:50:56 mark-jaunty-desktop pulseaudio[6385]: alsa-util.c: Device hw:3 doesn't support 2 channels, changed to 1.
Feb 25 16:50:56 mark-jaunty-desktop pulseaudio[6385]: alsa-util.c: Device hw:2 doesn't support 44100 Hz, changed to 16000 Hz.
Feb 25 16:50:56 mark-jaunty-desktop pulseaudio[6385]: alsa-util.c: Device hw:2 doesn't support 2 channels, changed to 1.
Feb 25 16:53:40 mark-jaunty-desktop pulseaudio[6385]: asyncq.c: q overrun, queuing locally
Feb 25 16:53:52 mark-jaunty-desktop last message repeated 187 times
Feb 25 16:53:55 mark-jaunty-desktop pulseaudio[6385]: cpulimit.c: Received request to terminate due to CPU overload.
Feb 25 16:53:56 mark-jaunty-desktop pulseaudio[6385]: module-rescue-streams.c: Failed to move source output 0 "PulseAudio Volume Control" to alsa_input.pci_13f6_111_sound_card_0_alsa_capture_0.
Feb 25 16:53:56 mark-jaunty-desktop pulseaudio[6385]: module-rescue-streams.c: Failed to move source output 1 "PulseAudio Volume Control" to alsa_input.pci_13f6_111_sound_card_0_alsa_capture_0.
Feb 25 16:53:56 mark-jaunty-desktop pulseaudio[6385]: module-rescue-streams.c: Failed to move source output 2 "PulseAudio Volume Control" to alsa_input.pci_1002_4383_sound_card_0_alsa_capture_0.
Feb 25 16:53:56 mark-jaunty-desktop pulseaudio[6385]: module-rescue-streams.c: Failed to move source output 3 "PulseAudio Volume Control" to alsa_...

Read more...

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pulseaudio - 1:0.9.22~0.9.21+341-g62bf-0ubuntu1

---------------
pulseaudio (1:0.9.22~0.9.21+341-g62bf-0ubuntu1) lucid; urgency=low

  * New snapshot based on stable-queue git branch (testing requested
    specifically by upstream)
    - LP: #164745, #173212, #201391, #204536, #207796, #210016, #221038,
    - LP: #226342, #230408, #236423, #237443, #250059, #269585, #274304,
    - LP: #274577, #275474, #277532, #277566, #277932, #278025, #280534,
    - LP: #283049, #286816, #287036, #292732, #298011, #298301, #300290,
    - LP: #302038, #311497, #311853, #324062, #339448, #344057, #348979,
    - LP: #350829, #356206, #367379, #367544, #369822, #371897, #374846,
    - LP: #375570, #381801, #399515, #402950, #403786, #408169, #409322,
    - LP: #409723, #410326, #410446, #417695, #417976, #419271, #421072,
    - LP: #422774, #423979, #424655, #425028, #427016, #431072, #432660,
    - LP: #437640, #437996, #442191, #443306, #443389, #446719, #449762,
    - LP: #455417, #461532, #464652, #483191, #497537, #503780
  * debian/patches/:
    + add: 0099-change-configure-git-version-tag.patch: Match released
           upstream 0.9.21 for shlibs and LIBPULSE_VERSION_INFO
    - drop: 0004-set-tsched0.patch (no longer relevant)
            0050-revert-pacmd-poll-argv.patch (no longer relevant)
            0056-dont-bail-on-sound-class-modem.patch (merged)
            0056-ignore-sound-class-modem.patch (merged)
            0058-Backport-4c793.patch (merged)
            0059-Backport-978d3.patch (merged)
            0060-fix-implicit-func-decl-cpu-arm.patch (merged)
            0061-Backport-c5fdb.patch (merged)
            0070-dont-bail-on-sound-class-modem-devs.patch (merged)
    + refresh: 0001-change-resample-and-buffering.patch
               0090-disable-flat-volumes.patch
               0091-dont-load-cork-music-on-phone.patch
               0057-load-module-x11-bell.patch
 -- Daniel T Chen <email address hidden> Thu, 14 Jan 2010 20:33:05 -0500

Changed in pulseaudio (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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