[pulseaudio-discuss] Pulse Audio Sample Cache & resampling

keith preston keithpre at gmail.com
Tue Feb 13 14:39:51 PST 2007


Ok, well I took a hack into pulling in these files into pulse audio (the
ubuntu fiesty debian package of it).

I took these files.

http://svn.xiph.org/trunk/speex/libspeex/resample.c
http://svn.xiph.org/trunk/speex/include/speex/speex_resampler.h

The pulse audio code is written well and was easy to modify.   I have got it
interfacing properly with the resample code, however I can not get the
resample code to work in Fixed point mode.

>From resample.c

TODO list:
      - Variable calculation resolution depending on quality setting
         - Single vs double in float mode
         - 16-bit vs 32-bit (sinc only) in fixed-point mode
      - Make sure the filter update works even when changing params
             after only a few samples procesed

Has this code been tested on fixed point?  The test files seems to only try
floating point.

http://svn.xiph.org/trunk/speex/libspeex/testresample.c

I tried putting #define FIXED_POINT and #define OUTSIDE_SPEEX, and then
hackishly defining MULT16_16 and PSHR32.  Now I get random noise.  Jean-Marc
Valin, can you give a little info on the status of resample.c with respect
to FIXED_POINT

I'm really interested in getting pulse audio to run with fixed point
resampling.  Anything I can do to help, let me know.

Keith Preston



On 2/13/07, Lennart Poettering <lennart at poettering.net> wrote:
>
> On Mon, 12.02.07 13:35, keith preston (keithpre at gmail.com) wrote:
>
> > I was wondering about a status update on getting a fixed point
> > resampler into pulseaudio.  I heard some of this work was taking
> > place, but had not yet seen anything.  I am interested in helping if
> > it would speed things along.
>
> During FOMS and linux.conf.au Jean-Marc Valin from Speex hacked up a
> fixed-point resampler:
>
> http://svn.xiph.org/trunk/speex/libspeex/resample.h
> http://svn.xiph.org/trunk/speex/libspeex/resample.c
>
> It has a nice API and is reasonably high-quality. As soon as I am done
> with my thesis and can focus full-time on PulseAudio again I will add
> support for this new resampler.
>
> If you are interested to work on this: it should be not too difficult,
> probably requires substantial changes only in resampler.[ch] and a few
> minor changes in some other files. (such as all files where
> PA_RESAMPLER_SRC_ is referenced.)
>
> Of course, libsamplerate support should be kept in, because it has
> better quality. The current resampler.h API already supports two
> implementations (a naive internal one, and libsamplerate), hence
> adding a third one shouldn't be too difficult. libsamplerate should
> be downgraded to an optional dependency, however.
>
> To become truly useful on non-FP CPUs the current (naive) mixing code
> needs to be rewritten, based on liboil. That however is not trivial,
> since liboil lacks a few features (like adding 16bit integer arrays
> into 32bit integer arrays), and we don't have a thread-safe bounce
> buffer abstraction yet. And then we enter squishy ground, since the
> whole thread-safety stuff is only available in the "lockfree" branch
> for now - and that branch doesn't really work yet.
>
> (BTW: If you interested read
> http://0pointer.de/blog/projects/foms-lca-recap.html for a longer
> list of what's new and what's coming in PulseAudio land.)
>
> > I'm also interesting in helping with APIs especially like what gsmartmix
> was
> > going to try and do.
>
> This area is very much in flux right now. Since I am not quite sure
> how a good API might look like I implemented only "automatic" policy
> modules for now - which don't need a user API. Those are
> module-volume-restore and module-rescue-streams.
>
> In short: for now, feel free to work on adding the Speex resampler
> into PA, but the rest is too unsettled, please wait with any further
> work until I am done with my thesis and can focus on PA full-time
> again (some time next month)
>
> Thanks for your interest!
>
> Lennart
>
> --
> Lennart Poettering; lennart [at] poettering [dot] net
> ICQ# 11060553; GPG 0x1A015CC4; http://0pointer.net/lennart/
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at mail.0pointer.de
> https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20070213/360356fe/attachment.htm>


More information about the pulseaudio-discuss mailing list