[Jack-Devel] Handling adaptive number of input samples required for adaptive resampler

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Jack-Devel] Handling adaptive number of input samples required for adaptive resampler

benravin
Hi,

I have a requirement to do a re-sampling based on drift detected on jitter buffer. 
Suppose I have set jack process callback to 128 samples, and I detected that I have to do
an resampling by 10%, ie n_in = 1.1 * nout then I need 12.8 samples more, which is not available and
has to wait for next callback. This will delay my processing. If I make my buffer size
more than 128, I may have to do a decimation based on drift in which direction.

How to handle these cases of having   varying buffer size requirements ?

-ben

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Handling adaptive number of input samples required for adaptive resampler

Robert Bielik

As the Jack callback is absolute, and that won't change, you'll have to adapt to it. Keep tab on clocks to have a resampling factor which is used to resample what you have to what you need. This is by no means an easy task, CoreAudio on Mac works like this to sync separate audio cards into an aggregate device.

 

Regards

/Robert 

 

Skickat från min LG-Mobil

 

 

------ Ursprungligt meddelande------

Från: Benny Alexandar

Datum: sön, 25 feb 2018 12:53

Till: [hidden email];

Ämne:[Jack-Devel] Handling adaptive number of input samples required for adaptive resampler

 

Hi,

I have a requirement to do a re-sampling based on drift detected on jitter buffer. 
Suppose I have set jack process callback to 128 samples, and I detected that I have to do
an resampling by 10%, ie n_in = 1.1 * nout then I need 12.8 samples more, which is not available and
has to wait for next callback. This will delay my processing. If I make my buffer size
more than 128, I may have to do a decimation based on drift in which direction.

How to handle these cases of having   varying buffer size requirements ?

-ben

_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org
Reply | Threaded
Open this post in threaded view
|

Re: Handling adaptive number of input samples required for adaptive resampler

Chris Caudle
In reply to this post by benravin
On Sun, February 25, 2018 5:53 am, Benny Alexandar wrote:
> I have a requirement to do a re-sampling based on drift detected on jitter
> buffer.

zita-alsa bridge already does something similar, you could look at that
source as an example.
http://kokkinizita.linuxaudio.org/linuxaudio/zita-ajbridge-doc/quickguide.html
Uses zita-resample library, you will need that along with ajbridge source.

Fons also wrote a paper explaining how it works:
http://kokkinizita.linuxaudio.org/papers/adapt-resamp.pdf

--
Chris Caudle


_______________________________________________
Jack-Devel mailing list
[hidden email]
http://lists.jackaudio.org/listinfo.cgi/jack-devel-jackaudio.org