Yes it is possible to run Twonky Server on the Alt-F firmware for DNS-323

1,667 views
Skip to first unread message

Steven Mackenzie

unread,
Jun 29, 2018, 7:25:21 AM6/29/18
to al...@googlegroups.com
Update: 
João made a twonky package for the Alt-F - install it via the Alt-F UI from Packages > Alt-F, then you will find it in the Service > User list in the Alt-F to configure and start - João gives details in his post, below.
 
My old clunky way of installing:

The Alt-F admin UI provides at least two other DNLA/UPNP media server options, MiniDLNA (now known as ReadyMedia, but the service is still called minidlna) and MediaTomb (which is no longer maintained). I tried both of them, and liked MiniDLNA best because its default media navigation made more sense to me, using Album Artist rather than track Artist in the default navigation of music files. It was very quick to navigate even very large folders, and it was serving the images that I expected for my CDs (from folder.jpg cover art images on the file system I think). The latest version of minidlna, 1.2.1, was available through the Alt-F package installer.

It took me some time to discover that after using the Alt-F admin UI to install a new service (Packages > Alt-F), the service does not start until it is configured in the Alt-F admin UI (Services > User). Easy now that I know.

The process to install Twonky is a little more manual, but in brief, visit http://download.twonky.com/ to download the generic Linux ARM little endian uclibc 0.9.2 version (not the dns-323 version), unpack it, and create symlinks to two libraries that twonky expects to be numbered differently (see the starttwonkyXXX.sh script, and more detailed steps below). 

Twonky is closed source, non-free, commercial, paid for software, and if you're happy with the costs, then it offers fast indexing and navigation of media files, and good support for serving files to different renderers (players) which often have quirks to work around. Most Twonky configuration can be done via the web UI that it runs on port 9000, but if you want to go deeper you can edit the twonkyserver.ini file and perhaps the resources/view_definitions.xml file to customise further. Twonky Server has a long history of updates for many platforms, available to download at http://download.twonky.com/.

In a quick test of Twonky 8.5.1 against MiniDNLA 1.2.1, twonky was quicker to build its initial file DB of 16,000 music files and 330 video files; it used less CPU while it was doing it. After the build, "top" reported less memory usage for twonky vs minidnla: 17.8MB vs 25MB for similar indexes.

These are the steps I took to run the 8.5.1 install on my DNS-323 with Alt-F 1.0 firmware. I expect there are better ways to get this running, for example, so that it starts and stops with the NAS. Please offer advice if you can see a better way to do this :)

I run twonky from a normal user account. In my install I create a Twonky appdata folder inside the install folder. I've ended up with a history of Twonky install folders on my disk like this:
drwxrwxrwx    6 504      703           4096 Apr 26  2015 twonky639
drwxrwxrwx    6 504      703           4096 Apr 26  2015 twonky728
-rwxr-xr-x    1 twonky   users         2998 Jun 29 09:58 starttwonky851.sh

And also set of simple start scripts that look like this:
-rwxrwxrwx    1 504      703           2465 Apr 26  2015 starttwonky639.sh
-rwxrwxrwx    1 504      703           2638 Apr 26  2015 starttwonky728.sh
-rwxr-xr-x    1 twonky     users          2472 Nov 25  2017 starttwonky851.sh

The start scripts start twonky using a command line that includes the -appdata and -logfile command line options, which allows me to very easily switch between them if I want to try out a newer version.

My steps to install are:
- Visit the Alt-F admin UI (Setup... > Users) and create a user account called twonky
- Log in (ssh) to the twonky user account
- Get the latest release, currently 8.5.1 (eg, wget http://download.twonky.com/8.5.1/twonky-armel-uclibc-1.0.9-8.5.1.zip )
- Create a new directory for the new release (so for Twonky version 8.5.1, mkdir twonky851)
- Unpack the release zip file into the new folder ( unzip twonky-armel-uclibc-1.0.9-8.5.1.zip -d twonky851 )
- Create a starttwonky851.sh script, and edit it to point to the new install (see below, edit the second line only)
- Run ./starttwonky851.sh (you can now log out of the shell and the server will keep running) 
- Visit http://your.nas.address:9000/ in a browser to setup the folders that you want to include

My starttwonkyXXX.sh files look like this (where XXX is the version numbers):
#!/bin/sh
TWONKYDIR=/home/twonky/twonkyXXX

# Stop any twonky server that is already running
killall twonkystarter && sleep 5
# ...waiting for a clean shutdown avoids a database rebuild at the next start

killall -9 twonkystarter
killall -9 twonkyserver
killall -9 twonkymedia

APPDATADIR=${TWONKYDIR}/appdata
TWONKYLOG=${APPDATADIR}/twonkyserver-log.txt
TWONKYSRV=twonkystarter

cd ${TWONKYDIR}

# For a D-Link NAS with Alt-F v1 firmware: 
# create symlinks to the numbered versions of libraries that Twonky expects
test -e /lib/libpthread.so.1 || test -e ${TWONKYDIR}/libpthread.so.1 || ln -s /lib/libpthread.so.0 ${TWO
NKYDIR}/libpthread.so.1
test -e /lib/libc.so.1 || test -e ${TWONKYDIR}/libc.so.1 || ln -s /lib/libuClibc.so.0 ${TWONKYDIR}
/libc.so.1
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${TWONKYDIR}

# Create a directory for working files (-p for 'if not existing already'):
mkdir -p "${APPDATADIR}"

# Use a command line option to specify the location of the application data
# (which includes the ini file) and log file:
"./$TWONKYSRV" -logfile "${TWONKYLOG}" -appdata "${APPDATADIR}"

# If -appdata is not given on the command line and the user running twonky has a home
# directory then .twonky is created in the home directory and used for appdata.

# If Upload is enabled but no upload folders are specified then a directory 
# Twonky will be created and used for music, photo and video uploads

paco....@gmail.com

unread,
Jun 30, 2018, 5:29:57 AM6/30/18
to Alt-F
Wow, wonderful news! I'm happy with minidlna, but I had twonky installed in my dns-320L before installing Alt-f and I bought a license. I'll try it ASAP.
Thanks.

Chad Baker

unread,
Jun 30, 2018, 10:49:35 AM6/30/18
to Alt-F
Thank you for this. I will definitely try this out as I also used to have Twonkey installed prior to Alt-F

João Cardoso

unread,
Aug 8, 2018, 12:10:14 PM8/8/18
to Alt-F
Following your tips I created a package, now available at sourceforge, that automates all that.

Binaries are installed at /opt/twonky, working dir is /var/lib/twonky, configuration in /etc/twonky/twonky.conf (created if none exists). A /etc/init.d/S80twonky init script is available from the command line, with 'rctwonky' (start|stop|status|enable|disable) as shortcut. The service runs as the system's user 'twonky' and can be used and configured using Alt-F webUI. No embedding in the Alt-F webUI is possible, but it has its own web pages.
To configure, you must first register yourself, and as it is a commercial product, non-open-source/free/libre, you have to pay $20 after the first month if you want it.
I also found it to be lighter and more feature-enabled than minidlna, but transcoding is not feasible on the under powered D-Link boxes.
Enjoy


On Friday, 29 June 2018 12:25:21 UTC+1, Steven Mackenzie wrote:
The Alt-F admin UI provides at least two DNLA/UPNP media server options, MiniDNLA (now known as ReadyMedia, but the service is still called minidnla) and MediaTomb (which is no longer maintained). I tried both of them, and liked MiniDNLA best because its default media navigation made more sense to me, using Album Artist rather than track Artist in the default navigation of music files. It was very quick to navigate even very large folders, and it was serving the images that I expected for my CDs (from folder.jpg cover art images on the file system I think). The latest version of minidnla, 1.2.1, was available through the Alt-F package installer.

K Robert

unread,
Aug 13, 2018, 2:54:25 AM8/13/18
to Alt-F
Works perfectly!
Thanks!

Steven Mackenzie

unread,
Aug 18, 2018, 1:37:38 AM8/18/18
to Alt-F
Thank you - finally the integrated install and start experience that twonky deserves on the DNS-323.

To install:

Open the NAS Alt-F Admin UI in a web browser 
Navigate to the Packages > Alt-F page
Log in
Click the UpdatePackageList button
Wait for the update to complete
Find Twonky in the list of available packages
Click the install button

To configure
Navigate to the Services > User page in the NAS Alt-F Admin UI
Put a check mark tick in the Boot Enabled box for Twonky
Start the Twonky Service if you need to, and wait for the Status to be "Running"
Click the Configure button to configure Twonky through it's own setup pages

I entered my licence key (Twonky account credentials that I bought from the Twonky web site), and it was remembered after rebooting. (If the web page for Twonky requests a password it is those credentials that are needed).,

Steven Mackenzie

unread,
Aug 18, 2018, 1:42:30 AM8/18/18
to Alt-F
Minor observations:
It would be correct to change the file 
/opt/twonky/twonkyserver-default.ini
and edit the first line to change
contentbase=/
to 
contentbase=/mnt/

That will avoid users navigating in to the Alt-F filesystem when choosing content folders in the Twonky admin screen. It only has effect during initial set up, if twonky is already configured then the existing value will be retained.

Also, the description text for the Twonky Service in the Admin UI ends in a full stop/period character - none of the other services that I installed have a dot at the end of their description :)

Tom

unread,
Sep 8, 2018, 10:44:50 AM9/8/18
to Alt-F
Hi Steven & João,

Thanks so much for setting this up!

It's very timely as I was looking for a way to play local music on my Google Home and I remembered that I used to have Twonky on my DLINK.

It works perfectly and much easier to install than on FFP.

Out of interest why did you go with the generic version rather than the DNS-323 version? What's the difference?

Thanks again.

On Saturday, 18 August 2018 06:37:38 UTC+1, Steven Mackenzie wrote:

Steven Mackenzie

unread,
Sep 8, 2018, 12:23:17 PM9/8/18
to Alt-F
Because the generic version runs in Alt-F, the DNS323 version does not: the dns323 version crashes when you try to start it inside the Alt-F firmware.

The dns323 version from Twonky assumes you are using the original DLink firmware, with particular very old versions and locations of required supporting files.

As you said, the Alt-F package that João made us is much easier to set up and use :)
Reply all
Reply to author
Forward
0 new messages