Giter Site home page Giter Site logo

hutorny / vlc-multiroom Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 5.0 5 KB

Shell script to configure multiple VLC Media Player instances for headless operation

License: MIT License

Shell 100.00%
vlc vlc-media-player systemd alsa multiroom multiroom-audio service web-interface

vlc-multiroom's Introduction

VLC-multiroom

Introduction

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.

Prerequisites

  • A computer running Linux OS with one or more ALSA-compatible audio cards (devices)

Preparations

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.

Install ALSA tools

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

Unmute all audio outputs

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

Ensure VLC makes audible output via ALSA

  • 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.

Setting up VLC as systemd services

Obtain files from this project

wget https://raw.githubusercontent.com/hutorny/vlc-multiroom/master/[email protected]
wget https://raw.githubusercontent.com/hutorny/vlc-multiroom/master/install-vlc-services.sh
chmod u+x install-vlc-services.sh

Make a dry run

./install-vlc-services.sh

It should list mapping of VLC instances to audio devices.

Run the script

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/

Troubleshooting

Open [email protected] 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

Useful links

vlc-multiroom's People

Contributors

hutorny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.