Difference between revisions of "GMediaServer - GNU UPnP media server (MIPSel)"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
 
(21 intermediate revisions by 6 users not shown)
Line 1: Line 1:
<center><font color=red>''Originally by AndreGauthier from linkstationwiki.org''</font></center>
+
{{Template:Articles}}<center><font color=red>''Originally by AndreGauthier from linkstationwiki.org''</font></center>
 +
<table align=right><tr><td>http://upload.wikimedia.org/wikipedia/commons/thumb/1/1b/Gnu_meditate_levitate.jpg/120px-Gnu_meditate_levitate.jpg
 +
</td></tr></table>
 
== Overview ==
 
== Overview ==
+
[http://www.gnu.org/software/gmediaserver/ GMediaServer] is a [[w:UPnP|UPnP]] compatible media server for the GNU system. It is part of the GNU project.
  
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.
+
GMediaServer serves audio and video files to certain network connected media players. Most hardware media players only play music and/or video—they don't provide the media themselves. Those media files have to come from a device on the network. GMediaServer is a server for such UPnP compatible media players, including:
  
 +
* NETGEAR [http://www.netgear.com/products/details/MP101.php Wireless Digital Music Player (MP101)]
 +
* Linksys [http://www.linksys.com/products/product.asp?grid=33&scid=38&prid=631 Wireless-B Music System (WMLS11B)], [http://www.linksys.com/products/product.asp?grid=33&prid=632 Wireless-B Media Link for Music (WML11B)]
 +
* Philips [http://www.streamium.com/products/sl300i/ Streamium SL300i], [http://www.homecontrol.philips.com/ Streamium RC9800i], [http://www.consumer.philips.com/consumer/catalog/catalog.jsp?fhquery=fh_secondid%3Dsla5520_05_gb_consumer%26fh_location%3D%2F%2Fconsumer%2Fen_GB%2Fcategories%3Ccatalog_gb_consumer%2Fcategories%3Chome_audio_video_gr_gb_consumer%2Fcategories%3Cwireless_av_networking_ca_gb_consumer%26&productId=SLA5520_05_GB_CONSUMER&activeCategory=WIRELESS_AV_NETWORKING_CA_GB_CONSUMER&fredhopperpage=detail.jsp&concept=SB30000002&language=en&country=GB&catalogType=CONSUMER Streamium SLA5520]
 +
* Omnifi [http://omnifimedia.com/products/omnifi_details.jsp?productId=12542 DMS1]
 +
* SMC [http://www.smc.com/index.cfm?event=viewProduct&localeCode=EN_USA&cid=11&scid=&pid=1333 EZ Stream 11Mbps Wireless Audio Adaptor (SMCWAA-B)]
 +
* D-Link [http://www.dlink.com/products/?pid=438 DSM-520 Wireless HD Media Player]
 +
* Roku [http://www.rokulabs.com/products/soundbridge/index.php SoundBridge Network Music Player M1000]
 +
* Terratec [http://entertainen.terratec.net/modules.php?op=modload&name=News&file=article&sid=228 NOXON audio], [http://entertainen.terratec.net/modules.php?op=modload&name=News&file=article&sid=241 NOXON 2 audio]
 +
* Pinnacle [http://www.pinnaclesys.com/PublicSite/uk/Products/Consumer+Products/Digital+Media+Adapters/Digital+Media+Player/ShowCenter+200.htm ShowCenter 200]
 +
*[[XBMC - Using Xbox Media Center with the LinkStation| XBMC]] (X-Box Media Center, 2.0+ Edition(s))
  
== Pre-requisites ==
+
Other UPnP media players (including software based) may work as well—see the [http://www.gnu.org/software/gmediaserver/manual/ manual] for a more complete list.
  
 +
GMediaServer is written in C by Oskar Liljeblad. It should compile and run on any modern [[w:POSIX|POSIX]] compatible system such as [[w:GNU/Linux|GNU/Linux]]. GMediaServer is a console based application which is usually run in the background. It is free software, licensed under the terms of the [[w:GNU General Public License|GNU General Public License]].
 +
 +
==FreeLink==
 +
You need to install at least the g++ (you might have the rest) from the build-essential packages (i.e., libc6-dev gcc g++ make dpkg-dev):
 +
apt-get install g++
 +
Apt get dependancies
 +
apt-get install libmagic1 libmagic-dev libid3-3.8.3 libtagc0 libtagc0-dev libuuid1 uuid-dev
 +
Then get the source files install them
 +
wget http://download.savannah.gnu.org/releases/gmediaserver/gmediaserver-0.12.0.tar.gz
 +
wget http://ovh.dl.sourceforge.net/sourceforge/upnp/libupnp-1.3.1.tar.gz
 +
Configure, make and install libupnp1.3.1
 +
tar -xvzf libupnp-1.3.1.tar.gz
 +
cd libupnp-1.3.1
 +
./configure
 +
make
 +
make install
 +
Then configure, make and install gmediaserver
 +
tar -xvzf gmediaserver-0.12.0.tar.gz
 +
cd gmediaserver-0.12.0
 +
./configure --prefix=/mnt/hda/gmedia
 +
make
 +
make install
 +
 +
==OpenLink (MIPSel)==
 +
=== Pre-requisites ===
 
# Linkstation2
 
# Linkstation2
# mipsel-openlink-052b.zip (from the downloads section and installed as per README).
+
# [[OpenLink]] - mipsel-openlink-052b.zip (from the downloads section and installed as per README).
# mipsel-tools-2.tgz (from the downloads section and installed with the install.sh).
+
# [[Precompiled C development environment, running on the LS]] - mipsel-tools-2.tgz (from the [http://downloads.buffalo.nas-central.org/ downloads] section and installed with the install.sh).
# 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).
+
# mipsel-screen-1.tgz (from the [http://downloads.buffalo.nas-central.org/ 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).
 
# /usr/bin/sort extracted from the debian package coreutils-5.2.
 
# /usr/bin/sort extracted from the debian package coreutils-5.2.
 +
  Additional Note: I had trouble finding these but I'm no Linux expert.
 +
  Eventually I found them on debian package site: [http://packages.debian.org/etch/mipsel/coreutils/download here] I happily used version 5.97-5.3 on LS2.
 +
  Use wget to get the file, then mkdir tmp; cd tmp; ar x ''../downloadedfilename''; tar -xvzf data.tar.gz; cp -ir ./usr/sort /usr; rm -r *
 +
 
# gmediaserver-latest.tar.gz from http://www.gnu.org/software/gmediaserver/
 
# gmediaserver-latest.tar.gz from http://www.gnu.org/software/gmediaserver/
 
# obtain required libraries.
 
# 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.
  
 +
  Additional Note: No idea what alien is, so I found the stuff [http://packages.debian.org/etch/mipsel/ here] under libraries.
 +
  Use wget to get the files, then mkdir tmp; cd tmp; ar x ''../downloadedfilename''; tar -xvzf data.tar.gz; cp -ir ./usr/* /usr; rm -r *; repeat for each library.
  
== 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       
 
* libid3-3.8.3-3.8.3.tgz       
 
* libupnp-dev-1.2.1.tgz
 
* libupnp-dev-1.2.1.tgz
 
* libid3-3.8.3-dev-3.8.3.tgz   
 
* libid3-3.8.3-dev-3.8.3.tgz   
 
* libupnp0-1.2.1.tgz
 
* libupnp0-1.2.1.tgz
   
+
=== Procedure ===
 +
  wget http://download.savannah.gnu.org/releases/gmediaserver/gmediaserver-0.12.0.tar.gz
 +
tar -xvzf gmediaserver-0.12.0.tar.gz
 +
cd gmediaserver-0.12.0
 +
./configure --prefix=/mnt/hda/gmedia
 +
make
 +
make install
  
== Procedure ==
+
=Configuration=
  
( If you add media you should restart the server as it will need to rescan the directories )
+
*''If you add media you should restart the server as it will need to rescan the directories''*
 +
*Insert init script into /etc/init.d (See Below)  
 +
cd /etc/rc.d/rc2.d
 +
ln -s ../init.d/gmserver S98gmserver
 +
cd ../rc0.d
 +
ln -s ../init.d/gmserver K02gmserver
 +
cd ../rc6.d
 +
ln -s ../init.d/gmserver K02gmserver
  
# Extract gmediaserver-latest.tar.gz
+
* Disable the pcast server (use the web interface).
# cd gmediaserver-0.11.0
+
# ./confiure --prefix=/mnt/hda/gmedia
+
# make
+
# make install
+
# Insert init script into /etc/init.d (See Below)
+
# cd /etc/rc.d/rc2.d
+
# ln -s ../init.d/gmserver S98gmserver
+
# cd ../rc0.d
+
# ln -s ../init.d/gmserver K02gmserver
+
# cd ../rc6.d
+
# ln -s ../init.d/gmserver K02gmserver
+
# Disable the pcast server (use the web interface).
+
# run the gmedia init script with a start parameter.
+
# 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. )
+
Additional note:
 +
  * Disable the pcast server (use the web interface). (it's so good I thought I'd mention it twice). You will get UPNP failed to bond/work/reach/something like that otherwise.  Basically PCAST will hog the stuff you want to use.
  
  
 +
* Run the gmedia init script with a start parameter. (this is the script below - create a file called gmedia in /etc/init.d/ called gmedia and add the script contents below. Don't forget to chmod +x afterwards if you want to execute it.)
 +
 +
Additional note:
 +
  I would suggest not rushing in above as if the server fails to start you won't know.
 +
  why not start simply:
 +
  cd /mnt/hda/gmedia/bin
 +
  ./gmediaserver -ieth0 -v4 ''music directory e.g. /mnt/hda/media''
 +
 +
* Wait a while as it scans the whole collection on every startup. (or just point it to one directory with a couple of files while you get it working!)
 +
 +
( you should edit the script to change the directory that should be shared. )
  
 
  #!/bin/sh
 
  #!/bin/sh
Line 62: Line 114:
 
  GM_HOME=/mnt/hda/gmedia
 
  GM_HOME=/mnt/hda/gmedia
 
  NAME=`hostname`
 
  NAME=`hostname`
 +
# Edit this following line to point to your media
 
  DIR=/mnt/hda/share/home_backup/media/mp3
 
  DIR=/mnt/hda/share/home_backup/media/mp3
 
   
 
   
Line 73: Line 126:
 
     start)
 
     start)
 
         echo  "Start services: gmediaserver"
 
         echo  "Start services: gmediaserver"
         $GM_HOME/bin/gmediaserver -b -i eth0 --friendly-name=$NAME \
+
         # Next line failed for me - seems to be an issue with logging. Hence commented out and redone.
            -o $GM_HOME/log/server.log -v1 $DIR
+
        #$GM_HOME/bin/gmediaserver -b -i eth0 --friendly-name=$NAME \
 +
        #    -o $GM_HOME/log/server.log -v1 $DIR
 +
        $GM_HOME/bin/gmediaserver -b -i eth0 --friendly-name=$NAME -v1 $DIR
 
         ;;
 
         ;;
 
     stop)
 
     stop)
Line 81: Line 136:
 
         ;;
 
         ;;
 
     restart)
 
     restart)
         stop
+
         # this didn't work for me.... Commented out and redone.
 +
        # stop
 +
        /sbin/start-stop-daemon --stop --quiet --exec $GM_HOME/bin/gmediaserver
 
         sleep 1
 
         sleep 1
         start
+
         # this didn't work for me.... Commented out and redone.
 +
        # start
 +
        $GM_HOME/bin/gmediaserver -b -i eth0 --friendly-name=$NAME -v1 $DIR
 
         ;;
 
         ;;
 
     *)
 
     *)
Line 96: Line 155:
 
[[Category:LS2]]
 
[[Category:LS2]]
 
[[Category:Howto]]
 
[[Category:Howto]]
 
+
[[Category:FreeLink]]
 
[[Category:Mediaserver]]
 
[[Category:Mediaserver]]

Latest revision as of 10:14, 11 January 2009

Originally by AndreGauthier from linkstationwiki.org
120px-Gnu_meditate_levitate.jpg

Contents

Overview

GMediaServer is a UPnP compatible media server for the GNU system. It is part of the GNU project.

GMediaServer serves audio and video files to certain network connected media players. Most hardware media players only play music and/or video—they don't provide the media themselves. Those media files have to come from a device on the network. GMediaServer is a server for such UPnP compatible media players, including:

Other UPnP media players (including software based) may work as well—see the manual for a more complete list.

GMediaServer is written in C by Oskar Liljeblad. It should compile and run on any modern POSIX compatible system such as GNU/Linux. GMediaServer is a console based application which is usually run in the background. It is free software, licensed under the terms of the GNU General Public License.

FreeLink

You need to install at least the g++ (you might have the rest) from the build-essential packages (i.e., libc6-dev gcc g++ make dpkg-dev):

apt-get install g++

Apt get dependancies

apt-get install libmagic1 libmagic-dev libid3-3.8.3 libtagc0 libtagc0-dev libuuid1 uuid-dev 

Then get the source files install them

wget http://download.savannah.gnu.org/releases/gmediaserver/gmediaserver-0.12.0.tar.gz
wget http://ovh.dl.sourceforge.net/sourceforge/upnp/libupnp-1.3.1.tar.gz

Configure, make and install libupnp1.3.1

tar -xvzf libupnp-1.3.1.tar.gz 
cd libupnp-1.3.1
./configure
make 
make install

Then configure, make and install gmediaserver

tar -xvzf gmediaserver-0.12.0.tar.gz 
cd gmediaserver-0.12.0 
./configure --prefix=/mnt/hda/gmedia
make
make install

OpenLink (MIPSel)

Pre-requisites

  1. Linkstation2
  2. OpenLink - mipsel-openlink-052b.zip (from the downloads section and installed as per README).
  3. Precompiled C development environment, running on the LS - 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.
 Additional Note: I had trouble finding these but I'm no Linux expert. 
 Eventually I found them on debian package site: here I happily used version 5.97-5.3 on LS2. 
 Use wget to get the file, then mkdir tmp; cd tmp; ar x ../downloadedfilename; tar -xvzf data.tar.gz; cp -ir ./usr/sort /usr; rm -r *
  1. gmediaserver-latest.tar.gz from http://www.gnu.org/software/gmediaserver/
  2. 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.

 Additional Note: No idea what alien is, so I found the stuff here under libraries.
 Use wget to get the files, then mkdir tmp; cd tmp; ar x ../downloadedfilename; tar -xvzf data.tar.gz; cp -ir ./usr/* /usr; rm -r *; repeat for each library. 
  • 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

wget http://download.savannah.gnu.org/releases/gmediaserver/gmediaserver-0.12.0.tar.gz
tar -xvzf gmediaserver-0.12.0.tar.gz 
cd gmediaserver-0.12.0 
./configure --prefix=/mnt/hda/gmedia
make
make install

Configuration

  • If you add media you should restart the server as it will need to rescan the directories*
  • Insert init script into /etc/init.d (See Below)
cd /etc/rc.d/rc2.d
ln -s ../init.d/gmserver S98gmserver
cd ../rc0.d
ln -s ../init.d/gmserver K02gmserver
cd ../rc6.d
ln -s ../init.d/gmserver K02gmserver
  • Disable the pcast server (use the web interface).
Additional note:
 * Disable the pcast server (use the web interface). (it's so good I thought I'd mention it twice). You will get UPNP failed to bond/work/reach/something like that otherwise.   Basically PCAST will hog the stuff you want to use.


  • Run the gmedia init script with a start parameter. (this is the script below - create a file called gmedia in /etc/init.d/ called gmedia and add the script contents below. Don't forget to chmod +x afterwards if you want to execute it.)
Additional note:
 I would suggest not rushing in above as if the server fails to start you won't know.
 why not start simply:
 cd /mnt/hda/gmedia/bin
 ./gmediaserver -ieth0 -v4 music directory e.g. /mnt/hda/media
  • Wait a while as it scans the whole collection on every startup. (or just point it to one directory with a couple of files while you get it working!)

( 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`
# Edit this following line to point to your media
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"
       # Next line failed for me - seems to be an issue with logging. Hence commented out and redone.
       #$GM_HOME/bin/gmediaserver -b -i eth0 --friendly-name=$NAME \
       #    -o $GM_HOME/log/server.log -v1 $DIR
       $GM_HOME/bin/gmediaserver -b -i eth0 --friendly-name=$NAME -v1 $DIR
       ;;
   stop)
       echo  "Stop services: gmediaserver"
       /sbin/start-stop-daemon --stop --quiet --exec $GM_HOME/bin/gmediaserver
       ;;
   restart)
       # this didn't work for me.... Commented out and redone. 
       # stop
       /sbin/start-stop-daemon --stop --quiet --exec $GM_HOME/bin/gmediaserver
       sleep 1
       # this didn't work for me.... Commented out and redone. 
       # start
       $GM_HOME/bin/gmediaserver -b -i eth0 --friendly-name=$NAME -v1 $DIR
       ;;
   *)
   echo "usage: $0 { start | stop | restart}" >&2
   exit 1
   ;; 
                                                                                             
esac

exit 0