Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

PC Based Computer music servers, crossovers, and equalization

CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.
CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 17th February 2020, 06:39 PM   #1
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Default CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.

I would like to announce CamillaDSP, a general purpose tool for routing and filtering sound. It can be used for example for building crossovers for active speakers, or for performing room correction.

You can find the source code here: GitHub - HEnquist/camilladsp


There is a second repository for configuration help here: GitHub - HEnquist/camilladsp-config: Help for setting up CamillaDSP, example config files etc

Quick summary
  • For Linux, macOS and Windows
  • Written in Rust
  • IIR filters (BiQuad)
  • FIR filters (Convolution via FFT)
  • Built-in sample rate converter
  • Filters can be chained freely
  • Flexible routing
  • Alsa, PulseAudio, Wasapi, CoreAudio, File and stdio input/output
  • Simple YAML configuration
  • All calculations done with 64-bit floats

I have been using BruteFIR for crossovers for quite some time, but there were two main things I wanted to improve upon. Firstly BruteFIR only supports FIR filters, and I wanted the ability to also use BiQuad without having to make an overly complicated setup. Secondly when BruteFIR encounters a buffer underrun it always exits with a "broken pipe" error instead of just trying again. This can get somewhat annoying. I also thought that the BruteFIR configuration is unnessecarily complicated.
I have also been using the excellent tool EqualizerAPO that does all I want, but it's for Windows only.

When using Alsa for both input and output, CamillaDSP can work almost as a drop-in replacement for BruteFIR. I run a 2048 tap stereo 2-way crossover at 44.1kHz, and this consumes less than 2% of a single cpu core on my HTPC (dual core Intel Skylake).

To help with configuration CamillaDSP checks the configuration and tries to give helpful error messages when there is a problem. In addition there is a Python script to visualize the whole pipeline from a config file.

Sample output:
Click the image to open in full size.

To try it, download a pre-built binary for your system from the "Releases" page:. Click "Assets" to view the available files.

Instead of using a pre-built binary it can also be built from source. The "Cargo" tool makes this very easy as it will download and compile all dependencies automatically. See more instructions in the README.

Last edited by HenrikEnquist; 2nd July 2020 at 07:36 PM. Reason: new version with Windows and macOS support
  Reply With Quote
Old 18th February 2020, 08:27 PM   #2
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Wow, very impressive! That really looks like a nice piece of work.

Couple of questions:
How are you implementing the FIR convolution (e.g. using what library, it was handcoded, etc.).?
How do you account for different latencies of different FIR filters, and if you have many filter blocks on one path from input to output versus another path?
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 18th February 2020, 09:24 PM   #3
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Thanks!
The convolution is done with the overlap-add method and it's using RustFFT for fft/ifft: GitHub - awelkie/RustFFT: A mixed-radix FFT library written in pure Rust

The processing is done on chunks of audio data. The capture device captures let's say 1024 frames, and then passes this chunk to the processing thread. This then applies all filtering, mixing etc before passing it on to the playback device. This means that there will always be a delay of 1024 samples, plus a little bit more for the time the processing takes. In this case the fir filter can be up to 1024 taps but no more. For longer filters a larger chunk size is needed.

If there are different FIR filters for different channels, they need to be matched so they have the same latency. It would also be ok to add a simple delay to a channel to make up for a shorter FIR latency. I guess that in most cases a crossover will be designed in matched pairs, so there is no relative delay between the high- and lowpass filters. But if you then add a FIR room correction to only the LF channels, the HF will be too early and needs a delay. This isn't done automatically.
  Reply With Quote
Old 19th February 2020, 01:56 PM   #4
Simofil is offline Simofil  Italy
diyAudio Member
 
Join Date: Feb 2017
Location: Italy
Awesome Work!
One question:
Is it possible to NOT use a loopback interface and read stream directly from /dev/stdin and send the output to /dev/stout just like BruteFIR?
  Reply With Quote
Old 19th February 2020, 06:06 PM   #5
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
I haven't needed stdin/stdout so I haven't implemented that yet. But I will! Probably quite soon.
  Reply With Quote
Old 19th February 2020, 07:41 PM   #6
Simofil is offline Simofil  Italy
diyAudio Member
 
Join Date: Feb 2017
Location: Italy
Quote:
Originally Posted by HenrikEnquist View Post
I haven't needed stdin/stdout so I haven't implemented that yet. But I will! Probably quite soon.
That would be awesome; I'll keep an eye on your repo Thanks for the work!
  Reply With Quote
Old 19th February 2020, 09:04 PM   #7
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Quote:
Originally Posted by Simofil View Post
That would be awesome; I'll keep an eye on your repo Thanks for the work!
Take a look now! The new version is in the branch "fileio" for now. Once I have tested it a little more I will merge to master.
  Reply With Quote
Old 23rd February 2020, 04:35 PM   #8
Jona66 is offline Jona66
diyAudio Member
 
Join Date: Jan 2020
Got it running on a headless Debian / Mopidy / Mopidy-Spotify & File player, easy to configure and handle! Doing convolution with rephase-generated filters.

Great, thank you for this nice piece of software!

Jo
  Reply With Quote
Old 23rd February 2020, 07:42 PM   #9
HenrikEnquist is offline HenrikEnquist  Sweden
diyAudio Member
 
Join Date: Apr 2016
Location: Lund
Quote:
Originally Posted by Jona66 View Post
Got it running on a headless Debian / Mopidy / Mopidy-Spotify & File player, easy to configure and handle! Doing convolution with rephase-generated filters.

Great, thank you for this nice piece of software!

Jo
Thanks for the feedback!

Just out of curiosity, how long filters do you have, what samplerate, and many channels are you outputting? And are you using the Alsa backend?
  Reply With Quote
Old 23rd February 2020, 07:51 PM   #10
Jona66 is offline Jona66
diyAudio Member
 
Join Date: Jan 2020
Filter is 16384 taps, 2 channels, 48khz, running on an Intel Celeron J3160, approx. 5% CPU load. CPU load is pretty much the same than Brutefir, delay is much shorter.

Kr
J
  Reply With Quote

Reply


CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc.Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The room correction or speaker correction? What can we do with dsp power now availabl Raimonds Full Range 233 28th January 2017 07:51 AM
Introducing OpenDRC, Open Digital Room Correction engine minidsp miniDSP 20 20th January 2016 05:37 PM
What the difference between dsp room correction eq and software correction erez1012 PC Based 0 10th March 2014 07:07 PM
Writing a Cross-Platform, Free Software Modeling Tool and TS-Parameter DB justinzane Software Tools 6 31st December 2013 06:55 AM
FS: DAC, room-correction, active crossovers, amp, speakers! taloyd Swap Meet 4 14th April 2009 03:16 PM


New To Site? Need Help?

All times are GMT. The time now is 04:42 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 15.00%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2020 DragonByte Technologies Ltd.
Copyright ©1999-2020 diyAudio
Wiki