Archive for January, 2005

RSS feeds fixed

For all the regular readers of Crossed Wires, you should both be able to pick up normal RSS feeds now (at least my Cisco phone doesn’t barf on it anymore).

I have altered my previous practice of using multiple paragraphs in the first body section.  Polarblog’s RSS feed generator uses that field as the “description” field for the feed, and the line breaks when I had multiple paragraphs were giving the CMXML generator grief.

Also, Polarblog stores HTML entities in the database which was just a bit messy by the time it got to RSS.  So, I’m now decoding HTML entities in the description field — but I may turn this off if it jepordises RSS validity.

Experiences with MythTV – part 2

I’m softening a little on MythTV.  Last night I recorded a program and it looked quite good.  I got a frontend working on the Mac, and was very impressed with image and sound quality — although the two machines are connected via gigabit Ethernet, so bandwidth should not have been a problem!

I still have lots of trouble with the backend “going away” when I tune a badly-configured or unresponsive channel, and HDTV just doesn’t work at all — if I try it on the same machine the backend is running on, I get a few seconds of broken vision and screeching audio before the frontend locks up.  Trying HDTV on the remote frontend gives the same problems with video and audio, but at least the frontend remains responsive and I can change channel away.

Also, it’s frustration aplenty trying to populate the TV guide.  I installed Rob-someone’s tv_grab_au, which at first just didn’t work, but then suddenly started working fine.  Problem is, it won’t enter any data into the database.  Okay, at first I had some problems in the XMLTV IDs I had entered for my channels, but I fixed all of that.  Strangely, I get guide data for all of the HD stations (typical, since they’re the ones I can’t watch) but only 9 on SD.

The next big test will be to try the MythTV frontend on XBMC.  Stay tuned for the next riveting episode…

Experiences with MythTV – part 1

Okay, I’m an ungrateful whinger.  MythTV so far has been an exercise in lost sleep and disappointment.  Don’t know if it’s my TV card, the card’s drivers, DVB (particularly HDTV) support in MythTV, or just the general stability of MythTV itself, but I’m far from happy.

I’ve been holding off on buying a TV card for years, partly because of my perception of poor support in Linux, but also because of the state-of-flux that TV in Australia is in (probably in other parts of the world too) regarding Digital TV.  But, XBMC made me take the plunge and I’m thinking it was not a good move.

I wanted to get TV going via XBMC.  There’s built-in support for ReplayTV, but since we don’t have and can’t get that over here I went a-browsing.  There’s a Python XBMC script that hooks XBMC into MythTV — cool, I thought.  I bought a card (supported by drivers written by a local guy, so I figured it would work well and be proven in the local area).

Getting the drivers to build and install was a trial.  Running a 2.6 kernel as I am, the way this guy’s package builds it basically toasts a large portion of my kernel tree and replaces it with symlinks to his code (which looks like a snapshot of the LinuxTV code).  There’s probably a lot of folk out there that don’t know any better, but IMHO you just don’t do that!  On account of how I don’t know a better way to do it though, I’ll shut up.

So I finally got the drivers built.  Where are the dvb-utils?  Ah, good question…  You see on Gentoo, the dvb-utils package builds NOTHING.  The maintainers of this package realise that if you are running a 2.6 kernel you’ll have fairly complete LinuxTV support in your kernel, so they tell you that they are doing nothing.  But what about the user-space utilites?  scan?  tzap?  Grrr…  Watch out for my flaming bug report…

So in the background while a lot of this was happening I was building MythTV.  When it finished, I was itching to watch TV!  BANG — nothing but an error from mythsetup saying that I had to add dvb support if I want to use a DVB card…  Seems there’s a USE flag I was missing.  I like Gentoo, but sometimes…  So I remerge MythTV…

So now I have a working MythTV, and a working card and drivers.  But how do I tune it in?  As they say, nothing worth having is easy to obtain.  This part of MythTV is probably one of its poorest-documented — how to find out the magic stuff you need to plug in to get going with DVB.  After two days of fiddling, I finally Googled a moderately simple method, but it still requires me to key in arcane little numbers and setting for every stream (not just each channel).

So finally I get to watch some TV!  But don’t make it high definition, oh no…  Seems that something in the chain (driver or MythTV) can’t do HDTV on this HDTV-capable card.  And if one of the arcane little numbers is not quite right, the whole things locks up.  Still, it could be worse, I’ve only had a couple of kernel freezes on what was previously a rock-solid machine — I’m just glad that I’m using a desktop machine to test with rather than going with my original plan, which was to put the TV card straight into my server.

It’s no wonder that “people” don’t like Linux.  Almost every endeavour I have undertaken using Linux has required that I undertake an exhaustive course of self-instruction to become aware of almost every facet of the mechanics of what I’m trying to do.  It happened with telephony, with DVD authoring, with TV.  How many people that run DVB cards on Windows would even know what PIDs are?  I have to know, though, because I run Linux.

Lucky I’m such a fucking geek.

Tags: ,

Can’t find a register in class GENERAL_REGS when reloading ‘asm’

I was getting this error when trying to build a lot of the DVD ripping and transcoding software I was trying to use.  Could not find any real resolution to the problem anywhere.  Tonight I got the same error compiling MythTV, so I figured I’d have to try and work it out — and a quick Google helped me figure it out.

This message from GCC is basically trying to tell me that it has run out of registers to use for the machine code it is trying to make.  Basically, the code is too complex for the compiler to build valid machine code using the compilation flags as set.  Adding -fomit-frame-pointer is supposed to help, as it frees up one register (I already had that set, though).  -fPIC can apparently also free a register, but a lot of code needs it to compile…  In my case, I had no optimisation flag set, so simply adding -O2 to my CFLAGS in make.conf has fixed it for me (and will give me optimised code that I never had before…  can’t believe I never had -O enabled…  maybe now is the time to rebuild X and KDE… :)

I read someplace that the -O options simply enable a bunch of -f and other flags that you could set individually by hand if you were anal enough.  So my problem was not necessarily solved by -O2, just by one of the hidden compile flags that -O2 turned on for me.

Oh, and GCC 3.4 is supposed to free more registers as well, so perhaps for some really complex code the only fix might be to switch up to GCC 3.4.

Nicholas wins Champion Of The Day at local baby show

Our man the star!  At a local charity baby show today (for the Cerebral Palsy League), Nicholas collected six prizes in total, including the top prize of “Champion of the Day”.  Needless to say, we’re all really proud!

His six prizes included two firsts (including the CotD), two seconds, and two thirds.  He won “Brightest Eyes” (no surprises there!), and was second in Prince of the Day!

He now has a set of trophies, ribbons and medals for his efforts.

So now, when we call him our “Little Champ”, it’s TRUE!  :)

More on XBMC — ‘Lets go to the movies!’

My experiences with XBMC are still happy ones.  I’m learning to live with its lockups (usually caused by me making vicious, unprovoked attacks on it by doing things like pressing buttons on the remote)…  No, that’s too harsh :)   In seriousness, I’m very impressed — almost as impressed with it as I am with how much disk space I’m going to have to buy if I want to rip my DVD collection to play on it!  (I’m beginning to wonder why I’m entering this in the Fun topic…)

I was explaining to a friend just the other day about how DVD was different to CD.  ”Audio CDs,” I said, “are a completely different format to data CDs, which meant that the first CD drives for computrs could not even read music CDs.  With DVDs it’s easier because all DVDs are basically data discs — the ones with movies on just have a special directory layout, and the movie is just simple computer files on the disc.”

What an idiot.  How I regret ever saying anything so stupid!

Over the last week I have tried more than a dozen combinations of software on Mac OS X, Linux and Windows to do the job of getting thosse “simple conputer files” off the DVD and onto my server so that we can view them on XBMC.  First complication is the fact that XBMC currently does not understand DVD menus, and only understands how to read a VIDEO_TS directory if it’s on a physical DVD.  So my first grand plan of simply copying VIDEO_TS to my server was a failure.

Here started my journey into ripping and transcoding.  A journey that has taken me from Mac the Ripper and Handbrake, through drip and quickrip, past countless forum pages and mailing list archives and a side-trip into Forty-Two, to arrive at ffmpegX (Mac) and dvd::rip (Linux).

I almost gave up on dvd::rip when I first set it up.  It has a cluster mode, and I naturally assumed that my Pentium-4 2.4GHz-HT clustered with my dual-Opteron server would make mincemeat of my DVDs (figuratively of course).  Unfortunately the Opteron is not strong on this sort of work (or perhaps the Gentoo ebuilds for the transcode package are not well optimised for AMD64), and the Pentium-4 was held back because it accessed the files over NFS.  That, combined with the fact that I had repeated errors and failed transcodes, drove me back to the Mac.

Not that that’s a bad thing.  Most of the software around is optimised for and benefits greatly from the Altivec engine.  Having a w00ty dual-G5 Power Mac is also a help ;)   Mac the Ripper takes no time at all (well, okay, about 5 minutes) to rip a DVD — maybe a bit longer for a hefty DVD9 — although I do only rip the main feature to save a little time.  Then, using either Handbrake (for simple jobs) or ffmpegX (for better access to tweaking knobs) I make an AVI or MPG out of it.

There are two costs to all of this: 1) time, and 2) storage.

Time: this is actually a double-edged sword.  Not only does it take a sodding-long time to actually do the transcode (luckily you don’t have to sit by it) but I then have to transfer the file to the server, then light up XBMC and give it a test.  Not necessary to watch the whole thing (usually the first minute or so is enough to tell you how far out of sync the audio is).

Storage: I thought that editing Mini-DV and mastering that to DVD takes storage…  There is no way I will rip my whole DVD collection.  Apart from the fact that there are some movies that you just have to watch in original quality (oh, didn’t I mention that?  Yes, transcoding does require you to sacrifice some picture quality, although you do have a little control over just how much you do lose), I can’t justify putting more storage in the server just to watch the occasional movie.

So what will I use this for?  Some things are ideal — I can see the kids videos that get played on endless repeat being done this way.  Nicholas will be able to do it himself without us worrying about DVD drawers and smudges on discs (just have to make sure I can lock out the “educational videos” from his set ;)   And, some things like the Bottom stage shows and episodes that we put on just for a laugh sometimes.  But not Matrix — not in MPEG4, anyways ;)

Tags: , ,

Susan operates XBMC without training

In spite of the fact that she never usually touches anything I set up without a cheat-sheet and at least a brief instruction tour, Susan managed to navigate through XBMC’s menu to play some music.  Not to detract from Susan’s initiative and skill, but kudos to the XBMC team for making it easy enough to use for a complete XBMC-newbie to be able to achieve results.

One reason why this was such an achievement is that it involved the use of the “Menu” key in XBMC.  ”Menu” (usually) returns the operator to the top menu, or steps back a menu layer in multi-layered menus.  Trick is that the “Menu” button on the XBox DVD Remote is a crappy little sub-button at the lower-left-hand corner of the navigation section (arrow buttons).  Not easy to find.

I had left the thing on the System Status page, and Susan got back to the main menu, selected My Music, saw the music cued up, and pressed “Play”.  Might not seem like much, but she gave it a go and won — and for that I’m proud of her.  Good one babe!

Our family day out on Sunday

It was probably the hottest day so far this year, but that didn’t stop us meeting up with some out-of-town relatives (and some in-town ones) at the Roma Street Parklands.

My Aunt Marion and her grand-daughters Jessica and Kaitlin visited my mum for a couple of days.  Mum organised a day out in town, and invited the Crossed Wires gang along with my sister and her two boys Kody and Jarod.

It was hot.  Man, was it hot.  The forecast was for 29C, and by 9am it was already 28C.  The sun was beating down, and the humidity (extra-high, always happens here when storms are on the way) made it worse.  I felt really sorry for Jessica and Kaitlin — I hope they don’t go back and tell their schoolmates about what a hell-on-earth Brisbane is (well, if they do, let it be for the right reasons and not because it was really really hot — sorry, little “Brisbane-is-the-arse-end-of-the-world” joke there).

I must say I’ve been in worse heat (our wedding anniversary in 2001 comes to mind, where it seemed like we walked from one end of Singapore to the other in search of Sentosa, having read a map wrong and got off the MRT at the wrong stop, and having walked for nearly two hours, and absolutely furious at each other, giving up in frustration probably only five more minutes walk from where we needed to be). but something made this feel worse.  Perhaps it was wanting to be good hosts for our guests — how can you show what a nice place you live in when your collar is sticking to your neck and your face looks like a beetroot that’s having a heart-attack?

Despite all of this, Nicholas was on his best behaviour: charming everyone in sight (as usual) and barely being upset at all despite the heat.  It was easier for him than the rest of us though — he had Dad-and-Granny Taxi Service to help out, and dropped off to sleep during the really hot part (ow on earth babies can sleep through any conditions I will never understand).

All told it was a great day — it was really nice to catch up with Marion and Jessica and Kaitlin.  Hopefully the girls will come back for another visit.

Maybe in winter next time.  :)

XBox modding

Fun for young and old!  Seriously, if you’ve got some time to kill (and potentially an XBox to kill as well!) you can take the opportunity to stick it to ol’ Bill Gates up in Redmond and hack his little console machine.

Depending on the application it can be a pretty cheap way to get the power you need: I can get a brand-new console for A$244 retail (without going to a real discount shop, or I could brave the second-hand and private sale market and save even more) and then sell the controller on eBay for a few bucks — for that money, I get a Celeron/Pentium (reports vary) 733MHz with 64MB of RAM, a 8-10GB hard disk, built in 100MBps Ethernet, in a low-power moderately compact form-factor.

That’s right — the XBox is just a PC.  Sure, it has no keyboard or mouse, but it is made of standard PC components.  The only thing stopping anyone from running normal PC programs (such as Linux, or normal Windows) is the software protections that Microsoft designed into the XBox system to stop it — and it is these protections that XBox modding defeats.

There are quite a few people about building clusters of XBoxes for doing…  well, whatever someone who wants a cluster but can’t afford a real one would do with a cluster.

Anyway, back to my modding adventure.

Late in 2003, I was invited to present at the Darwin Linux User Group annual Install-Fest.  One of the presentations (not mine) was a cracker — basically, the presenter stopped at the local shopping centre on the way to the venue and bought a brand-new XBox, and proceeded to apply a software exploit and install Linux.  It was what I’d always wanted to do to the XBox I bought when I was working in Auckland, but never got around to.  Even after having seen it done, though, I didn’t get my finger out and do it myself.

The exploit that the presenter at DarLUG used is known as “MechInstaller”.  It was one of the early programs that exploited bugs in games.  The first game with an exploitable bug was “007: Agent Under Fire” by Electronic Arts, but soon afterwards Microsoft themselves released the game “Mech Assault” that contained a similar bug.  Basically, you “obtain” special files that look to the game like a “save-game” (a file containing saved progress through the game).  Instead of being real game progress data however, the file contains code that triggers the bug in the game and defeats the protection that Microsoft built into the XBox to prevent it from running unauthorised programs.

MechInstaller was the first exploit that I tried — but first I had to get a copy of the game.  Having heard that Microsoft had fixed the exploitable bug in later versions of the game, I figured that buying a “pre-played” copy of the game would increase my chances (and save me a few bucks on a game that I’d rarely play).  What I should have done is research if there was a way to determine if you had a patched copy of the game — because sure enough, I got home and found that the exploit didn’t work with my copy of MechAssault.  Boo hoo.  At this late stage I did the research and found that the DVD media of the original game had different identifying markings than the patched version, and what the markings were.

Susan joins the story at this point — she volunteered to go back to the game shop and play “Gamer’s Girlfriend” to try and get me the right version of the game.  Whatever she said to them worked, because she got it!  MechInstaller was GO, and before long I had a Linux system running on the XBox!

Now I had to choose which Linux to run.  Being a long time Gentoo user I was interested in Gentoo or Gentoox (a customised Gentoo specifically for XBox), but Xebian (or Ed’s Debian) has the best and longest track record in the XBox Linux scene so I pulled down the CD and went for it.  Before long I was booting the CD, installing, and rebooting off a real Linux system on the XBox.

Now what?  It was always my intention to use Linux on the XBox for media streaming.  Xebian comes with the Freevo package already installed, but I didn’t see that it would really suit the task.  I found the XBMP and XBMC projects (XBMC the descendant of the first, XBMP) which looked very attractive.  There was also a XBMC competitor that looked like a customised Gentoox build running MythTV, but again it did not seem to be exactly what I needed.  So, XBMC it was.

The folks that maintain XBMC do not build binaries of it.  Legally, XBMC can only be built using the Microsoft XDK — which is well beyond my price reach and far beyond the budget of this project (from what I understand the XDK is one of these “if you have to ask the price you can’t afford it” things).  A project to build a Free DK for the XBox, but XBMC will not build cleanly this way.  So how can you get it?  I cannot say — but if you poke around places like XBox-Linux and XBox-Scene for long enough you will find out.

Having found a way to get XBMC, I had to install it.  This is where things got interesting…  The MechInstaller was good only to perform a very basic modification to the XBox Dashboard (the program that provides the funky green blobby control panel on the XBox when it’s not running a game) that allows you to boot Linux.  Using MechInstaller, you always had to first boot up the XBox to the Dashboard, then select the “Linux” option that appeared, in order to run Linux.  Booting automatically to Linux, or running some other program (like XBMC) from the Dashboard, did not seem to be possible.  I started to face the possibility that the only way to proceed would be to replace the BIOS in my XBox with a BIOS that would allow other programs to run.  I set the project aside for a little while (during Christmas and New Year) while I contemplated doing possibly irreperable damage to my XBox…

When I came back to the XBox, I stumbled onto a new breed of software exploits: the UBE, and its descendant the UXE.  The original exploits like MechInstaller had a flaw — they were a two-part exploit.  The main bug they exploited was the buffer-overrun exposure in the game, but they also needed a gap in the way the Dashboard operates to make the needed Dashboard change.  Microsoft was busily patching this up, using updates to the XBox kernel and Dashboard in later builds of the XBox, but also using the “XBox Live” service to update the software on XBoxes without warning or permission from owners.  Some games also had updates to the XBox software, that were automatically applied when the game ran.  Consequently, by the very latest versions of the XBox software it was getting very difficult to use the existing exploits.

Then came the UBE.  While it still relied on a game with the exploitable bug, the trick it did on the XBox was different.  I don’t know the details, but apparently by the time the second version of the UBE was released (called UBE2) only the very latest PAL XBoxes could not be modded out-of-the-box — and even those could be done with a small and reversible change before running the exploit.  The UXE takes this even a step further — apparently any XBox can be modded.  There is a utility called ltools that you can use to install an exploit (now it provides UXE) and install one of a variety of alternative Dashboards which run at bootup instead of the Microsoft one.

UXE provided my answer to running XBMC.  I used MechInstaller’s Emergency Linux system to get the ltools files over the network to the XBOX, then I used the MechInstaller to restore the previous Dashboard (probably didn’t have to do this, but figured that the ltools installer might not handle a box that already had an exploit installed).  Then, I started MechAssault and loaded the ltools savegame.  What appears is one of the available alternative Dashboards for the XBox, and by pressing a couple of buttons I got the ltools installation script.  When it was time to run, a mini Linux system booted and did the work: first, it made a compressed copy of the XBox C: partition, then it did its real work (copying or modifying files, etc).  When I restarted, the XBox booted into my chosen Dashboard (MXM).

After that I installed XBMC by copying the files over the network using MXM’s built-in FTP service.  After selecting “Reset Menu Cache” in MXM and rebooting, XBMC was available in a new Applications menu of MXM.  My fun with XBMC was about to start!

About the only thing I’d like to do now is make the XBox boot up to XBMC.  Running via MXM only adds two button presses to the startup sequence, but if I’m going to be running XBMC all the time I might as well boot straight there (and if I need to run the M$ Dashboard or MXM I can do so from XBMC).

Tags:

XBox Media Centre

Only a couple of weeks after going all gooey over SqueezeBox and SlimServer, I’ve found another way of doing media streaming at home.  I’ve now joined that rebel group known as “XBox-modders”, and have a machine at home now running the XBox Media Centre.

XBox Media Centre requires a modded XBox to operate, though as I found out a software-mod-only XBox is fine (given the apparent illegality of mod-chipping in Australia).  See another post for more info about how I modded.

XBMC lets me play my library of MP3s, listen to Internet Radio, watch movies (including ripped DVDs, apparently), and (perhaps most importantly to us right now) browse our digital photo gallery — all using the XBox DVD remote.  It comes with its own streaming protocol server, which appears not to stream as such but rather just serve files, but does run on Linux (an ebuild for Gentoo was all ready to go).  The interface is via TV, which makes sense for viewing movies and pictures but not so much for audio (of course you can turn the telly off once you’ve made your selection, or buy/build one of the LCD screen modules that XBMC knows how to address).  For the truly keen there is a web server built into XBMC as well, that lets you control some functions from a browser (it worked alright with IE, but Safari on our Power Mac gave it trouble, and there are reports of unfriendliness with Firefox).

Cost-wise, XBMC has really only cost me an XBox (yes, I already had one, but unfortunately for one who said that he only ever bought an XBox in order to run Linux I’ve built a bit of a game collection, and until only very recently I believed that the only way I could run Linux or XBMC from bootup was to replace the XBox BIOS, an operation that would have rendered the XBox unable to play games.  So I bought a new XBox for playing games, and modded the existing one.  Then I found out that I didn’t need to replace the BIOS…  Sigh…).  I also bought the “Advanced AV Pack”(?), the little output box that gives you S-Video and optical audio output from the XBox.  XBMC knows how to handle the digital output, and generates a superb-sounding AC-3 stream to our Yamaha amplifier (I never thought 128kbps MP3 could sound so good).

So is XBMC the “way to go”?  Well, I’ll let you know.  I’m happy so far — except for the freezes that have happened a few times, and the extraordinary amount of noise that comes out of the thing to keep the heat down (heat being a possible cause of the lockups, because I had not turned on a setting in XBMC that instructs it to increase the fan speed in response to rising temperature).  I’ve yet to try a DVD in it yet, and the promised visualisations do not appear when playing music…  Its competition is media streaming boxes like the Netgear MP-101 (which only does audio, has no digital output and requires proprietary Windows-only server software), the D-Link Media Gateway (?) (which does video and pictures but again requires Windows-only server software), Pinnacle’s media box (similar to the D-Link), and the SqueezeBox (great design, terrific software and community, but ghastly expensive by the time it lands in AU, with no video or picture capability).  For now I think I’ve made the right call.

Tags: ,