[linux-audio-dev] jack_process and pitch-shifting

Christian Henz chrhenz at gmx.de
Fri Apr 22 18:34:48 UTC 2005


On Fri, Apr 22, 2005 at 08:10:45PM +0200, Olivier Guilyardi wrote:
> Erik de Castro Lopo wrote:
> 
> >On Fri, 22 Apr 2005 16:48:32 +0100
> >Steve Harris <S.W.Harris at ecs.soton.ac.uk> wrote:
> >
> > 
> >
> >>Doing heavy jobs in the process() callback is fine, as long as the CPU
> >>load is deterministic. I this case I think it should be.
> >>   
> >>
> >
> >Yep, the CPU load of the sample rate conversion process of libsamplerate 
> >is pretty close to linearly related to the size of the blocks you are
> >converting.
> > 
> >
> I want to vary the pitch in realtime, and even to totally enable/disable 
> the pitch-shifting routines when needed, always in realtime, while rolling.
> 
> I'm not sure if all that's still linear. The CPU load of my process() 
> callback may remain constant when the user vary the pitch, but it will 
> suddenly increase/decrease if the user enables/disables pitch-shifting.
> 
> Is this still deterministic/linear ? If not, is spanning a new thread 
> the only alternative ?
> 

If you want to do this in realtime, this doesn't help at all. If your jack process callback takes too long, you get kicked out. If your spawned thread doesn't keep up, you get cracks in your sound. Neither is really an option.

The determinic running time is only a nescessary criterium, not a sufficient one. The code still has to be fast enough to keep up.

cheers,
Christian



More information about the Linux-audio-dev mailing list