Dies ist eine alte Version des Dokuments!


Musik im Raum

Für die Musik läuft ein MPD auf einem Raspberry PI 3

Hostname rpi3.raum.ctdo.de User: pi Pass: wasserfall

Per ssh einloggen und „ncmpc“ eingeben.

Musik per Webbrowser steuern: http://raum.ctdo.de/mpd/

Die Quellenwahl und Lautstärke kann durch das Projekt Audiosteuerung gemacht werden.

Konfiguration auf dem Raspberry Pi

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.

# Activate iptables firewall: Only access from CTDO-IP-Range
iptables -F INPUT
iptables -P INPUT DROP
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p icmp -j ACCEPT
iptables -A INPUT -i lo -m conntrack --ctstate NEW -j ACCEPT
iptables -A INPUT -s 195.160.168.0/23 -m conntrack --ctstate NEW -j ACCEPT
iptables -A INPUT -j REJECT

# Activate ip6tables firewall: Only access from CTDO-IP-Range (IPv6)
ip6tables -F INPUT
ip6tables -P INPUT DROP
ip6tables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
ip6tables -A INPUT -p icmpv6 -j ACCEPT
ip6tables -A INPUT -i lo -m conntrack --ctstate NEW -j ACCEPT
ip6tables -A INPUT -s fe80::/10,2001:67c:275c::/48 -m conntrack --ctstate NEW -j ACCEPT
ip6tables -A INPUT -j REJECT

# Make sure that volume is UP when rpi has booted
amixer set Master 100%

# Do NOT play anything after reboot. (Don't freak out the one who just gave power to the room)
mpc pause

# Bridge script to give information about current file to MQTT.
/usr/bin/python3.2 /home/lucas/mpd-to-mqtt.py  >> /dev/null &

exit 0
music_directory		"/srv/filebase/audio"
playlist_directory		"/srv/filebase/audio"
db_file			"/srv/filebase/raspberry_netfs/raum3/mpd/tag_cache"
log_file			"/var/log/mpd/mpd.log"
pid_file			"/var/run/mpd/pid"
state_file			"/var/lib/mpd/state"
sticker_file                   "/srv/filebase/raspberry_netfs/raum3/mpd/sticker.sql"
user				"mpd"
bind_to_address         "127.0.0.1"
bind_to_address         "195.160.169.17"
bind_to_address         "::1"
bind_to_address         "2001:67c:275c:a9::11"
zeroconf_enabled		"yes"
zeroconf_name			"Music Player"
input {
        plugin "curl"
}
audio_output {
	type		"alsa"
	name		"My ALSA Device"
	format		"48000:16:2"	# optional
	#mixer_control	"Master"	# optional
	mixer_control	"none"	# optional
}
filesystem_charset		"UTF-8"
id3v1_encoding			"UTF-8"
music_directory		"/srv/filebase/audio"
playlist_directory		"/srv/filebase/audio"
db_file			"/srv/filebase/raspberry_netfs/raum3/mpd/tag_cache"
log_file			"/var/log/mpd/mpd.log"
pid_file			"/var/run/mpd/pid"
state_file			"/var/lib/mpd/state"
sticker_file                   "/srv/filebase/raspberry_netfs/raum3/mpd/sticker.sql"
user				"mpd"
bind_to_address         "127.0.0.1"
bind_to_address         "195.160.169.17"
bind_to_address         "::1"
bind_to_address         "2001:67c:275c:a9::11"
zeroconf_enabled		"yes"
zeroconf_name			"Music Player"
input {
        plugin "curl"
}
audio_output {
	type		"alsa"
	name		"My ALSA Device"
	format		"48000:16:2"	# optional
	#mixer_control	"Master"	# optional
	mixer_control	"none"	# optional
}
filesystem_charset		"UTF-8"
id3v1_encoding			"UTF-8"
  • Zuletzt geändert: 05.08.2022 22:51
  • (Externe Bearbeitung)