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

Would have been really nice if it had worked 🙂 Another thing that could be worth trying, where I think the chance of success is higher, is to add a more controlled stop and start after it has recovered from the xrun. That would then be a call to drain(), followed by a second prepare().



I'll take a look!

How do you feel about following phofmans suggestion to try to fix the problem in the driver? These other things are just various ways to try to work around the problem, while that could solve it.

OK so I have been using my modifications for a while and they make my system usable. Any xrun results in an audio dropout between roughly 250-1000ms (estimated), but when the audio comes back the channel order is correct. I watched Interstellar the other day and it happened 3 or 4 times in the 2 and a half hours. So, it's managable but obviously not ideal.
I would like to try the driver fix but that is going to take a significant amount of time so it will need to wait for a while.
@phofman - Please excuse a silly question, but what's the reason to re-compile the whole kernel? Isn't this loaded as a module? There must be something I am unaware of here.
 
Thanks for confirming I am not missing anything @phofman. I'm on RPi and the things we're interested in are modules (see below, I removed many other related lines of output). I am using a 64-bit kernel but with 32-bit applications (armhf is the 32-bit newest ARM architecture). I need dpkg to use arm64 so I will reinstall my OS entirely.
Code:
gordoste@raspberrypi:~ $ lsmod | grep bcm2835
bcm2835_isp            28672  0
snd_soc_bcm2835_i2s    20480  2
bcm2835_v4l2           45056  0
bcm2835_codec          49152  0
bcm2835_mmal_vchiq     36864  3 bcm2835_codec,bcm2835_v4l2,bcm2835_isp
snd_soc_core          274432  6 snd_soc_spdif_rx,snd_soc_bcm2835_i2s,vc4,snd_soc_hdmi_codec,snd_soc_simple_card_utils,snd_soc_simple_card
snd_bcm2835            28672  0
gordoste@raspberrypi:/boot $ dpkg --print-architecture
armhf
 
Thanks @HenrikEnquist for the kind offer... I think I will reinstall the OS and attempt to test this driver change first. If that doesn't work, I will try to tweak the config settings and also add some retry logic, because sometimes (rarely) the restart of the playback thread fails with snd_pcm_open() returning EBUSY. But it's not a big deal, the kids just switch back to using the TV's internal speakers 🙂
 
Yes that is the first suspect 🙂 I had already removed PulseAudio since I don't need it for a pure DSP pipeline. Last night I reinstalled OS, recompiled my custom CDSP codebase and successfully played some music. Once I set CDSP up to auto-start, I will start looking at the kernel module modifications.
 
I need some help with toubleshooting importing of filters from REW:

I have measured sub, mid and tweeter individually with REW. Based on the results have I generetade EQ-filters for lowpass, highpass, baffle step and leveling.
The filtes are saved from REW in *.yml.
Code:
filters:
  FIRTweet2M_1:
    parameters:
      freq: 259.0
      gain: -28.3
      q: 9.519
      type: Peaking
    type: Biquad
  FIRTweet2M_2:
    parameters:
      freq: 279.0
      gain: -14.2
      q: 7.449
      type: Peaking
    type: Biquad
...

pipeline:
  names:
  - FIRTweet2M_1
  - FIRTweet2M_2
...
  type: Filter

then have i edited my camillaDSP config by adding the following

Code:
filters: 
  tweet_fir:   
  type:  Conv
  parameters:     
    type: File     
    filename: home/camilladsp/configs/fir_tweeter.yml     
    format: File     
    skip_bytes_lines: 0 (*)     
    read_bytes_lines: 0 (*)

Code:
pipeline:
  - type: Mixer
  name: to6chan
  - type: Filter
  channel: 0
  names:
  - tweet_fir

I guess there are some kind of typo here, however can I not find it...

Please help!
 
If one paste a number of filters right on the top, at least I need to delete the first space on the first line (it will jump 2 spaces left) and then add 2 spaces back to set the correct indentation. Also the same for the pipeline... yml is picky here...

//
 
nope, double checked all the indentations.

As long as the filter are not used in the pipeline do I at least get sound in the speakers. When add "tweet_fir" to the pipeline in config.yaml do everything become dead silent (as it does when I make mistakes in the config.yaml).

Are there any way to read error codes from camilladsp. Running it only via text promt, no graphical interface.
 
@PerCarlin

I think you may be mixing concepts. The .yml file generated from REW is a partial configuration that contains IIR filters (biquads), this is clear from the .yml file you posted.

Code:
filters:
  FIRTweet2M_1:
    parameters:
      freq: 259.0
      gain: -28.3
      q: 9.519
      type: Peaking
    type: Biquad
  FIRTweet2M_2:
    parameters:
      freq: 279.0
      gain: -14.2
      q: 7.449
      type: Peaking
    type: Biquad
...

pipeline:
  names:
  - FIRTweet2M_1
  - FIRTweet2M_2
...
  type: Filter

This is also explained in Henrik's documentation -> https://github.com/HEnquist/camilladsp#export-filters-from-rew.

REW can automatically generate a set of filters for correcting the frequency response of a system. REW V5.20.14 and later is able to export the filters in the CamillaDSP YAML format.

  • Go to the "EQ Filters" screen. Expand the "Equalizer" section in the list on the right side.
  • Select "CamillaDSP" as Manufacturer and "Filters" as Model.
  • Expand the "Filter Task" section and click "Save filter settings to YAML file".
    • This opens a popup with the the text "Enter the label to use for each filter, the filter number will be appended to the label". This allows identification of the filter set.
Note that the generated YAML file is not a complete CamillaDSP configuration. It contains only filter definitions and pipeline steps, that can be pasted into a CamillaDSP config file.

What I don't understand is this configuration you posted.

Code:
filters:
  tweet_fir:  
  type:  Conv
  parameters:    
    type: File    
    filename: home/camilladsp/configs/fir_tweeter.yml    
    format: File    
    skip_bytes_lines: 0 (*)    
    read_bytes_lines: 0 (*)

Code:
pipeline:
  - type: Mixer
  name: to6chan
  - type: Filter
  channel: 0
  names:
  - tweet_fir

Did you generate a separate FIR filter? Or are you just taking the partial configuration from REW and attempting to use it as a FIR filter?

Michael
 
My Copy-Paste did not go as planed with te indents in the first post

This works (filter deactivated, if I remove the bracket does it not work)

Code:
  firTweet2M:
    type: Conv
    parameters:
      type: File
      filename: configs/FIRTweet2M.yaml
      format: TEXT
      skip_bytes_lines: 0
      read_bytes_lines: 0

Code:
pipeline:
  - type: Mixer
    name: to6chan
  - type: Filter
    channel: 0
          # Vänster midd
    names:
        - lowpassMid
        - highpassMid
#        - firTweet2M
 
filter in .yaml file

Code:
filters:
  FIRTweet2M_1:
    parameters:
      freq: 259.0
      gain: -28.3
      q: 9.519
      type: Peaking
    type: Biquad
  FIRTweet2M_2:
    parameters:
      freq: 279.0
      gain: -14.2
      q: 7.449
      type: Peaking
    type: Biquad
  FIRTweet2M_3:
    parameters:
      freq: 301.0
      gain: -19.9
      q: 8.105
      type: Peaking
    type: Biquad
  FIRTweet2M_4:
    parameters:
      freq: 352.0
      gain: -14.5
      q: 3.37
      type: Peaking
    type: Biquad
  FIRTweet2M_5:
    parameters:
      freq: 389.0
      gain: -21.1
      q: 3.993
      type: Peaking
    type: Biquad
  FIRTweet2M_6:
    parameters:
      freq: 460.0
      gain: -17.2
      q: 4.193
      type: Peaking
    type: Biquad
  FIRTweet2M_7:
    parameters:
      freq: 495.0
      gain: -10.1
      q: 6.269
      type: Peaking
    type: Biquad
  FIRTweet2M_8:
    parameters:
      freq: 597.0
      gain: -15.3
      q: 6.44
      type: Peaking
    type: Biquad
  FIRTweet2M_9:
    parameters:
      freq: 692.0
      gain: -16.3
      q: 5.393
      type: Peaking
    type: Biquad
  FIRTweet2M_10:
    parameters:
      freq: 837.0
      gain: -16.3
      q: 5.104
      type: Peaking
    type: Biquad
  FIRTweet2M_11:
    parameters:
      freq: 965.0
      gain: -14.1
      q: 6.867
      type: Peaking
    type: Biquad
  FIRTweet2M_12:
    parameters:
      freq: 1220.0
      gain: -11.7
      q: 4.17
      type: Peaking
    type: Biquad
  FIRTweet2M_13:
    parameters:
      freq: 1413.0
      gain: -8.2
      q: 6.501
      type: Peaking
    type: Biquad
  FIRTweet2M_14:
    parameters:
      freq: 1779.0
      gain: -14.2
      q: 1.318
      type: Peaking
    type: Biquad
pipeline:
  names:
  - FIRTweet2M_1
  - FIRTweet2M_2
  - FIRTweet2M_3
  - FIRTweet2M_4
  - FIRTweet2M_5
  - FIRTweet2M_6
  - FIRTweet2M_7
  - FIRTweet2M_8
  - FIRTweet2M_9
  - FIRTweet2M_10
  - FIRTweet2M_11
  - FIRTweet2M_12
  - FIRTweet2M_13
  - FIRTweet2M_14
  type: Filter
 
It does work if I copy-paste the filters directly to the camillaDSP config. however is it a bit unpractical to test different EQ-filters by this. reading a file would make life easier.
Ah sorry didn't see this before! Reading biquad filters from a separate file is not supported. It's been suggested before to add this, but it would make the config handling much more complicated and I don't think it's worth it.