1. teil: server

Der Server hat folgende Aufgaben:

  • Die lokale (auf dem Server gespeicherte) Musik in einer Datenbank erfassen,
  • Wiedergabelisten zu speichern und
  • die abzuspielende Musik im Netzwerk zu verteilen (streamen).

Die Last für den Server is wirklich minimal und kann eigentlich fast überall nebenher laufen.

Musicpd installieren:
#> cd /usr/ports/audio/musicpd && make install clean
-> Als Option den httpd aktivieren!

Konfigurationsdatei erstellen:
#> ee /usr/local/etc/mpd.conf

music_directory "PFADZUDEINERMUSIK"
playlist_directory "~/playlists"
db_file "~/.mpd/database"
log_file "~/.mpd/log"
pid_file "~/.mpd/pid"
state_file "~/.mpd/state"
user "musicpd"
bind_to_address "IP-ADRESSEDEINESSERVERS"
port "6600"
password "PASSWORT@read,add,control,admin"
default_permissions "read,add,control,admin"
input {
plugin "curl"
}
audio_output {
type "httpd"
name "[256k] music.bsdbox.de"
port "8000"
bitrate "256"
format "44100:16:2"
}
audio_output {
type "httpd"
name "[128k] music.bsdbox.de"
port "8001"
bitrate "128"
format "44100:16:2"
}
filesystem_charset "ISO-8859-15"
id3v1_encoding "ISO-8859-15

MUSICPD Benutzer erstellen:
#> adduser

Username: musicpd
Full name: Music Player Daemon
Uid (Leave empty for default):
Login group [musicpd]:
Login group is musicpd. Invite mpd into other groups? []:
Login class [default]: daemon
Shell (sh csh tcsh bash rbash nologin) [sh]: nologin
Home directory [/home/musicpd]:
Use password-based authentication? [yes]: no
Lock out the account after creation? [no]: yes
Username : musicpd
Password : <disabled>
Full Name : Music Player Daemon
Uid : 1011
Class : daemon
Groups : musicpd
Home : /home/musicpd
Shell : /usr/sbin/nologin
Locked : yes
OK? (yes/no): yes
Add another user? (yes/no): no
Goodbye!

Nach dem Anlegen des Benutzers wird noch ein Playlist-Verzeichnis benötigt, in dem später die abgespeicherten Playlists abgelegt werden:
#> mkdir -p /home/musicpd/playlists
#> mkdir -p /home/musicpd/.mpd
#> chown -R musicpd:musicpd /home/musicpd/playlists
#> touch /home/musicpd/.mpd/log

Für den automatischen Start eintragen:
#> ee /etc/rc.conf
musicpd_enable="YES"

MUSICPD starten ohne den PC neu starten zu müssen.:
#> /usr/local/etc/rc.d/musicpd start

Das wars schon. Ende 1. Teil. Ab zum 2. Teil.

One Response to 1. teil: server

  1. Pingback: bsdbox » Blog Archive » Neue Serie: Musik im Netzwerk verteilen