Pulseaudio with LD_PRELOADing libsoxr-lsr

Pulseaudio with default-sample-rate=192000 and resample-method=src-sinc-best-quality takes about 90% CPU on my i5, aplay via default (pulse plugin) complains about xruns, pulseaudio gets killed eventually (I do not know what kills it, CPU ulimit is unlimited, probably some laptop service watching CPU hogs).

Simply starting pulseaudio with LD_PRELOAD

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libsoxr-lsr.so.0 pulseaudio

drops pulseaudio CPU load down to 6-9% while resampling running (checked in the card’s hw_params).

That was simple :)

Integrating with client-spawn pulseaudio

Tested on Mint15:
1. Create executable script /usr/local/bin/pulseaudio.sh. Make sure to use correct path to your libsoxr-lsr library:

Bash | view plain | copy to clipboard by clicking on icon (via flash)  
#! /bin/bash
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libsoxr-lsr.so.0
exec /usr/bin/pulseaudio $@ 

Do not forget to set it executable:

Bash | view plain | copy to clipboard by clicking on icon (via flash)  
chmod a+x /usr/local/bin/pulseaudio.sh

2. Set path to the script as your pulseaudio daemon binary in /etc/pulse/client.conf
daemon-binary = /usr/local/bin/pulseaudio.sh

That’s it :-)

This entry was posted in Linux Audio. Bookmark the permalink.

6 Responses to Pulseaudio with LD_PRELOADing libsoxr-lsr

  1. gmail sign in video
    chat allows Gmail account holders to communicate
    with Gmail users via video. By default, Google Sync synchronizes Calendar and Contacts
    automatically.

  2. Hello all, here every person is sharing these kinds of
    knowledge, thus it’s nice to read this blog, and I used to pay a quick
    visit this website every day.

  3. Peculiar article, exactly what I needed.

    Here is my blog; paid surveys online

  4. Additionally, try to locate a good company to have your loan from.

    my homepage; payday loans online (http://www.evxteam.org)

  5. Name says:

    Thank you for this solution that drops the CPU significantly and give us really good resampling. The problem on my computer is that linux lose connection to Pulseaudio every now and then. You have an idea why this might happen? Secondly, what SoX resampling settings are being used?

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*
captcha

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>