Managing Digital Signage Player running on Ubuntu 20.04 LTS requires controlling the sound output device from the command line to ensure consistent behavior even when monitors are turned off at night. Here's a guide to help you with that.
Determine Current Sound Output Device
First, let's find out the current sound output device. Run the following command:
aplay -l
This command will display a list of available sound cards and their properties. Take note of the device name.
Set Sound Output Device
Now, let's set the sound output device using the alsa utility. Replace <device_name> with the device name you found earlier:
amixer sset <device_name> pulse
This command sets the default sound output device to pulse.
Ensure Consistent Behavior
To ensure that the sound output device is always set to pulse, you can create a startup script. Here's an example:
- Create a new file in the
/etc/xdg/autostartdirectory:
sudo nano /etc/xdg/autostart/set-sound-output.desktop
- Add the following content to the file:
[Desktop Entry]
Type=Application
Exec=/bin/bash -c "amixer sset <device_name> pulse"
Hidden=false
X-GNOME-Autostart-enabled=true
Name=Set Sound Output Device
Replace <device_name> with the device name you found earlier.
- Save and close the file.
Now, whenever the system starts, the sound output device will be set to pulse.