alsactl init
apt install alsa vlc
adduser vlcuser audiovlc -I telnet --telnet-password=<password> --telnet-port=9999 --alsa-audio-device default
VLC on Raspbian Lite Headless
sudo nano /lib/modprobe.d/aliases.conf
find the line and comment (for usb soundcard):
options snd-usb-audio index=-2
flock -n /tmp/vlc.lock vlc -I telnet --telnet-password=home --telnet-port=9999 --aout=alsa --no-dbus --file-logging --logfile=/tmp/vlc.log
https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi/updating-alsa-config
automatic start script
$ cat startvlc.sh
XDG_RUNTIME_DIR=/run/user/$(id -u)
DISPLAY=:0
flock -n /tmp/vlc.lock vlc -I telnet --telnet-password=<password> --telnet-port=9999 --file-logging --logfile=/tmp/vlc.log
$ cat checkerror.sh
if [ ! -f /tmp/vlc.log ] ; then
echo 'log not found'
exit 0
fi
outp=$(grep -c "vlcpulse error" /tmp/vlc.log)
if [ $outp -gt 0 ] ; then
echo $(date)' error found, killall vlc' >> /tmp/vlccheck.log
pulseaudio --check
killall vlc
sleep 1
cp /tmp/vlc.log /tmp/vlc.log.bk
rm /tmp/vlc.log
sleep 5
else
echo $(date)' no error found' >> /tmp/vlccheck.log
fi
$ cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=ID
network={
ssid="ssidname"
psk="wifipassword"
}