CamillaDSP with Moode – build a simple filter pipeline

CamillaDSP

This tutorial demonstrates how you can build your own filter pipeline with CamillaDSP and moOde. Building your own filter pipelines with CamillaDSP maybe can look challenging the first time, how ever in practice it isn’t that hard to do.

We will use a very basic filter; a biquad low pass filter. No intended to be very useful, but to have an easy to hear divergent sound to check the working of the filter.

Before we start

Before we can start it is very important to comply to the preconditions:

  • moOde 7.1 or higher installed (how ever 7.2 or higher is advised).
  • moOde works correctly (plays music)
  • Use a moOde music source that supports CamillaDSP (like local, network files and UPnP for example)
  • If used disable all other DSP/EQ functions of moOde.
  • Correct working CamillaDSP chain (test with the default flat config)

Especially validation that the default supplied CamillaDSP config ‘flat’ is working is important to make sure before our ‘experiment’ start our system in ok.

If not sure how to do this see my CamillaDSP and moOde.

Steps of creating a new configuration

In basic creating a CamillaDSP config be can summarized as:

  • Create new configuration
  • Create filters
  • Add the filters to a pipeline (at least one pipeline per channel)
  • Activate the changed configuration

We walk through all this steps.

What will we create

The image below show the configurations we will create:

It contains:

  • A two channel input (= capture device).
  • A two channel mixer.
  • A low pass filter called lp applied two both channels.
  • A two channel output (= playback device)

The mixer is used:

  • If need to prevent clipped of the signal.
  • To normalize the level against my other filter configurations.

Opening the moOde CamillaDSP configuration page

  • Open from the moOde menu (Yes the M in the right upper corner)
  • And select configure
  • Pick from the qucik menu the CamillaDSP option.

The dialog that opens up is the moOde CamillaDSP configuration page. Not to be confused with the pipeline editor from CamillaDSP it self, which is also supplied with moOde. The pipeline editor is lateron needed to edit the configuration it self.

Creating a new configuration file

If you have tested the flat config from the moOde CamillaDSP config, we already have working config so we don’t have to start from scratch.

Let’s copy that configuration:

  • In the pipeline configuration section select the flat configuration from the list.
  • Next press copy
  • Provide a name for the new configuration.

Great we have now a new configuration. By creating the configuration file in this way, moOde will arange the following things for you:

  1. It will setup the correct input device for CamillaDSP
  2. It will setup the correct the output device CamillaDSP.
  3. It will have already an default mixer

By the way if you upload an already created CamillaDSP config, moOde will also update the config to use the correct capture and playback device.

Before we can actually use it, we nee to activate it:

  • Select the configuration lowpass from the list on top of the screen.
  • Press save

Before we proceed further this is a good to starting point to play some music. If you have music playing, the changes we will make hereafter will be direct audible.

Start CamillaDSP pipeline editor

  • Go to the botton of the screen.
  • If not already active toggle the pipeline editor status to ON. ( After a moOde restart it will turned off again).
  • Press the open button .

The web paged opened is the very nice pipeline configuration editor supplied by the CamillaDSP project it self, called camillagui.

Because moOde already arranged the correct basic configuration we can directly continue.

Create a filter

  • Press on the Filters tab
  • Press on the green plus

A new filter configuration box appears. If everything went well there is already default a Biquad Lowpass filter selected like below.

The only left to do is set the correct by:

  • Click on the name field
  • Provide a new name. In this case we will use just ‘lp’

If this filter isn’t present (or you want to select a different filter) use first the type selector to select Biquad filter.

Available filter types

Next the subtype can be selected:

Available Biquad subtypes

With the icon below you can show the bandwidth and phase response of the filter.

Bandwidth and phase respons.

Create the pipeline

Now we created a filter we have to add the filter to the pipeline.

Open the pipeline editor by click on the Pipeline tab

At the pipeline overview we already see the mixer with 2in, 2out present.
(It is configured at the mixer tab, no need to change the configuration this time).

  • Add a pipeline by pressing the green plus.
  • Default the pipeline is created for the first channel. Make sure it is channel 0 (step 1), not 1 that will be the second channel.
  • Select the filter from the list (step 2)

We now have only a pipeline for the left channel. Lets add a new pipeline for the right channel:

  • Press the green plus at the bottom.
  • Enter 1 at the channel input to assign it to the right channel
  • Select from the list the ‘lp’ filter again.

If you create new filters you can repeat the process by adding the filter to the two existing pipelines.

With graph button you can generate an bandwidth/phase plot over the entire pipeline. In our case it will be the same as from a single filter, but if you apply multiple filters it provides a great feedback.

Testing the new pipeline

Time to test the filter.

  • Press the Apply to CDSP button on the right side of the screen.

This will make it active and save the configuration. If you already have music playing it will be direct audible.

This make it very easy to tweak your settings. For example:

  • You can change the frequency setting of the filter at the filters tab.
  • After the change apply the configuration.
  • And check if your changes doesn’t result in clipping (in which you have the reduce the gain at the mixers tab.

Conclusion

We reached the end to this article. I hope you see that creating new CamillaDSP configuration isn’t that hard. Especially in combination with moOde, which will handle most of the hard parts for you.
Time for your own adventure to create more usefull configuration yourself.

Using Camilladsp with moOde 7 – Part 2

In part I I explained how you can get CamillaDSP working with moOde 7. In the upcoming release moOde 7.1.0, we have improved the integration a lot. No need anymore for any dirty command line work. Configuration files can edited with a web interface.

Features

The features are:

  • Dedicated CamillaDSP configuration page
  • Quick access to the CamillaDSP configuration page from the moOde configuration menu.
  • Management of CamilllaDSP configuration files.
  • Management of impules response files for the convolution filters.
  • Uses the alsa_cdsp module in config_cdsp mode, which passes the samplerate and capture format to camilladsp.
  • Patching the alsa_cdsp configuration with the correct camilladsp configuration file.
  • Automatic patching of the configuration files with the correct output device, capture device and sample format. Of course it can also be disabled.
  • Custom mode where the alsa_cdsp and camilla configuration are not managed by moOde. For example when using multiple output devices.
  • Quick convolution mode.
  • While playing music you can switch live between camilladsp configurations.
  • Start Camillas own very nice web gui from moOde to edit configuration files.
  • Wave convolution file converter to raw included. Also split stereo wave files.
  • Software versions are bumped to the latest repo commits just before the 7.1 release.

Before you start your CamillaDSP adventure, make sure moOde functions correct and is able to play music.

And to do some expectation management; moOde doesn’t included measured tooling for creating room/device/speaker responses it self. Luckily there is al lot of tooling available, for example the good old REW. For headphone corrections there a lot of responses measurements/settings available out there waiting to be downloaded by you.

moOde CamillaDSP configuration page

The easiest way to access the CamillaDSP functionality is using the CamillaDSP button from the general configuration screen.

This will open the moOde CamillaDSP configuration page:

General

In the configuration selection box you can select a configuration to use. There are three special ones:

  • Off – you already guessed it; turns off CamillaDSP
  • Custom – When chosen alsa_cdsp and camilladsp and related are not managed by moOde. This makes it possible to create a setup different that the default moOde provided. Use only if you know what you are doing.
  • Quick convolution filter – instead of providing you own camilla configuration file, there is a template for quick setup of a convolution filter. For example perfect for AutoEq headphone corrections.

All other choices are the available configuration files. In the section Pipeline configuration those can be managed, I would suggest to keep the flat configuration. This makes it easy to toggle between the several CamillaDSP configurations files and use the flat one as an ‘off’ mode.

When the Default Device option is active, from the active CamillaDSP configuration the used capture and playback device are patched to use the active device configured in moOde.

Quick convolution filter

Camilladsp works with configuration files. For basic convolution filter a template is present.

You only have to provide four settings to get it working.

Quick convolution filter

The left and right impulse responses can be uploaded in the section convolution file.

The pipeline configuration contains:

  • 2x master gain
  • 2 convolution filter

Below is the graphical form of it:

quick convolution filter configuration

For headphone users among us, the project AutoEQ provide parametric eq and convolutions files for equalization you headphone.

Pipeline configuration

Here you can manage the pipeline configuration files, including checking the configuration and show a graphical form of the pipeline.

pipeline configuration

A few configuration files are provided. Those are not useful for anything then to test camilladsp works correctly.

The easiest way to start building your own configuration files is to copy an existing and open the provided camillagui to create your filter pipeline.

Alternative you can upload you own premade configuration files. See the camilladsp website for the format of the configuration files.

Convolution file

Impulse response files for the convolution filters can be managed here. With the INFO button you can show some basic information about the impulse response file. See camilladsp for information about the supported file types.

impulse response coefficients information

When you upload a wave file, you will notice some red errror marks about the use of a wave file:

Wave files aren’t support. It is possible to treat a mono wave file as raw by skipping the the header (you need to know the header size) in the CamillaDSP pipeline configuration. For stereo files this isn’t possible.

To ease the pain a wave file converter is build in. You can activate it with the convert button. It will:

  • If the wave file is a stereo wave file split it in to mono files.
  • Convert the mono files to raw
  • Add the channel, samplerate and bitdepth (currently always convert to 24bits) to file name.
  • Remove the original wave file

Update:
In moOde 7.3 the convert function is removed, because camilladsp 0.5.2 is used. Which supports direct use of wave files, mono and stereo.

Pipeline editor

The pipeline editor is the web interface provides by the camilladsp project it self.

The status shows if the gui is already running or not. If not it can be started by toggling the button.

The expert mode show some settings you only need to change or check when use custom config alsa_cdsp or custom output device(s).

camillagui is started as a systemd service called camillagui.

On start the camillagui will load the active configuration file. On apply the changed configuration will be activated and saved.

camillagui

At the left side the clipped number of samples are shown. If that is the case you can reduce the input with a gain filter at the front of your pipeline.

At the filter section self there is a plot button which provide the gain an phase response:

Some example configurations

Remember that CamillaDSP is much more then only convolution filters.
Parametric EQ or graphical EQ are also easy to implement.

For example below is an Linkwitz crossfeed filter implemented based on the available IIR filters:

Or you can of course go wild with convolution filters like the implementation of spatial room response based on ASH IR Data:

Keep in mind that you need IR files for every sample rate you want to support.

Despite the fact that moOde with CamillaDSP is a fantastic solution, the Pi is limited in the available hardware resources. Be realistic about what is required and what the device can do.

Behind the scenes

For the ones who wonder how everything behind scenes works, below a small illustration about the involved and the relations between those:

More information

For more info about CamillaDSP visit the homepage or follow the nice thread at diyaudio CamillaDSP – Cross-platform IIR and FIR engine for crossovers, room correction etc.