Author Topic: Blog: PulseAudio: An Achilles Heel that needs repair  (Read 177 times)

Offline menotu

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 15304
  • ┌∩┐(◕_◕)┌∩┐
Blog: PulseAudio: An Achilles Heel that needs repair
« on: March 05, 2013, 01:38:50 PM »
Come in Just17, calling Just17  :D
====================

By Jack Wallen - March 4, 2013,

Jack Wallen takes on PulseAudio and runs head first into an issue that has been around since 2008. With Steam gaining ground, sound is going to become a crucial element for Linux. Can the PulseAudio developers solve this troubling issue?

I don’t usually have a case to go off on a Linux or an open source project. But in the case of PulseAudio — I do.

Let me set this stage.

One of my other, many jobs, is recording audio books. For this job I use Audacity — it’s a perfect solution for the task. I use Audacity on Ubuntu 12.10. Since purchasing a new computer (one with an Intel i5 chip), I’ve had nothing but issues with skipping sound (which caused ‘hiccups’ in the system and in my recordings). And I have gone through a long list of troubleshooting steps:

    Replaced motherboard
    Ran memtest86
    Replaced hard drive
    Tested CPU
    Installed three flavors of Linux (Ubuntu Studio, Linux Mint, Ubuntu 12.10)
    Installed three different kernels (3.7, 3.8, and low-latency)
    Tried various multimedia players
    Tweaked PulseAudio settings
    Read more about sound than I thought I ever would

Turns out — the issue has been around for some time and is still a problem. Now, before I lay blame on a single project, I understand it’s a challenge. The PulseAudio developers have to deal with multiple hardware, many distributions, desktops, and applications. It would be a daunting task for anyone. But —  and here’s where the sympathy leaves the building for me — prior to PulseAudio, this wasn’t an issue (and the developers of Esound, OSS, and Alsa had the same pressures on their shoulders).

I should also say that some of my tweaking had better results (I’ll share what I did in a moment); but, in the end, the skipping persists. I have to say this: Get it together PulseAudio! I’ve scoured countless forums to find posts dating back to 2008, posts complaining of the same problem. Countless bugs have been filed, but the pleas for help seem to fall on deaf ears.

Here’s the problem: When PulseAudio works well, it’s a dream. But when it starts causing problems, it’s a nightmare. Removing PulseAudio isn’t the solution — as too many distributions are now in deep with this sound system. Ultimately, the solution is for the skipping audio to be fully, and completely, addressed.
My optimizations

I’ve managed to get my skipping down to a bare minimum. I’ve tried quite a lot of tweaks and changes, but ultimately, what has worked the best for me, is the following:

    kernel 3.8.1 - generic
    using Audacious to listen to sound (making sure to choose PulseAudio for the output settings)

The following tweaks need to be made in the /etc/pulse/daemon.conf file:

Uncomment the following lines:


    realtime-scheduling = yes
    realtime-priority = 5

Uncomment the following lines:

    default-sample-format = s16le
    default-sample-rate = 44100
    default-sample-channels = 2

Set the following*:

    default-fragment-size-msec = 125
    default-fragments = 2

* The above numbers were derived from the following steps (done from a terminal window):

    echo autospawn = no >> ~/.pulse/client.conf
    killall pulseaudio
    LANG=C pulseaudio -vvvv > ~/pulseverbose.log 2>&1

Hit Ctrl-c to return to your prompt. Now run the following commands:

    rm ~/.pulse/client.conf
    grep device.buffering -m2 ~/pulseverbose.log

The second command should present to you something like:

: sink.c:     device.buffering.buffer_size = “352800″
: sink.c:     device.buffering.fragment_size = “176400″

The calculations for the settings are:

    352800/1411200 = 0,25s = 250 msecs
    176400/1411200 = 0,125s = 125 msecs

Once you’ve added those settings to /etc/pulse/daemon.conf, restart PulseAudio with the command pulseaudio -k. You should now enjoy less (but not zero) skipping.

http://www.techrepublic.com/blog/opensource/pulseaudio-an-achilles-heel-that-needs-repair/4202
PCLinuxOS 32bit KDE 4.10.1; kernel-3.4.11-pclos1.bfs & 64bit 3.2.18bfs; NVidia GeForce 8400GS 1GB 310.19 driver

Sony Vaio SVE1513A4ESI Laptop, Intel Core i5, 2.6GHz, 6GB RAM, 750GB, 15.6" Intel HD Graphics 4000

Online Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10647
  • MLUs Forever!
Re: Blog: PulseAudio: An Achilles Heel that needs repair
« Reply #1 on: March 05, 2013, 02:26:36 PM »
Quote
Come in Just17, calling Just17 
====================

Reporting for duty Sir!

I read through the post and one thing struck me very forcibly .......  there was a problem recording with one application (software) and apparently the fixes tried were to change hardware.

He reports skipping sound and states he uses Audacity for recording.
He tried various players and still had skipping.
He tried three distros .... all using the same base.
He tried different hardware.

What he does not appear to have tried is

1.    Use a different application to record
2.    Try an unrelated distro

 I would seriously have to ask why  ???

I am not in any way saying there is not a problem with PulseAudio.

I am saying that the elimination of other causes was not done.

Rather surprising for such a 'well known' name as Jack Wallen.


Regarding the tweaks he performed .......  most of those options are there for that very purpose. I fail to see why they should be such a huge 'deal' to use if required.


While there might be a problem with PulseAudio, there might also be a problem with the Bunty range of distros, or Audacity if the skips are recorded. I'm not sure to be honest whether the skipping is on playback of any file or only those recorded with Audacity.

Not convinced ;)

The other possibilities need to be eliminated first.

MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT