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

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search
m (ARM9)
Line 34: Line 34:
====Manual download====  
====Manual download====  
[http://downloads.linkstationwiki.net/Users/kaiten/ushare-1.0+libupnp-1.4.6_arm9.tgz ushare-1.0+libupnp-1.4.6_arm9.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]
cd /tmp
cd /tmp
wget http://downloads.linkstationwiki.net/Users/kaiten/ushare-1.0+libupnp-1.4.6_arm9.tgz
wget http://downloads.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
tar -C / -xzvf ushare-1.0+libupnp-1.4.6_arm9.tgz
ldconfig -v
ldconfig -v

Revision as of 02:26, 11 September 2007



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


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 ushare
  • You may also need to install libupnp in order to get ushare to work:
ipkg install libupnp
  • 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



cd /tmp
wget http://downloads.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').

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

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

# Directories to be shared (space or CSV list).
# Ex: USHARE_DIR=/dir1,/dir2

# 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


/etc/init.d/ushare start

Package Changes:

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

Package Contents:


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
make install

Then configure, make and install ushare

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


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 netmask eth0

To complete the installation, you must edit /etc/ushare.conf to add the location(s) of your media files.


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

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

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

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

# Directories to be shared (space or CSV list).
# Ex: USHARE_DIR=/dir1,/dir2

Then you can create a start/stop script


# 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:

DESC="uShare UPnP A/V Media Server"

[ -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
    echo -n "Starting $DESC: $NAME"
    start-stop-daemon --start --quiet --background --oknodo \
      --make-pidfile --pidfile $PIDFILE \
      --exec $DAEMON -- $USHARE_OPTIONS
    echo "."
    echo -n "Stopping $DESC: $NAME"
    start-stop-daemon --stop --signal 2 --quiet --oknodo --pidfile $PIDFILE
    echo "."
    echo -n "Reloading $DESC: $NAME"
    start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile $PIDFILE --e$
    echo "."
    echo -n "Reloading $DESC: $NAME"
    start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile $PIDFILE --e$
    echo "."
    $0 stop
    $1 start
    echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
    exit 2

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


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

Command Line Options

-n --name=NAME Set UPnP Friendly Name (default is 'uShare')
-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

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


  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.
Link.png This article is currently a stub. You can help this Wiki by expanding it

. This template will categorize articles that include it into Category:Stubs.