Long latencies with JConvolver or BruteFIR

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

Long latencies with JConvolver or BruteFIR

AKC360
Hello People,

I have a strange problem with high latency for both JConvolver or BruteFIR.
My Jack settings are low(3ms) and stable and the latency doesn't seem to
tally with the partition size?

My Hardware:
i5-8259U - Intel NUC
8GB DDR4
PCIe SSD
M-Audio - MTrack8 USB Sound

Software:
Ubuntu Studio 19.04 - Have tried updated and fresh install also a blank
Debian 10.1
Jconvolver 0.9.3-2
BruteFIR 1.0o-1
Jackd2 1.9.12

Settings:
Jack Settings - 48KHz 64Buffer 3Period
BruteFIR - 7 Filters each 8192 Taps, These are each split into 512sample
partitions
Jconvolver - 7 Filters each 8192 Taps, These are split into 64sample
partitions


Results:

JConvolver Latency = 85mS, CPU Load = <5%
Brutefir Latency = 104mS, CPU Load = 55-60%

These latencies are measured inside Jack(Not using sound card IO) using a
jack signal generator and a jack oscilloscope. But also verified externally.


I dont understand why I am getting such long latencies, I would be very
grateful if anyone could shed some light on why the latencies are so long
and even more grateful if you could share how to fix it!

Thank you in advance,

Alex



--
Sent from: http://linux-audio.4202.n7.nabble.com/linux-audio-user-f5.html
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Long latencies with JConvolver or BruteFIR

Moshe Werner
Hi there,

Could you post the jconvolver config file, I think that the latency depends on the number of partitions.

Cheers
Moshe

On Sat, Oct 5, 2019, 19:45 AKC360 <[hidden email]> wrote:
Hello People,

I have a strange problem with high latency for both JConvolver or BruteFIR.
My Jack settings are low(3ms) and stable and the latency doesn't seem to
tally with the partition size?

My Hardware:
i5-8259U - Intel NUC
8GB DDR4
PCIe SSD
M-Audio - MTrack8 USB Sound

Software:
Ubuntu Studio 19.04 - Have tried updated and fresh install also a blank
Debian 10.1
Jconvolver 0.9.3-2
BruteFIR 1.0o-1
Jackd2 1.9.12

Settings:
Jack Settings - 48KHz 64Buffer 3Period
BruteFIR - 7 Filters each 8192 Taps, These are each split into 512sample
partitions
Jconvolver - 7 Filters each 8192 Taps, These are split into 64sample
partitions


Results:

JConvolver Latency = 85mS, CPU Load = <5%
Brutefir Latency = 104mS, CPU Load = 55-60%

These latencies are measured inside Jack(Not using sound card IO) using a
jack signal generator and a jack oscilloscope. But also verified externally.


I dont understand why I am getting such long latencies, I would be very
grateful if anyone could shed some light on why the latencies are so long
and even more grateful if you could share how to fix it!

Thank you in advance,

Alex



--
Sent from: http://linux-audio.4202.n7.nabble.com/linux-audio-user-f5.html
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user

_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Long latencies with JConvolver or BruteFIR

Fons Adriaensen-3
On Sat, Oct 05, 2019 at 08:10:09PM +0300, Moshe Werner wrote:
 
> Could you post the jconvolver config file, I think that the latency depends
> on the number of partitions.

It doesn't depend on the number of partitions, but on the minimum
partition size (which is set in the config file).

To see the actual partitions sizes, use the -v option.

Ciao,

--
FA

_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Long latencies with JConvolver or BruteFIR

AKC360
In reply to this post by Moshe Werner
Hi

Thank you both and in particular Fons for creating this great software.
I will post my config when back in the country on Monday but the JConvolver
sample size is set to 64 to match Jack.

Alex



--
Sent from: http://linux-audio.4202.n7.nabble.com/linux-audio-user-f5.html
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Long latencies with JConvolver or BruteFIR

Fons Adriaensen-3
In reply to this post by AKC360
On Sat, Oct 05, 2019 at 09:50:38AM -0700, AKC360 wrote:

> JConvolver Latency = 85mS, CPU Load = <5%
> Brutefir Latency = 104mS, CPU Load = 55-60%

Both are way too high. Are you sure you are measuring
latency, and not just the delay of your filter ?

A symmetric FIR of 8192 samples would have a delay
of 4096 samples, or 85.333 ms...

To measure latency, you'd need a 'filter' consisting
of single sample at position 0 (use the 'dirac' command
in the jconvolver config).

Ciao,

--
FA


_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Long latencies with JConvolver or BruteFIR

AKC360
# jconvolver configuration
# ------------------------
#
# AK Mission 753 Crossover

# Replace by whatever required:
#
#
#                in  out   partition    maxsize    density
# --------------------------------------------------------
/convolver/new    2    7         64     200000        1.0
#
#
#              num   port name      connect to
# -----------------------------------------------
/input/name     1    In-L
/input/name     2    In-R
#
/output/name    1    Hi-L
/output/name    2    Hi-R
/output/name    3    Low-L
/output/name    4    Low-R
/output/name    5    Bass-L
/output/name    6    Bass-R
/output/name    7    Sub
#
#
#
/cd /home/ak/XO-Config
#
#
#
#               in out  gain   delay  offset  length  chan      file  
#
------------------------------------------------------------------------------
#
/impulse/read    1   1    1     0     0       0     1    High.wav
/impulse/read    2   2    1     0     0       0     1    High.wav
/impulse/read    1   3    1     0     0       0     1    Low.wav
/impulse/read    2   4    1     0     0       0     1    Low.wav
/impulse/read    1   5    1     0     0       0     1    Bass.wav
/impulse/read    2   6    1     0     0       0     1    Bass.wav
/impulse/read    1   7    1     0     0       0     1    Sub.wav
#



--
Sent from: http://linux-audio.4202.n7.nabble.com/linux-audio-user-f5.html
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Long latencies with JConvolver or BruteFIR

AKC360
In reply to this post by Fons Adriaensen-3
Fons Adriaensen-3 wrote
> Both are way too high. Are you sure you are measuring
> latency, and not just the delay of your filter ?
>
> A symmetric FIR of 8192 samples would have a delay
> of 4096 samples, or 85.333 ms...
>
> To measure latency, you'd need a 'filter' consisting
> of single sample at position 0 (use the 'dirac' command
> in the jconvolver config).

I am sorry yes I think I have confused the terms being used. I sent an
impulse through JConvolver with the oscilloscope CH1 being connected to the
signal generators Jack output. CH2 was connected to the Jack Output of
Jconvolver. I measeured the time difference on the scope between the two
impulses.

So I guess I am measuring jack latency and the filter delay. I thought with
partitioned convolution the filter delay would be lowered from the
traditional delay(85mS)?

Thanks for your help with this, my speakers sound so much better since going
active and linear phase!

Alex



--
Sent from: http://linux-audio.4202.n7.nabble.com/linux-audio-user-f5.html
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Long latencies with JConvolver or BruteFIR

Fons Adriaensen-3
On Mon, Oct 07, 2019 at 11:42:33AM -0700, AKC360 wrote:

> Fons Adriaensen-3 wrote
>
> > A symmetric FIR of 8192 samples would have a delay
> > of 4096 samples, or 85.333 ms...
>
> I am sorry yes I think I have confused the terms being used. I sent an
> impulse through JConvolver with the oscilloscope CH1 being connected to the
> signal generators Jack output. CH2 was connected to the Jack Output of
> Jconvolver. I measeured the time difference on the scope between the two
> impulses.
>
> So I guess I am measuring jack latency and the filter delay.

With the minimum partition size equal to the Jack period there is no
additional latency, what you measure is just the filter delay.

> I thought with partitioned convolution the filter delay would be
> lowered from the traditional delay(85mS)?

No, the delay is a property of the filter, not of how it is implemented.
You can't have linear phase without the delay... But you could probably
reduce the filter size to 4096. It may affect the Sub crossover a bit,
but I don't think you'd hear the difference.

> Thanks for your help with this, my speakers sound so much better since
> going active and linear phase!

No surprise :-)

Hints: set the max size to your filter lenght, this will use less
memory. Also you could set the density to 0.5.

The higher frequency filters probably are much shorter than 8192
samples, with most energy concentrated around sample 4096. You
could leave out the (near) zeros at the start and end, like this:

Replace

/impulse/read    1   1    1     0       0       0     1    High.wav

by

/impulse/read    1   1    1  2048     2048    4096    1    High.wav

or

/impulse/read    1   1    1  3072     3072    2048    1    High.wav

keeping only the central 4096 or 2048 samples.

This may reduce the CPU load (not that it seems to be a problem).

Ciao,

--
FA

_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user
Reply | Threaded
Open this post in threaded view
|

Re: Long latencies with JConvolver or BruteFIR

AKC360
Thank you Fons, very helpful indeed. I will experiment...

While you are here I wonder if I might ask you an unrelated but similar
topic question.

Have you heard of Linea researche's Linea Impulse Response(LIR) filter. They
have created a linea phase filter with almost zero delay. There is a
whitepaper at
http://linea-research.co.uk/wp-content/uploads/LR%20Download%20Assets/Tech%20Docs/LIR_LinearPhaseCrossovers.pdf

Do you think this will be something the open source comunity will be able to
recreate one day? Would be great for us DIY enthusiasts!

Thank you and regards,

Alex



--
Sent from: http://linux-audio.4202.n7.nabble.com/linux-audio-user-f5.html
_______________________________________________
Linux-audio-user mailing list
[hidden email]
https://lists.linuxaudio.org/listinfo/linux-audio-user