This is an old revision of the document!
Installing Twonkymedia UPnP Server
This will allow proper UPnP serving to Playstation 3 & XBOX360 Consoles - something alot more interesting now they both support mpeg4 (Divx/Xvid) Codecs. UPnP is improved in 1.04 firmwares but this will add the feature to 1.03 Firmwares. This tutorial is originally from here - PS3 Forums
TwonkyMedia isn't free, but it includes a 30-day trial. According to their website, it currently costs $39.95 for a TwonkyMedia license (version 4.4.x). Twonky don't provide telephone or email support for software installed on to a DNS-323, so make sure that it is working for you properly before buying the license key.
Which Version to Install?
Twonky Server version 4.4.18 installs most easily and works well, but is no longer being updated for more recent UPnP clients or getting new features. Additionally it allows you to edit the navigation trees for example to include A-Z sorting of large music or video collections.
Currently the latest version is 6.0.1, which can also install and run without problem, but requires some configuration changes after installation. Extending the navigation tree requires editing XML files, or at least replacing the default XML files with downloaded versions (eg from this QNAP forum post)
Downloading the Twonky software
Download links for 4.X, 5.X and 6.X versions of the software are available from this links on this page of the Twonky website.
Instructions
Enable telnet
To install TwonkyMedia, you must first enable a telnet server on the DNS-323. Some might consider this hacking, and it does require some basic knowledge of Linux, so if you're not comfortable with Linux or don't want to modify your DNS-323's startup process and config, I would not recommend proceeding. (This is not a permanent change and can be easily backed out.)
Another way (and the way I went) was to install MLDonkey, which not only installs Telnet but also a edonkey/torrent interface for your DNS-323, all by copying a few files via ftp.
NOTE = Since the firmware 1.05, the DNS-323 has BitTorrent support.
Install TwonkyMedia 4.4.18
Now, you can install TwonkyMedia version 4.4 for D-Link DNS-323, dns323-4.4.11-20090108.zip. Version 4.4.18 is available from the Twonky website.
Twonky are not producing more 4.4.x versions; you can get version 5.0.x, 5.1.x or 6.x versions from the Twonky media site, but see the additional notes below.
Windows
The archive includes a setup program that will copy the necessary files to you NAS, and modify the boot files accordingly - no setup necessary. You just need to run the NASSetup.exe program on your PC, then follow the instructions.
The TwonkyMedia server will be installed at /mnt/HD_a2/twonky.
The TwonkyMedia autostart script will be installed at /mnt/HD_a2/starttwonky.sh.
The TwonkyMedia web interface will be accessible at http://<fill in your DNS-323's ip address>:9000/configpage/index.html
Other Operating Systems
If you need to install via some other operating system, you will need to FTP the files, and modify the autostart file, fun_plug to start twonkymedia.
Create the directory /mnt/HD_a2/twonky. Copy the following files and directories to /mnt/HD_a2/twonky: twonkymedia twonkymedia-default.ini cgi-bin plugins resources twonkymediaserver
Start server by running twonkymedia.
Additional Configuration for version 6.0.1 (also needed for version 5.X?)
After installing Twonky you will have a file called starttwonky.sh in the root of your first shared drive. You need to modify this file to avoid your DNS-323 breaking if you have a large media library (pink lights and missing file shares). If you do this from Windows then use a text editor that is aware of “Unix line endings”, like notepad++.
The example file below shows the suggested changes with comments.
#!/bin/sh route add -net 224.0.0.0 netmask 240.0.0.0 dev egiga0 cd /mnt/HD_a2/twonky # The lines above are written by the twonky installer and show the install # directory for this twonky installation. The new file and directory # that is created below should be inside it. # On the DNS-323, /tmp, /var and /mnt are in the root partition (/). The root # partition is entirely in RAM and has total size 9.7MB. # By default Twonky 6.0.1 is built to log to /tmp/TwonkyMediaServer-log.txt, # and other data is stored in /var and /mnt. # Two problems: # 1/ The available space in / is quickly filled, the DNS-323 stops serving files # and the status lights on the front go pink. # 2/ Any saved twonky configuration is lost after a reboot, including the # license key. # So we need to change the Twonky configuration to store this data on the big # disks instead. This is easy to do by editing the starttwonky.sh script (this file!) ## First create a directory for working files: # mkdir /mnt/HD_a2/twonky/appdata # or create it using Windows File explorer in \\yourNas\Volume_1\twonky # Add 2 command line options to change the location of the application data # (which includes the ini file) and log file: /mnt/HD_a2/twonky/twonkymedia -logfile /mnt/HD_a2/twonky/TwonkyMediaServer-log.txt -appdata /mnt/HD_a2/twonky/appdata & # You should also edit the file /mnt/HD_a2/twonky/appdata/twonkymedia-server.ini to # set suitable values for uploaded and cached media files using the settings for # servermanagedmusicdir, servermanagedpicturedir and servermanagedvideodir # More about command line options: Any option in the .ini file can be used with a # leading '-' on the command line. For example -disablelocalssdp 0 # You can test different options directly via HTTP (browser address bar) #http://twonky_IP:9000/rpc/set_option?disablelocalssdp=0
Symlinks could be used to fix the problem instead, described here: http://forum.dsmg600.info/viewtopic.php?id=5288
## First create a directory for working files: # mkdir /mnt/HD_a2/twonky/appdata # or create it using Windows File explorer in \\yourNas\Volume_1\twonky ## And a file for log data like this # touch /mnt/HD_a2/twonky/TwonkyMediaServer-log.txt Then add these lines near the beggining of starttwonky.sh: ln -s /mnt/HD_a2/twonky/appdata /var/twonkymedia ln -s /mnt/HD_a2/twonky/TwonkyMediaServer-log.txt /tmp
Alternative method for installing Twonky 6.0.30
(This alternative section - between the two groups of three parallel lines - was inserted by Briain on 07/02/2011)
I've just successfully updated a DNS-323 (Hardware Version B / D-Link FW 1.08) to Twonky 6.0.30 and have created an alternative starttwonky.sh file. It's based on adding the above recommended symlinks to the starttwonky.sh file, but in addition to the above, it first checks for the new directory and automatically creates it (same with the log file) if it's not already present (e.g. first time it's run). Basically, you can install Twonky 6.0.30, replace starttwonky.sh with the one below, reboot the D-Link and that's it done. I've tested it on a D-Link DNS323 (which has 32,000 FLAC files) and it all works well. With the below script and D-Link hibernation set to 15 minutes, the disks on my test NAS spin down in about 40 minutes; about ideal fer a media server.
First update your D-Link to 1.08 firmware, then install Twonky 6.0.30 as described above, but at the very start of the installation process, remove the tick from the 'start server' box (so it doesn't start as soon as it's installed and thus doesn't immediately fill up /var). Then copy the below script, paste it into Notepad++ and select EOL conversion to Unix format, then save it as starttwonky.sh
Copy this new version of the starttwonky.sh to the D-Link: You will have to either Telnet into it and either chmod 777 /mnt/HD_a2/starttwonky.sh (the existing Twonky created one) before you can drag and drop the new version onto the Volume_1 share (using Windows), or better still, drop it into a temporary directory, then Telnet in and copy it to overwrite the existing one*. Once you have replaced it with the below version, reboot the D-Link and it will start Twonky using the revised script and all will be well (then remember to set your media paths in the twonky config web page).
* If you create a new folder called 'temp' on the Volume_1 share, you can drop the new starttwonky.sh into it, then access the NAS using Telnet and type the below commands:
cd /mnt/HD_a2 (then hit the 'enter' key)
cp -i temp/starttwonky.sh . (then hit the 'enter' key)
You will be asked if you wish to over-write the existing file; type 'y' (then hit the 'enter' key)
You can now reboot the D-Link (you can simply type the word 'reboot' then hit the enter key).
#!/bin/sh # Twonky 6.0.31 replacement start-up script for D-Link DNS-323 NAS 11 February 2011 # Creates directories and symlinks to move db and cache from /var and log from /tmp # This protects NAS OS, prevents db rebuild at boot and loss of cache, settings etc # Multicast set to 224.0.0.0/4 /sbin/route add -net 224.0.0.0 netmask 240.0.0.0 dev egiga0 # Checks symlink folder exists (if not, creates it) and enables user tree changes if [ ! -f /mnt/HD_a2/twonky/sym_var ]; then /bin/mkdir /mnt/HD_a2/twonky/sym_var /bin/chmod -R u+rwx,g+rwx,o+rwx /mnt/HD_a2/twonky/resources/views /bin/sleep 1 fi # Checks relocated log file exists (if not, creates it) if [ ! -f /mnt/HD_a2/twonky/TwonkyMediaServer-log.txt ]; then /bin/touch /mnt/HD_a2/twonky/TwonkyMediaServer-log.txt /bin/sleep 1 fi # Creates symbolic links for the cache, db and log file /bin/ln -s /mnt/HD_a2/twonky/sym_var /var/twonkymedia /bin/ln -s /mnt/HD_a2/twonky/TwonkyMediaServer-log.txt /tmp /bin/sleep 10 # Starts Twonky in mode that enables better hibernation characteristics TWONKYSRV="/mnt/HD_a2/twonky/twonkymedia" $TWONKYSRV -powersavemode 1 &
Note 1 Don't worry if you forget to disable the 'start server' tick-box option during the installation process. The /var will fill up and the D-Link will show its pink lights, but you can still Telnet into it, delete the Twonky created starttwonky.sh file then reboot the D-Link (Twonky will not start). You can then add the revised starttwonky.sh and reboot the D-Link (which will then work okay).
Note 2 Optionally, once you have unzipped the Twonky 6.0.30 installation files (and before running the installation process) you can (if you wish) change the trees at this stage (my latest custom versions are available here on the Qnap forum). If you do not wish to do that at this stage, you can still change them later (without having to use Telnet) as the above script changes the permissions in the /twonky/resources/views directory (so the trees can also be changed by simply dragging and dropping them using Windows Explorer at a later date). After any tree changes, remember to perform a full Twonky database rebuild to pick up the new music menu.
General Notes Twonky will be slow the first time you browse album covers on your control point (it has to cache the images). It also seems to be very slow for the first few times you navigate the menu, but it soon settles down and runs very quickly. It doesn't fully rebuild the database when you restart the NAS, but it does rescan the contents (so it can take a while for large music libraries). The Media Receivers section in the Twonky config page can be set to suit your devices. If using a control point which can resize album art itself, it's best to select 'AssetControl DS Control Point' or 'Linn DS Control Point' against the MAC/IP address of your control point as this will make Twonky send full resolution art to the control point. That also speeds up the first art caching operation (after a database rebuild) as Twonky caches the full sized images (and thus doesn't have to use CPU to resize them). The 'Generic Media Receiver' entry resizes all images to 160 x 160 pixels (and will thus be slower when first browsing covers). Note that you will have to reset these 'media receiver' entries after performing a full database rebuild (a database rebuild resets them to 'Generic Media Receiver') though any custom set ones survive all rescans and reboots okay. Note that certain CP software (like Songbook or Chorus DS for the iPhone/iPad/iPod Touch) will set the media receivers entries automatically (so you don't have to bother setting them yourself).
(ESPAÑOL) Instalando Twonkymedia UPnP Server
Este producto le brindará un apropiado UPnP Server para las consolas PlayStation 3 y XBox 360 — algo mucho más interesante ahora que ambos soportar MPEG4 (DivX/Xvid) Codecs. UPnP fue mejorado en el firmware 1.04, pero habia sido agregado en el firware 1.03.
Este tutorial fue originalmente publicado aqui = PS3 Forums
TwonkyMedia NO ES GRATIS, es una versión de prueba por 30 días. De acuerdo con su sitio, el costo es actualmente de US$39.95 for una licencia de TwonkyMedia (version 4.4.x)
Instrucciones
Habilite telnet
Para instalar TwonkyMedia, ud debe primero habilitar un servidor de Telnet en el DNS-323. Hay quienes lo consideran un hackeo, y requiere un conocimiento básico de Linux. Si no se siente seguro en Linux o no quiere modificar el proceso de arranque y configuración de su DNS-323, le recomendamos no proceder (No es un cambio permanente y puede ser fácilmente recuperado).
Otra manera (y la que utilice) fue instalar MLDonkey, el cual no solo instala Telnet sino tambien una interface edonkey/torrent en tu DNS-323, todo copiando unos archivos via ftp.
NOTA = Desde el firmware 1.05, el DNS-323 tiene soporte a BitTorrent
* Instalar TwonkyMedia 4.4.11 *
Ahora, ud puede instalar la version 4.4.11 de TwonkyMedia para D-Link DNS-323 dns323-4.4.11-20090108.zip. Originally from Here.
Windows
El archivo incluye un programa de instalación que copiará los archivos necesarios a tu NAS, y modificará los archivos de inicio correspondientes. Ninguna configuración adicional es requerida.
Ud solo necesita ejecutar el programa NASSetup.exe en tu PC y seguir las instrucciones que se indican.
El servidor TwonkyMedia será instalado en /mnt/HD_a2/twonky.
El script de autoarranque de TwonkyMedia será instalado en /mnt/HD_a2/starttwonky.sh.
La pagina web de TwonkyMedia será accesible en http://<su IP del DNS-323's>:9000/configpage/index.html
Otros Sistemas Operativos
Si ud necesita instalar a través de otro sistema operativo, ud necesitará pasar por FTP los archivos, y modificar el archivo de autoarrnque, fun_plug, para iniciar el TwonkyMedia. (Favor ampliar estas instrucciones si lo considera necesario). Le recomendamos usar Windows !
Traducido por amunoz_tico