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.

One Response to Pulseaudio with LD_PRELOADing libsoxr-lsr

  1. That is very fascinating, You’re a very skilled blogger.
    I’ve joined your feed and stay up for searching for extra
    of your fantastic post. Additionally, I have shared your web site in my social networks

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>