[pulseaudio-discuss] How to decrease cpu usage?

rong deng dzrongg at gmail.com
Tue Aug 14 22:04:13 PDT 2012


2012/8/15 Tanu Kaskinen <tanuk at iki.fi>:
> On Tue, 2012-08-14 at 20:49 -0600, Kelly Anderson wrote:
>> In profiling with oprofile on CuBox the code that is hogging cpu is the
>> Speex resampler.
>
> The original reporter had high cpu use also when pulseaudio was supposed
> to be idle. Do you have the same problem?
>
>> I am currently trying to figure out how to get pulseaudio open without
>> triggering the resampler.  There are about 3 tests in pulseaudio which
>> check for
>> the need to resample.  If any of them evaluate as true, resampling kicks in.
>>
>> To avoid resampling:
>>
>> 1. you can't use variable sample rate
>> 2. the channel maps have to match
>> 3. the sample rate has to match
>
> You can add "the sample format has to match" to the list, but sample
> rate conversion is the expensive operation. I believe converting between
> different channel maps and sample formats is trivial in comparison.

Hi Christophe,

IIRC, you can set the resampler function to the lowest one and try
that out, if it reduces the CPU usage, then chances are that it's
limited by the speed of resampling.

Oprofile looks outdated, may be you can check 'perf' tools? I haven't
tried it on ARM platform, but I assume it should work.

Another thing I can think of to reduce the CPU usage is to make the
alsa buffer size larger, it could hurt the latency of your sound, but
it should be beneficial to your CPU usage.

Just my $0.02. Hope this helps. :)

deng


More information about the pulseaudio-discuss mailing list