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

From: Christian Henz <chrhenz@email-addr-hidden>
Date: Fri Apr 22 2005 - 21:34:48 EEST

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@email-addr-hidden> 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
Received on Sat Apr 23 00:15:09 2005

This archive was generated by hypermail 2.1.8 : Sat Apr 23 2005 - 00:15:10 EEST