Comparison

My SQL Server course having finished at last, it was inevitable that I’d start wondering whether it was competitive with Oracle. There are lots of feature differences between the two products, of course, but I just wondered what out-of-the-box performance was like.

So I built a 16GB RAM, 60GB Virtual machine and installed Windows 2008 R2 Standard SP1 on it, plus .NET Framework 3.5 and the guest additions. (I used Windows 2008 R2 simply because it doesn’t automatically try to activate itself: this was a disposable testbed, not a machine I wanted accrued to my activation account!) Once it was built, I took a snapshot.

Next, I installed Oracle 11.2.0.1 64-bit, Enterprise Edition, software only. Once the install was complete, I fired up the Net Configuration Assistant to create a listener and then DBCA to created a new custom database. For the most part, I accepted all defaults (so the database was created in no archivelog mode, for example). However, I de-selected all optional components except Oracle Text and Enterprise Manager. I deliberately didn’t alter any of the automatic memory settings: as far as possible, I took Oracle’s out-of-the-box defaults. I did alter the online redo logs to be 500MB in size each (so 1500MB in all), and the USERS tablespace to be 15000MB (so that the entire database was around 20GB in size, all tablespaces considered). Software installation only took just 3 minutes, but the database creation process took another 28 minutes.

After taking a new snapshot, I reverted back to the original and then installed 64-bit SQL Server 2012 Developer Edition (Database Engine, Full-text search, Integration Services and all the management tools, plus a .NET Framewaork 3.5.1 installation when required). Then I created a new database, 20GB in size and with a 1500MB transaction log, running in simple recovery mode.Total time to install and create the database: 22 minutes.

Now, I know that any SQL Server users out there are going to be wailing and gnashing teeth at this point, because I’ve committed (at least!) two cardinal sins: I’ve plonked the transaction log on the same “spindle” as my data files; and I’ve only created a database with a single, large primary filegroup (you’re supposed to create multiple data files, on different “spindles”, and group them as part of the secondary file group for the database.

Well, tough: Oracle’s not supposed to have all its files on one disk, either, but I installed it that way, too. So, it’s still a like-for-like comparison, as far as I can tell. Besides, I don’t have ‘spindles’” this is using a solid state drive, where matters of rotational latency can be ignored. Yes, it would be nice to write sequentially to a redo or transaction log, and not have that sequential write disturbed by the random access required to a datafile: but on an SSHDD, there are no disk heads to dislodge like that anyway. So I think you can overdo the teeth-gnashing on that score!

Anyway: I took a final snapshot and can therefore now flip back and forth between Oracle 11g on Windows 2008 R2 and SQL Server 2012 on Windows R2 -identical virtual hardware, running on the one physical PC. Time, then, for some comparative tests!

Here’s the code I used for the Oracle database:

drop table testtable purge;
create table testtable
(
  col1 varchar(10),
  col2 date,
  col3 date,
  col4 date,
  col5 date,
  col6 date
) tablespace users;

set timing on 
set autotrace trace

declare 
  v_rowcount number;
  v_rowstring varchar2(10);
  v_random number;
  v_upper number;
  v_lower number;
  v_date date;

begin
  v_lower := -730;
  v_upper := -1; 
  v_rowcount := 0;

  while v_rowcount < 5000000 loop
    v_rowstring := to_char(v_rowcount);
    select round(((v_upper - v_lower -1) * dbms_random.value + v_lower),0) into v_random from dual;
    v_date := sysdate+v_random;

  insert into testtable values (
    lpad(v_rowstring,10,'0'), 
    v_date,
    v_date+1,
    v_date+2,
    v_date+3,
    v_date+4);

    v_rowcount := v_rowcount+1;
  end loop;
commit;
end;
/

update testtable set col4=col4+4;
commit;

select * from testtable where col4<sysdate+2 order by col4;   

create index col4idx on testtable(col4) tablespace users;

select * from testtable where col4<sysdate+2 order by col4;  
select * from testtable where col4<sysdate+2 order by col4 desc;

delete from testtable where mod(to_number(col1),3)=0;  
commit;

drop index col4idx;
delete from testtable where mod(to_number(col1),2)=0; 
commit;

And here’s the near-equivalent for SQL Server:

Query -> query options -> Results -> Discard results after execution -> OK

use hjrdb;
go

drop table testtable;

create table testtable
(  
  col1 varchar(10),  
  col2 datetime,  
  col3 datetime,  
  col4 datetime,  
  col5 datetime,  
  col6 datetime
);

declare @RowCount int
declare @RowString varchar(10)
declare @Random int
declare @Upper int
declare @Lower int
declare @InsertDate datetime

set @Lower = -730
set @Upper = -1
set @RowCount = 0

while @RowCount < 5000000
begin
  set @RowString = cast(@RowCount as varchar(10))
  select @Random = round(((@Upper - @Lower -1) * rand() + @Lower), 0)
  set @InsertDate = dateadd(dd, @Random, getdate())

  insert into testtable(col1,col2,col3,col4,col5,col6)
  values 
   (replicate('0', 10 - datalength(@RowString)) + @RowString, 
   @InsertDate,
   dateadd(dd, 1, @InsertDate),
   dateadd(dd, 2, @InsertDate),
   dateadd(dd, 3, @InsertDate),
   dateadd(dd, 4, @InsertDate))

   SET @RowCount = @RowCount + 1
end;

update testtable set col4=col4+4;
commit;

select * from testtable where col4 >= dateadd(day,+2,getdate()) order by col4;

create index col4idx on testtable(col4);

select * from testtable where col4 >= dateadd(day,+2,getdate()) order by col4;
select * from testtable where col4 >= dateadd(day,+2,getdate()) order by col4 desc;

delete from testtable where cast(col1 as int) % 3=0;
commit;

drop index col4idx on testtable;
delete from testtable where cast(col1 as int) % 2=0;
commit;

As you can see, it’s pretty basic stuff: populate a table with 5 million rows, do some selects with ordering, do some updates, create an index, do some ordering ascending and descending, do some deletes. In all cases, I switch off returning results to the client tool, to rule out network transport and client handling issues. Here are the results:

Test Oracle SQL Server
Insert 5 million rows 297 seconds 854 seconds
update 5 million rows 26 seconds 8 seconds
select 5 million rows, no ordering 20 seconds 2 seconds
select, filtering and ordering by column 4 0.23 seconds 1 seconds
create an index on column 4 3 seconds 7 seconds
select, ordering by column 4 0.07 seconds 0.1 second
select, ordering by column 4 descending 0.06 seconds 0.1 second
delete 1/3rd of the rows 28 seconds 7 seconds
delete half of the rows in the absence of the index 13 seconds 2 seconds

All tests were performed three times, with the VM being reset to its appropriate snapshot between each run. Above timings are the averages of the three runs.

Make of that what you will: clearly, Oracle beats SQL Server into the dust with an initial load and is pretty fast when selecting the data back out, too. But it struggles on updates and deletes: data maintenance seems curiously easy for SQL Server. My best guess at this stage is that this is what doing multi-versioning read-consistency costs you: SQL Server doesn’t have to worry about letting readers see the old version of data before the new one is committed; Oracle has to… and I think it shows.

Interesting nonetheless: if concurrent access to data is not really an application requirement, you might be forgiven for thinking that Oracle was overkill. Alternatively, if big, bulk loads and massive queries are what you spend all your time doing, you may well conclude that SQL Server isn’t quite up to the job. Horses for courses, in other words. More investigation required, of course…

Note: Because I’m still feeling my way in the way T-SQL works, I took the original script from here, changed it a bit and then modified it for Oracle use.

Foreigner in a Strange Land…

Have been attending DBA training for SQL Server 2012 this week, courtesy of my current employer’s attempts to broaden my horizons. Talk about a culture shock!

I’m not just talking about the product, either: training is very different from what it was “in my day”! Currently, for example, I am sharing the same classroom with students doing 6 different courses, simultaneously. How is this possible? Because the instructors (there are two of them) don’t actually instruct. In fact, they don’t seem to do anything very much at all. The real training is instead delivered via streamed, pre-prepared video and a set of headphones. The “mentors” (for so they are called) are just there in case you forget a password, need a pen or screw something up really badly. Otherwise, they are mute for the day. Looks to me to be the most boring job in the world, to be honest!

I will grudgingly admit, however, that this learning method suits me very well. I can concentrate exclusively on the material, rather on the annoying quirks of the presenter. If my mind wanders, it is trivial to re-wind the last few minutes of the video and try again. If I stuff up an exercise, it’s painless to revert the virtual machines they give us back to the previous known-good snapshot. I can work at my own pace, and no amount of ‘thickies” elsewhere in the classroom are holding me back. At the end of each day so far, I realise with amazement (and a certain amount of exhaustion) just how concentrated and focused I’ve been for nearly 8 hours: to a degree I would have considered impossible in a traditional classroom.

But I am glad I was a trainer when I was and didn’t last to see this happen to what I once considered my profession, nonetheless!

As for SQL Server: it’s a very nice RDBMS, with a lot of nice integration with the O/S and a lovely toolset. But there are times you glimpse a boney skeleton beneath the gaudy finery! Maybe it’s my particular (Microsoft-approved) course, but do SQL Server practitioners really, truly still worry about file placement for load-balancing and performance reasons? Was SAME (stripe-and-mirror-everything) just something that happened in the Oracle world?! There are quite a few other areas where you (I mean, I) feel that SQL Server is struggling to do things, or has to do them incredibly manually, where Oracle has automated the problem away since about 10g. Beneath the gloss, there are patches of threadbare…

Nevertheless, I’m enjoying it immensely and the product impresses.

As does my employer’s touching faith in me: it has to be that to part with about $4000, don’t you think? For that sort of money, I’d really want better lunches, less sticky keyboards and a take-home DVD of the courseware, to be honest. But it’s not to be. Finish on Friday… and then a long weekend (we get Monday off for the Queen’s birthday). Joy!

It would be a shame if something happened to it…

I have finally gotten around to documenting the Salisbury approach to building an Active Data Guard set-up (that is, 2-node RAC replicating to a 2-node RAC, with the standby in open read-only mode), thereby protecting your data from anything that might unfortunately befall your production RAC.

The article is here.

The article concludes with ARCH doing the log shipping, which isn’t actually the best way of going about things, though it does achieve a high-availability objective. I’ll follow up shortly with altering protection modes and configuring data guard broker… but the article was so long as it stands that I felt compelled to relegate those subjects to follow-up articles rather than the main billing itself.

Keen eyes will note that the screenshots in the latest article are distinctly different from those in the build-a-2-node-RAC one: it’s what happens when Fedora is wiped from your laptop and Windows 8 replaces it!

Hyper-V Hundone

Oh well, that’s that then. Had to remove Hyper-V from my desktop today, because it seems incapable of running a 4-node RAC without crashing one or more nodes at random. Ah, you say: that could just be because Oracle software is flakey and RAC is as stable as a pile of teflon-coated jellies at the best of times. To which I retort merely that the 4 nodes seem to have no problem staying up and working as expected on exactly the same PC when they are run as VMware Workstation VMs.

Bit of a shame: I had hoped to be a fan of Hyper-V. But I need to finish off my 2-node RAC + 2-node Standby before the mid-year Solstice and sticking with Hyper-V isn’t going to get me there. I wish I could provide eloquent diagnostics and explanations. But stuff it: uninstalling it just seems a whole lot simpler to me.

 

Thanks, Toshiba

Fairness dictates that I follow up on my recent travails trying to get Toshiba to send me recovery disks for my laptop, preferably without trampling over my privacy concerns as they do so. For they have responded superbly to my complaint and, in the process, quite converted me back into the Toshiba fan I was of old.

First things first, then: having emailed them a reluctantly-scanned copy of the receipt for the laptop, I rang the next day at 8.01am… and was immediately answered by a charming, polite and efficient bloke. After a quick 20 seconds calling my details up on screen, he simply asked for my credit card number, the address to which the disks should be shipped… and that was that. No hassles, no being kept in a queue, no strife. Service as it should be, I think.

Second things second: although I had been warned that the disks might take up to 5 working days to arrive, they actually arrived the next day. Efficiency, indeed.

Third, the “Customer Service Team Leader” took the trouble to write a long and detailed reply to my earlier emailed complaint. He stepped through the things I’d mentioned, point by point. He apologised for lines not being open when they were supposed to be, and for the recorded voice message advising incorrect opening times. He said he’d get the voice message amended as soon as possible -and the same thing about the email template that mentions a ‘Windows product key’ that Windows 8 users won’t have.

And then the biggie: he took the trouble to explain why Toshiba asks for the receipt in these circumstances:

For older versions of Windows where the product key has faded or missing from the base of the notebook, it was Toshiba’s process to collect the proof of purchase to show ownership of the notebook. I appreciate your feedback that since customers are willing to provide their payment details and delivery details [when purchasing the recovery disks] that their identity should not be in doubt. With Windows 8 now having the product key injected into the unit, I am currently reviewing our process with recovery disk orders.

You can’t get fairer than that, really: there was perhaps a legitimate reason for it back in the day; he recognises that reasoning doesn’t necessarily apply now; he promises to look into it and see what alternative approach he can come up with for the future.

My kind of customer response, really. And then this was the icing on the cake:

As a gesture of goodwill and thanking you for the time to provide feedback, I would like to refund the cost of these recovery disks to your credit card account.

I don’t think that’s ever happened before: taking the time to complain gets called ‘providing feedback’ and warrants getting your money back! Brilliant, Toshiba, and thank you.

Summing up: I think my complaint was legitimate, and Toshiba has responded to it extremely well and generously. As I say, although it would be great not to have to complain in the first place, you can’t ask for a better outcome when you do. Toshiba return to my good books, then!

Incidentally, my enquiry of the Department of Fair Trading suggests that Toshiba is within its rights to ask to see the receipt (though I remain unconvinced), but that if I couldn’t provide one (maybe because I’d lost it, maybe because it was a gift, etc) then Toshiba would not be within their rights to use that as justification for not supplying the recovery disks.That is, they have discretion in the matter and could well waive the receipt requirement on a case-by-case basis. Anyone for whom the requirement was not waived would be withing their rights to make a formal complaint to the Department, who would pursue the matter directly with Toshiba.

Happily, it didn’t come to that, and hopefully, given the response from Toshiba above, it won’t do so for anyone else in the future.

Windows (&) Me

Hold the front page! Shock, horror! I find I actually like Windows 8! Not your common-or-garden stock Windows 8, you understand: the interface formerly known as Metro (TIFKAM) is definitely a dog’s dinner and I can’t stand it or its applications. Both look ghastly and are, it seems to me, an impediment to productivity (if I ever get a Windows-based tablet, though, I am certain to find TIFKAM a great idea. Just not on my desktop, thanks all the same).

Fortunately, a quick install of Classic Shell immediately after Windows 8 installation makes TIFKAM go away, almost completely. It’s free, too. (There are other Start menu replacements, but most of them cost a few dollars. Classic Shell, though, does all I need it to do for none at all). You may need to do a few ‘open with’ tricks on various file types to stop them being opened with the new ‘Modern Apps’, but otherwise, once Classic Shell is in, it’s pretty much a Desktop Experience a la Windows 7: bearable!

Pro Tip: Classic Shell also works fine on Windows Server 2012, and is a god-send there, too.

Firefox 20 is a better privacy-protecting browser than Internet Explorer (at least in part because Adblock Plus, Noscript and Ghostery will run in the former but not the latter), so that bit of the Windows experience immediately got a makeover, post-installation, too.

I’m using Windows 8 Pro, and that comes with Hyper-V (I mean that it comes with the ability to install Hyper-V, because it’s not implemented by default). This is not available in basic Windows 8, but the Pro and Enterprise editions include it. The last time I used Hyper-V was back when Windows 2008 (1st release) was new, and I didn’t much like it, largely because on the desktop PC where I tried to use it, the presence of NVidia graphics drivers meant the entire PC stuttered and stammered badly (unable to play a little bit of audio without choking, for example).

Well, that problem is fixed. If your CPU uses Second Level Address Translation (SLAT, or Extended Page Table in Intel-speak; or Rapid Virtualization Indexing in AMD-speak), then that sort of performance stutter is completely gone. Most i3, i5 and i7 processors do include SLAT, and my one, happily, is on the list. So now I can bare-metal virtualize and play Mozart without wincing.

This means I can park my VMware Workstation license where the sun don’t shine; and I won’t be needing VirtualBox in a hurry either. The Hyper-V management tools are slick and well-integrated and a very nice step up from those desktop virtualization offerings, too. I particularly like the way Hyper-V makes displaying a VM entirely separate from running one. It’s true that you can switch a VMware VM to run in the background after you’ve started it; and if you run your VirtualBox VMs from the command line, they can run-but-not-display, too. But this capability is baked-in to Hyper-V and requires no post-startup or command-line shenanigans to get working, so I noticed it and liked it immediately.

“Guest Additions” are available for CentOS/Red Hat/Scientific, too, so those OSes are able to make best use of their virtual environments. Admittedly, there is no support for Solaris on Hyper-V, which might be a problem for me down the track. We’ll see.

In short, there’s a lot of Windows 8 hate about (the comments on this article are a nice snapshot of that sort of thing!); but I think much of it is overblown. Stick Classic Shell on it and you have a practically-pure 100% desktop experience, devoid of all Metro taint. On the other hand, you get very nice, very capable virtualization built-in for nothing, which has to be a plus. And to top it all off, it performs nicely, too (rather better than Win7 on the same hardware, I think, anyway).

It’s early days, and it could all end horribly in tears any moment now… but so far, at least, the trip back to Win8 has been ‘not bad’.

Camera Joys… and Windows Woes

nikond600In January 2014, I turn 50. Rather more significantly, in November 2013, Benjamin Britten would have turned 100, if he hadn’t been unlucky enough to die in 1976. But whatever: the end of this year, one way or another, turns out to be of great personal significance… and, as a result, me and ToH will be travelling back to the UK in late November, to celebrate both occasions with family, friends and any strangers that want to take pity on a couple of wandering Aussies.

Yes, we are both completely bonkers, and fully understand that we are facing average maximum day-time temperatures of around 8 degrees Celsius (46 Fahrenheit for old-timers and American readers). But we will be in Aldeburgh on November 22nd, standing in the graveyard and paying respects to one of the great composers of our time. So it’s worth it.

I have also wangled a lifetime-desired trip to Bletchley Park (where we won the war by decrypting German Enigma traffic, happening also to invent computers along the way, just in passing). I’m looking forward to that a lot.

The trip comes with some costs attached, however (and I’m not talking about the unheard-of amounts that Aldeburgh’s White Lion hotel wants to charge us!). Specifically, ToH says that a new camera is needed since the last lot of London photos were a tad disappointing, and thus last Thursday we shelled out around $3000 for the Nikon D600 you see above. I coughed a bit, but since I’ve only just recently splashed out $2000 for a new Toshiba laptop, it’s difficult to complain much!

In fact, of course, there is no need to complain at all, because ToH’s former Nikon D80 gets handed down to me (definitely the ugly step-sister when it comes to matters photographical), and I accordingly take a rather large step up from the little Lumix DWC-FH20 I’ve been using for the past 4 years. The last time I used an SLR, digital or analogue, was back in the 1980s, when my trusty (built like a Soviet tank, in fact) Zenit did me duty in the likes of Bulgaria, Zimbabwe and Botswana… so it’s going to be a learning curve for me.

Of course, this means having to deal with RAW images and learning to stitch and crop them as the mood takes me -and thus I feel compelled to renew my hitherto fleeting acquaintance with Photoshop. And Photoshop, of course, means Windows (for Wine will let Photoshop 3 just about pass muster, but cannot cope with Photoshop 5, which we use chez Dizwell). And thus it is that only a fortnight after having purged the house of the last non-ToH-owned Windows machine, I have felt compelled to dump Fedora from my desktop and reverted to Windows 8. After 6 months uninterrupted Linux loveliness, I somewhat regret the move, but no way, no how am I going to try to wrestle GIMP into submission!

I hasten to add that it is not all ToH’s fault, since work is asking me to pick up some SQL Server administration duties, thus making domestic installation of Server 2012 and SQL Server 2012 look like a sensible proposition for career prospects. Time to wipe CentOS off my two HP Proliant Microtower servers, then, after 9 happy months of just sitting there and working beautifully…

Some updates about Windows 8, Windows 2012, Hyper-V and SQL Server to come, too!

Colour me unhappy with… Toshiba :-(

My new laptop (Toshiba p870) has been doing nicely of late, but I decided I’d like to get the factory-settings re-installation media after all, just because it seemed like a good idea at the time. I knew I’d have to pay for these disks, but it seemed like a worthwhile investment (though it would be an even better idea if Toshiba shipped a couple of 30cent disks with a $2000 laptop).

Little did I reckon with Toshiba.

First, there’s nowhere on their site you can request the re-installation media. I had to visit their site, poke around for half an hour and then give up and send a web-based general enquiry instead. No matter, I suppose: slightly inconvenient, but the message got through, since the next day brought a welcome response: please ring this phone number between 8am and 6pm, have a credit card, your laptop serial number and your Windows product ID handy.

No worries. At 8.01am this morning I rang…and got told that “the lines have now closed. They re-open 7am to 7pm”. Well, I’m guessing that since it’s past 8am and they’re not open for business, the reference to 7am is just a mistake. No problem: hang up, retry later.

Actually, I re-tried 8 times, between 8.01am and 8.08am. Only then did I get through.

No matter: at least I’m finally talking to a human. Ah, I say: I notice your earlier email to me mentioned I’d have to have a Windows product ID. Trouble is, the bottom of my PC shows a laptop model and serial number, but no Windows number. Yes, the Toshiba representative says: things have changed with Windows 8 and Microsoft don’t now have product numbers on the outside of laptops and PCs. (So, I ask myself, why did your email say I’d have to have one if that’s no longer true: time to update your automated email boilerplate with the reality of the Win8 world, instead of the old Win7, perhaps?)

Well, no worries: I have my credit card, my laptop serial number and I’m ready to do business anyway. Not so fast, says the Toshiba guy: we need to see the receipt you received when buying the laptop.

Now, I bought the laptop at the local JB Hifi store. That’s a transaction between me and JB Hifi. I used my credit card, so that’s a transaction between me and Visa. But nowhere, notime did I transact with Toshiba, and I don’t see why they get to see receipts of transactions between me and third parties. Ah, says Toshiba Guy: we have to establish proof of ownership. It’s a Microsoft requirement.

Well, I say, Microsoft wasn’t party to my transaction with JB Hifi either, so they’re no more entitled to my transaction records than you are. Somewhat less, I’d say, given that I wiped Windows off my laptop within a day of buying it!

I change tack: how do I get this receipt to you? Just email a scanned image of it, he says. But what if I don’t have a scanner, I say. Take a photo of it with your camera, he says. I point out that’s assuming quite a few things. Oh well, just fax it over, he concedes. I point out that that’s assuming quite a few things, too! (Does anyone still have a fax machine?!)

I point out that the laptop might have been a gift, and that as a result I might not actually have a receipt at all, despite having legitimate ownership of the laptop. I don’t believe he answered that one.

As one of my recent commentators moronically pointed out, these are all first world problems: but I’m nevertheless mightily and legitimately annoyed that it’s impossible to purchase re-installation media without having your privacy trampled on in this way. Since when did Toshiba (or Microsoft, according to them) get granted police powers to investigate issues of legitimate ownership of laptops? Don’t they just sell you the software to run on them, wherever you got it from??!

Even if one concedes that they have an interest in servicing requests from only legitimate owners, it’s all just pointless security theatre: I could knock up an impressive-looking receipt with a word processor and a bit of imagination, after all.

I’ve written to Toshiba to complain. I’ve also written to the Department of Fair Trading, since it seems odd to me that the question of my legitimate ownership of the laptop can be raised by my simply asking to be able to perform a factory reset, should I want to. I’m paying for the installation media, after all (or trying to!): it’s not being provided by Toshiba out of the goodness of their hearts.

I await a reply from them, and I’ll probably just email a copy of the receipt anyway… but Toshiba sucks on this one and I won’t be buying any more of their kit as a consequence.

DLNA and the Media Center of Doom

HDD RecorderIn my never-ending quest to rid the house of anything to do with Microsoft, I decided time was up for the Core 2 Duo, circa 2006, that had been doing Sterling service as our Media Center, first running Windows 7 Media Center and then upgrading to Windows 8 (plus the paid-for Media Center addition).

It’s worked quite well, but has occasionally hung (and inevitably, it hangs just when a really good TV program needs to be recorded). and exhibited other, sporadic and quite rare, weird behaviours. The PC itself was an old rack-mounted monster and was beginning to show signs of its age. All things considered, therefore, I felt it was time to put it out to pasture.

What to replace it with? Well, my first choice might have been another PC running something like MythTV… but ToH has to be taken into account, which rather rules out anything requiring more than an on/off switch, to be honest. I wouldn’t call myself a MythTV expert, either; and the one thing I know about it for sure is that it can be scarily complicated… so no thanks! Something more “consumer electronic good”-like, and less PC-ish. Something that just works. Something that doesn’t cost the earth.

Well, the picture at the top of this post gives the game away: after exhaustive minutes of online research, we bought a Panasonic DMR-HW220. It comes with WiFi built-in, plays MKVs, has a 1TB hard drive, twin HD tuners… and thus seemed to fit the bill perfectly, especially because it was only $340.

If only I’d read the small print (or the online reviews that spell it out!): whilst the machine is Wifi-aware, it has no concept of mapping network drives. It can’t see Samba shares. It’s network capabilities are, in fact, limited to acting as a DLNA server and/or client.

DLNA?? Someone of my age and upbringing probably thinks it’s a splinter Irish terrorist organisation, but in fact it stands for “Digital Living Network Aliiance”, and it’s a set of standards built around UPnP to determine how different electronic media devices play nice with each other. In my home media center context, it means that the Panasonic is a DLNA Client, and that means something on the PC has to be running as a DLNA Server (and Samba or NFS don’t count).

Immediately, therefore, things are more complicated than I’d like: how to run a DNLA server on the CentOS box that’s hosting all my movies, music and photos?

Happily, such a beast does exist and it’s relatively painless to set up: MediaTomb. I could also have installed miniDNLA, which works very simply, too. You can obtain it with a simple “yum install mediatomb” once the RPMForge repository has been added to your list of software sources. Once it’s installed, you need to start the thing with a service mediatomb start -and a chkconfig mediatomb on to make it re-start automatically at every subsequent server reboot. Once it’s running, do a service mediatomb status to find out what port it’s running on: by default, it’s 49152, but a status check will make certain.

Once you know the port, just fire up a browser and type in an address of http://<server IP>:49152 (or whatever port you’ve determined is in use). You should see a pretty bare-bones interface. Select the Filesystem link and you’ll see a tree-like representation of your server’s hard disk structure. Navigate to where your media files are then click the ‘Plus-in-a-Circle’ button on the top right:

mediatomb

Here’s where you get to mark a directory (and it’s sub-directories, if you tick that ‘Recursive’ option) for inclusion in the list of what this DLNA server can, er, serve. Scoot on over to the Panasonic, select the correct option to act as a DLNA client and… bingo! The appropriate directories are now browseable.

Erm… except that none of my MKV files were actually playable! I could certainly see them on the Panasonic, but they were greyed out. I checked the box: “MKV Playback” was definitely there in big, bold letters. So why my MKVs couldn’t be played, I couldn’t quite fathom. Until I read up on DLNA a bit more and discovered that MKV is not a supported container format for DLNA. Some clients can deal with them, but most can’t… and the Panasonic certainly doesn’t.

Had I read the ‘Cons’ column at the top of this product review before purchase, I don’t think I’d have bothered with the Panasonic at all, to be honest: “Can’t play MKV over network”. Plain and simple.

My plans to workaround this awful limitation consisted of copying my MKVs onto a USB hard disk, plugging that in and having the media play from there. Except that when you plug in a USB disk like that, you have to “register” it with the Panasonic device …which means “format” it, and with some sort of file system the likes of which none of my Windows or Linux boxes have ever met before. Once the Panasonic has touched the disk, nothing else can, basically. Too late I discovered that the ability to plug in USB devices is intended to get stuff off the internal 1TB hard disk by way of backup, but not to let you put stuff on to it via a PC, for example. DRM rears its ugly head, therefore, and makes an obvious way of media ‘injection’ non-viable.

(I believe that the on-box claim for MKV playback relates to the ability to play from an SD card. Not exactly what I had in mind, though).

At this point, I fear it’s obvious that I haven’t done my homework, and I am accordingly saddled with a machine which barely meets any of my functional requirements (it can record two TV channels at a time in HD, but that’s about it).

There is one saving grace: MKV is a container, not a video encoding. It’s therefore possible to extract the contents of an MKV and re-pack it in an MP4 container (which the Panasonic does play over the network, because the DLNA spec says it must), without any re-encoding effort. (That’s important, because with a couple of thousand video files to deal with, re-encoding is not an option!)

Various tools can do this re-packing trick: on my Fedora box, perhaps the simplest is Avidemux. You open your MKV, set the Video and Audio Outputs to “Copy”, select “MP4v2 Muxer” as the output format and then click Save. Done locally, a video file is thereby converted from unplayable MKV to playable MP4 in a matter of seconds. Done by pointing Avidemux to my network shares over the wire, however, and it takes a couple of minutes per movie… which is too long to be practical.

The obvious trick is to perform the re-packing on the server itself, for which a command line tool would be good. There is actually an Avidemux command line tool (avidemux3-cli, if you’re trying to yum install it), but scripting it is a nightmare and even invoking it file-by-file is a pain in the butt. So, in the end, I created this little shell script as a file called movieconvert.sh:

#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
f=`ls *.mkv`
ffmpeg -i "$f" -vcodec copy -acodec copy `basename "$f" .mkv`.mp4
IFS=$SAVEIFS

The …IFS… lines are there to deal with the fact that a lot of my movie files have spaces in their names, which would result in ffmpeg trying to convert files called “2001″, “A”, “Space” and “Odyssey” instead of a single file called “2001 A Space Odyssey” (which would be wrong, of course, and thus just lead to runtime errors). Otherwise, the main action is done by invoking ffmpeg with a bunch of switches which demand the video file be copied, not re-encoded, but re-packed as an MP4, not an MKV.

I stuck that in /usr/bin (so it’s in my path), and now I can cd to any directory containing a movie file and do ./movieconvert.sh and everything then just happens automatically. Sure enough, the Panasonic can play the MP4s just fine, too.

So we settle down for the evening to watch one of the movies I’d converted into MP4, and all was going swimmingly. Until suddenly a pop-up appeared informing me that a scheduled TV recording was about to start and therefore the DLNA connection would have to be terminated. What??? Yup. It turns out that you can’t record a program in the background whilst watching a film over the network. Which makes this particular Panasonic a piece of crapola that got taken back to the store that sold it the very next day. Happily, a full refund was received with not too many questions asked.

So what am I using now? Funnily enough, exactly the same kit that the Windows Media Center originally replaced: a Western Digital WD TV Live, which does movies and music very well, using plain old Samba shares to which it connects without drama. And for the live and recorded TV, a relatively ancient Topfield TF-7100 (now about 4 years old, upgraded by yours truly to a 500GB hard disk some years ago, still going strong).

The only pain points in going back to this arrangement are that it would require 4 remote controls (WD TV LIve, the TV, the receiver/amplifier and the Topfield). Happily, a Logitech Harmony all-in-one remote control takes care of that. Which leaves just one real pain-point: the TV listings in Windows Media Center are clear and speedy to navigate. The Topfield equivalent is hopeless, displaying just one channel at a time and taking an age to load or move through. A many-channels-at-a-glance view would be good, but no such beast exists. Not even the paid-for ICE TV gives what is needed. For the moment, I have no answer to this one, then.

Whether we persist with this retro setup, I can’t say. However, I can say that the Panasonic DMR-HW220 is completely hopeless -and, indeed, that anything relying on DLNA is not something I’ll be letting into my house again any time soon! I am really surprised that there isn’t a single box which can do dual-channel live TV, multi-channel recording, Samba connections, MKV and FLAC playback, with a decent, synoptic program guide. But as far as I can tell, there simply isn’t: and that seems a curious gap in the market at this stage of the game!

Taxi

TaxiRolling in some changes to the production system the other day required me to work through the evening and into the early hours. I finally left the office at 2.00AM, meaning that I was in need of a taxi ride home (104KM away). Two cabs turned me down; the third agreed to take me: it’s a long way out of anyone’s way, so I was grateful.

Being extremely tired, I had hoped to snooze whilst the taxi worked its way to deepest southwest Sydney, but I hadn’t reckoned on the fact that I had somehow managed to pick the worst taxi driver in Christendom. Straight bits of road he could mostly do, but anything involving the slightest curve seemed to compel him to cross the lane dividing line, so that one or more wheels continually bumped as the white dashes stopped and started. In this lane-straddling fashion, we’d limp our way home for long, bouncy minutes at a time.

I could have lived with that, I suppose, but that would have been to ignore the drivers strange desire to brake and accelerate, more or less at random, and never with any warning. If the road curved ever-so-slightly, we slowed -abruptly- to around 60km/h. If the road straightened out so he could see which way the lane was going (i.e., straight ahead!), then 130km/h seemed more his sort of thing, with heavy application of foot-to-pedal. And this was on a well-lit motorway, not the country lanes we get to as we near my house. The less said about his capabilities on them the better!

I’ve seldom spent an hour and a half in such fear, to be honest. But if you’re stranded miles from home in the middle of the night, what else are you going to do?

The final fare ($357) was enough to have hired a helicopter for the evening, I think. Never again!!