I suppose it is what is loaded into the GU if you push the button "New config from Default".
//
//
Ah got it, there is room for improved here in the readme. If says the backend config is at config/camillagui.yml, and this "config" directory is a subdirectory of the backend. I'll try to clarify this.I am not editing this config file because the readme indicated that the config file that's used by the backend is in /home/mark/camilladsp/config/
Since you are using the bundle, the backend file structure is a little different. I would suggest editing the file in /home/mark/camilladsp/camillagui_backend/_internal/config/ and then you don't need the -c option when starting the backend.
I tried your suggestion and it works fine. I agree that the readme could be a little clearer. And perhaps references to /configs need to be removed, that was a confusion factor for me.
Thank you for your assistance!
Thank you for your assistance!
YEESSSS...
I found a script to read out the mouse scroll-wheel. With a little edit I can control the volume of CDSP with a mouse scroll wheel.
Hopefully it will work with a wireless mouse with USB dongle as well... can not check at the moment, have just wired ones 😉
I found a script to read out the mouse scroll-wheel. With a little edit I can control the volume of CDSP with a mouse scroll wheel.
Hopefully it will work with a wireless mouse with USB dongle as well... can not check at the moment, have just wired ones 😉
Python:
from evdev import InputDevice, categorize, ecodes, list_devices
import socket
import websocket
import time
import json
cmdUp = {
"AdjustVolume": [1.0, -60.0, 0.0]
}
cmdDown = {
"AdjustVolume": [-1.0, -60.0, 0.0]
}
# Config: path to CamillaDSP control socket
host = 'localhost'
port = 1234
DSP_SOCKET = (host, port)
# Adjust volume by this dB step
VOLUME_STEP = 1.0
devices = [InputDevice(path) for path in list_devices()]
mouse = None
for dev in devices:
if 'Mouse' in dev.name or 'mouse' in dev.name:
mouse = dev
break
if mouse:
print(f"Monitoring: {mouse.name}")
for event in mouse.read_loop():
if event.type == ecodes.EV_REL and event.code == ecodes.REL_WHEEL:
ws = websocket.create_connection("ws://localhost:1234")
if event.value > 0:
print("Scroll up")
ws.send(json.dumps(cmdUp))
result = ws.recv()
print("Response:", result)
ws.close()
elif event.value < 0:
print("Scroll down")
ws.send(json.dumps(cmdDown))
result = ws.recv()
print("Response:", result)
ws.close()
@chriss0212
"Hopefully it will work with a wireless mouse with USB dongle as well..."
I tried for you, but it doesn't work, at least with my wireless mouse with USB dongle.
"Hopefully it will work with a wireless mouse with USB dongle as well..."
I tried for you, but it doesn't work, at least with my wireless mouse with USB dongle.
Urghh...
****, but wired mouse is working?
And: have you disconnected, the wired one before you start the script?
****, but wired mouse is working?
And: have you disconnected, the wired one before you start the script?
i don't have wired mouse...
python3 -m evdev.evtest show the wireless mouse but no events is get when whell is used
python3 -m evdev.evtest show the wireless mouse but no events is get when whell is used
Last edited:
Maybe it will work with pynput if evdev is not working... on my windows laptop this snippet is working with wireless and wired mouse:
Python:
from pynput import mouse
def on_scroll(x, y, dx, dy):
if dy > 0:
print("Up")
elif dy < 0:
print("Down")
# Start the mouse listener
with mouse.Listener(on_scroll=on_scroll) as listener:
listener.join()
Last edited:
me too, just trying the new snippet on windows, because i don't have Raspi at work 😉i use linux headless configuration...
But i see now, that pynput only works on X11.
Last edited:
OK... will check later at home. Don't get, why it is not working, if the mouse is recognized... strange.i don't have wired mouse...
python3 -m evdev.evtest show the wireless mouse but no events is get when whell is used
Yes... sorry... havn't seen this post ;(But again: i don't have wired mouse...
Maybe this could be an alternative solution?
Python:
import subprocess
proc = subprocess.Popen(['libinput', 'debug-events'], stdout=subprocess.PIPE)
try:
for line in proc.stdout:
decoded = line.decode('utf-8').strip()
print(decoded)
if 'pointer axis' in decoded and 'vertical' in decoded:
if 'value 1.0' in decoded:
print("Scrolled Up")
elif 'value -1.0' in decoded:
print("Scrolled Down")
except KeyboardInterrupt:
proc.terminate()
Requires the libinput-tools package:
Python:
sudo apt install libinput-tools
ok, it work ( original version) , my error was than my wireless mouse is listed 5 time in evdev, so i have changed your script to point to /dev/input/event2, the only than detect whell
Last edited:
python3 -m evdev.evtest
ID Device Name Phys Uniq
-------------------------------------------------------------------------------------------------------------------
0 /dev/input/event0 Aureon 7.1 USB usb-0000:01:00.0-1.3/input3
1 /dev/input/event1 MOSART Semi. 2.4G Keyboard Mouse usb-0000:01:00.0-1.4/input0
2 /dev/input/event2 MOSART Semi. 2.4G Keyboard Mouse usb-0000:01:00.0-1.4/input1
3 /dev/input/event3 MOSART Semi. 2.4G Keyboard Mouse Consumer Control usb-0000:01:00.0-1.4/input1
4 /dev/input/event4 MOSART Semi. 2.4G Keyboard Mouse System Control usb-0000:01:00.0-1.4/input1
5 /dev/input/event5 MOSART Semi. 2.4G Keyboard Mouse usb-0000:01:00.0-1.4/input1
--------------------------------------------------------------------------------------------------
ID Device Name Phys Uniq
-------------------------------------------------------------------------------------------------------------------
0 /dev/input/event0 Aureon 7.1 USB usb-0000:01:00.0-1.3/input3
1 /dev/input/event1 MOSART Semi. 2.4G Keyboard Mouse usb-0000:01:00.0-1.4/input0
2 /dev/input/event2 MOSART Semi. 2.4G Keyboard Mouse usb-0000:01:00.0-1.4/input1
3 /dev/input/event3 MOSART Semi. 2.4G Keyboard Mouse Consumer Control usb-0000:01:00.0-1.4/input1
4 /dev/input/event4 MOSART Semi. 2.4G Keyboard Mouse System Control usb-0000:01:00.0-1.4/input1
5 /dev/input/event5 MOSART Semi. 2.4G Keyboard Mouse usb-0000:01:00.0-1.4/input1
--------------------------------------------------------------------------------------------------
Last edited:
Python:
import asyncio
import evdev
from camilladsp import CamillaClient
MOUSE_PATH = "/dev/input/event2"
cdsp = CamillaClient("127.0.0.1", 1234)
cdsp.connect()
def adjust_volume(direction):
current_volume = cdsp.volume.main_volume()
if current_volume is None:
print("Error: volume not available")
return
volume_change = 1 if direction == "up" else -1
# Clamp volume between -100 and 0
new_volume = max(-100, min(0, current_volume + volume_change))
cdsp.volume.set_main_volume(new_volume)
print(f"Volume set to {new_volume}")
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:
adjust_volume("up")
elif event.value < 0:
adjust_volume("down")
if __name__ == "__main__":
asyncio.run(main())
great... perfect and thx for edit my script...
AND: using camillaClient is for sure the better solution compared to my Websocket one 😉
AND: using camillaClient is for sure the better solution compared to my Websocket one 😉
here a complete script , not for mouse but for remote. i have simplified for use with mouse... https://www.audiosciencereview.com/...mdsimon2’s-implementation.52818/#post-2317807
HaHa...
It seems, you have "a little bit more" experience with scripting 😉
So still a lot things i have to learn 😉
It seems, you have "a little bit more" experience with scripting 😉
So still a lot things i have to learn 😉
- Home
- Source & Line
- PC Based
- CamillaDSP - Cross-platform IIR and FIR engine for crossovers, room correction etc