Packages:firefly
Aus NAS-4220
Inhaltsverzeichnis |
Einsatzzweck der Pakete
Die hier angebotenen Versionen 0.2.4 und svn-1586 des Firefly Media Servers stellen eine aktuellere Version des sich noch unter dem alten namen "mt-daapd" auf dem NAS befindlichen iTunes Servers dar.
Beide Versionen unterstützen die neueren iTunes Versionen und bieten eine Vielzahl von Einstellungsmöglichkeiten über die integrierte Weboberfläche.
Zusätzlich unterstützt die Version svn-1586 das Umwandeln von ogg-vorbis und flac Dateien um sie als WAVE Stream an Clients ohne ogg und flac Support zu streamen.
Paket Changelog
| Version | Author | Status | Änderungen |
|---|---|---|---|
| 0.2.4 | eldrik_whs | Alpha | Inital Version |
| 0.2.4.1 | skara | Alpha | IDE/Raid aware File linking and daemon start |
| 0.2.4.2 | willjoha | Alpha | Sausalito integration |
| --> FireFly can be enabled/disabled through the NAS Web UI | |||
| IDE/Raid aware mt-daapd.conf | |||
| svn-1586_pkg1 | willjoha | Beta | Updated to firefly svn-1586 with ogg and flac transcoding support |
| Bugfix: added missing mDNS start after reboot | |||
| svn-1586_pkg2 | willjoha | Beta | Bugfix: made the sqlite temporary directory configurable. Sourcecode Patch |
| Bugfix: start the rsp (Roku Soundbridge Protocol) mDNS responder |
Bekannte Probleme
Version 0.2.4.*
- Der integrierte Torrent Client funktioniert nichtmehr nach der Installation dieser Version (libgcc_s.so.1 wird durch ein inkompatible Version ersetzt).
- FireFly wird beendet wenn im NAS Webinterface Bonjour disabled wird (killall mt-daapd wird scheinbar von der original Firmware ausgeführt.)
- 0.2.4.2: Bonjour wird nach einem Reboot nicht gestartet und iTunes findet daher FireFly nicht. Fehler tritt mit Avahi nicht auf.
Version svn-1586_pkg1
- Das FireFly Webinterface (http://<DeineNAS>:3689/) zeigt falsche Fehlermeldungen beim Abspeichern von Änderungen. Diese können ignoriert werden.
- FireFly wird beendet wenn im NAS Webinterface Bonjour disabled wird (killall mt-daapd wird scheinbar von der original Firmware ausgeführt.)
- Das Roku Soundbridge Protokoll (RSP) wird nicht über Bonjour veröffentlicht. (Behoben in svn-1586_pkg2)
- Die Datenbank kann beim Starten korrupt werden, falls im /tmp Verzeichniss nicht genügent Platz vorhanden ist. (Behoben in svn-1586_pkg2)
Version svn-1586_pkg2
- Das FireFly Webinterface (http://<DeineNAS>:3689/) zeigt falsche Fehlermeldungen beim Abspeichern von Änderungen. Diese können ignoriert werden.
- FireFly wird beendet wenn im NAS Webinterface Bonjour disabled wird (killall mt-daapd wird scheinbar von der original Firmware ausgeführt.)
Struktur und Inhalt der Pakete
Ordnerstruktur und Inhalt ab Version 0.2.4.2
- mt-daapd
- bin // Unterordner von mt-daapd mit allen Anwendung für mt-daapd
- conf // Unterordner von mt-daapd mit den Konfigurations- und Logdateien mt-daapd.conf, mt-daapd-sample.conf und mt-daapd.log
- admin-root // Unterordner von conf, enthält die für den FireFly Webserver benötigten Dateien
- cache/mt-daapd // Unterordnerstruktur von conf, enthält die Datei songs3.db (zentrale Datenbank von Firefly)
- init // Datei welche das mt-daapd Packet Sausalito bekannt macht
- lib // Unterordner von mt-daapd mit den benötigten Librarys
- plugins // Unterordner von lib der weitere in Firefly einzubindene Plugins zur Verfügung stellt
- sausalito // Unterordner von mt-daapd mit den benötigten Sausalito Skripten & Konfigurationsdateien
- conf
- base
- firefly // Unterordner von sausalito mit der Konfiguration der benötigten Sausalito Event Handler
- base
- constructor // Unterordner von sausalito, enthält das Sausalito firefly constructor Skript
- 99_construct_firefly.sh // Datei welche alle von FireFly benötigten Libraries und Applikationen linkt und FireFly sowie Bonjour falls enabled startet.
- handlers
- base
- firefly // Unterordner von sausalito, enthält alle Sausalito firefly Handler.
- base
- schemas
- base
- firefly // Unterordner von sausalito, enthält das codb Schema für firefly.
- base
- conf
- webroot // Unterordner von mt-daapd, enthält für das NAS Webinterface benötigte Dateien.
- cgi // Unterordner von webroot, enthält alle benötigten cgi-Skripte.
- nav // Unterordner von webroot, enthält die Navigations Konfiguration für das NAS Webinterface.
Installation des Paketes
Um FireFly in iTunes bekannt zu machen wird ein Bonjour Dienst benötigt. Ab Version 0.2.4.2 wird der in die Firmware integrierte Bonjour Dienst unterstützt wodurch das Avahi Paket nichtmehr zwingend notwendig ist, es wird aber weiterhin unterstützt.
Die Installtion des Paketes sollte durch das Kopieren der heruntergeladenen Datei mt-daapd.tgz in den Unterordner "/applications/new_software/" der Freigabe public mit anschließendem Neustart des NAS erfolgen.
Das Paket wird wärend des Neustarts automatisch entpackt, gestartet und für den richtigen Mount Point konfiguriert.
Nach der Installation muss der neue iTunes Server noch über das NAS Web Interface unter "Control Panel -> Network Services -> FireFly Server" enabled werden.
Weiter Einstellungen sind nicht nötig, können allerdings in der Konfigurationsdatei mt-daapd/conf/mt-daapd.conf oder über das FireFly Webinterface vorgenommen werden.
Um das neue Firefly Paket zu aktivieren muss der iTunes Support unter "Control Panel -> Network Services -> Bonjour" deaktiviert werden!
Das Paket bereits auf dem eigenen Client zu entpackt und direkt in den Ordner "/applications/" der Freigabe public zu kopieren wird nur erfahrenen Benutzern empfohlen.
Für Versionen < 0.2.4.2: Erklärung des Zusammenspiels der im Paket enthaltenen init, mt-daapd.conf und mt-daapd.sh Dateien '
Die folgenden Informationen treffen nur auf Pakete < Version 0.2.4.2 zu.
In Versionen ab 0.2.4.2 wurde das Paket komplett in die Sausalito Architektur integriert und Manuell Schritte sind nichtmehr nötig.
init Datei
Die im Paket enthaltene init Datei ist für den Start des Programms nicht verantwortlich, diese sorgt nur dafür, dass der NAS eigene, beim Bootvorgang gestartete mt-daapd Prozess beendet wird (lieber einmal zu viel als zu wenig beendet) ferner wird das eigentliche Start Script in den scripts Ordner des userscript Paketes kopiert.
Das userscript Paket übernimmt dann die Aufgabe die in der Datei mt-daapd.sh aufgeführten Anweisungen zu starten.
Hier die init Datei:
Die Anweisungen habe ich jeweils auf Englisch hinter der # erklärt
#!/bin/sh
killall mt-daapd
#Define Path to homedir
#PackageDIR=/mnt/ide1/public/applications
#changed by skara
PackageDIR=$(cat /usr/sausalito/codb/objects/1/Disk.rootdir 2> /dev/null)/public/applications
#copy startup script to rc-location for automatic start
if [ ! -e /usr/sausalito/constructor/99_mt-daapd.sh ]; then
ln -s $PackageDIR/mt-daapd/mt-daapd.sh /usr/sausalito/constructor/99_mt-daapd.sh
fi
Achtet darauf, dass alle Angaben was /mnt/ide1/ in meinen Anleitungen betrifft, mit eurem NAS übereinstimmen, ansonsten wird das Script nicht richtig funktionieren!!!
mt-daapd.sh Datei
Die für den Start der Anwendung benötigten Anweisungen stehen in der Datei mt-daapd.sh diese wird im weiteren Verlauf des Bootvorgangs des NAS an das userscript Paket übergeben und ausgeführt.
Hier der Inhalt der im Paket enthaltenen mt-daapd.sh Datei
#!/bin/sh #Kill old processes killall mt-daapd #Define homedir #PackageDIR=/mnt/ide1/public/applications/mt-daapd #changed by skara PackageDIR=$(cat /usr/sausalito/codb/objects/1/Disk.rootdir 2> /dev/null)/public/applications/mt-daapd ln -s $PackageDIR/lib/libz.so.1 /usr/lib/ ln -s $PackageDIR/lib/libvorbisfile.so.3 /usr/lib/ ln -s $PackageDIR/lib/libvorbis.so.0 /usr/lib/ ln -s $PackageDIR/lib/libtag_c.so.0 /usr/lib/ ln -s $PackageDIR/lib/libtag.so.1 /usr/lib/ ln -s $PackageDIR/lib/libsqlite3.so.0 /usr/lib/ ln -s $PackageDIR/lib/libogg.so.0 /usr/lib/ ln -s $PackageDIR/lib/libid3tag.so.0 /usr/lib/ ln -s $PackageDIR/lib/libhowl.so.0 /usr/lib/ ln -s $PackageDIR/lib/libgsm.so.1 /usr/lib/ ln -s $PackageDIR/lib/libFLAC.so.7 /usr/lib/ ln -s $PackageDIR/lib/libavutil.so.0d /usr/lib/ ln -s $PackageDIR/lib/libavformat.so.0d /usr/lib/ ln -s $PackageDIR/lib/libavcodec.so.0d /usr/lib/ ln -s $PackageDIR/lib/libavahi-client.so.3 /usr/lib/ ln -s $PackageDIR/lib/liba52-0.7.4.so /usr/lib/ ln -s $PackageDIR/lib/libvorbisenc.so.2 /usr/lib/ ln -s $PackageDIR/lib/libdc1394_control.so.13 /usr/lib/ ln -s $PackageDIR/lib/libstdc++.so.6 /usr/lib/ ln -s $PackageDIR/lib/libraw1394.so.8 /usr/lib/ cp -f $PackageDIR/lib/libgcc_s.so.1 /usr/lib/ #Start new mt-daapd application $PackageDIR/bin/mt-daapd -m -c $PackageDIR/conf/mt-daapd.conf
Die Anwendung mt-daapd wird über den Befehl:
#Start new mt-daapd application $PackageDIR/bin/mt-daapd -m -c $PackageDIR/conf/mt-daapd.conf
und den Parametern "-m" und "-c" unter Angabe der zentralen mt-daapd Konfigurationsdatei mt-daapd.conf gestartet.
Der Parameter "-m" verhindert, dass Firefly seinen eigenen mDns Dienst startet, der für das veröffentlichen der iTunes Bibliothek im Netzwerk verantwortlich ist.
Warum den für das veröffentlichen benötigten Dienst weglassen werden sich nun einige fragen?
Der Grund für die Option "-m" liegt darin, dass die iTunes Bibliothek, trotz des von Firefly aktivierten mDns Dienstes, auf keinem meiner Clients sichtbar war.
Daher musste ich auf das Avahi Paket zurückgreifen, mit dem der daab Dienst von Firefly sowie der Webserver im Netzwerk gemacht wird.
Da zwei aktive mDns Dienste sich gegenseitig behindern können, musste der in Firefly aktive Dienst kurzerhand deaktiviert werden.
Daher die Option "-m"
Auf die für die Erkennung benötigten ".service" Dateien von Avahi gehe ich noch ein.
mt-daapd.conf
Die zentrale Konfigurationsdatei von Firefly ist die Datei mt-daapd.conf in ihr wird z.B. angegeben, welche Datenbankversion Firefly nutzen soll, wo die Musikdateien liegen, welches Admin oder iTunes Passwort verwendet werden soll usw.
Die Datei ist in sich selber gut Dokumentiert. Hier die im Paket enthaltene Datei, die entsprechend der eigenen gewünschten Gegebenheiten angepasst werden muss.
# $Id: mt-daapd.conf.templ 1238 2006-06-18 04:54:13Z rpedde $ # # This is the mt-daapd config file. # # If you have problems or questions with the format of this file, # direct your questions to rpedde@users.sourceforge.net. # # You can also check the website at http://mt-daapd.sourceforge.net, # as there is a growing documentation library there, peer-supported # forums and possibly more. # [general] # # web_root (required) # # Location of the admin web pages. # # If you installed from .RPM, .deb, or tarball with --prefix=/usr, then # this is correct. # # If you installed from tarball without --prefix=/usr, then the correct # path is probably /usr/local/share/mt-daapd/admin-root. # web_root = /mnt/ide1/public/applications/mt-daapd/conf/admin-root # # port (required) # # What port to listen on. It is possible to use a different # port, but this is the default iTunes port # port = 3689 # # admin_pw (required) # # This is the password to the administrative pages # admin_pw = mt-daapd # # db_type (required) # # This is what kind of backend database to store the song # info in. Valid choices are "sqlite" and "sqlite3". # db_type = sqlite3 # # db_parms # # This is any extra information the db needs to connect. # in the case of sqlite and sqlite3, this is the name # of the directory to store the database in # # If you installed from RPM or .deb, this path likely already # exists. If not, then you must create it. The directory itself # must be writable by the "runas" user. # db_parms = /mnt/ide1/public/applications/mt-daapd/conf/cache/mt-daapd # # mp3_dir (required) # # Location of the mp3 files to share. Note that because the # files are stored in the database by inode, these must be # in the same physical filesystem. # mp3_dir = /mnt/ide1/public/music # # servername (required) # # This is both the name of the server as advertised # via rendezvous, and the name of the database # exported via DAAP. Also know as "What shows up in iTunes". # servername = eldrik-nas_iTunes # # runas (required) # # This is the user to drop privs to if running as # root. If mt-daapd is not started as root, this # configuration option is ignored. Notice that this # must be specified whether the server is running # as root or not. # # This is also ignored on Windows. # runas = root # # playlist (optional) # # This is the location of a playlist file. # This is for Apple-style "Smart Playlists" # See the mt-daapd.playlist file in the # contrib directory for syntax and examples # # This doesn't control static playlists... these # are controlled with the "process_m3u" directive # below. # # playlist = /etc/mt-daapd.playlist # # password (optional) # # This is the password required to listen to MP3 files # i.e. the password that iTunes prompts for # #password = mp3 # # extensions (optional) # # These are the file extensions that the daap server will # try to index and serve. By default, it only indexes and # serves .mp3 files. It can also server .m4a and .m4p files, # and just about any other files, really. Unfortunately, while # it can *attempt* to serve other files (.ogg?), iTunes won't # play them. Perhaps this would be useful on Linux with # Rhythmbox, once it understands daap. (hurry up!) # # Failing that, one can use server-side conversion to transcode # non-standard (.ogg, .flac) music to wav on the server side. # See the ssc_* options below. # # To be able to index .ogg files, you'll need to have configured # with --enable-oggvorbis. For .flac, --enable-flac, for .mpc, # --enable-musepack. # extensions = .mp3,.m4a,.m4p,.ogg,.flac,.mpc # # ssc_codectypes (optional) # # List of codectypes for files that the daap server should # perform internal format conversion and present to clients # as WAV files. The file extensions that these codectypes correspond # to must also be present in 'extensions' # configuration value, or files are not probed in the first # place. # # Valid codectypes: # # mp4a - for AAC (.aac, .mp4, .m4a, .m4p) # mpeg - for mp3 # wav - for wav # wma - for wma # ogg - for ogg # flac - for flac (.flac, .fla) # mpc for musepack (.mpc, .mpp, .mp+) # alac for alac (.m4a) # # Not needed because ffmpeg is enabled. -joshk # ssc_codectypes = ogg,flac,alac # # ssc_prog (optional) # # Program that is used in server side format conversion. # Program must accept following command line syntax: # ssc_prog filename offset length ... # Parameter filename is the real name of the file that is # to be converted and streamed, offset is number of bytes # that are skipped from the beginning of the _output_ file # before streaming is started, length is length of the song # in seconds (or zero). All other possible arguments must # be ignored. The resulting wav file (or the rest of # the file after initial seek) is written to the standard # output by the ssc_prog program. This is typically # a script that is a front end for different conversion tools # handling different formats. # # ssc_prog = /usr/bin/mt-daapd-ssc.sh # # logfile (optional) # # This is the file to log to. If this is not configured, # then it will log to the syslog. # # Not that the -d <level> switch will control the log verbosity. # By default, it runs at log level 1. Log level 9 will churn # out scads of useless debugging information. Values in between # will vary the amount of logging you get. # #logfile = /var/log/mt-daapd.log # # art_filename (optional) # # There is experimental support thanks to Hiren Joshi # (hirenj@mooh.org) for dynamically adding art to the id3v2 # header as it is streamed (!!). If you were using a music system # like zina or andromeda, for example, with cover art called # "_folderOpenImage.jpg", you could use the parameter # art_file _folderOpenImage.jpg and if the file _folderOpenImage.jpg # was located in the same folder as the .mp3 file, it would appear # in iTunes. Cool, eh? # #art_filename = _folderOpenImage.jpg # # rescan_interval # # How often to check the file system to see if any mp3 files # have been added or removed. # # if not specified, the default is 0, which disables background scanning. # # If background rescanning is disabled, a scan can still be forced from the # "status" page of the administrative web interface # # Setting a rescan_interval lower than the time it takes to rescan # won't hurt anything, it will just waste CPU, and make connect times # to the daap server longer. # # #rescan_interval = 300 # always_scan # # The default behavior is not not do background rescans of the # filesystem unless there are clients connected. The thought is to # allow the drives to spin down unless they are in use. This might be # of more importance in IDE drives that aren't designed to be run # 24x7. Forcing a scan through the web interface will always work # though, even if no users are connected. # always_scan = 0 # # process_m3u # # By default m3u processing is turned off, since most m3u files # sitting around in peoples mp3 directories have bad paths, and # I hear about it. :) # # If you are sure your m3u files have good paths (i.e. unixly pathed, # with relative paths relative to the directory the m3u is in), then # you can turn on m3u processing by setting this directive to 1. # # I'm not sure "unixly" is a word, but you get the idea. # # process_m3u = 0 # # scan_type # # # This sets how aggressively mp3 files should be scanned to determine # file length. There are three values: # # 0 (Normal) # Just scan the first mp3 frame to try and calculate size. This will # be accurate for most files, but VBR files without an Xing tag will # probably have wildly inaccurate file times. This is the default. # # 1 (Aggressive) # This checks the bitrates of 10 frames in the middle of the song. # This will still be inaccurate for VBR files without an Xing tag, # but they probably won't be quite as inaccurate as 0. This takes # more time, obviously, although the time hit will only happen the # first time you scan a particular file. # # 2 (Painfully aggressive) # This walks through the entire song, counting the number of frames. # This should result in accurate song times, but will take the most # time. Again, this will only have to be incurred the first time # the file is indexed. # scan_type = 0 always_scan = 0 process_m3u = 0 debuglevel = 0 compress = 0 password = test rescan_interval = 86400 logfile = /mnt/ide1/public/applications/mt-dappd/conf/mt-daapd.log # # compress # # Whether to use gzip content-encoding when transferring playlists etc. # This was contributed as a patch by Ciamac Moallemi just prior to the 0.2.1 # release, and as such, hasn't gotten as much testing as other features. # # This feature should substantially speed up transfers of large databases # and playlists. # # It will eventually default to 1, but currently it defaults to 0. # #compress = 0 [plugins] plugin_dir = /mnt/ide1/public/applications/mt-daapd/lib/plugins plugins = rsp.so,ssc-ffmpeg.so [scanning] ignore_appledouble = 1 case_sensitive = 1 ignore_dotfiles = 0 process_xml = 1 concat_compilations = 0 [daap] supports_update = 1 supports_browse = 1 empty_strings = 0 [scan] correct_order = 0
daab.service und web_daab.service
Da Avahi für das veröffentlichen der iTunes Bibliothek verwendet wird müssen folgende Dateien im /services/ Ordner von Avahi abgelegt werden (in dem auf dem Wiki enthaltenen Avahi Paket sind diese bereits vorhanden!).
Hier die daab.service Datei, welche die Defintion zum veröffentlichen der iTunes Bibliothek beinhaltet.
<?xml version="1.0" standalone='no'?> <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> <service-group> <name replace-wildcards="yes">%h_iTunes</name> <service> <type>_daap._tcp</type> <port>3689</port> </service> </service-group>
Hier wird über den Parameter %h automatisch der Hostname des NAS verwendet zusätzlich wird diesem dann _iTunes angehängt.
Je nach dem wie ihr eure Bibliothek nennen wollt, muss dieser Wert geändert werden.
Hier die web_daap.service Datei die den Firefly Webserver unter http://eurenasip:3689 veröffentlicht in eurem Netzwerk veröffentlicht.
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h Firefly Mediaserver</name> ## Name of the Bookmark
<service>
<type>_http._tcp</type>
<port>3689</port>
</service>
</service-group>
Hier kann wieder der aus daap.service bekannte Eintrag %h abgeändert werden.
Solltet ihr alle Parameter in der mt-daapd.conf erfolgreich abgeändert haben sollte der Firefly Media Server euch nach einem Neustart des NAS zur Verfügung stehen.
Viel spass mit den neuen Möglichkeiten :-)
