Using libsoxr-lsr in Alsa Rate Plugin with LD_PRELOAD

Since my previous post the great libsoxr library incl. the libsoxr-lsr variant has become part of debian testing/ubuntu repositories. It means we can easily use it instead of libsamplerate now.

Just install the package:

pavel@samsung ~ $ aptitude search libsoxr
p libsoxr-dev - High quality 1D sample-rate conversion lib
p libsoxr-dev:i386 - High quality 1D sample-rate conversion lib
p libsoxr-lsr0 - High quality 1D sample-rate conversion lib
p libsoxr-lsr0:i386 - High quality 1D sample-rate conversion lib
p libsoxr0 - High quality 1D sample-rate conversion lib
p libsoxr0:i386 - High quality 1D sample-rate conversion lib

sudo aptitude install libsoxr-lsr0

Check contents of the package:

pavel@samsung ~ $ dpkg -L libsoxr-lsr0
...
/usr/lib/x86_64-linux-gnu/libsoxr-lsr.so.0.1.9
...
/usr/lib/x86_64-linux-gnu/libsoxr-lsr.so.0
...

Using the device rate192 (resampling to 192kHz using samplerate_best) from my previous post, on my samsung laptop:

time aplay -D rate192 sweep.wav
Playing WAVE 'sweep.wav' : Signed 24 bit Little Endian in 3bytes, Frekvence 44100 Hz, Stereo

real 0m10.060s
user 0m7.652s
sys 0m0.044s

Almost 8secs of CPU time for 10 secs playback on Intel i5.

Now let’s use libsoxr-lsr0 instead of libsamplerate, using the handy LD_PRELOAD method:

time LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libsoxr-lsr.so.0 aplay -D rate192 sweep.wav
Playing WAVE 'sweep.wav' : Signed 24 bit Little Endian in 3bytes, Frekvence 44100 Hz, Stereo

real 0m10.037s
user 0m0.652s
sys 0m0.040s

650ms is a way better figure :-)

Unfortunately the spectrum test still reveals the (actually audible) cracks:

As you see the cracks appear only during the first seconds of playback. Hopefully in co-operation with authors of libsoxr this minor issue will be fixed soon.

Note: The noisy background compared to the dark black one of spectrograms shown in my previous post is caused by conversion down to 16 bits, still present in stock alsa library. I will post my patch to alsa-devel mailinglist.

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

20 Responses to Using libsoxr-lsr in Alsa Rate Plugin with LD_PRELOAD

  1. Купить саженцы кустарников почтой.
    Интернет магазин саженцы почтой.

    Hello very cool site!! Guy .. Beautiful .. Wonderful ..
    I’ll bookmark your website and take the feeds additionally?
    I’m glad to seek out a lot of useful info right here in the submit,
    we need develop more techniques in this regard, thanks for
    sharing. . . . . .

  2. You are so interesting! I don’t suppose I’ve truly read a single thing like this before.
    So wonderful to find somebody with some original thoughts on this issue.
    Really.. thank you for starting this up. This site is something that’s needed on the internet, someone with a little originality!

  3. Hello! Do you know if they make any plugins to protect against hackers?
    I’m kinda paranoid about losing everything I’ve worked hard on.
    Any recommendations?

    Look at my web page – star wars first assault

  4. Click the “Options” button for the Outlook Express toolbar.
    Mail “Categories” feature permits you to group multiple contacts together, then email all them simultaneously by simply sending an email compared to that Category.

    my web blog yahoo.com login

  5. Hey very interesting blog!

  6. As soon as once more , that is practically similar to Injustice.

    Also visit my homepage: WWE Immortals Hack

  7. Our coders are always making sure that only safe and fully working hack tools are released!

  8. toppless says:

    I enjoy, result in I found exactly what I used to be looking for.

    You have ended my 4 day lengthy hunt! God Bless you man. Have a nice day.
    Bye

  9. The Gucci sunglasses are manufactured to
    meet this requirement and are always labeled as UV400; an indication that they block ultraviolet rays of that wavelength.
    It may not be considered worthwhile to spend a big amount
    on an item like a snapback because one cannot be certain about
    the period for which the fashion may last. Following trends doesn’t always make you just another follower but in fact if you’re one of
    the earliest adopters then you’d always stand out and stay a cut above the rest.

  10. Those who choose making fish should consider
    trying to catch your individual.

    Have a look at my web-site; http://www.ishibeautyart.com

  11. It’s nearly impossible to find knowledgeable
    people about this topic, however, you sound like you
    know what you’re talking about! Thanks

  12. In a period of Internet safety concerns, locking down your Facebook account is critical to safeguarding your.

    Manually adding your family members, friends and co-workers
    on your facebook login profile could be time-consuming, particularly if you already have their own contact details.

  13. Solutions consist of voice as well as information cabling services and fiber optic cabling job services.

    My web-site – Cabling contractor leads

  14. I do agree with all the ideas you’ve presented for
    your post. They’re very convincing and can certainly work.
    Still, the posts are too short for starters. May you please lengthen them a bit from subsequent time?

    Thank you for the post.

  15. Well, you just have to click download button and you
    will get your copy of Madden NFL Mobile Hack Tool right away!

  16. I’m really impressed with your writing skills ass well as with the layout on yourr blog.
    Is this a paid theme or did you modify it yourself?

    Anyway keep up the excellent quality writing, it is rare to see a great blopg like this one nowadays.

    Also visit my website … alat bantu sex murah

  17. Nevertheless, this drug can also increase aerobic capacity (quantity
    of oxygen utilized by the physique in the course of exercise) and is useful to the asthmatic.

  18. Contrary to well-known belief, Clenbuterol has a half life
    of 35 hours and not 48 hours.

  19. I’m truly enjoying the design and layout of your blog. It’s a very easy on the eyes which makes
    it much more enjoyable for me to come here and visit more often.
    Did you hire out a developer to create your theme?

    Outstanding work!

  20. In order to shield your self from the worries of side effects you
    need to speak with a physician about your selection to purchase steroids
    on the internet.

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>