Pulseaudio network sinks overload CPU

Bug #329896 reported by Mark Greenwood
24
This bug affects 2 people
Affects Status Importance Assigned to Milestone
alsa-lib (Ubuntu)
Invalid
Undecided
Unassigned
Nominated for Jaunty by Jovaro
pulseaudio (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Jaunty by Jovaro

Bug Description

Binary package hint: pulseaudio

Description: Ubuntu jaunty (development branch)
Release: 9.04

Trying to use network sinks with Pulseaudio causes unacceptable CPU load on both ends.

To reproduce, you need 2 machines on a LAN.
It's most obvious if you run 'top' on both machines while doing the following:

1) On machine 1 use paprefs to enable the following 3 options:
    Enable network access to local sound devices
    Allow other machines on the LAN to discover local sound devices
    Don't require authentication

2) On machine 2 use paprefs to enable the option
    Make discoverable network sound devices available locally

Now, on machine 2, open pavucontrol. Watch the CPU usage of 'pulseaudio' on both machines rise and rise. On one of my machines it maxes out the CPU and pulseaudio quits.

Until recently I was using Ubuntu 8.10 on both these machines and didn't have this problem. CPU usage of pulseaudio barely registered.

I can't see this being an ALSA issue because no audio is playing at the time.

pulseaudio:
  Installed: 0.9.14-0ubuntu5
  Candidate: 0.9.14-0ubuntu5
  Version table:
 *** 0.9.14-0ubuntu5 0
        500 http://gb.archive.ubuntu.com jaunty/main Packages
        100 /var/lib/dpkg/status

uname -a
Linux hoss 2.6.28-7-generic #20-Ubuntu SMP Mon Feb 9 15:42:34 UTC 2009 x86_64 GNU/Linux

Seen on x86_64 and i386 installations.

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

fixed in 0.9.15-test2

Changed in pulseaudio:
status: New → Fix Committed
Revision history for this message
Mark Greenwood (fatgerman) wrote :

Is that fix in this package which appeared as an update today?

pulseaudio:
  Installed: 0.9.14-0ubuntu6
  Candidate: 0.9.14-0ubuntu6
  Version table:
 *** 0.9.14-0ubuntu6 0
        500 http://gb.archive.ubuntu.com jaunty/main Packages
        100 /var/lib/dpkg/status

Installed the above package today and it has not fixed the issue. Indeed, opening pavucontrol even with no network sinks enabled will cause the local CPU usage to reach 95%.

Revision history for this message
Mark Greenwood (fatgerman) wrote :

As of today's update:

bob@hoss:~$ apt-cache policy pulseaudio
pulseaudio:
  Installed: 0.9.14-0ubuntu7
  Candidate: 0.9.14-0ubuntu7
  Version table:
 *** 0.9.14-0ubuntu7 0
        500 http://gb.archive.ubuntu.com jaunty/main Packages
        100 /var/lib/dpkg/status

I can now see network sinks, and I can have pavucontrol open. But any attempt to send audio to a network sink results in that sink crashing within 30 seconds. Again, CPU usage on the sink exceeds 90% (with pulseaudio 0.9.10 on both machines and the same settings CPU usage was < 10%). On several occasions the crash has been severe enough that the only way to recover the machine is to power cycle it.

Note: The sink machine has not been upgraded - this is running ubuntu 8.10 with pulseaudio 0.9.10 and has always been stable. It's only the sending machine that I have upgraded. The bug is therefore definitely in sending audio across the network.

Progress, but not complete yet.

Revision history for this message
Marcos (deflagmator) wrote :

With last upgrade today the remote pulseaudio ( ubuntu 8.10 ) crashes.

Soft CPU time limit exhausted, terminating

Revision history for this message
Mark Greenwood (fatgerman) wrote :

Hi,

The status of this bug says 'Fix Committed' - does this mean I should have the fix?
I now have:

apt-cache policy pulseaudio
pulseaudio:
  Installed: 1:0.9.14-0ubuntu16
  Candidate: 1:0.9.14-0ubuntu16
  Version table:
 *** 1:0.9.14-0ubuntu16 0
        500 http://gb.archive.ubuntu.com jaunty/main Packages
        100 /var/lib/dpkg/status

and this bug is still very much present.

http://homepage.ntlworld.com/fatgerman/local_end.txt - log from the end which is discovering network sinks
http://homepage.ntlworld.com/fatgerman/remote_end.txt - log from the network sink

Revision history for this message
Michael Gratton (mjog) wrote :

Yes, I can confirm this is still a problem using the 1:0.9.14-0ubuntu20 packages.

Revision history for this message
Jovaro (bug-jovaro) wrote :

I have the same problem with pulseaudio. I run mythtv with pulseaudio on a VIA board and the computer becomes unusable when it tries to play sound with pulseaudio. I removed pulseaudio as a very temporary solution.

According to Daniel T Chen, the fix is commited in a 0.9.15 version. Perhaps he can tell us when this version will be released or how to get this version?

Revision history for this message
Robin Sheat (eythian) wrote :

Any word on this? It is still occurring in 9.04, and makes the whole 'network audio' promise of pulseaudio fairly useless. Maybe there's a PPA we can get an improved version from...?

Revision history for this message
Robin Sheat (eythian) wrote :

Actually, it makes the whole 'be on a network, and listen to music at all' thing pretty useless, as if someone else has pulseaudio and is on the LAN, it'll keep crashing.

Anyway, I found this PPA:
https://launchpad.net/~themuso/+archive/ppa
which contains the next version up. My brief testing of it indicates that it works. I'm streaming audio again like I did in 8.10, but which I couldn't do with the stock pa from 9.04.

Revision history for this message
Daniel T Chen (crimsun) wrote : Re: [Bug 329896] Re: Pulseaudio network sinks overload CPU

On Mon, 27 Apr 2009, Robin Sheat wrote:
> Any word on this? It is still occurring in 9.04, and makes the whole
> 'network audio' promise of pulseaudio fairly useless. Maybe there's a
> PPA we can get an improved version from...?

Luke (themuso) maintains 0.9.15 in his PPA.

Revision history for this message
Marcos (deflagmator) wrote :

I tried all the posibilities and finally I found the solution.

With the default ALSA installed with Jaunty the Luke (themuso) PPA doesn't work correctly.

Install the Luke (themuso) PPA together with ALSA updated to 1.0.19.
http://ubuntuforums.org/showthread.php?p=6589810

(AlsaUpgrade-1.0.x-rev-1.16.tar)

NOTE: Before use this script "AlsaUpgrade-1.0.x-rev-1.16.tar" you must install the ALSA-LIBS (http://ppa.launchpad.net/themuso/ppa/ubuntu/pool/main/a/alsa-lib/alsa-lib_1.0.19.orig.tar.gz)

Let me know if this help you.

Revision history for this message
Øyvind Stegard (oyvindstegard) wrote :

Confirming here too. I cannot get network-audio to work at all with Pulseaudio in Jaunty. If I try, the pulseaudio server immediate disconnects all clients (probably crashes, I haven't bothered checking yet).

Daniel T Chen (crimsun)
Changed in alsa-lib (Ubuntu):
status: New → Fix Committed
Revision history for this message
robert114 (robertreems) wrote :

Just updated my Pulseaudio with the Jaunty proposed repo. The problem didn't go away.

Haven't tried anything else jet.

My sort-of-work-a-round: I just use the Netwerk Ubuntu as Default Server, that way i still can use Pulse audio without crashes or high CPU-usage. I don't make discoverable network sound devices available locally

Robert

Revision history for this message
Marcos (deflagmator) wrote :

Robert,

I have the same problem that you. The only solution that I found is to use Network Ubuntu as Default Sever that you mentioned.

Since your post have you found any different solution?

Whith "themuso" packages I feel less CPU usage but the sink sound to network is very buggy.

regards,

Marcos

Revision history for this message
Mark Greenwood (fatgerman) wrote :

Any volunteers to make a Pulseaudio 0.9.10 package available for Jaunty? I've been tracking pulseaudio git for a few weeks and it's just getting worse and worse. It got so bad I gave up.

Revision history for this message
Andreas Kern (kerna) wrote :

what worked for me was turning "enable network access to local sound devices" off on the source side and also turning off "make discoverable network sound dev..." on the "sink"-side

first i thought, that the problem was somewhere else cause of the strange network behaviour, because the sink is an 4g eeepc attached to the stereo and while connected over wlan pulseaudio was up and sound was choppy, but when i connected the netbook to the normal wired lan, the network traffic and the cpu load kept rising 'til crash. in a nutshell wlan works, wired-lan crashes ... but now it works over wired lan with turning the "unnecessary" services off

Revision history for this message
robert114 (robertreems) wrote :

Dodoth,

Thanx but your solution didn't work here.

I'm using the "themuso" repo

Robert

Revision history for this message
scontin (stecontin) wrote :

 "Make discoverable network sound devices available locally" is wrong conceptually.

If one wants redirect audio, it's right to use CPU power of other machine, in other words the instance of Pulseaudio available through network. In this way, local Pulseaudio won't be used.
Turning the option on, local pulseaudio try to elaborate remote audio flow, with all the obvious delays.

Without this option all is OK :-)

Stefano from Italy

Revision history for this message
scontin (stecontin) wrote :

According to me, "themuso" repo is a mess.
I had all kind of problems using it.....
Reverting to old pulseaudio default in Jaunty, all OK.
Same 32 and 64 bit

Stefano

Revision history for this message
burgwinkel (burgwinkel) wrote :

Enabling "Allow other machines on the LAN to discover local sound devices" at the server crashes PulseAudio. PA works fine as long as I manually define the server IP at each of the client machines.

This has been this way since my Jaunty upgrade in May 2009. Maybe even before? This may have been an issue for me throughout Intrepid, too. I use to be able to "Allow other machines on the LAN to discover local sound devices" when on Hardy for sure, and maybe during part of Intrepid, too.

Installed is 1:0.9.14-0ubuntu20.2 (jaunty-updates)

'uname -a' is
Linux joesbox 2.6.28-16-generic #55-Ubuntu SMP Tue Oct 20 19:48:32 UTC 2009 x86_64 GNU/Linux

Interestingly, on my 32bit laptop, I can enable the 'allow machines on LAN to discover' option without crashing PA there. Though that is not being used as a server, so maybe that's meaningless.

Waiting for 0.9.15,
...still. I had hoped this issue would be fixed in Jaunty before the Karmic release.

In fairness, let me add that this issue is not critical, just annoying. I use PulseAudio exclusively in my home network, and except for this annoyance, I find PulseAudio is stable and, frankly, quite magical. :)

Revision history for this message
Rola (pabswiss) wrote :

Had a similar problem with my eee 1005ha (under Karmic). Enabling pulseaudio network audio and playing music inmediately crashed on server machine (the one broadcasting audio). Problem got better after installing backported wireless modules. After that, it connects and plays music, but has very annoying skips every two minutes or so, and finally ends crashing after some time.

I currently blame the wireless atheros card, as this doesn't happen when wired over 10/100 ethernet cable. Ordered a Dell 1510 wireless to try see if it makes any difference, though...

Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

Are you still affected by this bug? Tell us your Ubuntu versions please! Thank you very much!

Changed in pulseaudio (Ubuntu):
status: Fix Committed → Incomplete
Changed in alsa-lib (Ubuntu):
status: Fix Committed → Invalid
Revision history for this message
burgwinkel (burgwinkel) wrote :

I don't know when exactly, but for a while now everything has been fine.

The server is on Lucid (still), as are the client machines.
'uname -a' yields:
Linux blubox 2.6.32-47-generic #109-Ubuntu SMP Tue May 7 02:02:22 UTC 2013 x86_64 GNU/Linux
pulseaudio version is
0.9.21-63-gd3efa-dirty

I just checked it again, with a video on the client sending audio flawlessly through both simultaneous output, and directly to the server's sound card (with "Allow other machines on the LAN to discover local sound devices" enabled).

I hesitate to upgrade to Precise. But, I must. I hope PA--and everything else--continues as well on Precise as on Lucid.

Revision history for this message
Thomas Hotz (thotz-deactivatedaccount) wrote :

Marking this bug as fixed.

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