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

Cargo install just failed

Hi

Having completed my testing phase of CamillaDSP I wanted to set it up as a service, and while reading the config page realised that it's recommended to install CamillaDSP using Cargo. So I deleted the previous camilladsp that I'd downloaded, and cloned camilladsp and camilladsp-config. I went to the cloned camilladsp folder and issued the cargo install instruction but it just failed when trying to compile alsa-sys. That seems odd since alsa-sys seems to have been downloaded successfully:

Code:
ubuntu@ubuntu:~/camilladsp$ sudo cargo install --path . --root /usr/local/
  Installing camilladsp v0.6.1 (/home/ubuntu/camilladsp)
    Updating crates.io index
  Downloaded ansi_term v0.11.0
  Downloaded atty v0.2.14
  Downloaded darling_macro v0.13.0
  Downloaded darling v0.13.0
  Downloaded generic-array v0.14.4
  Downloaded dirs-sys-next v0.1.2
  Downloaded fnv v1.0.7
  Downloaded httparse v1.5.1
  Downloaded getrandom v0.2.3
  Downloaded http v0.2.4
  Downloaded hashbrown v0.11.2
  Downloaded rustversion v1.0.5
  Downloaded signal-hook-registry v1.4.0
  Downloaded utf-8 v0.7.6
  Downloaded yaml-rust v0.4.5
  Downloaded serde_with_macros v1.4.2
  Downloaded cfg-if v1.0.0
  Downloaded unicode-xid v0.2.2
  Downloaded matches v0.1.9
  Downloaded opaque-debug v0.3.0
  Downloaded signal-hook v0.3.9
  Downloaded slog v2.7.0
  Downloaded version_check v0.9.3
  Downloaded slog-async v2.7.0
  Downloaded num-complex v0.4.0
  Downloaded indexmap v1.7.0
  Downloaded input_buffer v0.4.0
  Downloaded unicode-bidi v0.3.6
  Downloaded strsim v0.10.0
  Downloaded serde_with v1.9.4
  Downloaded tinyvec v1.3.1
  Downloaded tinyvec_macros v0.1.0
  Downloaded term v0.7.0
  Downloaded slog-scope v4.4.0
  Downloaded textwrap v0.11.0
  Downloaded thiserror-impl v1.0.28
  Downloaded slog-term v2.8.0
  Downloaded syn v1.0.75
  Downloaded serde_json v1.0.67
  Downloaded typenum v1.13.0
  Downloaded strsim v0.8.0
  Downloaded lazy_static v1.4.0
  Downloaded take_mut v0.2.2
  Downloaded serde_derive v1.0.130
  Downloaded bitflags v1.2.1
  Downloaded tungstenite v0.13.0
  Downloaded serde_yaml v0.8.20
  Downloaded num-integer v0.1.44
  Downloaded proc-macro2 v1.0.28
  Downloaded block-buffer v0.9.0
  Downloaded primal-check v0.3.1
  Downloaded rand_distr v0.4.1
  Downloaded pkg-config v0.3.19
  Downloaded thread_local v1.1.3
  Downloaded realfft v2.0.1
  Downloaded num-traits v0.2.14
  Downloaded unicode-normalization v0.1.19
  Downloaded sha-1 v0.9.8
  Downloaded rand_chacha v0.3.1
  Downloaded arc-swap v1.3.2
  Downloaded alsa-sys v0.3.1
  Downloaded itoa v0.4.8
  Downloaded url v2.2.2
  Downloaded thiserror v1.0.28
  Downloaded percent-encoding v2.1.0
  Downloaded rand v0.8.4
  Downloaded chrono v0.4.19
  Downloaded serde v1.0.130
  Downloaded ryu v1.0.5
  Downloaded once_cell v1.8.0
  Downloaded nix v0.20.1
  Downloaded memoffset v0.6.4
  Downloaded idna v0.2.3
  Downloaded linked-hash-map v0.5.4
  Downloaded vec_map v0.8.2
  Downloaded transpose v0.2.1
  Downloaded libc v0.2.101
  Downloaded clap v2.33.3
  Downloaded log v0.4.14
  Downloaded quote v1.0.9
  Downloaded autocfg v1.0.1
  Downloaded byteorder v1.4.3
  Downloaded rubato v0.8.1
  Downloaded rawsample v0.1.1
  Downloaded alsa v0.5.0
  Downloaded strength_reduce v0.2.3
  Downloaded unicode-width v0.1.8
  Downloaded time v0.1.43
  Downloaded rustfft v6.0.1
  Downloaded ident_case v1.0.1
  Downloaded rand_core v0.6.3
  Downloaded ppv-lite86 v0.2.10
  Downloaded libm v0.2.1
  Downloaded dirs-next v2.0.0
  Downloaded digest v0.9.0
  Downloaded form_urlencoded v1.0.1
  Downloaded dtoa v0.4.8
  Downloaded crossbeam-channel v0.5.1
  Downloaded crossbeam-utils v0.8.5
  Downloaded cpufeatures v0.2.1
  Downloaded bytes v1.1.0
  Downloaded darling_core v0.13.0
  Downloaded base64 v0.13.0
  Downloaded 103 crates (4.7 MB) in 2.55s
   Compiling autocfg v1.0.1
   Compiling libc v0.2.101
   Compiling cfg-if v1.0.0
   Compiling proc-macro2 v1.0.28
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.75
   Compiling libm v0.2.1
   Compiling version_check v0.9.3
   Compiling typenum v1.13.0
   Compiling serde_derive v1.0.130
   Compiling bitflags v1.2.1
   Compiling slog v2.7.0
   Compiling serde v1.0.130
   Compiling fnv v1.0.7
   Compiling ident_case v1.0.1
   Compiling tinyvec_macros v0.1.0
   Compiling strsim v0.10.0
   Compiling crossbeam-utils v0.8.5
   Compiling pkg-config v0.3.19
   Compiling log v0.4.14
   Compiling ppv-lite86 v0.2.10
   Compiling matches v0.1.9
   Compiling lazy_static v1.4.0
   Compiling strength_reduce v0.2.3
   Compiling bytes v1.1.0
   Compiling itoa v0.4.8
   Compiling percent-encoding v2.1.0
   Compiling httparse v1.5.1
   Compiling once_cell v1.8.0
   Compiling ryu v1.0.5
   Compiling rustversion v1.0.5
   Compiling unicode-bidi v0.3.6
   Compiling serde_json v1.0.67
   Compiling signal-hook v0.3.9
   Compiling unicode-width v0.1.8
   Compiling hashbrown v0.11.2
   Compiling opaque-debug v0.3.0
   Compiling linked-hash-map v0.5.4
   Compiling slog-async v2.7.0
   Compiling dtoa v0.4.8
   Compiling byteorder v1.4.3
   Compiling utf-8 v0.7.6
   Compiling base64 v0.13.0
   Compiling take_mut v0.2.2
   Compiling strsim v0.8.0
   Compiling vec_map v0.8.2
   Compiling arc-swap v1.3.2
   Compiling ansi_term v0.11.0
   Compiling num-traits v0.2.14
   Compiling num-integer v0.1.44
   Compiling memoffset v0.6.4
   Compiling indexmap v1.7.0
   Compiling generic-array v0.14.4
   Compiling camilladsp v0.6.1 (/home/ubuntu/camilladsp)
   Compiling tinyvec v1.3.1
   Compiling alsa-sys v0.3.1
   Compiling form_urlencoded v1.0.1
   Compiling input_buffer v0.4.0
   Compiling thread_local v1.1.3
   Compiling http v0.2.4
   Compiling textwrap v0.11.0
   Compiling yaml-rust v0.4.5
error: failed to run custom build command for `alsa-sys v0.3.1`

Caused by:
  process didn't exit successfully: `/home/ubuntu/camilladsp/target/release/build/alsa-sys-09595e0ba2ffaa04/build-script-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=ALSA_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=ALSA_STATIC
  cargo:rerun-if-env-changed=ALSA_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_aarch64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_aarch64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_aarch64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_aarch64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_aarch64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'Failed to run `"pkg-config" "--libs" "--cflags" "alsa"`: No such file or directory (os error 2)', /root/.cargo/registry/src/github.com-1ecc6299db9ec823/alsa-sys-0.3.1/build.rs:13:18
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `camilladsp v0.6.1 (/home/ubuntu/camilladsp)`, intermediate artifacts can be found at `/home/ubuntu/camilladsp/target`

Caused by:
  build failed
ubuntu@ubuntu:~/camilladsp$ sudo apt install alsa-sys
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package alsa-sys

Can anyone help me with this?
 
... just copy the downloaded binary to "/usr/local/bin/" ...
All done now and CamillaDSP is running just great as a service. Thanks! For my understanding, can I ask about some of the things in asound.conf, and what they do?
Code:
pcm.!default { 
   type plug 
   slave.pcm "camilladsp" 
}
 
pcm.camilladsp {

    # Use the ALSA plug-in "plug" for rate-/format-conversion.
    type plug

    # Forward the audio stream to the ALSA loopback-device
    slave {
        pcm {

            # Direct hardware access
            type        hw

            # Loopback card name
            #
            # Has to match "id" in the options of the snd-aloop module
            card        "Loopback"

            # Loopback device ID
            device      0

            # Number of audio channels
            #
            # Has to match the number of channels in music player app
            # and in the CamillaDSP input configuration
            channels    2

            # Format of audio stream
            #
            # Has to match the format defined in the
            # of the CamillaDSP input configuration
            format      "S32_LE"

            # Sampling-rate of audio stream
            #
            # Has to match the sampling-rate defined in the
            # CamillaDSP configuration
            rate        192000
        }
    }
}
I didn't have this plug in place when I was testing, so I guess its purpose is to make the Loopback > CamillaDSP route the default for all audio? In order to do that it will convert the format and sampling-rate of the music player's audio stream output to match what CamillaDSP is expecting, right? If that's so:

- audio already being directed to the loopback device won't be affected at all, will it? In my case Roon is already finding the loopback device and sending it audio in a compatible channel/format/sampling-rate, so I guess it isn't affected at all by this plug?

- I'd read that ALSA conversions are lower quality than CamillaDSP - so this plug's conversions should be avoided if possible, by matching the streams wherever possible, knowing that the plug will step in only if needed - is that right?

- If I wanted to upsample a CD stream from 2ch/S16LE/44.1kHz to 2ch/S32LE/192kHz (if I get that far!) then as long as I make sure the loopback is sending 2ch/S32LE (to match my existing config.yml but say at 44.1kHz, so not matching the CamillaDSP sampling rate) then CamillaDSP would do the resampling (as long as enable_resampling was true)? I ask this because the comments in the example asound.conf say the sampling-rate of the audio stream "has to match the sampling-rate defined in the CamillaDSP configuration"

Many thanks
 
I didn't have this plug in place when I was testing, so I guess its purpose is to make the Loopback > CamillaDSP route the default for all audio? In order to do that it will convert the format and sampling-rate of the music player's audio stream output to match what CamillaDSP is expecting, right?
Yes exactly, to make the Loopback accept any imput, and also make it the default.



- audio already being directed to the loopback device won't be affected at all, will it? In my case Roon is already finding the loopback device and sending it audio in a compatible channel/format/sampling-rate, so I guess it isn't affected at all by this plug?
Yes if you go directly to the Loopback, then the plug is bypassed.



- I'd read that ALSA conversions are lower quality than CamillaDSP - so this plug's conversions should be avoided if possible, by matching the streams wherever possible, knowing that the plug will step in only if needed - is that right?
Correct. You can configure Alsa to use a better quality resampler, but the default one isn't that great. It will only convert the rate if needed. It will also convert the sample format as needed, but that doesn't cause any quality issues.



- If I wanted to upsample a CD stream from 2ch/S16LE/44.1kHz to 2ch/S32LE/192kHz (if I get that far!) then as long as I make sure the loopback is sending 2ch/S32LE (to match my existing config.yml but say at 44.1kHz, so not matching the CamillaDSP sampling rate) then CamillaDSP would do the resampling (as long as enable_resampling was true)? I ask this because the comments in the example asound.conf say the sampling-rate of the audio stream "has to match the sampling-rate defined in the CamillaDSP configuration"
Yes, set enable_resampling to true, and capture_samplerate to 44100. That comment in the .conf-file doesnt mention the resampler in CamillaDSP, because it didn't exist yet when I wrote that :)
 
Hi,


I am already a happy user of Camilla DSP in combination with moode audio, thank you so much for making this great product available for the public!



I am now ready to start a project building a 3 way active speaker using DSP crossovers and Camilla DSP. I was hoping to use an RPI 4 and connect to an AVR receiver through HDMI to get 6 separate channels of audio.



It seems that quite a few are already using this configuration. Before I go to the step and buying an AVR receiver, can anyone confirm that this is possible? Do anyone have any practical experience with such a setup?


Many Thanks!
 
Hi,


I am already a happy user of Camilla DSP in combination with moode audio, thank you so much for making this great product available for the public!



I am now ready to start a project building a 3 way active speaker using DSP crossovers and Camilla DSP. I was hoping to use an RPI 4 and connect to an AVR receiver through HDMI to get 6 separate channels of audio.



It seems that quite a few are already using this configuration. Before I go to the step and buying an AVR receiver, can anyone confirm that this is possible? Do anyone have any practical experience with such a setup?


Many Thanks!
I do - that's exactly what I use. Pi is a bit of a PITA here, because you may have to rebuild the kernel after making some changes. per Charlie's kernel updates https://www.diyaudio.com/forums/pc-based/341590-using-raspberry-pi-4-usb-dsp-dac-9.html#post5906147

USB should work natively, but hdmi for whatever reason they keep pulling 24/96/8channel support in and out of the kernel. Since you are using Moode, you will note they have their own kernel, so you'll need to ask Tom(?) if that kernel already supports high res multi channel over hdmi.
 
Hi Henrik, I'm really pleased with the updates in the latest version of Moode. Really nice improvements in usability. I do have a question though - at what point does selecting a YAML file update the configuration running on the server? Do i need to select the file, then select "apply dsp" or select file, "fetch", then "apply" ? It seems a little inconsistent when it actually switches, but it may be the subtleties of the different filters I'm using mask the changes.
Anyway, great work!
 
New version 0.6.2!
Changes since the previous version:

New features:

  • Updated wasapi library
  • Add FivePointPeq biquad combo
  • Support wav with extended header
Bugfixes:

  • Stop properly after failing to start with bad wasapi config
Get it here: Release v0.6.2 * HEnquist/camilladsp * GitHub


This should be used with the existing pycamilladsp v0.6.0, and the new pycamilladsp-plot v0.6.1. It needs no changes in the gui or backend.
 
Just want to let you folks know that from now on I will be tracking binary releases by Henrik in my debian repository ( Debian repository :: T5! DIY Audio Software & Hardware )

The package is called "camilladsp-binary".

Architectures available are amd64, armhf and arm64.

PS: why the package name "camilladsp-binary" and not camilladsp? I wanted to be nice and not produce conflicting package names onces camilladsp moves upstream. It does provide "camilladsp" so it will play nicely with a potential package named "camilladsp" that also provides the file /usr/bin/camilladsp . Only one of the two packages will be able to be installed at the same time.
 
Last edited:
Hi.

I created an fifo file (mkfifo /usr/audio_fifo.fifo)

Setting MPD.conf to ::

audio_output {
type "fifo"
name "mpd_audio_pipe"
path "/usr/audio_fifo.fifo"
#format "44100:16:2"
buffer_time "500000"
}
I keep getting error's and "Mouse" -like sounds :D

pi@raspberrypi:~/camilladsp $ cat 44100.yml
devices:
samplerate: 44100
chunksize: 8192
queuelimit: 4
#silence_threshold: -60
#silence_timeout: 3.0
#target_level: 500
#adjust_period: 10
#enable_rate_adjust: true
#enable_resampling: true
#resampler_type: BalancedAsync
#capture_samplerate: 44100
stop_on_rate_change: false
rate_measure_interval: 1.0
capture:
type: File
channels: 2
filename: "/usr/audio_fifo.fifo"
format: S32LE
playback:
type: ALSA
channels: 2
device: "sound_out"
format: S32LE
Sep 04 16:31:27.213 WARN Prepare playback after buffer underrun, module: camillalib::alsadevice
Sep 04 16:31:27.940 WARN sample rate change detected, last rate was 21921.466078394158 Hz, module: camillalib::filedevice
Sep 04 16:31:27.945 DEBG Playback buffer level: 188.64285714285714, signal rms: [-26.50481, -26.499989], module: camillalib::alsadevice
Sep 04 16:31:27.946 WARN Prepare playback after buffer underrun, module: camillalib::alsadevice
Sep 04 16:31:28.700 WARN Prepare playback after buffer underrun, module: camillalib::alsadevice
Sep 04 16:31:29.061 WARN sample rate change detected, last rate was 21921.95581067485 Hz, module: camillalib::filedevice
Sep 04 16:31:29.432 WARN Prepare playback after buffer underrun, module: camillalib::alsadevice

I don't think MPD is capable of playing to /dev/stdout, only fifo files is accepted.

Jesper.
 
Phofman :: :)

It was actually the problem...
Changing my .yml config into :

devices:
samplerate: 44100
chunksize: 8192
queuelimit: 4
#silence_threshold: -60
#silence_timeout: 3.0
#target_level: 500
#adjust_period: 10
#enable_rate_adjust: true
#enable_resampling: true
#resampler_type: BalancedAsync
#capture_samplerate: 44100
stop_on_rate_change: false
rate_measure_interval: 1.0
capture:
type: File
channels: 2
filename: "/usr/audio_fifo.fifo"
format: S16LE
playback:
type: ALSA
channels: 2
device: "sound_out"
format: S32LE

Did the trick...

why placing the FIFO into root-writeable /usr?
.. I know... just for testing for now...

Now back into tweaking it a bit... thank's man

Jesper.
 
Last edited:
I'm not very interested in CUDA since it's completely tied to Nvidia hardware. But there really isn't much need, any half-decent cpu has enough processing power to do quite long fir filters at high sample rates.

What filter lengths and sample rates do you have in mind?

See your point:)
Maybe the samplerate converter could benefit from CUDA? But not worth the efford I guess.

CammillaDSP can of cource run on the Cortex-A57 and the CUDA part could be used for
  • LIDAR
  • Room metrics measuring
  • Listening position placement in measured room
  • AR to select the best filters for camilla DSP based where you are sitting in the room.
Just dreaming