01-09-2025, 07:08 PM
(01-08-2025, 09:33 PM)Tim Curtis Wrote: I understood your request. There have been a few similar requests over the years. Here's some info that may help you out.
Changes to volume via the knob slider, +/- buttons or the mute toggle result in changes to:
1. MPD volume
2. ALSA volume if the audio device has a hardware volume controller
3. CamillaDSP volume if thats configured
Couple other things that happen when volume is changed:
1. The MPD idle timeout is triggered which returns a block of status and currentsong data to the WebUI including the dB mapped volume from ALSA if the audio device has a hardware volume controller or from CamillaDSP if thats configured.
2. Some internal SQL and session variables store the volume state for use in other parts of the application.
The code for volume handling is in the source files below. The flow is:
Knob -> setVolume() -> sendVolCmd() -> case: 'upd_volume' -> MPD or ALSA volume, optionally Receiver volume
/var/www/js/playerlib.js
- function setVolume()
- function sendVolCmd()
/var/www/command/playback.php
- case: 'upd_volume'
/var/www/js/scrips-panels.js
- three jQuery events that call setVolume()
/var/www/util/vol.sh
NOTE when when CamillaDSP volume is configured there is a separate daemon "mpd2cdspvolume" that catches the MPD idle timeout event and then proxies the volume chan ge to CamillaDSP.
thanks to your advice i managed to call two scripts through the + and - buttons but now i have to delete the volume slider and the numeric indicator since i get this information from somewhere else. could you help me?
[*]Speakers: Chario Constellation Delphinus
[*]Amplifier: Modified Fosi Audio V3
[*]Source: Raspberry Pi Zero 2W + HiFiBerry DAC+ Zero
[*]Amplifier: Modified Fosi Audio V3
[*]Source: Raspberry Pi Zero 2W + HiFiBerry DAC+ Zero