[pulseaudio-discuss] [RFC PATCH] softvolume: implement fast volume translation

Maarten Bosmans mkbosmans at gmail.com
Wed Oct 19 01:41:32 PDT 2011


2011/10/19 Lu Guanqun <guanqun.lu at intel.com>:
> Hi Maarten,
>
> Thanks for your nice work, I'll take a look.
>
> According to my test here, it seems soft volume processing doesn't cost
> CPU usage too much, instead, it's the resampling that takes much CPU
> usage. e.g. one sink input, resampler of speex-float-3 is used, the
> general CPU usage is about 4%, when resampler of 'copy' is used (of
> course, in this case, the same format of sink input and sink should
> match), it drops to less than 1%.
>
> So should we optimize resampler a little harder?

Sure, resampling is by far the most CPU intensive thing pulse does.
That's why we have the choice of such a large array of algorithms, so
that the user can pick the one that fits his CPU/quality tradeoff
best.

In general you can assume than these resamplers are already as
optimized as possible. Especially for our default speex resampler, I
don't expect there's a lot to gain. But if you'd like you could work
with that project to see if there are improvements possible. Last week
I sent some patches to speed up the trivial resampler, but that is
more of a toy-resampler, so not that important.

If optimizing the resampling algorithms is hard, the easiest solution
is to minimize the amount of resampling we do. Pierre's patches that
just got merged are a good example of this.

Only without resampling (the copy-resampler, which should be more
aptly names noop-resampler, because no copying is done) the CPU usage
of the other stuff (svolume, sconv, channel remap, mixing) comes on
the radar.

Maarten


More information about the pulseaudio-discuss mailing list