Copyright 2009-2020 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/

Configuring the D-Link DNS-320 NAS as an SVN Subversion server and connecting with VisualStudio 2010 4

Posted on November 23, 2012 by danny

Introduction

I recently found myself wanting to work on a programming project at home, using C# and VisualStudio 2010, and like any good developer realised I needed source control. Yes of course I could use Microsoft Sourcesafe, it does integrate nicely with VisualStudio. But lets be honest, it is a pile of crap, I’m used to TFS at work, I can’t be doing with Sourcesafe. Running my own TFS server is probably a bit over the top, I’m not sure I have the spare change in my back pocket for the licencing.

At the same time I was aware I wanted to move my RAID’ed storage / backup solution out of the media system under the telly where it currently lives, to a dedicated NAS device.

Two birds? One stone?

Being a tight arse I went over to Ebuyer and looked up the cheapest unit that supported RAID1 (mirroring) and gigabit transfer rates and found the D-Link DNS320 for £53 inc VAT without disks, it can take up to two 2TB drives. Thinking of my old Linksys router and remembering appliances often run linux under the hood, I had a bit of a google and found this page. Someone had got subversion running on it. Very cool!!

So I ordered one, waited a few days and once it arrived shoved a drive in it. Getting the device up and running was the job of a few minutes work. Getting subversion working – rather longer. Nevertheless – success was ultimately had. For reference, I am not a linux expert – in fact it would be fair to say, I know to next to nothing about it. But I like a challenge…

What will I end up with?

Whilst the DNS-320 ships with its own version of Linux in the firmware, we aren’t going to be able to bolt directly onto that. However there is an undocumented hook (called ‘fun_plug’ which I guess stands for functionality plugin) that is checked on startup and can be used to add additional functionality stored on the hard drive.

To get subversion running on the DNS-320 you need a linux installation that runs alongside the one in the firmware, in this case DebianSqueeze. Installing this does not affect the rest of the NAS and you wont see any impact on the web interface. Once you have DebianSqueeze installed and running, you install and configure the subversion package and away you go.

So what you end up with, is a NAS running linux, that runs DebianSqueeze linux as a plugin that hosts subversion.

Installation

Unfortunately it’s not that simple. To configure DebianSqueeze requires Telnet to be running on the NAS and unfortunately out of the box, this is not the case. Luckily there is a (convoluted) way to get a very thin linux install (ffp) with Telnet onto the box first and then use that to configure DebianSqueeze. Once that is done, the ffp install is not used any further.

This exceptionally well written blog post describes how to install ffp, the “Fonz fun_plug 0.5 for CH3SNAS, CH3MNAS, DNS-323”
Follow it all the way down to the section headed “Logging in using SSH”, but don’t disable Telnet in the last step, as you’re going to need it.

Next, download DebianSqueeze from here
Open the zip file. Inside is a “how to” and two other files. Follow the instructions in the file from Step 2 (you have in effect already done Step 1).
The very last step of renaming fun_plug.debian to fun_plug effectively discards ffp that we installed earlier, it having served it’s purpose.

Now that you have DebianSqueeze running you can install subversion.
This blog post here provides a step by step guide to do this.
Half way down he mentions the command:
# svnadmin create /var/svn/projectalpha
‘projectalpha’ should be replaced by whatever you want to call your repository.
Other than that, follow the blog exactly, all the way down to the point where it starts talking about running an ssh server on a custom port. You probably don’t need to do that so can stop there.

You now have subversion running on your NAS. Excellent!!

Connecting VisualStudio 2010

Although subversion is usually used with an Apache web server this is not actually necessary. The author of the previous post has avoided doing this opting to instead use the ssh server and communication protocol already installed with DebianSqueeze. This makes it more lightweight and conserves the limited RAM available on the box.

To get VisualStudio 2010 to work with subversion you need a plugin. A popular one is AnkhSVN which can be downloaded for free.

Once installed, assuming you don’t have the Tortoise SVN client installed then you need to help the plugin understand the ssh protocol before you can use it in VisualStudio.
This blog post describes how.
NB: The configuration file mentioned in the post is described as being in your My Documents\Application Data\subversion directory, this is in XP. In Windows 7, this folder now maps to here: c:\Users\<USERNAME>\AppData\Roaming\Subversion. You may need to set the Windows Explorer “Folder and Search Options” to “Show hidden files, folders, and drives” to be able to see the AppData folder.

Now restart VisualStudio.

First you need to enable Subversion as the source control plugin for VisualStudio. Go to “Tools->Options” and in the dialog go to the subsection “Source Control” and edit the “Plug-in Selection” to be AnkhSVN.

Now, you can connect to your Subversion repository using “File->Subversion->Open From Subversion.

In the dialog that pops up enter the URL of the subversion repository on your NAS box, which will look like this: svn+ssh://<NASBOX>/var/svn/<SvnRepositoryYouCreatedEarlier>
and you’re in!!!

So now you’ve got it all working. The only thing is this irritating “Plink.exe” window that keeps popping up. It has to go – it just has to.

Download TortoiseSVN from here, install it, find the file tortoiseplink.exe, rename it to plink.exe and replace your plink.exe with it. You can then uninstall TortoiseSVN again.

Hope this has been of help.

Now some thanks and references:
First and foremost Murzal Arsya who made it clear that this project could be done on the DNS-320, outlined the need for DebianSqueeze and provided the step by step instructions for setting up subversion on the NAS.
Next http://nas-tweaks.net which is a great resource for people wanting to use their NAS for more than just NAS and provided the amazing ffp stuff.
Then Shaunc for guidance on svn+ssh, cheers geeza!!
Finally Hao Chen for for the tip to get rid of the plink pop-up window http://haochen.wordpress.com/2011/02/22/hiding-the-plink-pop-up-window-in-netbeans-ide-using-svnssh/

NVIDIA Graphics Driver Installer Fails: The system cannot write to the specified device. 4

Posted on July 03, 2012 by danny

Just in case anyone runs into this problem and starts losing the plot!!

I was trying to install an earlier version of the NVIDIA display drivers for my graphics card today on Windows 7. Ones that MediaCentre would play nicely with.

Boy did I have to jump through some hoops!

Had to delete the version that Windows Update had downloaded otherwise it kept reinstalling them after the reboot – which was really annoying. Not trivial – you have to remove them from here:

C:\Windows\System32\DriverStore\FileRepository\nvdsp something something something. To delete them, you first need to take ownership of them (google that) and then once you have ownership set the permissions to provide full control. THEN you can remove them.

Then when I ran the NVIDIA installer it failed whilst trying to install the graphics driver component. Grrrr!

Then I tried installing it from Device Manager using “Update Driver” – and got this error message: “The system cannot write to the specified device.” – which lead me to believe that it couldn’t write to the card, or something in the windows directory – probably due to more bloody file permissions or whatever. And then I realised … that it wasn’t NVIDIA’s fault at all. My “Temp” folder was on a partition that was practically full. The installer couldn’t unpack the files. I cleaned out the temp folder – and hey presto – the drivers updated very happily indeed.

Net result – my kids can now watch “Peppa Pig” when they get up in the morning and I can sleep in. Praise your deity du jour!

Flickery HD on Freeview 0

Posted on July 03, 2012 by danny

So I’ve been having problems with HD on FreeView for ages. Sometimes it would just about work but other times the screen would go black for up to 4 seconds at a time – though the audio would continue uninterrupted. Some channels seemed worse than others – but then a channel that had been okay one day – would turn to crap the next.

I have top end Black Gold tuners and a more than adequate graphics card – so I put it down to reception. It had the feel of a reception problem, comments on other forums seemed to corroborate that, and I noticed that MediaCenter reported the signal strength as being around 66%.

However – I had an SSD failure last week so I had to replace the drive – I usually move the pagefile to a spin disk – but this time I left it on the SSD.

HD works. No flickering.

I never considered it would page – I thought 2GB RAM would be enough. But clearly it is not and the system is using the pagefile.

If it really is paging video data, which as we know is lots of data, it could wear the SSD out fairly quickly, even with the levelling algorithms they use. I shall investigate the quantity of traffic and report back…

Samsung LED TV with HDMI stretches Windows Desktop 2

Posted on August 02, 2011 by danny

Following on from my last post – I replaced the VGA and stereo audio cables with a single HDMI cable from the Graphics Card to the Samsung LED TV.

I had to reboot the Media Center for it to allow me to reassign the default audio output to the HDMI output but once I had restarted it let me do so. It looks like it detects whether the audio is connected as the machine boots rather than as a “hot” plug n play sort of thing.

Now for the nasty bit … the Windows desktop was now stretched beyond the sides of the screen. A good long search through the graphics driver controls yielded nothing to change the size and position.

Fiddling with the Samsung TV I then did find a setting that helped. Under Menu->Screen Adjustment there’s a setting called “Screen Fit” – the result of using this was that the desktop properly fitted on the screen. Problem was – it still looked wrong compared to the crisp output I’d had using the VGA cable. As though the screen had been stretched, introducing artifacts and then squashed again – leaving them behind.

Googling was required to solve the problem and I’m glad I did as I don’t think I’d have ever found the answer – and I’m endebted to this post for the answer:
http://ubuntuforums.org/showthread.php?t=1666329
The very first post nails the problem (ignore the rest of the thread). It says “Go into the menu on the TV and select Source List, Edit Name, then chose the HDMI and change the name to be either PC, DVI or DVI-PC. Either of these three setting should correct the over sized display issue.” – and the author is right. Giving a “Name” to the HDMI connection, corrects the problem. In fact the word name is really misleading, it’s really a “Type” – particularly as you pick the one you want from a list rather than choosing your own from scratch.

Making this setting, resolves the problem and removes the artifacts. Very confusing bit of UI from Samsung.

End result – great looking display and a reduction in the number of cables. So musn’t grumble.

Upgrading Media Center to HD 1

Posted on August 01, 2011 by danny

I’ve slowly been adding the ability to handle HD content to my media center of late. As usual, the machine is well underpowered so it always stretches the components.

I started by adding a Black Gold BGT3620 Dual HD tuner. This supports both Freeview and Freeview HD (as well as analogue and cable). Setup as always was very easy and it works with Windows 7 Media Center seamlessly. This is an expensive high end card. As mentioned in other posts, the key difference between this and other tuner cards is that Black Gold do a lot more of the stream processing on card rather than relying on the CPU to do the processing. This allows the rest of the machine to be a rather lower spec and prevents the CPU becoming a bottlekneck.

I then added a Samsung UE40D5000 40″ LED TV (which is excellent incidentally – the blacks are … err … very black!). This has a Freeview tuner built in (but not Freeview HD). I also didn’t go for any of the built in internet / iplayer gizmo’s that some of the more expensive Samsungs go for – on the grounds that since it’s attached to a PC – the PC is doing all of that.

Once the TV was connected up and the output from the graphics card altered to the new resolution it became clear that the move up from 720×576 to 1900×1080 was clearly a step to far and at this resolution the media center really started to struggle. SD content was ok, but any rapid movement in the HD content it could not cope with becoming stuttery and blocky. The Graphics Card, a GeForce 6200LE for PCI-E clearly couldn’t cope. Given this was launched in 2004 perhaps this isn’t surprising but it’s worth mentioning because until 2011 it was still being sold as a budget card around the £25 mark. It had a fill rate of approx 700 megapixels / second.

Taking the card out and relying on the onboard graphics capabilities of the motherboard, a Gigabyte GA-946GMX-S2 i946GZ actually improved performance which was unexpected. But then a new budget card was dropped in, the GeForce G210 (£27 inc Vat), launched in 2008. With a fill rate of 4.1 gigapixels / second, clearly much quicker. The result? HD playback is now flawless. As always I buy fanless cards for the media center – I want to listen to the movie, not the machine.

Along the way I also answered the question “Do graphics cards with hdmi output sound?” – Answer: In 2011, yeah, probably. Going back four or five years this used not to be the case, a card with HDMI may well not have had audio, indeed may not even have provided a connector to grab the audio from the motherboard or soundcard – but these days this would appear no longer to be the case, if a budget card like the G210 has onboard digital audio output to the HDMI cable, it seems likely that most other graphics cards will do as well. In the world of PC based media centers and gaming on TV’s this was probably an inevitability. A card supporting HDMI and not supporting audio is just, well, a bit pointless really.

My one remaining problem? The plastic surround on the HDMI cable is too fat preventing the connector from fully inserting into the HDMI socket of the card (it catches on the PC case). I either need to cut the extra plastic off OR buy a flatter one. Grrrrr.

Next I installed a Samsung Bluray drive to replace the existing DVD drive. This came bundled with CyberLink’s Powerdvd software and supports that products “TrueTheater” upscaling technology to upscale SD content on DVD to something approaching HD. You can use this in a split screen before and after mode to look at the changes. I turned off it’s colour lightening setting whilst setting the sharpening to the middle setting and tested it on some scenes from “The Lord of the Rings : The Two Towers” and the improvent is remarkable – definately no need to buy the Bluray version of the movie. The only slight niggle here, is that whilst the standalone version of Powerdvd works flawlessly, the embedded version that sits within MCE doesn’t quite display full screen leaving a black border.

So the system currently stands like this:
Gigabyte GA-946GMX-S2 i946GZ Socket 775 onboard VGA 8 channel channel mATX
Intel E2160 Socket 775 Pentium Dual Core 2×1.8Ghz 800FSB Retail Boxed Processor
Asus GeForce G210 SILENT 512MB DDR2 DVI VGA HDMI Out DirectX 10.1 Low Profile PCI-E Graphics Card
4GB Kingston DDR2 RAM

Next time out – I’ll be getting surround sound sorted out.

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.

Getting a SiliconImage Sil3114 SATA RAID card to work in Windows 7 13

Posted on October 29, 2010 by danny

I recently had the experience of moving a pair of RAID1 storage disks from one server to another. It was not without difficulty.
Both server’s had the OS on a third non RAIDed drive, so i didn’t have to worry about being able to boot from them (thank god!)

The server they came from, an old MSI AMD motherboard had a Promise RAID controller built in. The Gigabyte board I was moving to did not, so I had to add an additional RAID controller on a PCI card.
The board chosen used a chipset from SilconImage – the Sil3114. This is an inexpensive card offering RAID0,1,5,10 & JBOD.

The card as delivered plugged into an empty PCI slot easy enough. However the motherboard recognised this only some of the time. (This was subsequently either resolved by a BIOS update to the card – more on this later – or pushing down hard on the card to ensure it was fully in – not sure which).

The Sil3114 card can be used in one of two configurations. As a RAID controller for up to 4 SATA drives. This requires a SATA RAID bios to be installed on the card (the default) and some SATARAID5 manager software to be installed in Windows.
OR – it can be used as a straight disk controller for up to 4 SATA drives (no RAID) – this is called “SATA Link” and requires SATA Link software in Windows. You can also install a SATA Link “base” BIOS to the card as well, instead of the RAID one, but since the SATARAID BIOS has a pass thru mode which allows the use of drives in a non RAID configuration, it makes you wonder why you’d bother.

The job then was to plug the drives in, set them up as a RAID group without losing the data already on them and then get them visible and useable in Windows.

After plugging the drives in, I went into the Silicon Image SATA RAID BIOS utility. Here I was able to create a RAID1 group containing the two drives. I allowed it to re-mirror the data from one drive to the other as part of this. The mirroring process took several hours for my Samsung Spinpoint 500GB drives.

After booting into Windows, Windows 7 automatically downloaded a bunch of driver software which it seemed to think would work. It also added an item to the Windows Control Panel called “Silicon Logic SATA RAID”. Despite clicking on this item many times – it never did anything.
In addition to this you need to install the SATARAID5 manager software which allows you to configure the disks in windows. This can be downloaded from the SiliconImage website here:
http://www.siliconimage.com/support/searchresults.aspx?pid=28&cat=3
Make sure you have at least version 1.5.20.3 of this.

These downloads inexplicably include an old copy of the Java virtual machine runtime environment. Ironically this doesn’t actually work with the SATARAID5 manager software it comes with. Genius! Although it will allow you to view the status of your disks – it won’t allow you to actually do anything with them, all the menu items just do nothing (I subsequently managed to run the manager in a console mode and found that all the menu items were throwing exceptions – ie: broken).
However if you install the latest version of the Java runtime from Sun (available here) – the manager software does work properly.

So now I was able to examine my disks using the SATARAID5 manager. They were marked as a Legacy RAID Group and painted red. In the Windows “Disk Management” window (right click on “Computer” in Windows Explorer, select “Manage” and then clicking “Disk Storage”) they were not visible at all.

So – problem! My disks are there, presumably with data and I can’t read them. And what the hell is a legacy RAID group?

After much reading of the siliconimage website, I downloaded updated versions of the Sil3114 BIOS
Specifically BIOS version: 5.4.0.3 available from here.
The combination of BIOS 5.4.0.3 and SATARAID5 Manager 1.5.20.3 was the one I settled on that finally worked.

The BIOS can be updated by opening Windows “Device Manager”, finding the Sil3114 under “Storage Controlers”, right clicking and selecting “Properties”. One of the tabs has a button for updating the BIOS here – it’s straightforward.

One option offered by the SATARAID5 manager software was to “Convert the Legacy RAID group” to a “New RAID group” – I wasn’t quite sure what this would do but as far as I could tell a Legacy group can be read natively by the card, whereas the New group uses the manager software / drivers instead.
Hardware vs Software RAID then? Not sure. But I’m pretty certain that a New RAID group would be much tougher to setup as a boot drive. So legacy would seem better – if only it could be made to be seen in the Windows “Disk Management” window.

So – I took one of the two drives out and let the system boot. Still couldn’t see it.
Deleted the RAID group in the BIOS and let the system boot. Now we could see the drive. SATARAID5 recognised it as a normal non-RAID disk, went into PASSTHRU mode and allowed it’s use. (It is this PASSTHRU mode that makes the alternative SATA Link BIOS software pretty pointless in my view as it acheives the same result),
NB: Whilst deleting a RAID group only seems to delete the RAID metadata from the hard drives with the Sil3114, leaving the data intact, the same might not be the case with other RAID controllers. Beware!
I now reinstalled the other disk, delete the RAID group from that as well and let the system boot.
The system could now see both drives in PASSTHRU mode, the partitions were intact, but the “Disk Management” window informed me that it couldn’t mount the second drive as it had the same identifier as the first. Which of course it would – so that seemed reasonable.

SO – rebooted again – went back into the RAID BIOS and recreated the RAID group, I didn’t bother to make it copy the data again as it was clearly going to be the same, and then let the system boot.

This time success. The drives were still recognised as a Legacy RAID group, but this time were painted green in the SATARAID5 manager software and were visible and useable in Windows 7. A check in “Disk Management” showed that a single drive was being recognised (ie: the two disks are successfully operating as a RAID1 mirror pair).

I have no idea why they were painted red the first time and green the second, other than that maybe the RAID BIOS was very old when I created the first pair and the metadata was a bit rubbish.

Anyway – all well in the end.

So yes – it is possible to get the Sil3114 to drive a pair of RAID1 disks in Windows 7. (Phew!)

Batch Convert WTV files to DVRMS and MPEG 25

Posted on August 19, 2010 by danny

When Microsoft released Windows 7 / the TV Service Pack for VISTA, they changed the file format from dvr-ms, as used in MCE 2005 to a new wtv format.

What does this new wtv format do for us that dvr-ms did not? Well that’s probably a subject for wikipedia, but for those of us watching Freeview in the UK – not a lot.

However what it does do, is stop us using other nice utilities such as DVRMSToolbox plus wtv files are half as big again as the dvr-ms files they replace. So a 3GB wtv file is equivalent to a 2GB dvr-ms file. Or to put it another way, that 1TB drive you bought so you could keep lots of shows, is now only worth 666GB. Which sucks.

So I want to convert my wtv files to dvr-ms files.

A very easy solution is simply to right click on the wtv file and select the option “Convert to .dvr-ms” format. However this has to be done one right click at a time (there’s no multi select) and rapidly becomes very tedious.

DVRMSToolbox with a bit of profile tweaking and using it’s FileWatcher feature can be made to do it automatically for you – but it is a bit fiddly to setup, and you have to have FileWatcher running continually.

However you can automate the whole process using DOS batch files. And if you want it to run periodically, use the Windows Scheduler service to kick it off, say, daily in the middle of the night.

So what would such a batch file look like? Well – this did take a couple of hours and a bit of research as my DOS batch scripting skills aren’t all that great – hence why I share it here.

ConvertAll.bat
@echo off

echo "Create wtv file list..."
dir /b *.wtv > d:\wtvlist.txt

echo "Process wtv file list..."
for /f "usebackq delims=" %%a IN (d:\wtvlist.txt) do call wtvrunner.bat "%%a"

echo "Cleaning Up"
del d:\wtvlist.txt

Drop the batch file into the directory you want to convert.

It works by creating a temporary file list in a txt file and looping through each entry in that file and passing it to a second batch file called “wtvrunner.bat”.

The wtvrunner.bat file then calls the standard windows utility for converting from wtv to dvr-ms (the same one used by the right click method above), converts the file and (if the output file was successfully created) deletes the wtv original. It’s a good idea to delete the wtv files as you go along rather than with a single del *.wtv at the end as it greatly limits the amount of free disk space required to convert a batch of files.

wtvrunner.bat
SET infile=%~1
SET outfile=%infile:~0,-4%
SET "outfile=%outfile% - DVRMS.dvr-ms"
echo %outfile%
c:\windows\ehome\WTVconverter.exe "%infile%"
IF EXIST "%outfile%" del "%infile%"

(NB: wtvconverter.exe is not available on Windows XP. Copying it onto an XP box doesn’t work either as it relies on other Windows 7 assemblies. So this is really Windows 7 only).

That works well then. Double Click the ConvertAll.bat file and a whole directory of wtv files gets converted to dvr-ms files.

However for other reasons, my workflow required me to then convert all the dvr-ms files to mpg files. So now I needed to add to the scripts to use DVRMSToolbox to do the conversion from dvrms to mpg.

So now ConvertAll.bat looks like this:

ConvertAll.bat
@echo off

echo "Create wtv file list..."
dir /b *.wtv > d:\wtvlist.txt

echo "Process wtv file list..."
for /f "usebackq delims=" %%a IN (d:\wtvlist.txt) do call wtvrunner.bat "%%a"

echo "Create dvr-ms file list..."
dir /b *.dvr-ms > d:\dvrmslist.txt

echo "Process dvr-ms file list..."
for /f "usebackq delims=" %%a IN (d:\dvrmslist.txt) do call dvrmsrunner.bat "%%a"

echo "Cleaning Up"
del d:\wtvlist.txt
del d:\dvrmslist.txt

This introduces a third batch file called “dvrmsrunner.bat” which handles the conversion of the dvr-ms files to mpg’s using DVRMSToolbox. This looks like this:

dvrmsrunner.bat
SET infile=%~1
SET outfile=%infile:.dvr-ms=.mpg%
"C:\Program Files (x86)\DVRMSToolbox\DVRMStoMPEG.exe" /if="%infile%" /of="%outfile%" /p=16384 /act="ffmpeg"
IF EXIST "%outfile%" del "%infile%"

Again this deletes the input files (if the output was successfully created) as soon as the conversion is finished to save space.

Job done.

NB: Scripts updated to only delete input files on success.

References:

Jim 2.5’s Blog – Article on DOS loops
John John’s post from this thread on looping through lists of filenames that have spaces in.
This article on dos string manipulation for replacing .dvr-ms extension with .mpg
macdad’s post from this thread on stripping off three character file extensions from file names.



↑ Top