01-08-2025, 09:33 PM
(This post was last modified: 01-08-2025, 10:29 PM by Tim Curtis.
Edit Reason: eta SQL
)
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.
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.