CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.

Henrik.

I fully agree with TNT, this is very good work, thanks man!

At post no. 1 you post this :


So it's possible to "Pre-EQ" with BiQuad created in e.g REW, and then afterwards make it run through FIR filter with one instance of camilla running.

Keep UP!

Jesper.
Thanks!

Yes it's easy to combine BiQuad and FIR filters in the same pipeline. Just add them to the list :) You can put in as many Filter and Mixer steps as you want, in any order you want. You only need to make sure the number of input channels of each Mixer (and the output device) matches the output channels of the previous Mixer (or capture device).

If you make a crossover, you could for example use this to add a Filter block first to pre-filter the stereo signal, then let a Mixer split into more channels, and then another Filter block to do all the low/higpass stuff.
 
By the way, I have ordered a Raspberry Pi 4 that should arrive tomorrow. I'll use it for testing and experimenting. I really want to try USB gadget mode!

I can't understand that you could have a life without :confused:....:D

I created an test.txt in REW (Generec EQ). The "filter" is BiQuad as can be seen in the attached file for LEFT channel...

My flow should be like this in the camilladsp pipeline...
1) PreEQ as BiQuad (flat target proberly)
2) FIR filter
3) Some -2dB gain to avoid clipping

My workflow should be as this for creating the final result :
1) Measure at sweetspot (excatly in the middle).
2) Create flat target BiQuad with thoose measurements
3) Apply the BiQuads to Camilladsp, and start camilladsp.
3a) Maybee apply -2dB gain now???
4) Measure again same spot with BiQuads in place
5) Create FIR's with thoose measurements
6) Apply the FIR's in camilladsp pipeline

Done!

Jesper.
 

Attachments

  • L_test.txt
    2 KB · Views: 62
Hello here Svenska :)

I am trying to attach the REW generated BiQuad's in the .yml file, but i cant make it work.
Camilla complains that config file is invalid etc...

I don't think the syntax that REW uses for BiQuad's are the same as the one camilladsp want's?

I attached a config file + biquads.

What do i do wrong here?

Jesper.
 

Attachments

  • LEFT_BQ.txt
    2.4 KB · Views: 48
  • RIGHT_BQ.txt
    2.3 KB · Views: 40
  • test_44100yml.txt
    1.3 KB · Views: 48
Hello here Svenska :)

I am trying to attach the REW generated BiQuad's in the .yml file, but i cant make it work.
Camilla complains that config file is invalid etc...

I don't think the syntax that REW uses for BiQuad's are the same as the one camilladsp want's?

I attached a config file + biquads.

What do i do wrong here?

Jesper.
CamillaDSP can't read the biquad coefficients from text files. You have to speficy the biquads one by one. This would be the first one from your file:
Code:
  right_biquad1:
    type: Biquad
    parameters:
      type: Free
      b0: 0.9866696115243617
      b1: -1.937899535406059
      b2: 0.9532965390462149
      a1: 1.937899535406059
      a2: -0.9399661505705766
 
CamillaDSP can't read the biquad coefficients from text files. You have to speficy the biquads one by one. This would be the first one from your file:
Code:
  right_biquad1:
    type: Biquad
    parameters:
      type: Free
      b0: 0.9866696115243617
      b1: -1.937899535406059
      b2: 0.9532965390462149
      a1: 1.937899535406059
      a2: -0.9399661505705766

Hey :)

I tried that also, but something i do wrong...

This happens when trying to run camilladsp :
Code:
lykke@Lykkedk:~/camilladsp/CONFIG/DSP_Engine/filters$ camilladsp -v test_44100.yml
[2020-05-15T15:25:21Z DEBUG camilladsp] Read config file Some("test_44100.yml")
[2020-05-15T15:25:21Z ERROR camilladsp] Invalid config file!
    filters: invalid type: string "0.9866696115243617,", expected f64 at line 20 column 15
[2020-05-15T15:25:21Z DEBUG camilladsp] Exiting due to config error

The error at line 20 colum 15 is here:
---
devices:
samplerate: 44100
buffersize: 8192
target_level: 4096
adjust_period: 5

capture:
type: Alsa
channels: 2
device: "camilla_in"
format: S32LE
playback:
type: Alsa
channels: 2
device: "sound_out"
format: S32LE

filters:
left_biquad1: <---- line 20, colum 15
type: Biquad
parameters:
type: Free
b0: 0.9184593819184058
b1: -1.663281696236836
b2: 0.7895051493456333
a1: 1.663281696236836
a2: -0.7079645312640391

right_biquad1:
type: Biquad
parameters:
type: Free
b0: 0.9866696115243617,
b1: -1.937899535406059,
b2: 0.9532965390462149,
a1: 1.937899535406059,
a2: -0.9399661505705766,

#filters:
# test_fir_L:
# type: Conv
# parameters:
# type: File
# filename: /home/lykke/camilladsp/CONFIG/DSP_Engine/filters/L_impulse.bin
# format: FLOAT32LE

# test_fir_R:
# type: Conv
# parameters:
# type: File
# filename: /home/lykke/camilladsp/CONFIG/DSP_Engine/filters/R_impulse.bin
# format: FLOAT32LE

clipgain_L:
type: Gain
parameters:
gain: -2.0
inverted: false

clipgain_R:
type: Gain
parameters:
gain: -2.0
inverted: false

pipeline:
- type: Filter
channel: 0
names:
- left_biquad1
- type: Filter
channel: 1
names:
- right_biquad1

# - type: Filter
# channel: 0
# names:
# - test_fir_L
# - type: Filter
# channel: 1
# names:
# - test_fir_R

- type: Filter
channel: 0
names:
- clipgain_L
- type: Filter
channel: 1
names:
- clipgain_R

Jesper...
 

Attachments

  • RIGHT_BQ.txt
    2.3 KB · Views: 36
  • LEFT_BQ.txt
    2.4 KB · Views: 39
  • biquad_44100.yml.txt
    1.6 KB · Views: 72
Ups.

There was an error in my config, i forgot to remove some ","

Now camilladsp gives me this :
Code:
lykke@Lykkedk:~/camilladsp/CONFIG/DSP_Engine/filters$ camilladsp -v test_44100.yml
[2020-05-15T16:10:01Z DEBUG camilladsp] Read config file Some("test_44100.yml")
[2020-05-15T16:10:01Z ERROR camilladsp] Unstable filter specified
[2020-05-15T16:10:01Z DEBUG camilladsp] Exiting due to config error

Proberly because most of the filter is missing i guess?

Jesper.
 
Does this mean that you have to type them in 1-by-1 by hand?

My latest EQ has 12 biquads...

//

PS. 4GB!

Hi...

It's pretty easy to "convert" them in ATOM

Jesper.
 

Attachments

  • Screenshot from 2020-05-15 18-26-19.png
    Screenshot from 2020-05-15 18-26-19.png
    150.6 KB · Views: 250
Ups.

There was an error in my config, i forgot to remove some ","

Now camilladsp gives me this :
Code:
lykke@Lykkedk:~/camilladsp/CONFIG/DSP_Engine/filters$ camilladsp -v test_44100.yml
[2020-05-15T16:10:01Z DEBUG camilladsp] Read config file Some("test_44100.yml")
[2020-05-15T16:10:01Z ERROR camilladsp] Unstable filter specified
[2020-05-15T16:10:01Z DEBUG camilladsp] Exiting due to config error

Proberly because most of the filter is missing i guess?

Jesper.

This error means that one of the Biquads is unstable, meaning that it might start oscillating or give some other uncontrolled output. I'll take a look at your coefficients, the check might be too picky. Are generated by REW?
 
This is exactly what I was going to suggest. Any decent editor has some kind of multi-cursor that makes this kind of thing quick and easy.
Are these normal peaking filters? You could then also specify them with frequency, gain and Q and let CamillaDSP calculate the Biquads coefficients.

They are generated in REW.
Left & Right mid speakers - recorded at 48000
Then IR window is removed and 1/6 octave smooting added.
After that i created Generec EQ with a flat target.
This generates my BiQuad's for the Pre filtering.
Then i save the filter as .txt at 44100 for a start (i'am pretty sure i can save in all samplerates here for future use :))

Do you have fun with the PI Henrik :nod:

Jesper.
 

Attachments

  • 1.png
    1.png
    143.4 KB · Views: 237
Just remembered something! MiniDSP has the sign of the a-coefficients inverted from most other definitions. Try flipping the sign of a1 and a2!
Haven't had time to do anything with the pi yet except to check that it boots. But I noticed it runs really hot even when idle. I get why most people add some cooling!
 
Just remembered something! MiniDSP has the sign of the a-coefficients inverted from most other definitions. Try flipping the sign of a1 and a2!
Haven't had time to do anything with the pi yet except to check that it boots. But I noticed it runs really hot even when idle. I get why most people add some cooling!

I generated with the Generic EQ, witch also flips for minidsp i see.

Yes the Pi got a little hot; i bought some small heatsinks for them, thats good enough.
I have one running LMS 24/7 here and another inside my DAC running picoreplayer (TinyCore Linux) and the camilladsp also lives on that Pi ;)

Jesper.
 

Attachments

  • rew.png
    rew.png
    54.9 KB · Views: 219
Nice alu'case phofman :)

Filters are running fine, when rewersing/flipping the negated a1 & a2
I attached my .yml config here, with "template" for 20 BiQuad's and the fir's.

If anyone should use it, be aware that the .yml format is space/tap's sensitive etc...

I will take some new measurements later, and i think that making Camilla calculate the EQ peak's are easier as to do than to modify the REW generated (Generic EQ) one's. Let's see how it goes.

Jesper.

Btw.: Henrik, you are hardcore coder so you proberly allready now... but i use midnight commander to transfer files to and from my PI's
 

Attachments

  • test_44100.yml.txt
    11.7 KB · Views: 60
  • MC_TC.png
    MC_TC.png
    140.9 KB · Views: 221
Last edited:
This is beyond cool.

I'm a 100% Linux guy and was recently thinking I wish somebody would make a 4.1 (I don't always use a sub but might as well include that output) amp with DSP for ultimate 2-way tinkering without having to build X-Overs. If I'm understanding correctly this would be perfect for such tinkering?

One detail I haven't seen, what hardware device are folks using to get all the channels out?
 
I am perfectly happy with this passive RPi4 heatsink - works as an enclosure at the same time

Armor Aluminum Case for Raspberry Pi 4, Black Case Heatsink Heat Sink | eBay
That's a nice one, thanks for the tip!


Nice alu'case phofman :)

Filters are running fine, when rewersing/flipping the negated a1 & a2
I attached my .yml config here, with "template" for 20 BiQuad's and the fir's.

If anyone should use it, be aware that the .yml format is space/tap's sensitive etc...

I will take some new measurements later, and i think that making Camilla calculate the EQ peak's are easier as to do than to modify the REW generated (Generic EQ) one's. Let's see how it goes.

Jesper.

Btw.: Henrik, you are hardcore coder so you proberly allready now... but i use midnight commander to transfer files to and from my PI's
Nope, didn't know mc supports sftp! That can be quite useful, thanks!



This is beyond cool.

I'm a 100% Linux guy and was recently thinking I wish somebody would make a 4.1 (I don't always use a sub but might as well include that output) amp with DSP for ultimate 2-way tinkering without having to build X-Overs. If I'm understanding correctly this would be perfect for such tinkering?

One detail I haven't seen, what hardware device are folks using to get all the channels out?
Yes, camilladsp would work very well for that.



I'm using a DIY 8-channel USB DAC based on an xmos interface (XMOS Multichannel high-quality USB to/from I2S/DSD SPDIF PCB - DIYINHK). That is connected via I2S to 4x PCM1794 dac boards. Then volume control via 4x PGA2310 chips controlled by an Arduino.


I think the easiest way to get started would be to get a home theater receiver. They have all you need: they can receive many channels of uncompressed audio over HDMI, have built in dacs, volume control and even power amps.


I think many are replacing their older receivers to get 4K-support, so you might be able to find really good ones cheaply on the used market. If I were to start over I would probably go this route. Building the dac took waaay to much time.. :)