The volume_interface node is responsible for coordinating volume across the system. It reads the hardware volume buttons directly. It listens to ROS topics for volume changes requested through Bluetooth, the app, or voice commands. It also saves and restores the volume across restarts. It also manages “ducking”, lowering the volume of playback audio when listening for a command. It maintains a system volume for sound effects and a Bluetooth volume for music playback, since Bluetooth volume is often much higher.
/volume/duck_setTakes a Bool for whether playback volume should be ducked
/volume/app_setTakes a Volume.msg message from the app or from a voice command request to change the volume
/volume/bt_setTakes a Volume.msg message indicating a Bluetooth source is requesting a volume change.
/volume/saveTriggers the current volume to be saved to disk.
/bluetooth/media_playingListens to this topic to decide whether to use the current Bluetooth volume or the normal system volume.
/volume/hw_setPublishes a Volume.msg message representing the change due to hardware volume buttons being pushed.
/volume/levelPublishes a Byte representing the current volume level from 0-255
/volume/button_statusPublishes a VolumeButton.msg message representing the physical state of the hardware buttons, used for reset conditions.
volume_interface.launch
There are parameters to control respawn, and also parameters to define what GPIO pins the buttons are hooked to and whether they are active low or active high.