Copyright 2009-2012 by djg. All Rights Reserved.

Wonky Gibbon Ramblings



D-Link DNS-320 NAS, DebianSqueeze and Twonky Media Server 7

Posted on November 28, 2012 by danny

I gave myself a bit of a shock today by working out something in Linux that actually worked, all by mself! Obviously to any proper linux person it’s little more than a child’s first steps – but it was quite satisfying!

So …

Having got the NAS loaded with all my media files, I enabled the UPnP MediaServer that came with it – to discover it was total crap. And promptly disabled it again.

But the word on the street, is that the Twonky Media Server is good, so I thought, put that on it.

And indeed people have put it on the DNS-320. This post covers much of what needs to be done, providing a link to a build of Twonky for the ARM processor and instructions on how to configure.

The only problem, is that all the instructions are for the lightweight ffp Linux install – rather than debiansqueeze which I’m using (because of the subversion project posted about previously).

Nevertheless – I followed the instructions, and with a few variations … got it to work … which surprised me!

The main thing I did was to strip off every occurrence of /ffp wherever I saw it in a path eg: /ffp/opt/twonky/ became /opt/twonky/
I did this both with the instructions in the blog post and with the content of the two scripts downloaded by those instructions ‘twonky.sh’ and ‘twonkyserver-default.ini’
Note: Two things to be aware of here: 1) Don’t edit these files with Windows Notepad, it messes up the line feeds at the end of each line such that linux doesn’t like the result! The free editor Notepad++ can probably handle it. 2) The debiansqueeze equivalent of the /ffp/start directory is /etc/inet.d so drop the twonky.sh file in there.

twonky.sh
#!/bin/sh

# PROVIDE: twonky
# REQUIRE: LOGIN

. /etc/ffp.subr
name="twonky"
start_cmd="twonky_start"
stop_cmd="twonky_stop"

twonky_start()
{
# Add a route for twonky to be published via UPNP
route add -net 224.0.0.0 netmask 240.0.0.0 dev egiga0 >/dev/null 2>/dev/null </dev/null &
cd /opt/twonky
mkdir -p /opt/twonky/data/ &
# Twonky requires one handle per monitored filesystem if inotify is
# used. On many devices, this is set to 8192, which might be too low
# if music or photos are scanned. Therefor this value is raised to
# the doubled amount. If more is required, change the value below.
# Thanks Michael for reporting this!
/sbin/sysctl fs.inotify.max_user_watches=16384 >/dev/null 2>/dev/null </dev/null &
# The line below is without logging (logs are written to /dev/null).
# If you want logging, exchange it with the line below the current one.
/opt/twonky/twonkystarter -logfile /dev/null -appdata /opt/twonky/data/ >/dev/null 2>/dev/null </dev/null &
# /opt/twonky/twonkystarter -logfile /opt/twonky/data/TwonkyMediaServer-log.txt -appdata /opt/twonky/data/ >/dev/null 2>/dev/null </dev/null &
}

twonky_stop()
{
# Kill Twonky
if [ -n "`pidof twonkyserver`" -o -n "`pidof twonkystarter`" ]; then
echo "Stopping twonkyserver"
kill -9 `pidof twonkyserver` `pidof twonkystarter`
fi

if [ -n "`pidof twonkyproxy`" ]; then
echo "Stopping twonkyproxy"
kill -9 `pidof twonkyproxy`
fi

if [ -n "`pidof twonkywebdav`" ]; then
echo "Stopping twonkywebdav"
kill -9 `pidof twonkywebdav`
fi
# Remove the route
route del -net 224.0.0.0 netmask 240.0.0.0 dev egiga0 >/dev/null 2>/dev/null </dev/null &
}

run_rc_command "$1"
twonkyserver-default.ini
#!/bin/sh

# PROVIDE: twonky
# REQUIRE: LOGIN

. /etc/ffp.subr
name="twonky"
start_cmd="twonky_start"
stop_cmd="twonky_stop"

twonky_start()
{
# Add a route for twonky to be published via UPNP
route add -net 224.0.0.0 netmask 240.0.0.0 dev egiga0 >/dev/null 2>/dev/null </dev/null &
cd /opt/twonky
mkdir -p /opt/twonky/data/ &
# Twonky requires one handle per monitored filesystem if inotify is
# used. On many devices, this is set to 8192, which might be too low
# if music or photos are scanned. Therefor this value is raised to
# the doubled amount. If more is required, change the value below.
# Thanks Michael for reporting this!
/sbin/sysctl fs.inotify.max_user_watches=16384 >/dev/null 2>/dev/null </dev/null &
# The line below is without logging (logs are written to /dev/null).
# If you want logging, exchange it with the line below the current one.
/opt/twonky/twonkystarter -logfile /dev/null -appdata /opt/twonky/data/ >/dev/null 2>/dev/null </dev/null &
# /opt/twonky/twonkystarter -logfile /opt/twonky/data/TwonkyMediaServer-log.txt -appdata /opt/twonky/data/ >/dev/null 2>/dev/null </dev/null &
}

twonky_stop()
{
# Kill Twonky
if [ -n "`pidof twonkyserver`" -o -n "`pidof twonkystarter`" ]; then
echo "Stopping twonkyserver"
kill -9 `pidof twonkyserver` `pidof twonkystarter`
fi

if [ -n "`pidof twonkyproxy`" ]; then
echo "Stopping twonkyproxy"
kill -9 `pidof twonkyproxy`
fi

if [ -n "`pidof twonkywebdav`" ]; then
echo "Stopping twonkywebdav"
kill -9 `pidof twonkywebdav`
fi
# Remove the route
route del -net 224.0.0.0 netmask 240.0.0.0 dev egiga0 >/dev/null 2>/dev/null </dev/null &
}

run_rc_command "$1"

NB: These scripts are provided for reference only – more current versions may vary.

Also – I didn’t bother with this line [[ $(ls -1 /mnt|grep -c HD_a2) -eq 0 ]] && sed -i -e ‘s!/HD_a2!/HD/HD_a2!g’ -e ‘s!/HD_b2!/HD/HD_b2!g’ /ffp/opt/twonky/twonkyserver-default.ini
in the instructions – it does a search and replace – but it doesn’t seem necessary.

Finally the ‘twonky.sh’ script makes use of a script called ‘ffp.subr’ which I think is used to start and stop the twonky service. This doesn’t exist in Debiansqueeze. There is probably some native way of achieving the same thing – but I don’t know what it is so instead, I went and found the download for ffp – unpacked it, and retrieved the script. There’s nothing specific to ffp in it so I dropped it into the /etc directory. You do need to go through the file and remove /ffp off the start of any paths that it appears in.

Then as instructed, I ran the twonky,sh script to start the service and connected via a web browser – and OMG!!!! IT WORKED!!!! First time too, which usually only happens to people who are either (a) lucky or (b) liars.

Once I had configured the server through the web page, I left it to get on with the job of indexing my media collection. This was a task that UPnP service that came with the NAS had taken all night to do. Twonky seemed to do it in minutes. Not only that, connecting using Windows Media Player, it downloads the metadata from Twonky so much more rapidly. Streaming of both audio and video is very rapid and smooth as is seeking to a certain spot in the video. All in all – very impressed with Twonky. It’s good.

There are three reasons, changing all this stuff worked:
1) All the scripts use the sh shell which is of course available in both ffp and debiansqueeze (ie the syntax was the same)
2) The folder structures of ffp and debiansqueeze are very similar.
3) Can’t remember – it’ll come back to me.

The only reference for this post, is to thank (again) Uli author of the http://nas-tweaks.net site
for this page http://nas-tweaks.net/384/installation-of-twonky-server-7-on-nas-devices/

Orbitsound – T4 Review 0

Posted on May 31, 2011 by danny

The marketing bumph for this is mostly keen to tell you about the incredible sound technology built in to the T4, how it’s spacial technology provides a stereo sweet spot wider than an outsize sombrero and all in a package the size of a pint of milk.

Well I’m here to tell you that the sound isn’t that great. It’s okay, sure. But it’s not great. The bass lacks punch and the mid is overbearing. Well what did you expect? As Scotty will say (come the 23rd century) “you cannae defy the laws of physics” and I put it to you that for this listener this remains true. It is very hard to get decent bass out of small speakers – the mid will tend to dominate.

Which begs the question? “Why do I love the Orbitsound – T4?” becaue I have to tell you, I do – I really do. In fact, I think it’s a fabulous piece of kit.

The size of a couple of pints of milk – you get all this:
– DAB and DAB+ radio
– FM Radio
– Internet Radio (inlcuding Podcasts such as from the BBC)
– Support for UPnP Media Playing
– iPod suport
– Aux in
– EQ
all for about 70 english pounds.

But it gets better. For a device this size, the UI is REALLY good. This if for two reasons. First the display can manage 6 lines of about 25 characters so the developers had plenty of space to work with. Second, the UI is quite rich. A display this size, allows a nicely nested menu system. Selecting a podcast from the BBC is not the keyhole surgery of the two line display of the Revo Mondo say (that I’ve known and loved for the last few years) – it’s actually pleasurable. For someone who listens to a lot of talk radio / podcasts (Radio 4 darling!) it’s a boon.

The switch on / boot time is practically instantaneous and the time to find and connect WiFi to the router if using Internet Radio or UPnP is very quick compared to other devices.

The controls are arranged around the top surface and there’s no remote control which does make the T4 only really suitable for smaller spaces in the home such as a Kitchen or as a bedside radio. As you return to a function previously used it automatically retunes to the last station selected, or in the case of an iPod, unpauses it (when you move from the iPod to something else, it pauses it again – nice touch).

In fact given the size and style of the device, you could actually use it as a device to drive an external HiFi in a similar role to something like a Revo Mondo and it wouldn’t look at all out of place and the sound quality would be well, HiFi. And given that the thing you really want on a remote is a volume control, the lack of a remote then isn’t a big deal.

My only other gripe is that the floppy wire aerial is a bit position sensitive when listening to DAB – but that’s a small detail.

All in all – I’m impressed. The developer who coded up the firmware gave a damn and it shows. There are just lots of nice little touches as though the engineers had actually used their own product (heaven forbid!) This is a good piece of kit at a great price. Well done Orbitsound! Can’t say I understand your marketing though.

WMP12 and UPnP problems 0

Posted on May 11, 2011 by danny

So … I’m trying to use Windows Media Player 12 on Windows 7 (32 bit) as a UPnP server. I enable all the things I’m supposed to enable. My Revo Mondo can “see” the server, it can even browse the files. But as soon as it tried to play them … nada!
So I try with my laptop. Same result. It can’t play the files.
Just to complete the loop, I try with my Android phone – again – it can list the files but not play them.

I try setting permissions on the files “everyone can read them” etc… no change.

In desperation I try using TVersity instead – but it appears to have the same problem. And additionally seems unable to cope with the size of the mp3 library.

A lot of browsing leads to lots of links on the Microsoft site that seem to have been removed. Only slightly annoying.

Finally – I work it out.

Like many people – my media collection has built up over many years. Either on an external drive, or on a secondary internal drive that gets pulled out of the old machine and plonked in the new one every time I upgrade my PC. Of course, when you do this (either with an external drive or with an internal one), the permissions on the files all relate to the old machine. So in effect, the new Windows 7 installation thinks that the drive is actually remote and refuses to serve the media.

If you copy the media (or a small subset of it) to the local drive and make it part of the music library – you suddenly find you can play it on your UPnP clients. Which is a solution if your system drive has the space. But if it doesn’t you’re still stuffed.

Eventually, I found the answer here http://forums.techarena.in/media-player/1168138.htm. God bless “Vincent”, whoever you are.

The solution is as follows:
1. Click Start, click Run, type regedit, and then click OK.
2. In the registry tree (on the left), expand HKEY_LOCAL_MACHINE, SOFTWARE,
Microsoft, MediaPlayer, and then Preferences.
3. Right-click HME, point to New, and then click DWORD Value.
4. Type EnableRemoteContentSharing, and then press ENTER.
5. Right-click EnableRemoteContentSharing, and then click Modify.
6. In the Value data text box, type 1, and then click OK. If you later
decide to disable remote content sharing, you can repeat this procedure and
change the value to 0.

To repeat, even though this text is talking about RemoteContentSharing and technically your content is not remote (it’s either on an external drive attached to the machine, or an internal secondary drive) – Windows thinks it is because of the obsolete permissions on the files. Following the steps above, will make your world a better place, full of whatever sounds fill your mp3 collection.

Revo Mondo and Serving Network Shared mp3’s via UPnP 2

Posted on May 08, 2009 by danny

After much agonising over DAB and various Internet Streaming devices, I recently bought a Revo Mondo Wireless Network Internet Radio Streaming device.

And it’s very liberating – I find myself listening to all sorts of new radio I would never have got around to finding before.

Obviously you can listen to streamed radio from all over the world, all the various “Listen Again” items on the various BBC Radio sites, plus play mp3 and other audio media stored elsewhere on my home network.

Network sharing of mp3 media was a major reason for getting the device. The standard way the Revo Mondo does this is for you to navigate to the network share where your mp3’s are stored. It then scans them and stores a cache index file away on that network share so that the process is quicker next time around. All of which is quite nice (if you don’t know any better).

But having to grant write access to the network share just so that the Radio streamer can store its cache file is clearly arse. There has to be a better way…
Read the rest of this entry →



↑ Top