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

I have tried your script but:

Python:
cdsp = CamillaClient("127.0.0.1", 1234)
cdsp.connect()

is not working because module can not be found.

I installed camillaDSP with the tutorial from mdsimon with this lines:
Bash:
mkdir ~/camilladsp ~/camilladsp/coeffs ~/camilladsp/configs
wget https://github.com/HEnquist/camilladsp/releases/download/v3.0.1/camilladsp-linux-aarch64.tar.gz -O ~/camilladsp/camilladsp-linux-aarch64.tar.gz
sudo tar -xvf ~/camilladsp/camilladsp-linux-aarch64.tar.gz -C /usr/local/bin/
And so camilladsp is in a different location

Any idea what i have to use instead of:
Python:
from camilladsp import CamillaClient
 
At the moment i do it this way, but don't know, if it has any disadvantage:
Python:
import asyncio
import evdev
import socket
import websocket
import time
import json

cmdUp = {
    "AdjustVolume": [1.0, -60.0, 0.0]
}
cmdDown = {
    "AdjustVolume": [-1.0, -60.0, 0.0]
}

MOUSE_PATH = "/dev/input/event2"

ws = websocket.create_connection("ws://localhost:1234")

def adjust_volume(direction):
    if direction == "up":
        print(f"UP")
        ws.send(json.dumps(cmdUp))
    else:
        print(f"DOWN")
        ws.send(json.dumps(cmdDown))

async def main():
    device = evdev.InputDevice(MOUSE_PATH)
    async for event in device.async_read_loop():
        # Listen for relative wheel events (e.g., mouse wheel or similar)
        if event.type == evdev.ecodes.EV_REL and event.code == evdev.ecodes.REL_WHEEL:
            if event.value > 0:
                #print(f"Up")
                adjust_volume("up")
            elif event.value < 0:
                #print(f"Down")
                adjust_volume("down")
               
if __name__ == "__main__":
    asyncio.run(main())
 
Last edited:
a little bit cleaned code:
Python:
import asyncio
import evdev
import websocket
import json

cmdUp = {"AdjustVolume": [1.0, -60.0, 0.0]}
cmdDown = {"AdjustVolume": [-1.0, -60.0, 0.0]}

MOUSE_PATH = "/dev/input/event2"

ws = websocket.create_connection("ws://localhost:1234")

def adjust_volume(direction):
    if direction == "up":
        #print("UP")
        ws.send(json.dumps(cmdUp))
    else:
        #print("DOWN")
        ws.send(json.dumps(cmdDown))

async def main():
    device = evdev.InputDevice(MOUSE_PATH)
    async for event in device.async_read_loop():
        # Listen for relative wheel events (e.g., mouse wheel or similar)
        if event.type ==
        .EV_REL and event.code == evdev.ecodes.REL_WHEEL:
            if event.value > 0:
                adjust_volume("up")
            elif event.value < 0:
                adjust_volume("down")
               
if __name__ == "__main__":
    asyncio.run(main())
 
"cdsp = CamillaClient("127.0.0.1", 1234)cdsp.connect()is not working because module cannot be found.


install pyCamillaDSP, the Companion Python library for CamillaDSP.



"At the moment I do it this way, but don't know, if it has any disadvantage":

Ok, it work but here are the main reasons why using the pycamilladsp library is more appropriate than manually sending JSON via websocket when interacting with CamillaDSP:

1) Instead of building and sending raw JSON commands, you can use intuitive Python methods like:

cdsp.adjust_volume(1.0, -60.0, 0.0)


This improves readability, maintainability, and reduces the risk of mistakes in the command format.

DSP communication,

2) The CamillaClient class handles:
  • WebSocket connection establishment
  • Reconnection logic (if needed)
  • JSON serialization/deserialization
You don’t have to deal manually with websocket.create_connection, json.dumps(), etc.

3) It ensures that commands you send follow the structure expected by CamillaDSP.
You avoid silent bugs due to incorrect field names, types, or missing values.

4) The library includes structured error responses and exceptions, which makes it easier to catch and debug issues.
With raw websockets, you have to parse everything manually.

5) If the CamillaDSP protocol evolves, the library can be updated to stay compatible —
you won’t need to rewrite your JSON messages or low-level socket logic.

6) Using pycamilladsp helps separate application logic (e.g., handling a rotary encoder) from DSP communication, which makes your code cleaner and more modular.
 
  • Thank You
Reactions: chriss0212
Strange

It worked but now not anymore.
Bash:
from camilladsp import CamillaClient
ImportError: cannot import name 'CamillaClient' from 'camilladsp' (unknown location)

What i have done since it doesn't work anymore:
  • reboot
  • changed IP to fixed IP

What i have tried to make a new install:
Bash:
sudo apt install git
sudo python -m venv --system-site-packages /opt/venv
source /opt/venv/bin/activate
pip3 install git+https://github.com/HEnquist/pycamilladsp.git
deactivate

This has worked first time.
 
sudo python -m venv --system-site-packages /opt/venv


python -m venv: Uses Python’s built-in module to create a virtual environment.

--system-site-packages: Allows the virtual environment to access globally installed Python packages (in addition to isolated packages).

/opt/venv: Specifies the location where the virtual environment will be created — in this case, in /opt/venv.

This creates a Python virtual environment in /opt/venv that has access to system-wide packages.
 
OK... now i have created my first service, to run the script on startup 😉

1. Create a service file:
Create a file at /etc/systemd/system/mousewheel.service:
Bash:
sudo nano /etc/systemd/system/mousewheel.service
Paste the following:
Code:
[Unit]
Description=Run mousewheel.py at startup
After=network.target

[Service]
ExecStartPre=/bin/sleep 10
Type=simple
User=chriss
WorkingDirectory=/home/chriss
ExecStart=/opt/venv/bin/python3 /home/chriss/mousewheel.py
Restart=on-failure

[Install]
WantedBy=multi-user.target
Adjust the path to mousewheel.py if it’s not directly in /home/chriss.
"ExecStartPre=/bin/sleep 10" is just because script is not starting... maybe camillaGUI is not ready?

2. Enable the service:
Bash:
sudo systemctl daemon-reexec
sudo systemctl daemon-reload
sudo systemctl enable mousewheel.service

3. Test it manually:
Bash:
sudo systemctl start mousewheel.service

Then check status:
Code:
sudo systemctl status mousewheel.service
 
Hi everyone, a kind soul from ASR directed me here for help after some install and config troubles of camilladsp on the latest linux mint. It's an HTPC using HDMI to a Denon AVR in 5.1, but without the rear speaker so it has a 3.1 physical speaker config where the rear surrounds are redirected to the front at 70% using 3.1downmix.yml file in /etc/camilladsp/.

I have a lot of devices in capture and playback that mean nothing to me. I have no idea which ones are correct. I've tried virtually all combinations and the closest I can get is the following where at least camilla dsp says it's running, but the levels are always below -96db and the volume slider does nothing. If I try other devices, I get errors and camilla won't even start.
1749167817677.png


Logs:
1749164040334.png


Here are my filters
1749167908084.png


1749167971964.png


See the link to the ASR thread to follow a history of how I got here, including the list of devices available.
https://www.audiosciencereview.com/...fig-help-device-selection-overwhelming.63297/

At the moment after booting sound is fine when playing out of roon. After activating camilladsp roon says

1749223018657.png


I have re-followed the readme and reconfigured everything using pipewire. I have no idea how to troubleshoot this. Any assistance from a kind soul?