GMediaServer - GNU UPnP media server (MIPSel)

From NAS-Central Buffalo - The Linkstation Wiki
Revision as of 23:17, 6 July 2006 by 64.198.1.59 (Talk)

Jump to: navigation, search
Originally by AndreGauthier from linkstationwiki.org

Contents

Overview

Having built apache2 and mod_musicindex the usefulness of the linkstation for streaming music all over the house has become an interesting intellectual exercise. Realizing that the built in PCast software is not up to the grade some investigation showed that GMediaServer seems to be the most tested software with a wide range of Wireless media devices so I thought I would get it working and see. So far I have tested it with djmount (an open source UPnP client for linux) and it works fine.


Pre-requisites

  1. Linkstation2
  2. mipsel-openlink-052b.zip (from the downloads section and installed as per README).
  3. mipsel-tools-2.tgz (from the downloads section and installed with the install.sh).
  4. mipsel-screen-1.tgz (from the downloads section and installed with the install.sh). (NOT REQUIRED but the compile takes ages and this helps if you get disconnected when it is running).
  5. /usr/bin/sort extracted from the debian package coreutils-5.2.
  6. gmediaserver-latest.tar.gz from http://www.gnu.org/software/gmediaserver/
  7. obtain required libraries.


Required Libraries

The libraries were downloaded from my local debian mirror and I used alien -t <debfile> to convert them to tgz files which were extracted into the root of the link station.

  • libid3-3.8.3-3.8.3.tgz
  • libupnp-dev-1.2.1.tgz
  • libid3-3.8.3-dev-3.8.3.tgz
  • libupnp0-1.2.1.tgz


Procedure

( If you add media you should restart the server as it will need to rescan the directories )

  1. Extract gmediaserver-latest.tar.gz
  2. cd gmediaserver-0.11.0
  3. ./confiure --prefix=/mnt/hda/gmedia
  4. make
  5. make install
  6. Insert init script into /etc/init.d (See Below)
  7. cd /etc/rc.d/rc2.d
  8. ln -s ../init.d/gmserver S98gmserver
  9. cd ../rc0.d
  10. ln -s ../init.d/gmserver K02gmserver
  11. cd ../rc6.d
  12. ln -s ../init.d/gmserver K02gmserver
  13. Disable the pcast server (use the web interface).
  14. run the gmedia init script with a start parameter.
  15. Wait a while as it scans the whole collection on every startup.

( you should edit the script to change the directory that should be shared. )


#!/bin/sh
#
# gmediaserver - startup script for gmediaserver 
# This goes in /etc/init.d and gets run at boot-time.
#
# . /etc/timezone

PATH=/bin:/usr/bin:/sbin:/usr/sbin

GM_HOME=/mnt/hda/gmedia
NAME=`hostname`
DIR=/mnt/hda/share/home_backup/media/mp3

if ! [ -x $GM_HOME/bin/gmediaserver ]; then
       exit 0
fi


case "$1" in

   start)
       echo  "Start services: gmediaserver"
       $GM_HOME/bin/gmediaserver -b -i eth0 --friendly-name=$NAME \
           -o $GM_HOME/log/server.log -v1 $DIR
       ;;
   stop)
       echo  "Stop services: gmediaserver"
       /sbin/start-stop-daemon --stop --quiet --exec $GM_HOME/bin/gmediaserver
       ;;
   restart)
       stop
       sleep 1
       start
       ;;
   *)
   echo "usage: $0 { start | stop | restart}" >&2
   exit 1
   ;; 
                                                                                             
esac

exit 0