Muggle-plugin
(→mysql-Datenbank befüllen) |
(→mysql-Datenbank befüllen) |
||
| Zeile 139: | Zeile 139: | ||
<pre> | <pre> | ||
| − | Update DB : echo "cd /mp3 ; find * -path 'Assorted' -prune -o -type f -exec | + | Update DB : echo "cd /mp3 ; find * -path 'Assorted' -prune -o -type f -exec mugglei -z -h localhost -n GiantDisc -f '{}' ';'"|at now |
</pre> | </pre> | ||
| + | |||
| + | Falls das nicht funktioniert, bitte den kompletten Pfad zu mugglei angeben ...-exec /usr/local/bin/mugglei -z.... | ||
Übergabe für VDR. | Übergabe für VDR. | ||
Version vom 22. Februar 2005, 19:16 Uhr
Inhaltsverzeichnis |
Beschreibung
Autor: Andi Kellner, Lars von Wedel, Ralf Klueber, Wolfgang Rohdewald
Das Plugin bietet eine Datenbankverbindung für den VDR, so dass die Medienauswahl flexibler wird.
Bilder
Hardwareanforderungen
Softwareanforderungen
- mySQL
- libid3tag
- libmad
- taglib
- libvorbis >= libogg
- flac >= libogg >= nasm
Installation
cd $SOURCEDIR
tar xvzf libid3tag-<VERSION>.tar.gz
cd libid3tag-<VERSION>
./configure --prefix=/usr/local
make
make install
cd -
tar xvzf libmad-<VERSION>.tar.gz
cd libmad-<VERSION>
./configure --prefix=/usr/local
make
make install
cd -
tar xvzf libogg-<VERSION>.tar.gz
cd libogg-<VERSION>
./configure --prefix=/usr/local
make
make install
cd -
tar xvzf libvorbis-<VERSION>.tar.gz
cd libvorbis-<VERSION>
./configure --prefix=/usr/local \
--with-ogg-libraries=/usr/local/lib
make
make install
cd -
tar xvzf flac-<VERSION>.tar.gz
./configure --prefix=/usr/local \
--with-ogg-libraries=/usr/local/lib
make
make install
cd -
tar xvzf taglib-<VERSION>.tar.gz
cd taglib-<VERSION>
./configure --prefix=/usr/local
make
make install
Sofern wir den Server nicht Binär installieren konnten, installieren wir als nächstes mysql.
cd $SOURCEDIR
tar xvzf mysql-<VERSION>.tar.gz
cd mysql-<VERSION>
./configure --prefix=/usr/local \
--libexecdir=/usr/local/bin \
--without-extra-tools \
--without-bench
make
make install
Nach der erfolgten Installation von mysql folgen noch ein paar weitere für muggle wichtige Installationsschritte:
find . -name my-medium.cnf -exec cp --backup=t \{} /etc/my.cnf \;
cd /usr/local/lib
ln -s mysql/libmysqlclient.so* .
groupadd mysql
useradd -g mysql mysql
cd ..
chown -R mysql var
mysql_install_db --user=mysql &
ldconfig
Die Installation des plugins erfolgt an der allbekannten Stelle $SOURCEDIR/VDR/PLUGINS/src vor:
cd $SOURCEDIR/VDR/PLUGINS/src tar xvzf vdr-muggle-<VERSION>.tgz ln -s muggle-<VERSION> muggle
Wurde, wie im oben genannten Installationsbeispiel mysql von den sourcen selbst übersetzt, muss im Makefile des muggle-plugins eine kleine Anpassung vorgenommen werden. Folgende Änderungen nehmen wir in folgender Datei $SOURCEDIR/VDR/PLUGINS/src/muggle/Makefile vor:
- -I/usr/include/mysql/ -I/usr/include/taglib + $(shell mysql_config --include) $(shell taglib-config --cflags) - MIFLAGS += -I/usr/include/taglib -lmysqlclient + MIFLAGS += $(shell taglib-config --cflags) -lmysqlclient
Ansonsten können wir nun das plugin wie gewohnt übersetzen
cd $SOURCEDIR/VDR make plugins
mysql-Datenbank befüllen
Als erstes starten wir den mysql-Server mit:
mysqld_safe --user=mysql &
Nun können wir die Datenbank füttern, vorrausgesetzt die Mp3 Sammlung befindet sich in /mp3
mkdir /mp3
cd $SOURCEDIR/VDR/PLUGINS/src/muggle
make mugglei
cp mugglei /usr/local/bin
cd scripts
sh make-empty-db
cd /mp3
find * -path 'Assorted' -prune -o -type f -exec mugglei -z -h localhost -n GiantDisc -f \{} \;
Später via commands.conf, mit folgenden Eintrag:
Update DB : echo "cd /mp3 ; find * -path 'Assorted' -prune -o -type f -exec mugglei -z -h localhost -n GiantDisc -f '{}' ';'"|at now
Falls das nicht funktioniert, bitte den kompletten Pfad zu mugglei angeben ...-exec /usr/local/bin/mugglei -z....
Übergabe für VDR.
vdr -P'muggle -h localhost -n GiantDisc -t /mp3'
Für das automatische Starten des Mysql Daemons, gibt es mehrere Lösungen. Wer Runlevel Scripte mag, sollte sich die Docs anschauen.
Unterhalb von ../support-files im Sourceverzeichnis, befinden sich Templates.
Ein Eintrag in der /etc/init.d/boot.local (falls vorhanden) sollte auch langen.
# starting mysqld daemon /usr/local/bin/mysqld_safe --user=mysql &
Als letzte Möglichkeit: einfach über die runvdr.
# starting mysqld daemon
if [ ! "$(ps axc|awk "{if (\$5==\"mysqld_safe\") print \$1}")" ] ; then
/usr/local/bin/mysqld_safe --user=mysql &
sleep 1s
fi
Probleme
SuSE spezifisch
Bei SuSE wurde mySQL so compiliert, dass import lokaler files nicht unterstuetzt wird. Einfach Sourcen nach der Anleitung oben übersetzen, oder z.B. rpms direkt von www.mysql.org installieren. Die SuSE eigenen Packete sollte man falls installiert entfernen, folgender Einzeiler erledigt dies:
rpm -qa|grep mysql|xargs rpm -e --nodeps
Optionen
| HAVE_VORBISFILE=1 | optionally libvorbis and libvorbisfile to replay OGG Vorbis files |
| HAVE_FLAC=1 | optionally libFLAC++ to replay FLAC files |
Plugin
| Parameter (kurz) | Parameter (lang) | Beschreibung |
|---|---|---|
| -h HHHH | --host=HHHH | specify database host (default is localhost) |
| -s SSSS | --socket=PATH | specify database socket (default is TCP connection) |
| -n NNNN | --name=NNNN | specify database name (overridden by -g) |
| -p PPPP | --port=PPPP | specify port of database server (default is ) |
| -u UUUU | --user=UUUU | specify database user (default is ) |
| -w WWWW | --password=WWWW | specify database password (default is empty) |
| -t TTTT | --toplevel=TTTT | specify toplevel directory for music (default is /mnt/music) |
| -g | --giantdisc | enable full Giantdisc compatibility mode |
Mugglei
| Parameter | Beschreibung |
|---|---|
| -s <socket> | specify a socket for mySQL communication (default is TCP) |
| -n <database> | specify database name (default is 'GiantDisc') |
| -u <username> | specify user of mySql database (default is empty) |
| -p <password> | specify password of user (default is empty password) |
| -f <filename> | name of music file to import or update |
| -a | import track as if it was on an assorted album |
| -z | scan all database entries and delete entries for files not found |
Bedienung
Links
| [1] | http://www.mysql.com | mySQL |
| [2] | http://www.underbit.com/products/mad | (M)PEG (A)udio (D)ecoder Homepage |
| [3] | http://www.xiph.org/ogg/vorbis | Ogg Vorbis CODEC Project |
| [4] | http://developer.kde.org/~wheeler/taglib.html | Taglib - Audio Meta-Data Library |
| [5] | http://vdrportal.de/board/thread.php?postid=206688 | snd2usb für muggle zum Schreiben auf USB Stick |
| [6] | http://flac.sourceforge.net | flac |
| [7] | http://www.htpc-tech.de/htpc/muggle.htm | Homepage des Plugins |