- VLC🔗
- is a VideoLAN's media player, that, among other cool features, facilitates command-line mode of operations and a web interface for remote control
- Multiroom🔗
- is an audio system that allow for playback and control of music throughout an entire home or building.
- SystemD🔗
- is an init system used in Linux distributions to bootstrap the user space and to manage system processes after booting
- ALSA🔗
- is a software framework and part of the Linux kernel that provides an application programming interface (API) for sound card device drivers.
VLC-multiroom is a shell script that on a Linux-based media computer configures systemd to run multiple VLC Media Player instances for audio playback via all available ALSA sound cards and for web based remote control with a purpose to make the media computer the core of a multiroom audio system.
- A computer running Linux OS with one or more ALSA-compatible audio cards (devices)
Recent Linux distro use PulseAudio as the main audio interface. Unfortunately, PulseAudio is not operable in a system deamon mode and VLC has to be switched to use ALSA audio interface. The script does it via command line, but ALSA drivers initially comes muted and have to be unmuted before using.
sudo apt-get install alsa-base alsa-tools alsa-utils
If the graphical environment available, you may also install ALSA GUI tools
apt-get install alsa-tools-gui
In a graphical environment you may run qasmixer
, otherwise run alsamixer
and follow instructions from this post.
For pure command-line approach please refer to this post
- With GUI
Switch VLC to use ALSA interface, please follow this link for instructions how to do this Start playback and try every hardware card via Audio > Audio Devices menu options
- With command line
List all available ALSA devices:
aplay -L
From this list the script will use only direct hardware output devices, selected as the following
aplay -L | grep plughw:CARD
Test an audio device
cvlc --novideo --no-sout-video --aout alsa --alsa-audio-device="plughw:CARD=Generic,DEV=0"
Repeat this test for every audio device you plan to use.
Obtain files from this project
wget https://raw.githubusercontent.com/hutorny/vlc-multiroom/master/vlc@.service
wget https://raw.githubusercontent.com/hutorny/vlc-multiroom/master/install-vlc-services.sh
chmod u+x install-vlc-services.sh
./install-vlc-services.sh
It should list mapping of VLC instances to audio devices.
sudo ./install-vlc-services.sh <password>
where <password>
is the password to be used for the http interface.
On success it should print the map VLC instance -> audio device and the list of VLC services
Each instance should be accessible via http://hostname:909N where hostname is the computer's host name or address and N is instance number, e.g. http://192.168.0.100:9090/
Open vlc@.service
in a text editor and uncomment lines
#ExecStartPre=-/bin/mkdir -p /var/log/vlc/
#ExecStartPre=-/bin/chown -R vlc /var/log/vlc/
and
# -vvv --extraintf=http:logger --file-logging --logfile=/var/log/vlc/vlc-%i.log
Restart VLC services
systemctl restart vlc@{0..9}
Analyze log for errors
Take corrective actions