TwonkyVision UPnP MediaServer

http://www.twonkyvision.de/banner/twonky-banner03.gif

= Twonkyvision = The TwonkyVision MediaServer enables you to share all your Music, Pictures and Videos throughout your home. It is available for many different platforms and interworks with a large variety of client devices including XBox 360™ and Sony PSP™. TwonkyMedia needs fewer resources and is faster than other UPnP Media Servers, but still provides more features which help the user to enjoy large media collections.

There are different ways to install Twonky onto the Linkstation


 * 1) The installer that comes with V3.1
 * 2) Frenchy's script from Yahoo Groups
 * 3) Precompiled binary for the LS-Pro (ARM9)

=PPC and MIPSel=

Installer
You need telnet access enabled, so if you disabled it when you installed freelink, you need to

ln -s /etc/init.d/utelnetd /etc/rc2.d/S05utelnetd

Start NASSetup.exe and type your Linkstations IP then hit Send server- > NAS

Start the mediaserver

cd /etc/init.d ./twonkyvision start

Start and stop it at shutdown

Openlink
ln -s /etc/init.d/twonkyvision /etc/rc.d/rc2.d/S99twonkyvision ln -s /etc/init.d/twonkyvision /etc/rc.d/rc6.d/K92twonkyvision ln -s /etc/init.d/twonkyvision /etc/rc.d/rc0.d/K92twonkyvision

Freelink
ln -s /etc/init.d/twonkyvision /etc/rc2.d/S99twonkyvision ln -s /etc/init.d/twonkyvision /etc/rc6.d/K92twonkyvision ln -s /etc/init.d/twonkyvision /etc/rc0.d/K92twonkyvision

Configure it on port 9000 on your Linkstation

http://:9000

Frenchy script
Twonkyvision changed the name of the binaries from mediaserver to twonkymedia, this script looks for mediaserver, so, either alter the script or change the binary name.

LS1, LS HG owners should use the ppc-script LS2 owners should use the mips-script (there are different paths... /mnt/ vs. /mnt/hda/)

Create folder where Twonkyvision will run from according to script (you can alter this, but adjust the script too)

LS1,HG (ppc) mkdir /mnt/share/twonkyvision LS2 (mips) mkdir /mnt/hda/share/twonkyvision

Save the corresponding script below as twonky and put it in the just created folder. LS1,HG (ppc) cp /mnt/share/twonkyvision/twonky /etc/init.d/twonky chmod 755 /etc/init.d/twonky LS2 (mips) cp /mnt/hda/share/twonkyvision/twonky /etc/init.d/twonky chmod 755 /etc/init.d/twonky

Test it to see if it works and it's in the correct place...

cd /etc/init.d ./twonky start

It should tell you that Twonkyvision has started and what version is running. XP users should see a UPNP icon flash up saying a new device has been detected. Issue top and see that twonky is shown running, if not check the script is where it should be and if you changed it that it is correct.

top

./twonky stop

Obviously stops it and nothing should be running

./twonky restart

Should stop all pids and say wait 20 secs

Once you're sure it's all working OK create these links: Openlink

ln -s /etc/init.d/twonkyvision /etc/rc.d/rc2.d/S99twonkyvision ln -s /etc/init.d/twonkyvision /etc/rc.d/rc6.d/K92twonkyvision ln -s /etc/init.d/twonkyvision /etc/rc.d/rc0.d/K92twonkyvision Freelink

ln -s /etc/init.d/twonkyvision /etc/rc2.d/S99twonkyvision ln -s /etc/init.d/twonkyvision /etc/rc6.d/K92twonkyvision ln -s /etc/init.d/twonkyvision /etc/rc0.d/K92twonkyvision

ppc-script
PATH=/sbin:/bin:/usr/sbin:/usr/bin tag=TwkMediaServer facility=user.info [ -f /mnt/share/twonkyvision/mediaserver ] || exit 0 start {      ## Cleaning up processes left before start /sbin/killall -q -s9 "mediaserver" > /dev/null sleep 3 if [ -f /var/run/mediaserver.pid ] ; then logger -t ${tag} -p ${facility} -i 'ATTENTION: a var/run/pid was left behind at stop time...' echo "START: WARNING there was a /var/run/pid was left over running ..." #/sbin/killall -q -s9 "mediaserver" > /dev/null #sleep 3 rm -f /var/run/mediaserver.pid else echo "STARTING - NO staled PID found - Cleaning loop bypassed..." fi       echo "DONE WITH THE START CLEANUP ..." ## Starting the server echo "Starting the Twonky Mediaserver" cd /mnt/share/twonkyvision/ ./mediaserver -D logger -t ${tag} -p ${facility} -i 'Started the service: /mnt/share/twonkyvision/mediaserver' } 15 request stop {       echo "Stopping the Twonky Mediaserver" /bin/kill $(cat /var/run/mediaserver.pid) echo "Sent the killall Cmd to mediaserver processes..." if [ -f /var/run/mediaserver.pid ] ; then echo "Removing Pid ..." rm -f /var/run/mediaserver.pid else echo "NO pids needed to be removed ..." fi logger -t ${tag} -p ${facility} -i 'Stopped the MediaServer and removed pid' echo "Waiting for 20 seconds for server activities to finish stopping ..." sleep 20 } restartlog {       echo "RESTARTING the Twonky Mediaserver!" logger -t ${tag} -p ${facility} -i 'RESTARTING the MediaServer .... ' } case "$1" in       start)                start                ;;        stop) stop ;;       restart)                restartlog 		stop                start                ;; 	*) echo "Usage: cd /etc/init.d THEN ./twonky {start|stop|restart}" >&2 exit 1 ;; esac exit 0
 * 1) !/bin/sh
 * 1) description: Starts and stops the Twonkyvision mediaserver daemons
 * 2) used to serve uPnP music-pics-video files
 * 3) This script should be used for all ppc-based Linkstations
 * 4) pidfile: /var/run/mediaserver.pid
 * 1) Check that binary file exists
 * 1) START SECTION ####################
 * 1) STOP SECTION ####################
 * 2) Need to find a better way to stop the server
 * 3) some pids are left behind showing some mediaserver processes dont just stop upon SIGTERM-
 * 1) Actually the server needs sometime to stop gracefully
 * 1) RESTART SECTION ####################
 * 1) SCRIPT COMMANDS ####################

mips-script (LS2)
PATH=/sbin:/bin:/usr/sbin:/usr/bin tag=TwkMediaServer facility=user.info [ -f /mnt/hda/share/twonkyvision/mediaserver ] || exit 0 start {      ## Cleaning up processes left before start /sbin/killall -q -s9 "mediaserver" > /dev/null sleep 3 if [ -f /var/run/mediaserver.pid ] ; then logger -t ${tag} -p ${facility} -i 'ATTENTION: a var/run/pid was left behind at stop time...' echo "START: WARNING there was a /var/run/pid was left over running ..." #/sbin/killall -q -s9 "mediaserver" > /dev/null #sleep 3 rm -f /var/run/mediaserver.pid else echo "STARTING - NO staled PID found - Cleaning loop bypassed..." fi       echo "DONE WITH THE START CLEANUP ..." ## Starting the server echo "Starting the Twonky Mediaserver" cd /mnt/hda/share/twonkyvision/ ./mediaserver -D logger -t ${tag} -p ${facility} -i 'Started the service: /mnt/hda/share/twonkyvision/mediaserver' } 15 request stop {       echo "Stopping the Twonky Mediaserver" /bin/kill $(cat /var/run/mediaserver.pid) echo "Sent the killall Cmd to mediaserver processes..." if [ -f /var/run/mediaserver.pid ] ; then echo "Removing Pid ..." rm -f /var/run/mediaserver.pid else echo "NO pids needed to be removed ..." fi logger -t ${tag} -p ${facility} -i 'Stopped the MediaServer and removed pid' echo "Waiting for 20 seconds for server activities to finish stopping ..." sleep 20 } restartlog {       echo "RESTARTING the Twonky Mediaserver!" logger -t ${tag} -p ${facility} -i 'RESTARTING the MediaServer .... ' } case "$1" in       start)                start                ;;        stop) stop ;;       restart)                restartlog 		stop                start                ;; 	*) echo "Usage: cd /etc/init.d THEN ./twonky {start|stop|restart}" >&2 exit 1 ;; esac exit 0 =ARM9=
 * 1) !/bin/sh
 * 1) description: Starts and stops the Twonkyvision mediaserver daemons
 * 2) used to serve uPnP music-pics-video files
 * 3) this script should be used on the LS2
 * 4) pidfile: /var/run/mediaserver.pid
 * 1) Check that binary file exists
 * 1) START SECTION ####################
 * 1) STOP SECTION ####################
 * 2) Need to find a better way to stop the server
 * 3) some pids are left behind showing some mediaserver processes dont just stop upon SIGTERM-
 * 1) Actually the server needs sometime to stop gracefully
 * 1) RESTART SECTION ####################
 * 1) SCRIPT COMMANDS ####################

Precompiled Binary for LS-Pro (ARM9) and Freelink
To get Twonky easily working, you need a running Freelink on you LS-Pro. All you have to do is to download the package from twonkyvision. Download and unzip it to a directory on the large partition (/mnt/disk1/). This directory will be the home-directory of the twonky-server.

Now you should have a look at the readme-File which is included in the zip-package. This File contains further instructions to get it running stable. Don't forget to edit the twonky config-file (you have to set the path to the twonky home-directory)!

Now you can start the server to do a first test: In the home-directory you'll find a shell script which will start the server for you. If everything works fine you should set symbolic links to the rc.d-directorys to get it startet automatically after system-boot.

Step-by-Step - Guide:
 * 1) you need a running Freelink
 * 2) Download  and extract it to the large partition
 * 3) Read carefully the included Linux-HowTo.txt
 * 4) Open twonkymedia.sh and edit the work-dir (path to twonky)
 * 5) Try starting the server manually ("./twonkymedia.sh start")
 * 6) Try to connect via Web-Browser (http://ip-of-ls:9000)
 * 7) create symbolic Link in /etc/rc2.d (Name: S99twonkyserver, Path to twonkymedia.sh)
 * 8) create symbolic Link in /etc/rc0.d (Name: K99twonkyserver, Path to twonkymedia.sh)
 * 9) Reboot - that's it :-)

Precompiled Binary for LS-Pro (ARM9) and stock/modified firmware
Twonkyvision has published a new version (4.4 download here) this also works with the stock or a modified firmware if you've telnet access. Version 4.4 comes with an updater where you can enter IP and user account. The user is root with the appropriate password. Read the enclosed README! Thread:

Seeing as how the other Twonky links are no longer working, here's a link I found to version 4.4.6 (download here) found at this link

Step-by-Step - Guide:
 * 1) enable telnet and (re)set the root password (stock or jtymod5 firmware? Use ACP Commander. Note that you may not need to force EM mode in the instructions)
 * 2) have wget on your box (e.g. get addons.tar on your box and untar it with "tar -C / -xzvf "      (already installed in jtymod firmware)
 * 3) Unzip downloaded Twonky NASSetup folder, and modify install.nas: RC=/etc/init.d/twonky
 * 4) start the installer, enter IP of your LSPro, user is root and the appropriate password

If you modified install.nas as above you'll have the script twonky in /etc/init.d afterwards. To start twonky during boot you have to include a call to this script in /etc/init.d/rcS. Using vi to do so is strongly recommended! The line that has to be included is exec_sh twonky. I suggest to use vi to do this. Only if you're absolutely desperate with the use of vi you should do a echo "exec_sh twonky" >> /etc/init.d/rcS But be sure to use this exact line, especially with the two ">>" are important otherwise you could delete the startup script /etc/init.d/rcS and that'd really mess your box up!

Old Versions of TwonkyVision

V4.2

http://www.twonkyvision.com/Download/4.2/twonkymedia-linkstation-pro.zip

Usefull Links http://www.twonkyforum.com/