Difference between revisions of "Ushare - UPnP Media Server for Linux"

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m
(Install)
 
(28 intermediate revisions by 10 users not shown)
Line 1: Line 1:
{{Template:Articles|FreeLink|OpenLink|Mediaserver}}
+
{{Template:Articles|LSPro|FreeLink|OpenLink|Mediaserver|ipkg}}
 
<table align=right> <tr><td>http://upload.wikimedia.org/wikipedia/en/thumb/4/45/GeeXboX_Logo.gif/250px-GeeXboX_Logo.gif </td></tr></table>
 
<table align=right> <tr><td>http://upload.wikimedia.org/wikipedia/en/thumb/4/45/GeeXboX_Logo.gif/250px-GeeXboX_Logo.gif </td></tr></table>
 
==Introduction==
 
==Introduction==
uShare<ref>[http://ushare.geexbox.org/ GeeXboX uShare] : A free UPnP A/V Media Server for Linux.</ref>
+
uShare<ref>[http://ushare.geexbox.org/ GeeXboX uShare] : A free UPnP A/V Media Server for Linux.</ref><ref>[http://www.geexbox.org/wiki/index.php/UShare Ushare - GeeXboX wiki]</ref>
 
is a [[w:Upnp|Upnp]] (TM) A/V Media Server based on [[GMediaServer - GNU UPnP media server (MIPSel)|GmediaServer]]<ref>[[GMediaServer - GNU UPnP media server (MIPSel)|GMediaServer]] : the original Media Server on which uShare was based.</ref>. It implements the server component that provides UPnP media devices with information on available multimedia files. uShare uses the built-in http server of libupnp to stream the files to clients.
 
is a [[w:Upnp|Upnp]] (TM) A/V Media Server based on [[GMediaServer - GNU UPnP media server (MIPSel)|GmediaServer]]<ref>[[GMediaServer - GNU UPnP media server (MIPSel)|GMediaServer]] : the original Media Server on which uShare was based.</ref>. It implements the server component that provides UPnP media devices with information on available multimedia files. uShare uses the built-in http server of libupnp to stream the files to clients.
 
uShare is written for the [[w:GeeXboX|GeeXboX]]<ref>[[w:GeeXboX|GeeXboX]] : the Linux multimedia distribution that uses djmount to provide access to UPnP contents.</ref> project. It is designed to provide access to multimedia contents to GeeXboX but can of course be used by any other UPnP client device. It should compile and run on any modern [[w:POSIX|POSIX]] compatible system such as [[w:Linux|Linux]]. uShare is free software - it is licensed under the terms of the [[w:GNU General Public License|GNU General Public License]] (GPL).
 
uShare is written for the [[w:GeeXboX|GeeXboX]]<ref>[[w:GeeXboX|GeeXboX]] : the Linux multimedia distribution that uses djmount to provide access to UPnP contents.</ref> project. It is designed to provide access to multimedia contents to GeeXboX but can of course be used by any other UPnP client device. It should compile and run on any modern [[w:POSIX|POSIX]] compatible system such as [[w:Linux|Linux]]. uShare is free software - it is licensed under the terms of the [[w:GNU General Public License|GNU General Public License]] (GPL).
Line 12: Line 12:
 
* '''Subtitle files''' : [[w:dks|dks]],  [[w:idx|idx]],  [[w:mpl|mpl]],  [[w:pjs|pjs]],  [[w:psb|psb]],  scr,  [[w:SubRip|srt]],  ssa,  stl,  [[w:SubTitle|sub]],  tts,  vsf,  zeg
 
* '''Subtitle files''' : [[w:dks|dks]],  [[w:idx|idx]],  [[w:mpl|mpl]],  [[w:pjs|pjs]],  [[w:psb|psb]],  scr,  [[w:SubRip|srt]],  ssa,  stl,  [[w:SubTitle|sub]],  tts,  vsf,  zeg
 
* '''Various text files''' : [[w:bup|bup]],  [[w:IFO|ifo]]
 
* '''Various text files''' : [[w:bup|bup]],  [[w:IFO|ifo]]
 +
 +
===Supported Devices===
 +
* [[w:Xbox 360|Xbox 360]]
 +
* D-Link DSM-320
 +
* [[w:SoundBridge|Roku SoundBridge]] M2000 Network Music Player devices
 +
* and others
  
 
==Installation==
 
==Installation==
 +
The following UPnP library is required to build and run uShare: Linux SDK for UPnP Devices (libupnp), 1.3.1 or later <ref>[http://upnp.sourceforge.net/#Linux SDK for UPnP Devices (libupnp)]: An Open Source UPnP Development Kit.</ref>
 
===[[OpenLink]] - [[Ipkg]] (PowerPC)===
 
===[[OpenLink]] - [[Ipkg]] (PowerPC)===
 
*Install [[Ipkg on the Linkstation (for end-users)]] and enable the NSLU2 Feed: [[Ipkg Package List: PowerPC]]
 
*Install [[Ipkg on the Linkstation (for end-users)]] and enable the NSLU2 Feed: [[Ipkg Package List: PowerPC]]
*Install ushare
+
*Install ushare and libupnp, libdlna, ffmpeg
  ipkg install ushare
+
  ipkg install libupnp libdlna ffmpeg ushare
 +
* On my HS, ipkg installed uShare into /opt/bin/ so I had to create a link to it from /bin:
 +
cd /bin
 +
ln /opt/bin/ushare ushare
 +
 
 +
===ARM9(Stock Firmware)===
 +
====Manual download====
 +
[http://www.kolumbus.fi/~d601194/ushare/ushare-1.2a+libupnp-1.6.6_bin.tgz ushare-1.2a+libupnp-1.6.6_bin.tgz]
 +
 
 +
[http://downloads.nas-central.org/Users/kaiten/ushare-1.0+libupnp-1.4.6_arm9.tgz ushare-1.0+libupnp-1.4.6_arm9.tgz]
 +
 
 +
====Install====
 +
<pre>
 +
cd /tmp
 +
wget http://downloads.buffalo.nas-central.org/Users/kaiten/ushare-1.0+libupnp-1.4.6_arm9.tgz
 +
tar -C / -xzvf ushare-1.0+libupnp-1.4.6_arm9.tgz
 +
ldconfig -v
 +
</pre>
 +
 
 +
<b>Edit /usr/local/etc/ushare.conf</b>
 +
<pre>
 +
# /etc/ushare.conf
 +
# Configuration file for uShare
 +
 
 +
# uShare UPnP Friendly Name (default is 'uShare').
 +
USHARE_NAME=uShare
 +
 
 +
# Interface to listen to (default is eth0).
 +
# Ex : USHARE_IFACE=eth1
 +
USHARE_IFACE=eth0
 +
 
 +
# Port to listen to (default is random from IANA Dynamic Ports range)
 +
# Ex : USHARE_PORT=49200
 +
USHARE_PORT=49200
 +
 
 +
# Directories to be shared (space or CSV list).
 +
# Ex: USHARE_DIR=/dir1,/dir2
 +
USHARE_DIR=/mnt/disk1/root/Music,/mnt/disk1/root/pictures,/mnt/disk1/root/Video
 +
 
 +
# Use to override what happens when iconv fails to parse a file name.
 +
# The default uShare behaviour is to not add the entry in the media list
 +
# This option overrides that behaviour and adds the non-iconv'ed string into
 +
# the media list, with the assumption that the renderer will be able to
 +
# handle it. Devices like Noxon 2 have no problem with strings being passed
 +
# as is. (Umlauts for all!)
 +
#
 +
# Options are TRUE/YES/1 for override and anything else for default behaviour
 +
USHARE_OVERRIDE_ICONV_ERR=true
 +
 
 +
# Enable Web interface (yes/no)
 +
USHARE_ENABLE_WEB=yes
 +
 
 +
# Enable Telnet control interface (yes/no)
 +
USHARE_ENABLE_TELNET=no
 +
 
 +
# Use XboX 360 compatibility mode (yes/no)
 +
USHARE_ENABLE_XBOX=no
 +
 
 +
# Use DLNA profile (yes/no) if libdlna is also used.
 +
# This is not needed with this custom3 build of uShare-1.1a
 +
# This is needed for PlayStation3 to work (among other devices)
 +
USHARE_ENABLE_DLNA=yes
 +
 
 +
#EOF
 +
</pre>
 +
 
 +
====Start====
 +
 
 +
<pre>/etc/init.d/ushare start</pre>
 +
 
 +
<b>Package Changes:</b>
 +
 
 +
Moved everything to /usr/local/, with the execption of the init script..
 +
 
 +
<b>Package Contents:</b>
 +
 
 +
<pre>
 +
./etc/init.d/ushare
 +
./usr/local/bin/ushare
 +
./usr/local/etc/ushare.conf
 +
./usr/local/include/upnp/ixml.h
 +
./usr/local/include/upnp/FreeList.h
 +
./usr/local/include/upnp/LinkedList.h
 +
./usr/local/include/upnp/ThreadPool.h
 +
./usr/local/include/upnp/TimerThread.h
 +
./usr/local/include/upnp/iasnprintf.h
 +
./usr/local/include/upnp/ithread.h
 +
./usr/local/include/upnp/upnpconfig.h
 +
./usr/local/include/upnp/upnp.h
 +
./usr/local/include/upnp/upnptools.h
 +
./usr/local/lib/libixml.so.2.0.3
 +
./usr/local/lib/libixml.so.2
 +
./usr/local/lib/libixml.so
 +
./usr/local/lib/libixml.la
 +
./usr/local/lib/libixml.a
 +
./usr/local/lib/libthreadutil.so.2.1.0
 +
./usr/local/lib/libthreadutil.so.2
 +
./usr/local/lib/libthreadutil.so
 +
./usr/local/lib/libthreadutil.la
 +
./usr/local/lib/libthreadutil.a
 +
./usr/local/lib/libupnp.so.2.0.3
 +
./usr/local/lib/libupnp.so.2
 +
./usr/local/lib/libupnp.so
 +
./usr/local/lib/libupnp.la
 +
./usr/local/lib/libupnp.a
 +
./usr/local/lib/pkgconfig/libupnp.pc
 +
./usr/local/share/locale/fr/LC_MESSAGES/ushare.mo
 +
./usr/local/share/locale/de/LC_MESSAGES/ushare.mo
 +
./usr/local/share/man/man1/ushare.1
 +
</pre>
 +
 
 +
<b>Note:</b> If installing over an earlier version, remove the ushare binary from /usr/bin/
 +
 
 +
<b>Todo:</b> Install script to check for older versions & config duplication.
  
 
===Compile from Source===
 
===Compile from Source===
Line 24: Line 144:
 
  wget http://ushare.geexbox.org/releases/ushare-0.9.7.tar.bz2
 
  wget http://ushare.geexbox.org/releases/ushare-0.9.7.tar.bz2
 
  wget http://ovh.dl.sourceforge.net/sourceforge/upnp/libupnp-1.3.1.tar.gz
 
  wget http://ovh.dl.sourceforge.net/sourceforge/upnp/libupnp-1.3.1.tar.gz
Configure, make and install libupnp1.3.1<ref>[http://upnp.sourceforge.net/Linux SDK for UPnP Devices (libupnp)]: An Open Source UPnP Development Kit.</ref>
+
Configure, make and install libupnp1.3.1
  
 
  tar -xvzf libupnp-1.3.1.tar.gz  
 
  tar -xvzf libupnp-1.3.1.tar.gz  
Line 34: Line 154:
 
  tar -xvjf ushare-0.9.7.tar.bz2
 
  tar -xvjf ushare-0.9.7.tar.bz2
 
  cd ushare-0.9.7
 
  cd ushare-0.9.7
  ./configure
+
  ./configure (--prefix=/usr/local --sysconfdir=/etc)?
 
  make  
 
  make  
 
  make install
 
  make install
 
  
 
==Configuration==
 
==Configuration==
Line 43: Line 162:
 
  route add -net 239.0.0.0 netmask 255.0.0.0 eth0
 
  route add -net 239.0.0.0 netmask 255.0.0.0 eth0
  
To complete the installation, you must edit <tt>/etc/ushare.conf</tt> to add the location(s) of your media files.  
+
To complete the installation, you must edit <tt>/etc/ushare.conf</tt> or <tt>/opt/etc/ushare.conf</tt> on an ipkg install to add the location(s) of your media files.  
 
====/etc/ushare.conf====
 
====/etc/ushare.conf====
 
<pre>
 
<pre>
Line 59: Line 178:
 
# Ex : USHARE_PORT=49200
 
# Ex : USHARE_PORT=49200
 
USHARE_PORT=49200
 
USHARE_PORT=49200
 +
 +
# Port to listen for Telnet connections
 +
# Ex : USHARE_TELNET_PORT=1337
 +
USHARE_TELNET_PORT=
  
 
# Directories to be shared (space or CSV list).
 
# Directories to be shared (space or CSV list).
 
# Ex: USHARE_DIR=/dir1,/dir2
 
# Ex: USHARE_DIR=/dir1,/dir2
USHARE_DIR=
+
USHARE_DIR=/mnt/share/storage,/mnt/share/My-Documents/iTunes-Music,/mnt/share/My-Documents/my-Pictures
 +
 
 +
# Use to override what happens when iconv fails to parse a file name.
 +
# The default uShare behaviour is to not add the entry in the media list
 +
# This option overrides that behaviour and adds the non-iconv'ed string into
 +
# the media list, with the assumption that the renderer will be able to
 +
# handle it. Devices like Noxon 2 have no problem with strings being passed
 +
# as is. (Umlauts for all!)
 +
#
 +
# Options are TRUE/YES/1 for override and anything else for default behaviour
 +
USHARE_OVERRIDE_ICONV_ERR=
 +
 
 +
# Enable Web interface (yes/no)
 +
ENABLE_WEB=yes
 +
 
 +
# Enable Telnet control interface (yes/no)
 +
ENABLE_TELNET=
 +
 
 +
# Use XboX 360 compatibility mode (yes/no)
 +
ENABLE_XBOX=yes
 +
 
 +
# Use DLNA profile (yes/no)
 +
# This is needed for PlayStation3 to work (among other devices)
 +
ENABLE_DLNA=
 
</pre>
 
</pre>
  
Line 138: Line 284:
 
And run the following to have it startup and stop on system start/shutdown
 
And run the following to have it startup and stop on system start/shutdown
 
  cd /etc/rc.d/rc2.d
 
  cd /etc/rc.d/rc2.d
  ln -s ../init.d/gmserver S99ushare
+
  ln -s ../init.d/ushare S99ushare
 
  cd ../rc0.d
 
  cd ../rc0.d
  ln -s ../init.d/gmserver K02ushare
+
  ln -s ../init.d/ushare K02ushare
 
  cd ../rc6.d
 
  cd ../rc6.d
  ln -s ../init.d/gmserver K02ushare
+
  ln -s ../init.d/ushare K02ushare
  
 
==Usage==
 
==Usage==
 
uShare runs from the console only. It supports the usual '''--help''' option which displays usage and option information.
 
uShare runs from the console only. It supports the usual '''--help''' option which displays usage and option information.
 
===Command Line Options===
 
===Command Line Options===
 +
<pre>uShare (version 1.1a), a lightweight UPnP A/V and DLNA Media Server.
 +
Benjamin Zores (C) 2005-2007, for GeeXboX Team.
 +
See http://ushare.geexbox.org/ for updates.
 +
 +
Usage: ushare [-n name] [-i interface] [-p port] [-c directory] [[-c directory]...]
 +
Options:
 +
-n, --name=NAME        Set UPnP Friendly Name (default is 'uShare')
 +
-i, --interface=IFACE  Use IFACE Network Interface (default is 'eth0')
 +
-f, --cfg=FILE        Config file to be used
 +
-p, --port=PORT        Forces the HTTP server to run on PORT
 +
-q, --telnet-port=PORT Forces the TELNET server to run on PORT
 +
-c, --content=DIR      Share the content of DIR directory
 +
-w, --no-web          Disable the control web page (enabled by default)
 +
-t, --no-telnet        Disable the TELNET control (enabled by default)
 +
-o, --override-iconv-err      If iconv fails parsing name, still add to media contents (hoping the renderer can handle it)
 +
-v, --verbose          Set verbose display
 +
-x, --xbox            Use XboX 360 compliant profile
 +
-d, --dlna            Use DLNA compliant profile (PlayStation3 needs this)
 +
-D, --daemon          Run as a daemon
 +
-V, --version          Display the version of uShare and exit
 +
-h, --help            Display this help
 +
</pre>
 +
uShare expects at least one directory argument (-c argument), specifying where multimedia files are stored. You should probably also use the -i option to specify which interface uShare should listen on.
 +
  ushare -i eth0 -c /shares
 +
 +
===Web Interface===
 +
You can also perform remote control of uShare UPnP Media Server through its web interface. This let you define new content locations at runtime or update the currently shared one in case the filesystem has changed. After starting ushare you can go to the web interface to manage it's shares: http://linkstation:49200/web/ushare.html
 
{|
 
{|
 
|-
 
|-
|| -n || --name=NAME ||           Set UPnP Friendly Name (default is 'uShare')
+
|| [[Image:ushare.png|200px|thumb|left|After starting ushare you can go to the web interface to manage it's shares: http://linkstation:49200/web/ushare.html]]
|-
+
||  -i || --interface=IFACE ||        Use IFACE Network Interface (default is 'eth0')
+
|-
+
||  -p || --port=PORT  ||          Forces the HTTP server to run on PORT
+
|-
+
||  -c || --content=DIR ||            Share the content of DIR directory (default is './')
+
|-
+
||  -w || --no-web ||              Disable the control web page (enabled by default)
+
|-
+
||  -v || --verbose ||                Set verbose display.
+
|-
+
||  -D || --daemon||                Run as a daemon.
+
|-
+
||  -V || --version ||                Display the version of uShare and exit
+
|-
+
||  -h || --help ||                  Display this help
+
 
|}
 
|}
uShare expects at least one directory argument (-c argument), specifying where multimedia files are stored. You should probably also use the -i option to specify which interface uShare should listen on.
 
  ushare -i eth0 -c /shares
 
===Web Interface===
 
After starting ushare you can go to the web interface to manage it's shares:
 
 
http://linkstation:49200/web/ushare.html
 
  
 
==References==
 
==References==
 
<references/>
 
<references/>
{{stubs}}
 

Latest revision as of 18:50, 19 June 2011

250px-GeeXboX_Logo.gif

Contents

Introduction

uShare[1][2] is a Upnp (TM) A/V Media Server based on GmediaServer[3]. It implements the server component that provides UPnP media devices with information on available multimedia files. uShare uses the built-in http server of libupnp to stream the files to clients. uShare is written for the GeeXboX[4] project. It is designed to provide access to multimedia contents to GeeXboX but can of course be used by any other UPnP client device. It should compile and run on any modern POSIX compatible system such as Linux. uShare is free software - it is licensed under the terms of the GNU General Public License (GPL).

Supported File Formats List

Supported Devices

Installation

The following UPnP library is required to build and run uShare: Linux SDK for UPnP Devices (libupnp), 1.3.1 or later [5]

OpenLink - Ipkg (PowerPC)

ipkg install libupnp libdlna ffmpeg ushare
  • On my HS, ipkg installed uShare into /opt/bin/ so I had to create a link to it from /bin:
cd /bin
ln /opt/bin/ushare ushare

ARM9(Stock Firmware)

Manual download

ushare-1.2a+libupnp-1.6.6_bin.tgz

ushare-1.0+libupnp-1.4.6_arm9.tgz

Install

cd /tmp
wget http://downloads.buffalo.nas-central.org/Users/kaiten/ushare-1.0+libupnp-1.4.6_arm9.tgz
tar -C / -xzvf ushare-1.0+libupnp-1.4.6_arm9.tgz
ldconfig -v

Edit /usr/local/etc/ushare.conf

# /etc/ushare.conf
# Configuration file for uShare

# uShare UPnP Friendly Name (default is 'uShare').
USHARE_NAME=uShare

# Interface to listen to (default is eth0).
# Ex : USHARE_IFACE=eth1
USHARE_IFACE=eth0

# Port to listen to (default is random from IANA Dynamic Ports range)
# Ex : USHARE_PORT=49200
USHARE_PORT=49200

# Directories to be shared (space or CSV list).
# Ex: USHARE_DIR=/dir1,/dir2
USHARE_DIR=/mnt/disk1/root/Music,/mnt/disk1/root/pictures,/mnt/disk1/root/Video

# Use to override what happens when iconv fails to parse a file name.
# The default uShare behaviour is to not add the entry in the media list
# This option overrides that behaviour and adds the non-iconv'ed string into
# the media list, with the assumption that the renderer will be able to
# handle it. Devices like Noxon 2 have no problem with strings being passed
# as is. (Umlauts for all!)
#
# Options are TRUE/YES/1 for override and anything else for default behaviour
USHARE_OVERRIDE_ICONV_ERR=true

# Enable Web interface (yes/no)
USHARE_ENABLE_WEB=yes

# Enable Telnet control interface (yes/no)
USHARE_ENABLE_TELNET=no

# Use XboX 360 compatibility mode (yes/no)
USHARE_ENABLE_XBOX=no

# Use DLNA profile (yes/no) if libdlna is also used.
# This is not needed with this custom3 build of uShare-1.1a
# This is needed for PlayStation3 to work (among other devices)
USHARE_ENABLE_DLNA=yes

#EOF

Start

/etc/init.d/ushare start

Package Changes:

Moved everything to /usr/local/, with the execption of the init script..

Package Contents:

./etc/init.d/ushare
./usr/local/bin/ushare
./usr/local/etc/ushare.conf
./usr/local/include/upnp/ixml.h
./usr/local/include/upnp/FreeList.h
./usr/local/include/upnp/LinkedList.h
./usr/local/include/upnp/ThreadPool.h
./usr/local/include/upnp/TimerThread.h
./usr/local/include/upnp/iasnprintf.h
./usr/local/include/upnp/ithread.h
./usr/local/include/upnp/upnpconfig.h
./usr/local/include/upnp/upnp.h
./usr/local/include/upnp/upnptools.h
./usr/local/lib/libixml.so.2.0.3
./usr/local/lib/libixml.so.2
./usr/local/lib/libixml.so
./usr/local/lib/libixml.la
./usr/local/lib/libixml.a
./usr/local/lib/libthreadutil.so.2.1.0
./usr/local/lib/libthreadutil.so.2
./usr/local/lib/libthreadutil.so
./usr/local/lib/libthreadutil.la
./usr/local/lib/libthreadutil.a
./usr/local/lib/libupnp.so.2.0.3
./usr/local/lib/libupnp.so.2
./usr/local/lib/libupnp.so
./usr/local/lib/libupnp.la
./usr/local/lib/libupnp.a
./usr/local/lib/pkgconfig/libupnp.pc
./usr/local/share/locale/fr/LC_MESSAGES/ushare.mo
./usr/local/share/locale/de/LC_MESSAGES/ushare.mo
./usr/local/share/man/man1/ushare.1

Note: If installing over an earlier version, remove the ushare binary from /usr/bin/

Todo: Install script to check for older versions & config duplication.

Compile from Source

  1. Install the Precompiled C development environment, running on the LS
  2. Then get the source files install them
wget http://ushare.geexbox.org/releases/ushare-0.9.7.tar.bz2
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 ushare

tar -xvjf ushare-0.9.7.tar.bz2
cd ushare-0.9.7
./configure (--prefix=/usr/local --sysconfdir=/etc)?
make 
make install

Configuration

At first you need to be sure that you have setup a multicast route for UPnP messages. If you don't but have a default route attributed, then this later will be used. Otherwise, simply declare a new route for UPnP multicasts (for example using eth0 interface) :

route add -net 239.0.0.0 netmask 255.0.0.0 eth0

To complete the installation, you must edit /etc/ushare.conf or /opt/etc/ushare.conf on an ipkg install to add the location(s) of your media files.

/etc/ushare.conf

# /etc/ushare.conf
# Configuration file for uShare

# uShare UPnP Friendly Name (default is 'uShare').
USHARE_NAME=

# Interface to listen to (default is eth0).
# Ex : USHARE_IFACE=eth1
USHARE_IFACE=

# Port to listen to (default is random from IANA Dynamic Ports range)
# Ex : USHARE_PORT=49200
USHARE_PORT=49200

# Port to listen for Telnet connections
# Ex : USHARE_TELNET_PORT=1337
USHARE_TELNET_PORT=

# Directories to be shared (space or CSV list).
# Ex: USHARE_DIR=/dir1,/dir2
USHARE_DIR=/mnt/share/storage,/mnt/share/My-Documents/iTunes-Music,/mnt/share/My-Documents/my-Pictures

# Use to override what happens when iconv fails to parse a file name.
# The default uShare behaviour is to not add the entry in the media list
# This option overrides that behaviour and adds the non-iconv'ed string into
# the media list, with the assumption that the renderer will be able to
# handle it. Devices like Noxon 2 have no problem with strings being passed
# as is. (Umlauts for all!)
#
# Options are TRUE/YES/1 for override and anything else for default behaviour
USHARE_OVERRIDE_ICONV_ERR=

# Enable Web interface (yes/no)
ENABLE_WEB=yes

# Enable Telnet control interface (yes/no)
ENABLE_TELNET=

# Use XboX 360 compatibility mode (yes/no)
ENABLE_XBOX=yes

# Use DLNA profile (yes/no)
# This is needed for PlayStation3 to work (among other devices)
ENABLE_DLNA=

Then you can create a start/stop script

/etc/init.d/ushare

#!/bin/sh
### BEGIN INIT INFO
# Required-Start: $local_fs $syslog
# Required-Stop:
# Default-Start:  2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop ushare
# Description:
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/bin/ushare
NAME=ushare
DESC="uShare UPnP A/V Media Server"
PIDFILE=/var/run/ushare.pid

[ -r "/etc/ushare.conf" ] && . /etc/ushare.conf

# abort if no executable exists
[ -x $DAEMON ] || exit 0

# abort if no shared directory is defined
[ -z "$USHARE_DIR" ] && exit 0

set -e

checkpid() {
  [ -e $PIDFILE ] || touch $PIDFILE
}
case "$1" in
  start)
    echo -n "Starting $DESC: $NAME"
    checkpid
    start-stop-daemon --start --quiet --background --oknodo \
      --make-pidfile --pidfile $PIDFILE \
      --exec $DAEMON -- $USHARE_OPTIONS
    echo "."
  ;;
 stop)
    echo -n "Stopping $DESC: $NAME"
    start-stop-daemon --stop --signal 2 --quiet --oknodo --pidfile $PIDFILE
    echo "."
  ;;
  reload|force-reload)
    echo -n "Reloading $DESC: $NAME"
    start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile $PIDFILE --e$
    echo "."
  ;;
  reload|force-reload)
    echo -n "Reloading $DESC: $NAME"
    start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile $PIDFILE --e$
    echo "."
  ;;
  restart)
    $0 stop
    $1 start
  ;;
  *)
    N=/etc/init.d/$NAME
    echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
    exit 2
  ;;
esac

exit 0

Run at Startup

And run the following to have it startup and stop on system start/shutdown

cd /etc/rc.d/rc2.d
ln -s ../init.d/ushare S99ushare
cd ../rc0.d
ln -s ../init.d/ushare K02ushare
cd ../rc6.d
ln -s ../init.d/ushare K02ushare

Usage

uShare runs from the console only. It supports the usual --help option which displays usage and option information.

Command Line Options

uShare (version 1.1a), a lightweight UPnP A/V and DLNA Media Server.
Benjamin Zores (C) 2005-2007, for GeeXboX Team.
See http://ushare.geexbox.org/ for updates.

Usage: ushare [-n name] [-i interface] [-p port] [-c directory] [[-c directory]...]
Options:
 -n, --name=NAME        Set UPnP Friendly Name (default is 'uShare')
 -i, --interface=IFACE  Use IFACE Network Interface (default is 'eth0')
 -f, --cfg=FILE         Config file to be used
 -p, --port=PORT        Forces the HTTP server to run on PORT
 -q, --telnet-port=PORT Forces the TELNET server to run on PORT
 -c, --content=DIR      Share the content of DIR directory
 -w, --no-web           Disable the control web page (enabled by default)
 -t, --no-telnet        Disable the TELNET control (enabled by default)
 -o, --override-iconv-err       If iconv fails parsing name, still add to media contents (hoping the renderer can handle it)
 -v, --verbose          Set verbose display
 -x, --xbox             Use XboX 360 compliant profile
 -d, --dlna             Use DLNA compliant profile (PlayStation3 needs this)
 -D, --daemon           Run as a daemon
 -V, --version          Display the version of uShare and exit
 -h, --help             Display this help

uShare expects at least one directory argument (-c argument), specifying where multimedia files are stored. You should probably also use the -i option to specify which interface uShare should listen on.

 ushare -i eth0 -c /shares

Web Interface

You can also perform remote control of uShare UPnP Media Server through its web interface. This let you define new content locations at runtime or update the currently shared one in case the filesystem has changed. After starting ushare you can go to the web interface to manage it's shares: http://linkstation:49200/web/ushare.html

After starting ushare you can go to the web interface to manage it's shares: http://linkstation:49200/web/ushare.html

References

  1. GeeXboX uShare : A free UPnP A/V Media Server for Linux.
  2. Ushare - GeeXboX wiki
  3. GMediaServer : the original Media Server on which uShare was based.
  4. GeeXboX : the Linux multimedia distribution that uses djmount to provide access to UPnP contents.
  5. SDK for UPnP Devices (libupnp): An Open Source UPnP Development Kit.