Hacker's Diary

A rough account of what I did with Emacs recently.

August 31
It is like, to borrow someone else's words, trying to build a bookshelf using mashed potatoes. Here is the task: I have a video clip. I would like to remove about 80 frames at the start and 80 frames at the end, and retain pretty much everything else as-is. I understand the nature of MPEG encoding may require the synthesis of the odd frame here and there. The tools at my disposal vary from the brute-force command-line - mplayer - to the GUI-driven - avidemux2 and cinelerra - but I'm still unable to do this apparently impossible task without re-encoding the entire video clip once I've done my cutting. Not even, apparently, if I cut it on an I-frame. That's the minor irritation, though. Having done some further fiddling about, I was faced with an audio/video sync problem. I don't have the horsepower to deal with this in cinelerra, so that leaves avidemux2 and mplayer. As it happens, avidemux2 can only use an external audio source as-is; it can't time-shift it. So much for that idea. But mplayer has not only an option to feed it an external audio source, but also an option to allow you to time-shift that source forward or backward as required. Yippee! Except... it crashes. It runs the file, but as soon as it finishes, or you hit 'q' to quit and try a different timeshift, it dumps a stacktrace and hangs. And because this is one of those clever applications that tries to manage crashes instead of simply dropping a core file as Ken intended, you are left with an unusable console. Ctrl-C doesn't work, nor does Ctrl-\. No, you can Ctrl-Z it and then kill it. Whoopee. So I tried a different tack: take the audio stream from the video, which is "known-good", load it into audacity in parallel with the doctored stream that I'm trying to realign, and play. Eventually I figured out that probably the handiest way to do this is to split the stereo stream into left/right and then put the two streams side-by-side and eyeball them into place. So I split the streams, and I select "move stream up", and audacity dies. This seems like a fairly basic piece of functionality to be inoperable. Really now. At this point I'm thinking I may just have to learn how all these stupid files are constructed so I can dismantle them and reassemble them without having to deal with someone else's idea of what sort of access I should have. Gah. Time to check out lve, I think. Oh, wait. That wants a custom ffmpeg build. YAY.

August 30
Enemy At The Gates is mostly a good war movie. The romantic thread gets a bit tacky at times, but the cat-and-mouse between Jude Law and Ed Harris - i.e. the meat of the story - is plenty engaging. Not bad, but don't miss dinner to see it.

August 29
Despite a certain apathy and really crap TV reception, I watched most of the original Ocean's 11. And yes, it's pretty much a vehicle for the Rat Pack to goof off in front of a camera. Unlike the remake, the heist is over way too quickly, there're no cliffhangers, and the twist at the end is severely telegraphed. Just as well I didn't pay money to rent this, I'd've felt cheated.

You may also have heard that Dungeons and Dragons is a bit, shall we say, lacking; this is pretty much understating the case. Granted, it's hard to watch it with an unjaundiced eye given the amount of negative reviews it's received, but I can enumerate the good things thusly: the elven chick and the fact that they kill off the irritating sidekick half-way through (sorry if that spoiled it for you...) Everything else is just tripe. I'm not much of a gamer, but I'd be fairly confident in saying this movie is trying too hard to appeal to gamers and in doing so losing track of important details like plot and character. Basically, don't bother.

My hacking on the XMMS MP3 plugin has, after several days of not having it, finally gotten me back to a working plugin. Mind, I figure if I twitch in its general direction it'll break, since I was mainly correcting compiler errors pretty blindly without checking for side-effects. For one thing, I suspect I've completely trashed HTTP streaming for the moment. For my next trick I'll, er, fix that.

Last movie for the day: Wonder Boys. I've been meaning to catch this for a while, and it's definitely worth seeing. To say it's full of unexpected twists is, again, understating the case. It's full of giggles and guffaws throughout, and wonderfully odd. And the soundtrack is pure excellence. Go watch it!

August 28
Checked in some changes to RMAIL support in BBDB; they're still a little off, but I did say I'd have 'em out in the wild this weekend, so.

After much staring at hexdumps and poking at files, I've written up some details on the file formats used on the newer Sony NW devices which use the v2 or better MP3FileManager. There appears to be a lot more redundant data, and there are some fairly critical bits I've not figured out which prevent writing files, but it should be possible to read files using this information. I've put the writeup in with the rest of the MPLE stuff (an increasingly poor choice of name since the v2 files are .OMA files. Note to all the whiny people who keep going on and on about ATRAC: these are still MP3 files. Obfuscated MP3 files, but otherwise unchanged from the source. They are not poorer quality, or transcoded, or any of that sort of thing. I'm curious, though, as to how much overlap there is between these files and ATRAC files since they share certain characteristics.

August 27
The premise: Rory, a rebellious 20-year-old with Duchenne Muscular Dystrophy shows up at a nursing home where he befriends Michael, a Cereberal Palsy sufferer and together they try to get on with their lives - outside the nursing home. Inside I'm Dancing has a lot of people talking bollox on the DVD extras about how it's not a movie about disability and how you could take the disability out and it would still be a great story and basically people even fumbling with how to say, "disabled people" which completely misses the point. This is a fantastic movie which quite simply would lose half its humour if they weren't zooming around in motorised wheelchairs, with Rory providing occasionally inaccurate interpretation for Michael because the latter's verbal output consists mostly of M's, N's and vowels. They go on the piss, they go clubbing, Rory goes joyriding and gets arrested ("are you going to arrest me?" "er, no" "that's discrimination!"), Michael falls in love and learns the hard way that it doesn't always work the way you'd like it to, and if you get the DVD you get a choice of endings, both equally good (plus there's a funny sequence in the Garda station on the deleted scenes). The non-wheelchair elements - Rory's an irritating guy with a motormouth and a poor sense of responsibility, Michael's a naif and easily led, but with a sneaky rebellious streak - are, I will concede, stock movie props, but again, adding the whole disability thing into it really makes it work. I strongly recommend you find some way of seeing this movie (it's an Irish Film Board joint, so it may not exactly get a wide release outside the British Isles, but it's worth hunting down). Oh, and the music's great, too.

August 26
Spent most of the day cleaning up the MP3 plugin from XMMS so that it doesn't require quite so many globals, and so that the stream handling is all centralised through one set of functions rather than having the thing littered with fopens and fseeks and what not. Ultimately the goal here is to allow translation libraries such as MPLE to be bolted in.

August 25
What I have learned about Apache and SELinux:Put these two together, add an early morning, and you get one rather annoyed waider. Grr.

August 24
Hmm. Google Talk. Bitlbee claims to connect to it, but my copy is instead blowing up and (I must admit, amusingly) dumping a stack trace into the IRC client. And trying to debug it is a nightmare because it simply doesn't want to perform as the commandline indicates it should.

Eventually got it working: despite the advertised port 5222/ssl, there is also an unadvertised port 5223/ssl which Bitlbee seems happier with. Yay!

August 23
Spent the day poking at some other Sony files. Verdict: I can transform them back into MP3 files, but I can't figure out where the magic is coming from.

August 22
What can I say about Farhenheit 9/11? It's a typical Michael Moore piece; overloaded with sentiment, carefully self-serving edits, and a condescending, didactic voiceover from the man himself. And I'm ostensibly on the same side as this movie. One positive thing I will say about it is its replaying of the WTC attack: Moore chose not to show the by-now-stock images of planes hitting buildings or the towers collapsing, instead resorting to just the mingled sounds of people and emergency services over a black screen, and some street-level footage of people running away or looking upward. Mostly, though, I felt a sense that the entire movie, whether manipulatively assembled or not, was a wasted effort, since here we are a year later and nobody's talking about a single (factual) thing brought up in the movie - the Unocal pipeline, the evacuation of the Bin Ladens during the nationwide grounding of flights, etc.

The other comment I'd make about it is this: it's been argued that the Republicans are where they are through manipulation of the media, controlling the framing of issues, etc. etc. Moore, I think, attempts to do this for the Democrats, but the problem I have with these techniques is that I can see them and I'm suspicious of them regardless of who's using them. Maybe it carries better in an environment where people aren't quite so aware that this is going on, but I'm not inclined to cast any aspersions about where you might find such an environment. This is, after all, a geek diary, not a political soapbox.

August 21
Still fruitlessly attempting to figure out the rmdir brokenness in the MPLE VFS code. Grr.

The Count of Monte Cristo is, going by my memory of the story, a pretty faithful movie rendition of Dumas' classic. There's less humour in it than you'd expect for a modern adventure movie (by comparison with, say, recent renditions of The Man in the Iron Mask and The Three Musketeers) but it's still present in a few places. Not quite enough swashbuckling sword-fights for my liking, but really, it's hard to find fault with this version except that there's nothing truly memorable about it.

Ok, I'm convinced at this point that I'm hitting some sort of bug in Nautilus, because all the other GVFS tools I can lay hands on seem to be okay with my code. This is not happy-making. (en passant: why is there a gnomevfs-mkdir, but no gnomevfs-rmdir?)

August 20
Cleaned up a few items in the BBDB FAQ, which is really crap because I got slack. Also remembered (again) that since SourceForge switched off cron for project accounts, the nightly updates aren't happening. I think they may have some other mechanism that does this for me, and I should investigate that. For the to-do list.

August 19
Poking at BBDB's RMAIL support, which is somewhat slack by comparison to the Gnus and VM support; turns out that RMAIL itself is pretty slack. I may have a rather chunky piece of work on my hands here.

Fantastic Voyage is the sort of movie that I think inspired the Simpsonsism "scienticians". It's funny seeing all the thinly-disguised-as-dialogue facts being flung at the viewer throughout the movie, while said viewer is waiting to see when Racquel Welch will show the goodies (find another movie, guys, she keeps her wetsuit on here!) Very black-and-white characters; the bad guy is pretty obviously the bad guy from the moment they're aboard the dollied-up speedboat submarine so it's really no surprise when he's "revealed". A little bubblegum for the brain, nothing more.

Full Tilt Boogie is the behind-the-scenes film of From Dusk Til Dawn. It's both more and less than a making-of documentary; more in that they talk to everyone - PAs, grips, the caterer, the drivers - and less in that there's none of the "so here's how we shot the big shoot-up scene" stuff you get in other making-ofs. It's not any the less for that, however; the off-camera atmosphere reeks of cameraderie and raw fun, even when they're bitching about having spent an 18-hour day in a dried-out lake bed facing dust storms and what not. There's an amusing bit where the camera crew of Full Tilt Boogie go to quiz some paparazzi hanging around on the perimeter, and the paparazzi get all cagey about having their equipment filmed. Pot, kettle, etc. Tarantino, I have to say, comes off like a jerk a lot of the time, but seeing him and Clooney and Rodriguez goofing off like a bunch of schoolmates is funny. Harvey Keitel puts in a brief appearance to make some waffly comment about acting and what not which I really couldn't follow; Juliette Lewis is far more succinct in describing her job as "lying" - maybe when she's as old as Keitel she'll try the mystic description of it instead. All in all, tons of fun and definitely worth watching.

August 18
Note to self, since I've been through this twice already with the same amount of head-banging-against wall: if your HTTPD settings look sane, CHECK SELINUX. The default Fedora Core setup either disables userdirs, or expects them to be somewhere that I'm not putting them; either way, about the only way I've been able to make localhost:/~waider work is to just switch off SELinux coverage for the HTTPD.

Hmm, annoying Gnome behaviour (reminding me of Steve Turnbull's comment, "All annoying Motif features are configurable"): the doodad that keeps track of my windows has a setting to either restore a window to the current desktop or to the window's native desktop; right now I'm not seeing any difference in behaviour between either option - both cause the window to appear on the current desktop, which is SO not what I want. I didn't encounter this problem on FVWM because I didn't use a window list at all, so maybe that's the solution here.

August 17
Ok, I was distracted for a bit by the disk crash, but I just now tried out dragging a file into the gnome-vfs-mple-provided MPLE folder, and shazam, it actually appears to have worked. Cool! Now if only I could figure out the directory delete brokenness.

Ugh. About the only good thing I can say about Magnolia is that I liked most of the music. Really, though, I'd rather have that three hours back, please.

August 16
Mostly spent recovering data from last night's crash. My home directory appears to have survived intact, which is good, because my backups were more than a week old; the /usr directory appears to be toasted, and the drive itself is pretty much fit only for the bin. Ordered a new one off Komplett, which shipped before close of business so there's a vague possibility I'll get it tomorrow.

Obviously in sympathy with the laptop, my webserver spontaneously froze, too. Yay, not.

They don't make movies like Where Eagles Dare any more. I mean, sure, the good guys go up against the Nazis and sustain, like, a single wound, which the stiff-upper-lip captain refers to with an utterance like, "damn and blast" as he binds it with his handkerchief (monogrammed, no doubt), but still. Definitely a good old-fashioned war movie, with a good plot, and a brilliant middle bit where you're suddenly left wondering who's on which side. Oh, and the crazy drive in the bus at the end where you finally realise why they were checking out the bus in the first place, and what the extra charges they'd set are for. Great stuff.

August 15
I'm stuck on the MPLE Gnome VFS plugin: I delete a directory, and the next directory at the same level that I try to open gets stuck trying to stat the directory I've deleted. I can't see anything wrong with my directory-handling code. Weird.

AAAaaand just to keep things interesting, I had a no-warning massive hard drive failure. Better still, the drive in question ate the filesystem journal. Owie.

August 14
Stayed overnight at John's place, and pretty much lounged around a lot when I got back. Did a little poking at the MPLE stuff, but not much.

August 13
The Manchurian Candidate is quite an excellent movie; I can't compare it to the original or the book as I've not experienced either, but it certainly stands up well on its own. It comes across as a combination of Jacob's Ladder and Neal Stephenson's coauthoured novel Interface; all the paranoia of the former, and all the technology of the latter. There's an amusing sight gag in the Library sequence, too - watch for the guy sitting next to Denzel Washington when he's searching Google. Some good extras on the DVD as well, including a few randoms talking about current politcs (and, by implication, the possibility of something like the movie's storyline becoming a reality) which unfortunately shows up several people to be the sort of typically scattershot armchair pundits who you know might have a point if they actually collected their efforts into a single direction. Meryl Streep's commentary about her role is interesting, in that she seems to suggest that yes, sometimes you need to break the rules to get the job done; she even goes so far as to quote Donald Rumsfeld, and not one of his malapropisms, either. In the movie she comes across as a laughingly exaggerated Republican, although the director says he found her performance convincing enough to sell a fictional Vice-Presidential candidate... Anyway, well worth a watch; about the only thing I didn't like was the music cutting in the opening credits/Desert Storm sequence. I'm guessing it was intended to convey the passage of time, but really, it was just distracting. Aside from that, no complaints. Now I need to see if I can dig up the original and possibly the novel.

More work on the file-writing stuff to make it more useful. There's currently a lot of wiring hanging out of the library code that should really, I think, be hidden behind opaque structures. I may start working on that once I figure out why it is that the Gnome-VFS stuff keeps blowing up every time I look sideways at it.

August 12
After much abuse, I managed to get the file writing stuff working; however, attempting to integrate it into my fledgling Gnome VFS module is proving to be a lot more difficult as it's claiming I don't have permission to do the write I'm doing despite the fact that it doesn't appear to be consulting any part of my module to check this.

August 11
National Treasure is fairly standard Bruckheimer fare, which is not to say I didn't enjoy it. Also, major props to the guy for coming up with a plausible way to blow up a 200-year-old ship trapped in ice inside the Arctic Circle. That's dedication to your bubblegum movie, that is. Don't put off anything important to see this, but on the other hand, don't put it on your Do Not Watch list, either. Stupid, trashy, predictable, but mostly fun. Amusingly, the director says they cut the original ending because people felt it was setting up for a sequel, which wasn't his intention. National Treasure 2 is, as you'd expect, scheduled for production.

Fantastic Four is roughly what I expected of it: an entertaining action movie with wisecracks, cleavage, explosions, and a light sprinkling of plot. A pretty much perfect summer movie, really. I'm not in a position to comment on how well it relates to the source material (although Stan Lee was grinning happily in his walk-on cameo) but it felt very much like it belongs to the same world as X-Men, which seems right. Good for a few laughs, not so high on the suspense-o-meter, and some excellent special effects.

It's sort of annoying to poke at code that hasn't changed in months and discover that it may have been broken all along and noone noticed. Grr.

Obviously movie-watching got in the way of further work on MPLE today, but I did make a start on adding writing to the Gnome-VFS interface before considering what would have to be done, exactly, at which point I decided that I needed to let it percolate somewhat.

August 10
Took a break from arguing with Gnome-VFS to put some filesystem-style access points into the MPLE code, and also to merge in the HAL 0.4 support that Yann Cantin worked out for me. Conveniently, I have a Fedora Core 3 box to test that on. Whee!

Got more of the Gnome-VFS stuff working, but I'm now running into some minor difficulties and intermittent bugs that go away when I try to diagnose them. Hmm.

August 9
Spent most of the day fighting with Gnome-VFS: I now have about 60% of a Gnome filesystem for manipulating the music player. About the most annoying thing about the VFS stuff is that it's missing a key part of abstracting a filesystem out of (from? on top of?) a music player: how do you cope with identically-named files? What I wanted to do was have an internal-use name based on the track number, and a display name for showing to the user, but this plan was scuppered by the fact that Gnome uses the display name to traverse the directory structure you give it. Curses, foiled again. So now I have to code up a check for uniqueness for album and file names, and hack something so that it adds a "#2" or similar to the end of any duplicates it finds. I've just now gotten it to copy off files, inserting an ID3 block at the start containing the artist and title metadata; it doesn't yet deobfuscate the file, and I think some more of this code should be pushed down to the MPLE library, but wow, it's actually working. Once I've got a completed version (by which I mean all the basic functions work, but there's no chrome) I'll add it to the website.

August 8
I finally figured out the timestamp field on the Sony player: it's a standard FAT timestamp, which is probably the first thing I should have tried. The Sony app probably doesn't even bother interpreting it, just copying it verbatim from the directory listing. Anyway, I've added code to handle it and convert it to and from Unix time to the MPLE library.

Went out for a walk with the camera, took a few pictures, then discovered I had the camera switched to macro mode. D'oh. Might try again tomorrow if the weather's as good as it was today.

August 7
A little further poking at the MPLE stuff; seems I was overcomplicating the XOR required for the algorithm. Now I just have to figure out why there's a 37-byte discrepancy in these file sizes that the player apparently doesn't care about.

August 6
Curiously enough, my own Sony device seems oblivious to the MSN issue, so perhaps some people out there have used my code after all, and the XORing and MSN-enforcing is a feature of later devices.

Ok, this is weird. One of my machines is registering itself via DHCP as "hostname.waider.ie.waider.ie". Neither the DHCP client nor server seem smart enough to figure out that this is wrong, and I can't find anywhere on the machine where it claims to be anything other than simply "hostname". More to the point, the DHCP server docs explicitly say that it doesn't stand for this sort of nonsense and won't put it into the local DNS, which, er, it's doing.

The problem appears to be the NetworkManager system, which is a shame, because that's something I'd rather hoped I could use. Oh well.

Spent an hour or so trying to figure out how to minimally connect to the local HAL daemon and ask it about devices. The API documentation leaves something to be desired, in that crucial bits of it seem to be missing. Eventually grabbed someone else's HAL code; turns out I was missing a single call. D'oh. The MPLE code now supports retrievel of the media serial number via one of three methods. I need to do a little more work on integrating this into the command-line tools and there may be a memory leak in the HAL/DBUS stuff, but it works, yay!

August 5
Hoo boy, evil on a stick. Using XPath, Ajax and Perl, I've got a page that you can upload a list of items to; the browser will then iterate over the list and run a database query against each one, replacing the list item with the query results. I have a quasi-practical application for this, but mainly it's just fun that it actually works.

Based on some sample data from a fellow Sony gadget owner and some hex-editor poking, I've confirmed what someone suggested to me some time back regarding some of the magic data in the MPLE stuff: the four bytes of data repeated in both the pblist and mpdat files is the media serial number. This would appear to be a cheap hack to prevent you from simply copying your files as-is from one player to another, since it appears that with an incorrect MSN the files won't play. This would also suggest that noone's actually managed to use my code, since the MSN is hardcoded there! It also appears that some Sony toys further obfuscate the file by XORing the data after feeding it to the obfuscation algorithm. The only suggestion I've had so far for the origin of the number used for the XOR is the last octet of the MSN; since that's 0xFF on my own machine, I can't help but wonder if I just happened to strike it lucky in that this value produced unXOR'd data. I'll have to tweak things and find out, I guess. The other problem that this throws up, mind you, is that the MSN isn't readable from anywhere useful without root access. Maybe I'll put in a small app to grab the number and write it to a hidden file on the device containing it that the rest of the MPLE toys can use.

August 4
The Terminal is schmaltzy, but it's well-done schmaltz. I really enjoyed this, aside from one or two cringe-inducing moments. A good deal more saccharine than the story it's based on, and transposed from Paris to New York, but what the hell. Go watch it.

Wow. Just watched the Global Frequency pilot which, er, totally doesn't exist or anything. It kicks ass. It's like a real-world Matrix on steroids, or something. Great writing plus excellent performances, and only one or two slightly clunky moments. I can't for the life of me understand why this wasn't picked up by anyone.

August 3
Layer Cake is not, as I'd expected, another movie in the mold of "Lock, Stock...", but is rather a complex thriller based around the old firm and new breed London gangsters. There are a few tips of the hand - it's pretty easy to figure out who offed Crazy Larry before it's revealed, for example - but mostly it's very, very clever so you can see what the guys need to do next, but you're at a loss as to how. Some very nice cuts, as well; camera zooms in and pans across close detail, or pans across something in the foreground, and at the end of the pan we're in a completely different scene. And some gorgeous night shots of London, particularly the Isle of Dogs, making it look more like a modern city than Merrie Olde Englande. Definitely worth checking out. The last-scene twist is a killer, too.

August 2
For some odd reason, the version of Emacs on this box disregards my overloading of html-mode and goes right on using the original one. This is obviously somewhat irritating, so I've fixed it (poorly) by telling it to explicitly use my mode.

Bunch more work on BBDB stuff that fell by the wayside, mostly clearning out old emails. For the record:BBDB is still under development, although to call it active would be stretching the use of that word. I have, however, recently synced up the XEmacs copy with the SourceForge copy, which should do something for the number of bugs reported. Not sure yet if it'll increase or decrease them...

Ugh. MH-E is pretty gross. But I found and fixed a BBDB bug reported by a MH-E user, so yay. Also fixed the automatic "mail CVS logs to bbdb-cvs list" thing which has been broken approximately forever.

August 1
Well, d'oh. Sendmail just handed me back a bunch of undelivered mail, including warnings that it wouldn't be delivering mail. Seems like it decided that it couldn't find any nameservers several days ago, and didn't bother looking again. This would explain at least one phone conversation I've had where the other party didn't seem aware of stuff I'd said in email...

Bwahahah. I've just hacked up an Emacs mode for working on sudoku puzzles. Right now it just prevents you from breaking the rules rather than actively assisting you in solving the puzzle. sudoku.el is in the workshop.

I'm not sure if it's the epic scale or just the overworked visuals, but I really couldn't get into Traffic, much less see why it picked up 4 Oscars. Something to while away the afternoon, I guess, but nothing more.

previous month | current month | next month

Waider | This winter weather is... fascinating.