• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

RPi4 + CamillaDSP Tutorial

MCH

Major Contributor
Joined
Apr 10, 2021
Messages
2,682
Likes
2,317
I've spend a little more time i'd be willing to admit trying to get Camilladsp setup on my RPi and believe to be stuck.
Followed the installation guide, but i think there's either a problem with my config file or the way my Octa Capture is handled by ubuntu?
This is as far as i'm getting trying to boot camilla:

I'm getting the error
2024-04-27 14:08:19.958993 ERROR [src/bin.rs:307] Capture error: ALSA function 'snd_pcm_hw_params_set_channels' failed with error 'EINVAL: Invalid argument'

I've attached the log and config file, i really hope there is somebody able to get me going; i'dd really love to get this working!
Thanks in advance

Log
Code:
024-04-27 14:08:19.728271 INFO [src/bin.rs:683] CamillaDSP version 2.0.3
2024-04-27 14:08:19.728381 INFO [src/bin.rs:684] Running on linux, aarch64
2024-04-27 14:08:19.728464 DEBUG [src/bin.rs:728] Loaded state: None
2024-04-27 14:08:19.728485 DEBUG [src/bin.rs:732] Using command line argument for initial volume
2024-04-27 14:08:19.728499 DEBUG [src/bin.rs:755] Using default initial mute
2024-04-27 14:08:19.728512 DEBUG [src/bin.rs:765] Initial mute: [false, false, false, false, false]
2024-04-27 14:08:19.728528 DEBUG [src/bin.rs:766] Initial volume: [-40.0, -40.0, -40.0, -40.0, -40.0]
2024-04-27 14:08:19.728551 DEBUG [src/bin.rs:768] Read config file Some("/home/kerwin/camilladsp/configs/octacapture.yml")
2024-04-27 14:08:19.730326 DEBUG [src/bin.rs:808] Config is valid
2024-04-27 14:08:19.730967 DEBUG [src/socketserver.rs:432] Start websocket server on 127.0.0.1:1234
2024-04-27 14:08:19.731320 DEBUG [src/bin.rs:994] Wait for config
2024-04-27 14:08:19.731357 DEBUG [src/bin.rs:1010] Waiting to receive a command
2024-04-27 14:08:19.731374 DEBUG [src/bin.rs:1013] Config change command received
2024-04-27 14:08:19.731390 DEBUG [src/bin.rs:999] New config is available and there are no queued commands, continuing
2024-04-27 14:08:19.731403 DEBUG [src/bin.rs:1036] Config ready, start processing
2024-04-27 14:08:19.732087 DEBUG [src/bin.rs:157] Using channels [false, false, true, true]
2024-04-27 14:08:19.732013 DEBUG [src/filters.rs:488] Build new pipeline
2024-04-27 14:08:19.732505 DEBUG [src/processing.rs:19] build filters, waiting to start processing loop
2024-04-27 14:08:19.954234 DEBUG [src/alsadevice.rs:334] Available Capture devices: [("hw:Loopback,0,0", "Loopback, Loopback PCM, subdevice #0"), ("hw:Loopback,0,1", "Loopback, Loopback PCM, subdevice #1"), ("hw:Loopback,0,2", "Loopback, Loopback PCM, subdevice #2"), ("hw:Loopback,0,3", "Loopback, Loopback PCM, subdevice #3"), ("hw:Loopback,0,4", "Loopback, Loopback PCM, subdevice #4"), ("hw:Loopback,0,5", "Loopback, Loopback PCM, subdevice #5"), ("hw:Loopback,0,6", "Loopback, Loopback PCM, subdevice #6"), ("hw:Loopback,0,7", "Loopback, Loopback PCM, subdevice #7"), ("hw:Loopback,1,0", "Loopback, Loopback PCM, subdevice #0"), ("hw:Loopback,1,1", "Loopback, Loopback PCM, subdevice #1"), ("hw:Loopback,1,2", "Loopback, Loopback PCM, subdevice #2"), ("hw:Loopback,1,3", "Loopback, Loopback PCM, subdevice #3"), ("hw:Loopback,1,4", "Loopback, Loopback PCM, subdevice #4"), ("hw:Loopback,1,5", "Loopback, Loopback PCM, subdevice #5"), ("hw:Loopback,1,6", "Loopback, Loopback PCM, subdevice #6"), ("hw:Loopback,1,7", "Loopback, Loopback PCM, subdevice #7"), ("hw:OCTACAPTURE,0,0", "OCTA-CAPTURE, USB Audio, subdevice #0"), ("null", "Discard all samples (playback) or generate zero samples (capture)"), ("hw:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\nDirect hardware device without any conversions"), ("hw:CARD=Loopback,DEV=1", "Loopback, Loopback PCM\nDirect hardware device without any conversions"), ("plughw:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\nHardware device with all software conversions"), ("plughw:CARD=Loopback,DEV=1", "Loopback, Loopback PCM\nHardware device with all software conversions"), ("default:CARD=Loopback", "Loopback, Loopback PCM\nDefault Audio Device"), ("sysdefault:CARD=Loopback", "Loopback, Loopback PCM\nDefault Audio Device"), ("front:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\nFront output / input"), ("dsnoop:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\nDirect sample snooping device"), ("dsnoop:CARD=Loopback,DEV=1", "Loopback, Loopback PCM\nDirect sample snooping device"), ("hw:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\nDirect hardware device without any conversions"), ("plughw:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\nHardware device with all software conversions"), ("default:CARD=OCTACAPTURE", "OCTA-CAPTURE, USB Audio\nDefault Audio Device"), ("sysdefault:CARD=OCTACAPTURE", "OCTA-CAPTURE, USB Audio\nDefault Audio Device"), ("front:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\nFront output / input"), ("dsnoop:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\nDirect sample snooping device")]
2024-04-27 14:08:19.958625 DEBUG [src/alsadevice.rs:352] Capture: supported channels, min: 12, max: 12, list: [12]
2024-04-27 14:08:19.958696 DEBUG [src/alsadevice.rs:353] Capture: setting channels to 4
2024-04-27 14:08:19.958993 ERROR [src/bin.rs:307] Capture error: ALSA function 'snd_pcm_hw_params_set_channels' failed with error 'EINVAL: Invalid argument'
2024-04-27 14:08:19.959036 DEBUG [src/bin.rs:309] Error while starting, release barrier
2024-04-27 14:08:19.977977 DEBUG [src/alsadevice.rs:334] Available Playback devices: [("hw:Loopback,0,0", "Loopback, Loopback PCM, subdevice #0"), ("hw:Loopback,0,1", "Loopback, Loopback PCM, subdevice #1"), ("hw:Loopback,0,2", "Loopback, Loopback PCM, subdevice #2"), ("hw:Loopback,0,3", "Loopback, Loopback PCM, subdevice #3"), ("hw:Loopback,0,4", "Loopback, Loopback PCM, subdevice #4"), ("hw:Loopback,0,5", "Loopback, Loopback PCM, subdevice #5"), ("hw:Loopback,0,6", "Loopback, Loopback PCM, subdevice #6"), ("hw:Loopback,0,7", "Loopback, Loopback PCM, subdevice #7"), ("hw:Loopback,1,0", "Loopback, Loopback PCM, subdevice #0"), ("hw:Loopback,1,1", "Loopback, Loopback PCM, subdevice #1"), ("hw:Loopback,1,2", "Loopback, Loopback PCM, subdevice #2"), ("hw:Loopback,1,3", "Loopback, Loopback PCM, subdevice #3"), ("hw:Loopback,1,4", "Loopback, Loopback PCM, subdevice #4"), ("hw:Loopback,1,5", "Loopback, Loopback PCM, subdevice #5"), ("hw:Loopback,1,6", "Loopback, Loopback PCM, subdevice #6"), ("hw:Loopback,1,7", "Loopback, Loopback PCM, subdevice #7"), ("hw:b1,0,0", "bcm2835 HDMI 1, bcm2835 HDMI 1, subdevice #0"), ("hw:b1,0,1", "bcm2835 HDMI 1, bcm2835 HDMI 1, subdevice #1"), ("hw:b1,0,2", "bcm2835 HDMI 1, bcm2835 HDMI 1, subdevice #2"), ("hw:b1,0,3", "bcm2835 HDMI 1, bcm2835 HDMI 1, subdevice #3"), ("hw:Headphones,0,0", "bcm2835 Headphones, bcm2835 Headphones, subdevice #0"), ("hw:Headphones,0,1", "bcm2835 Headphones, bcm2835 Headphones, subdevice #1"), ("hw:Headphones,0,2", "bcm2835 Headphones, bcm2835 Headphones, subdevice #2"), ("hw:Headphones,0,3", "bcm2835 Headphones, bcm2835 Headphones, subdevice #3"), ("hw:OCTACAPTURE,0,0", "OCTA-CAPTURE, USB Audio, subdevice #0"), ("null", "Discard all samples (playback) or generate zero samples (capture)"), ("hw:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\nDirect hardware device without any conversions"), ("hw:CARD=Loopback,DEV=1", "Loopback, Loopback PCM\nDirect hardware device without any conversions"), ("plughw:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\nHardware device with all software conversions"), ("plughw:CARD=Loopback,DEV=1", "Loopback, Loopback PCM\nHardware device with all software conversions"), ("default:CARD=Loopback", "Loopback, Loopback PCM\nDefault Audio Device"), ("sysdefault:CARD=Loopback", "Loopback, Loopback PCM\nDefault Audio Device"), ("front:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\nFront output / input"), ("surround21:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\n2.1 Surround output to Front and Subwoofer speakers"), ("surround40:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\n4.0 Surround output to Front and Rear speakers"), ("surround41:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\n4.1 Surround output to Front, Rear and Subwoofer speakers"), ("surround50:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\n5.0 Surround output to Front, Center and Rear speakers"), ("surround51:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\n5.1 Surround output to Front, Center, Rear and Subwoofer speakers"), ("surround71:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\n7.1 Surround output to Front, Center, Side, Rear and Woofer speakers"), ("dmix:CARD=Loopback,DEV=0", "Loopback, Loopback PCM\nDirect sample mixing device"), ("dmix:CARD=Loopback,DEV=1", "Loopback, Loopback PCM\nDirect sample mixing device"), ("hw:CARD=b1,DEV=0", "bcm2835 HDMI 1, bcm2835 HDMI 1\nDirect hardware device without any conversions"), ("plughw:CARD=b1,DEV=0", "bcm2835 HDMI 1, bcm2835 HDMI 1\nHardware device with all software conversions"), ("default:CARD=b1", "bcm2835 HDMI 1, bcm2835 HDMI 1\nDefault Audio Device"), ("sysdefault:CARD=b1", "bcm2835 HDMI 1, bcm2835 HDMI 1\nDefault Audio Device"), ("dmix:CARD=b1,DEV=0", "bcm2835 HDMI 1, bcm2835 HDMI 1\nDirect sample mixing device"), ("hw:CARD=Headphones,DEV=0", "bcm2835 Headphones, bcm2835 Headphones\nDirect hardware device without any conversions"), ("plughw:CARD=Headphones,DEV=0", "bcm2835 Headphones, bcm2835 Headphones\nHardware device with all software conversions"), ("default:CARD=Headphones", "bcm2835 Headphones, bcm2835 Headphones\nDefault Audio Device"), ("sysdefault:CARD=Headphones", "bcm2835 Headphones, bcm2835 Headphones\nDefault Audio Device"), ("dmix:CARD=Headphones,DEV=0", "bcm2835 Headphones, bcm2835 Headphones\nDirect sample mixing device"), ("hw:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\nDirect hardware device without any conversions"), ("plughw:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\nHardware device with all software conversions"), ("default:CARD=OCTACAPTURE", "OCTA-CAPTURE, USB Audio\nDefault Audio Device"), ("sysdefault:CARD=OCTACAPTURE", "OCTA-CAPTURE, USB Audio\nDefault Audio Device"), ("front:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\nFront output / input"), ("surround21:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\n2.1 Surround output to Front and Subwoofer speakers"), ("surround40:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\n4.0 Surround output to Front and Rear speakers"), ("surround41:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\n4.1 Surround output to Front, Rear and Subwoofer speakers"), ("surround50:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\n5.0 Surround output to Front, Center and Rear speakers"), ("surround51:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\n5.1 Surround output to Front, Center, Rear and Subwoofer speakers"), ("surround71:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\n7.1 Surround output to Front, Center, Side, Rear and Woofer speakers"), ("iec958:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\nIEC958 (S/PDIF) Digital Audio Output"), ("dmix:CARD=OCTACAPTURE,DEV=0", "OCTA-CAPTURE, USB Audio\nDirect sample mixing device")]
2024-04-27 14:08:19.981141 DEBUG [src/alsadevice.rs:352] Playback: supported channels, min: 10, max: 10, list: [10]
2024-04-27 14:08:19.981210 DEBUG [src/alsadevice.rs:353] Playback: setting channels to 4
2024-04-27 14:08:19.981385 DEBUG [src/bin.rs:312] Wait for playback thread to exit..
2024-04-27 14:08:19.981586 DEBUG [src/processing.rs:21] Processing loop starts now!
2024-04-27 14:08:19.981743 DEBUG [src/bin.rs:1038] Processing ended with status Ok(Restart)
2024-04-27 14:08:19.981778 DEBUG [src/bin.rs:1052] Restarting with new config
2024-04-27 14:08:19.981791 DEBUG [src/bin.rs:994] Wait for config

Config File:
Code:
description: null
devices:
  adjust_period: 10
  capture:
    channels: 4
    device: hw:OCTACAPTURE
    format: S32LE
    type: Alsa
  capture_samplerate: 41000
  chunksize: 1024
  enable_rate_adjust: false
  playback:
    channels: 4
    device: hw:OCTACAPTURE
    format: S32LE
    type: Alsa
  queuelimit: 4
  rate_measure_interval: 1
  samplerate: 41000
  silence_threshold: -100
  silence_timeout: 5
  stop_on_rate_change: false
  target_level: 1024
  volume_ramp_time: null
filters: null
mixers:
  4x4:
    channels:
      in: 4
      out: 4
    description: null
    mapping:
    - dest: 0
      mute: false
      sources:
      - channel: 2
        gain: 0
        inverted: false
        mute: false
        scale: null
    - dest: 1
      mute: false
      sources:
      - channel: 3
        gain: 0
        inverted: false
        mute: false
        scale: null
    - dest: 2
      mute: false
      sources:
      - channel: 2
        gain: 0
        inverted: false
        mute: false
        scale: null
    - dest: 3
      mute: false
      sources:
      - channel: 3
        gain: 0
        inverted: false
        mute: false
        scale: null
pipeline:
- bypassed: null
  description: null
  name: 4x4
  type: Mixer
processors: null
title: Analog
I don't know your device, but I read that at 41kHz it supports 12 channels capture and 10 channels playbak also your log suggests the same:

src/alsadevice.rs:352] Capture: supported channels, min: 12, max: 12, list: [12]

src/alsadevice.rs:352] Playback: supported channels, min: 10, max: 10, list: [10]

But you set 4 channels. I would try setting the number of channels accordingly in your config and give it a try
 

kerwin

New Member
Joined
Apr 27, 2024
Messages
3
Likes
0
can you try with 10, the maximum of input channels.
Thanks, i didn't know you had to use all channels.
I had to adjust the channels, format and sampling rate using information i got from aplay
Small step forward, it boots but gives me a sampling rate warning.
This changes every second or so:
2024-04-27 17:25:20.873867 WARN [src/alsadevice.rs:779] sample rate change detected, last rate was 28084.176587296097 Hz

At the same time I/O on the interface are going crazy.

Config file is now:
Code:
description: null
devices:
  adjust_period: 10
  capture:
    channels: 12
    device: hw:OCTACAPTURE
    format: S32LE
    type: Alsa
  capture_samplerate: 44100
  chunksize: 1024
  enable_rate_adjust: false
  playback:
    channels: 10
    device: hw:OCTACAPTURE
    format: S32LE
    type: Alsa
  queuelimit: 4
  rate_measure_interval: 1
  samplerate: 44100
  silence_threshold: -4000
  silence_timeout: 5
  stop_on_rate_change: false
  target_level: 1024
  volume_ramp_time: null
filters: null
mixers:
  12x10:
    channels:
      in: 12
      out: 10
    description: null
    mapping:
    - dest: 0
      mute: false
      sources:
      - channel: 0
        gain: -40
        inverted: false
        mute: false
        scale: null
    - dest: 1
      mute: false
      sources:
      - channel: 1
        gain: -40
        inverted: false
        mute: false
        scale: null
    - dest: 2
      mute: false
      sources:
      - channel: 0
        gain: -40
        inverted: false
        mute: false
        scale: null
    - dest: 3
      mute: false
      sources:
      - channel: 1
        gain: -40
        inverted: false
        mute: false
        scale: null
    - dest: 4
      mute: false
      sources:
      - channel: 0
        gain: -40
        inverted: false
        mute: false
        scale: null
    - dest: 5
      mute: false
      sources:
      - channel: 1
        gain: -40
        inverted: false
        mute: false
        scale: null
    - dest: 6
      mute: false
      sources:
      - channel: 0
        gain: -40
        inverted: false
        mute: false
        scale: null
    - dest: 7
      mute: false
      sources:
      - channel: 1
        gain: -40
        inverted: false
        mute: false
        scale: null
    - dest: 8
      mute: false
      sources:
      - channel: 0
        gain: -40
        inverted: false
        mute: false
        scale: null
    - dest: 9
      mute: false
      sources:
        - channel: 1
          gain: -40
          inverted: false
          mute: false
          scale: null
pipeline:
- bypassed: null
  description: null
  name: 12x10
  type: Mixer
processors: null
title: null
 

tinnitus

Active Member
Joined
Jan 26, 2021
Messages
150
Likes
207
Location
Germany
Hi Kerwin, the camilladsp mixer must not use all Channels that are available. You can use a 2x4 Mixer. Yust use as much channels vou need to operate ;-)
 

kerwin

New Member
Joined
Apr 27, 2024
Messages
3
Likes
0
Hi Kerwin, the camilladsp mixer must not use all Channels that are available. You can use a 2x4 Mixer. Yust use as much channels vou need to operate ;-)
But when i use less channels i get an error 'wrong number of input channels. Expected 12, found 2'
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
511
Likes
334
Thanks, i didn't know you had to use all channels.
You do not have to use all channels, but the number must be between the min and max supported by the driver/device, as reported in the log. That's only 10 for the capture direction, in this particular case.
This changes every second or so:
2024-04-27 17:25:20.873867 WARN [src/alsadevice.rs:779] sample rate change detected, last rate was 28084.176587296097 Hz

Do you perhaps have the device switched to be clocked from incoming SPDIF, with no SPDIF signal present?
 
  • Like
Reactions: MCH

silverD

Member
Joined
May 12, 2020
Messages
41
Likes
41
For those of you who picked up a Hifiberry DAC8x, I couldn't get it to work on Ubuntu server LTS 24.04. There seems to be an issue with overlays and had success with Raspberry Pi OS Lite 64.
 
Last edited:

terryforsythe

Addicted to Fun and Learning
Forum Donor
Joined
May 4, 2022
Messages
527
Likes
580
CamillaDSP + Raspberry Pi is an incredible combination. I am using it to apply the Harman curve (modified for my preference) on my KEF LS60s. The LS60s are very good speakers, but using CamillaDSP for room correction (using convolution files) takes them to the next level in my room - significant improvement.

As a side note, I am impressed with how efficient the software runs. On my Raspberry Pi 5, the DSP load stays under 5%, and my memory (RAM) usage stays below 180 MB. (Getting a Raspberry Pi 5 with 8 GB of RAM is way, way overkill for 2-channel operation).
 

Wirrunna

Member
Joined
May 27, 2021
Messages
94
Likes
45
Location
South Coast, NSW, Australia
CamillaDSP + Raspberry Pi is an incredible combination. I am using it to apply the Harman curve (modified for my preference) on my KEF LS60s. The LS60s are very good speakers, but using CamillaDSP for room correction (using convolution files) takes them to the next level in my room - significant improvement.
What filters have you used to get the Harman Curve ?
As far as I can remember, I set the Shortcut Bass and Treble to them,
Bass filter.jpg
Treble filter.jpg


In my latest toy, a CamillaDSP on a RPi5 mounted behind an Elecrow 7" touchscreen to test out a HiFiBerry DAC8X I have been trying out the Bass and Treble in the shortcuts tab of the CamillaDSP GUI -
Picoreplayer and Pi Screen tone ctl.jpg
The slider allows a slightly delayed (1 or 2 seconds due to stream buffers) response. Pic shows a PiCorePlayer on the left and the Elecrow screen on the right. The black box under the PiCorePlayer is my attempt at mounting Michael's recommended OLED screen and FLIRC, it's RPi5 is just visible with the red led between the screens.
 

jbjbjbjbjb

Member
Joined
Feb 12, 2022
Messages
25
Likes
12
Hi Michael,
In the other forum you mentioned that you had the DAC8x working with CDSP. Was this with Ubuntu and a Rpi5? Any tips to getting it going? I've just got one here.
Thanks!
 

Rafaille

Member
Joined
Dec 5, 2021
Messages
90
Likes
47
Hi Michael,
In the other forum you mentioned that you had the DAC8x working with CDSP. Was this with Ubuntu and a Rpi5? Any tips to getting it going? I've just got one here.
Thanks!
Does it have to be Ubuntu? @silverD in a post above mentioned he had to switch to Raspberry Pi OS for this DAC to work with CDSP.
 
Top Bottom