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

Lu Guanqun guanqun.lu at intel.com
Wed Oct 19 01:10:49 PDT 2011


On Tue, Oct 18, 2011 at 06:10:06PM +0800, Maarten Bosmans wrote:
> > 2011/10/18 Wang Xingchao <xingchao.wang at intel.com>:
> >> if all channels have same volume setting, use fast way to
> >> do volume change. this patch intended to work for two formats:
> >> s16ne/s16re.
> 
> I did some work to optimize svolume already, see my branch on github:
> https://github.com/mkbosmans/pulseaudio/compare/master...orcify
> 
> After a few pending patches that I have already sent to the list are
> pulled, I plan to submit this branch in parts. (the branch needs to be
> rebased after the pending patches are committed)
> 
> For testing correctness of your volume implementation (and
> performance, as Tanu suggested) you can use the svolume-test program
> added in this commit:
> https://github.com/mkbosmans/pulseaudio/commit/cf0c5c9ad47ba0434b0518ca79ca802d0e62153a
> 
> The Orc svolume implementation currently only handles 1ch s16ne (the
> orcify branch also adds 1ch float), so I added a similar test for
> identical channel volumes for the Orc case:
> https://github.com/mkbosmans/pulseaudio/commit/8659d08f22ccaba0c1ca18c0b29744318bf4fe08
> I like that way (only using one extra variable) a bit better than
> yours (with both same_vol and fast_vol added), but that is not really
> important.

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?

> 
> 2011/10/18 Wang Xingchao <wangxingchao2011 at gmail.com>:
> > Hi all,
> >
> > I didnot touch much formats optermization, only for most used
> > s16nr/re, please help review whether the idea is acceptable. If so, i
> > will take the responsbility for all formats.
> 
> I'd say only float32ne is another candidate.
> 
> Maarten
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

-- 
guanqun


More information about the pulseaudio-discuss mailing list