Wednesday, 13 April 2011

Rhythmbox Artist Prefix Plugin

I've recently started using the Rhythmbox music player.  It seems pretty simple to use and like other Gnome applications is actually quite powerful under the covers but hides a lot of the power from basic use.  You sometimes have to dig a little to find a feature you're looking for.  That said, with no amount of digging was I able to find a feature to enable artists to be sorted while ignoring certain prefixes.  This is a pretty bulk standard feature of most music players and allows artists such as "The Beatles" to be sorted under "B" for Beatles rather than "T" for The.  There's quite a lot of discussion to be found on this in various Rhythmbox bug reports and on the mailing list.  The view of the developers is that it's not possible to automatically provide a one size fits all solution so they implemented the ability to allow users to manually add a sort tag to each track.

I've just written a first versions of a plugin I'm calling Rhythmbox Artist Prefix which allows the user to choose whether to have Rhythmbox attempt to automatically sort artists ignoring certain artist prefixes.  If you use Rhythmbox then give it a try!

The plugin works by querying the Rhythmbox database for artists with the given prefixes and that don't currently have a sort order defined (which allows the user to manually override the sort order derived by the plugin).  So long as the plugin is active it will watch the database for changes too.  The first time you run the plugin it will automatically add an entry to the sort order of all tracks returned by the query and if you leave it running then any time Rhythmbox finds new tracks matching the query their sort order will be updated as well.  Whenever the plugin is notified of a track by an artist such as "The Beatles" and that track doesn't already have a sort order, it will chop off "The" from the artist name and add the remainder (in this case "Beatles") to the artist sort order property for that track.  Quite simple really and I'm amazed it hasn't been done before.

Monday, 11 April 2011

Another New Home Server

Those of you following this blog over the past couple of years will know I've already had several low power home servers including an NSLU2, tinytuxbox and Joggler.  The NSLU2 and tinytuxbox are both history but we've still got the Joggler at home.  After finding it was grinding to a halt with the stuff I was running on it while trying to use it interactively it became clear we needed something else at home too.  Since I was also running out of storage space on my home PC a NAS solution seemed like the obvious choice so I went for a Netgear ReadyNAS Ultra Plus 2 (RNDP200U).

I opted for the ReadyNAS Ultra series because I run a SqueezeBox Duet for my music and Netgear are the only partner directly supported by Logitech for their music devices.  After spending huge amounts of time hacking the NSLU2, tinytuxbox and Joggler I felt it was about time I had a device that "just worked" so the option of simply downloading and installing stuff and having it work is really quite attractive.  Of course, other NAS devices can run SqueezeCenter but whether the community supported versions work well and are kept up to date is another matter which I didn't investigate thoroughly.  Another good reason for choosing the Ultra series is they're based on x86 hardware so some of the code and plugins I know I want to run which had previously not worked (or been possible) on the slug for example would be fine, a lot of NAS boxes are still running ARM processors.

The Ultra 2 comes in 2 flavours and I went for the more powerful of the two (the Ultra 2 Plus).  They are exactly the same except the Ultra 2 Plus has a dual core processor vs a single core on the Ultra 2.  Given I'm fully intending to run what is probably more than average on the NAS the chance of getting a more powerful processor was well worth the extra few quid it costs.

On the subject of price, the NAS solution is probably one of the more expensive ways to get yourself a home server.  Again though, the "it just works" factor comes heavily in to play here as I'm not responsible for installing the O.S. and setting up a raft of different services on the box, they're all just there, working!  Probably the most competition for a NAS would be the Asus Revo running Linux, possibly with FreeNAS on it too.  The Revo with the same processor as the Ultra 2 Plus I bought is around 60% of the price.  The Revo isn't able to support the amount of storage you can get with a NAS device though, doesn't (easily) support RAID and if I did want to do those things it would have to be with ugly USB attached disks which are hard to spin down when not in use.

It took just a matter of hours to unpack, boot and setup the device in the way I wanted.  The array has been formatted and exports a share to Linux and Windows boxes, all my data has been copied on there with plenty of room for expansion and user management is sorted.  After that, updating SqueezeCenter to the latest version was simple and installing other additional software (whether official or community supported) is also really easy.  So far I've set up transmission (for bit torrents) and enabled ssh access.  Hardware management is all done through a web interface so the option of automatically powering on/off the device on a schedule or setting up disk spin down is merely just a box tick away.

I've got it connected to a 10/100 switch which is fine for streaming music to the SqueezeBox or sharing pictures with the Joggler but for access from my PC and to large amounts of data I figured that throughput wouldn't be enough.  Fortunately, the NAS has 2 Gigabit Ethernet ports so I've used the second one to direct attach it to my PC and enabled Jumbo frames.  The performance over that link has been absolutely fine whether measured simply by the subjective feel of how long it takes to do certain tasks or via a more rigorous iozone test.

With the tasks of device and software management all taken care of the the thing up and running in no time at all, I'm looking forward to having more time on my hands to do some even more interesting hacking with the box instead.

Sunday, 10 April 2011

ReadyNAS Ultra 2 Plus

I recently bought a Netgear ReadyNAS Ultra Plus 2 (RNDP200U) Network Attached Storage (NAS) device and before buying found it hard if not impossible to find out the finer technical details of the hardware specification.  In a similar way to some of my previous posts I thought I'd list out some of the key specs as found under Linux running on the device.

It appears to be running a distribution based from Debian Etch which Netgear have modified to make what they call their Raidiator operating system.  It shipped with Raidiator version 4.2.15 and this is upgradeable when they release new versions.

The kernel version is and (surprisingly) is x86_64 rather than the 32 bit OS I would have expected.

The tech specs list the RAM as 1GB DDR2 SODIMM and I can happily report free sees all 1GB available, there's around 500MB of swap space too.

They seem to carve out some sort of virtual storage on the disks you put into the box too.  I've not quite worked this out yet but df reports the following
/dev/md0              4.0G  572M  3.3G  15% /

The CPU is pretty beefy for this type of hardware, Linux sees one processor and two hyperthreaded cores so you get four lots of the following in /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 28
model name : Intel(R) Atom(TM) CPU D525   @ 1.80GHz
stepping : 10
cpu MHz : 1800.215
cache size : 512 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 10
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl tm2 ssse3 cx16 xtpr pdcm movbe lahf_lm
bogomips : 3600.43
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

The other hardware in the system is pretty much covered by the output of lspci
Host bridge: Intel Corporation Unknown device
VGA compatible controller: Intel Corporation Unknown device
Display controller: Intel Corporation Unknown device
PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1
PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2
PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 3
USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #1
USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #2
USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #3
USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #4
USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller
PCI bridge: Intel Corporation 82801 Mobile PCI Bridge
ISA bridge: Intel Corporation Unknown device 27bc
SATA controller: Intel Corporation 82801GR/GH (ICH7 Family) Serial ATA Storage Controller AHCI
SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller
Ethernet controller: Marvell Technology Group Ltd. Unknown device 4380
USB Controller: NEC Corporation Unknown device 0194
Ethernet controller: Marvell Technology Group Ltd. Unknown device 4380

The hardware Specs from the ReadyNAS site are

Physical Specifications
Intel® Atom 1.8 GHz Dual-core CPU (Ultra 2 Plus)
Two (42) Serial ATA II channels
Hot swappable and lockable trays
Two (2) 10/100/1000 Ethernet ports
One (1) USB 3.0 port
Two (2) USB 2.0 ports
Embedded 128 MB Flash Memory for OS
Kensington Lock security hole
Software controlled 80 mm chassis cooling fan
Dimension (H x W x D): 101 x 142 x 220 mm (3.98 x 5.59 x 8.66 in)
Weight: 2.07 kg (4.56 lb), without hard disks
60W External AC power supply
Input: 100-240V AC~ 50-60Hz 5A(Max)
Power Consumption
34W typical with 2 x 2TB disks
32W idle, 19W with disk spin-down
Environmental Compliance
0 to 40 C (32 to 104 F)
20% to 80% Humidity (non-condensing)
FCC, UL, CE, RoHS, C-tick, VCCI, CCC, KCC compliance
Available Configurations