Computers

This should be easy...


I have a large stack of unencrypted (well, they are now…) DVDs. Each one contains several short video clips, correctly separated with chapter marks. I want a new DVD containing a subset of those clips, arranged in the order of my choosing, with a simple menu structure, and without re-encoding any of the videos. A mix disc, as it were, with no quality loss. So far, every Open Source or free tool I’ve tried has choked.

I’ve tried three different VOB-splitting tools. All of the available author-from-VOB tools choke on them, because they’re missing the embedded tags that make it a real DVD-compatible VOB (e.g. muxed with “mplex -f8”). Demuxing (either directly from the DVD or from split VOBs) produces an audio track that none of the tools can read, not even the same tool that just demuxed it; they all claim it’s unsupported. mplayer, ffmpeg, ffmpegX, mjpegtools, dvdauthor, transcode, etc, etc, all the same. mplayer cheerfully plays the DVDs (and the single-chapter VOBs), but it only successfully demuxes if the audio is AC3 or MP2; mine are all PCM.

[side note: ffmpegX and HandBrake both have a tendency to produce garbage in either audio or video when used to transcode and compress DVD video; there are options that work correctly with both, but many things that should work don’t.]

It seems the only realistic solution is to rip to DV and drop them into iDVD, accepting the quality loss from re-encoding. Everything else involves spending more money than the task is worth.

spam/day


Current stats across all my email accounts: 115 spams/day, 30 of them caught by Mac Os X’s Junk filtering, 85 ended up in my Quarantine folder (people who aren’t in my address book or email history).

Best news: 0 false positives in the most recent ten days worth of email. By its nature, the Quarantine folder will occasionally contain real email from someone who’s trying to reach me for the first time, but I have a variety of other rules that do a pretty good job of detecting common cases. I also create custom addresses for every new vendor and site membership, and a monthly disposable address for this blog, and all of those get filtered into special folders.

I haven’t set up anything more sophisticated, largely because the problem is under control. About twice a month, something makes it into my real Inbox, and that’s not worth the effort.

They still don't get it...


[last update: the root cause of the Linux loopback device problem described below turns out to be simple: there’s no locking in the code that selects a free loop device. So it doesn’t matter whether you use mount or losetup, and it doesn’t matter how many loop devices you configure; if you try to allocate two at once, one of them will likely fail.]

Panel discussions at LinuxWorld (emphasis mine):

"We need to make compromises to do full multimedia capabilities like running on iPod so that non-technical users don’t dismiss us out of hand."

"We need to pay a lot more attention to the emerging markets; there’s an awful lot happening there."

But to truly popularize Linux, proponents will have to help push word of the operating system to users, panelists said.

... at least one proponent felt the Linux desktop movement needed more evangelism.

Jon “Maddog” Hall, executive director of Linux International, said each LinuxWorld attendee should make it a point to get at least two Windows users to the conference next year...

I’m sorry, but this is all bullshit. These guys are popping stiffies over an alleged opportunity to unseat Windows because of the delays in Vista, and not one of them seems to be interested in sitting down and making Linux work.

Not work if you have a friend help you install it, not work until the next release, not work with three applications and six games, not work because you can fix it yourself, not work if you can find the driver you need and it’s mostly stable, not work if you download the optional packages that allow it to play MP3s and DVDs, and definitely not work if you don’t need documentation. Just work.

[disclaimer: I get paid to run a farm of servers running a mix of RedHat 7.3 and Fedora Core 2/4/5. The machine hosting this blog runs on OpenBSD, but I’m toying with the idea of installing a minimal Ubuntu and a copy of VMware Server to virtualize the different domains I host. The only reason the base OS will be Linux is because that’s what VMware runs on. But that’s servers; my desktop is a Mac.]

Despite all the ways that Windows sucks, it works. Despite all the ways that Linux has improved over the years, and despite the very real ways that it’s better than Windows, it often doesn’t. Because, at the end of the day, somebody gets paid to make Windows work. Paid to write documentation. Paid to fill a room with random crappy hardware and spend thousands of hours installing, upgrading, using, breaking, and repairing Windows installations.

Open Source is the land of low-hanging fruit. Thousands of people are eager to do the easy stuff, for free or for fun. Very few are willing to write real documentation. Very few are willing to sit in a room and follow someone else’s documentation step-by-step, again and again, making sure that it’s clear, correct, and complete. Very few are interested in, or good at, ongoing maintenance. Or debugging thorny problems.

For instance, did you know that loopback mounts aren’t reliable? We have an automated process that creates EXT2 file system images, loopback-mounts them, fills them with data, and unmounts them. This happens approximately 24 times per day on each of 20 build machines, five days a week, every week. About twice a month it fails, with the following error: “ioctl: LOOP_SET_FD: Device or resource busy”.

Want to know why? Because mount -o loop is an unsupported method of setting up loop devices. It’s the only one you’ll ever see anyone use in their documentation, books, and shell scripts, but it doesn’t actually work. You’re supposed to do this:

LOOP=`losetup -f`
losetup $LOOP myimage
mount -t ext2 $LOOP /mnt
...
umount /mnt
losetup -d $LOOP

If you’re foolish enough to follow the documentation, eventually you’ll simply run out of free loop devices, no matter how many you have. When that happens, the mount point you tried to use will never work again with a loopback mount; you have to delete the directory and recreate it. Or reboot. Or sacrifice a chicken to the kernel gods.

Why support the mount interface if it isn’t reliable? Why not get rid of it, fix it, or at least document the problems somewhere other than, well, here?

[update: the root of our problem with letting the Linux mount command auto-allocate loopback devices may be that the umount command isn’t reliably freeing them without the -d option; it usually does so, but may be failing under load. I can’t test that right now, with everything covered in bubble-wrap in another state, but it’s worth a shot.]

[update: no, the -d option has nothing to do with it; I knocked together a quick test script, ran it in parallel N-1 times (where N was the total number of available loop devices), and about one run in three, I got the dreaded “ioctl: LOOP_SET_FD: Device or resource busy” error on the mount, even if losetup -a showed plenty of free loop devices.]

From Point A to Point B


I am here, at the corner of Boronda and N. Main in Salinas. I wish to go here, to a parking garage in Palo Alto.

Yahoo thinks I should take US-101 to CA-85 to I-280 to Page Mill Road to Alma to University. 76.2 miles, 78 minutes.

Mapquest thinks I should take US-101 to University. 74.32 miles, 78 minutes.

I recently upgraded my car’s GPS navigation system, replacing the 2001 software with the 2005 version. Before the upgrade, it thought I should take US-101 to Oregon Expressway to Middlefield to University, which (perhaps accidentally) recognizes that University is a lousy place to get off the highway. It was a good route.

Imagine my surprise when the four-years-newer firmware proposed the following route: US-101 to Espinosa to Castroville Road to CA-1 to CA-17 to CA-85 to US-101 to University. 78.25 miles, 95 minutes.

the long way...

This is not a “scenic route” option; the car thinks it’s offering good advice, despite the fact that you can persuade it to admit that both Yahoo’s and Mapquest’s suggestions are both shorter and faster. They’ve significantly changed the way they weight different roads, and I haven’t figured out where the “don’t be stupid” button is.

And I need to, because this is a mind-bogglingly stupid route, starting with the very first turn. Espinosa is a two-lane highway with heavy farm traffic, and getting onto it from US-101 requires making a left turn across southbound traffic, from a full stop. When you eventually make it to Castroville, the speed limit in town is 25mph. CA-1 is two lanes of lovely coastal highway up to Santa Cruz, with lots of trucks struggling to navigate the hills and curves. CA-17 is a very pretty—and ridiculously crowded—drive through the Santa Cruz Mountains. CA-85 isn’t nearly as bad as it used to be, but even with the recent improvements, merging back onto US-101 at the north end can be messy during rush hour.

Unfortunately, my ability to control routing decisions is limited to flavor (“shortest”, “fastest”, “maximize highway”) and “avoid this road”. I don’t want to tell it to avoid Espinosa, because when it’s not rush hour, it’s the fastest route to the Borders in Seaside, and it’s always the fastest way back from the coast.

[update: when calculating the B-to-A route, the new version of the software agrees with the old one, and combining that with the Mapquest picture gives me a pretty good clue about what’s going on. I think US-101 between Salinas and Watsonville is being weighted as a non-highway road, making Espinosa/Castroville the shortest path to a highway. Either the old data gave that stretch of 101 a better rating, or the new software optimizes for starting road conditions at the expense of overall trip quality.

So, if I tell it to avoid the stretch of Castroville Road just before CA-1 North, it should change the weights enough to send me up 101 when going to Palo Alto without interfering with route planning to Seaside. The potential downside is that it might try to route me up 101 to CA-17 to reach Santa Cruz, but that depends on just how heavily it weights the “avoid this road” markers.]

[update: oh, this is getting good. I set an “avoid this area” marker on Castroville Road just past the 156 south exit, so it wouldn’t interfere with routing to Seaside and Monterey. The car recommended taking 156 south to the next exit to get onto CA-1.

So I moved the marker a bit further down the road, past that exit, and the car took 156 south a bit further to reach CA-1. So I moved the “avoid this area” marker onto CA-1, and the car routed through Hollister.

Along San Juan Grade Road. This is a paved goat path running through the Gabilan Mountains.

However, if I remove all of the “avoid” markers and set a waypoint along 101 near San Juan Batista, the car gives me a perfectly sensible route, which it admits is shorter and faster than all previous recommendations (74 miles, 69 minutes).]

World of Warcraft ganks my DSL modem


[update 8/9: The ActionTec GT704 that I replaced my SpeedStream with has been rock-solid with WoW; I haven’t had a single disconnect since I started using it]

[update 6/21: I scrounged up a different brand of DSL modem, and preliminary testing suggests that this one doesn’t have the same problem. Current working theory is that excessive packet fragmentation is causing the ethernet port on the Speedstream to choke.]

I recently started playing WoW again, after a lapse of several months. I like the game, but I really hate the way it crashes my DSL modem when I turn in quests.

This is not my imagination. Frequently, the act of turning in a quest disconnects me from the Internet, forcing me to power-cycle the modem. It happened five times this morning, as I was running my Orc Warlock through some low-level Crossroads quests. Turn in quest, lose connection, power-cycle modem, log back in, repeat. It’s not the volume of data; I can flood the line with BitTorrent traffic for days, upstream and downstream, without the line going down. I think that since I got the current modem, it’s lost connection maybe once every six weeks.

Except when I play WoW. I’m stumped. And despite the fact that I know I’m not crazy, I can’t think of a way to explain this to SBC tech support that would result in useful support.

[update: more details. I’ve now repeated the crash using the PC version of WoW, and it’s 100% consistent. Turn in a quest, power-cycle the Siemens Speedstream 4100 (running in bridge mode with firmware 1.0.0.53, upgraded from 1.0.0.48 today without fixing the problem). Even the direct web-admin connection goes down.

To my astonishment, SBC tech support believes me. It took a bit of doing, but I managed to get to a second-tier support guy who spoke sysadmin, and we spent half an hour on the phone diagnosing the problem. There is no evidence on his side of the modem crashing and failing to resync, or of other problems on my line. What may in fact be happening is that the uplink port on my switch is crashing, not the DSL modem at all. Connecting directly to the modem and turning in a quest worked once, but I didn’t have any other quests to test further with.]

[update: I’ve been wanting to upgrade to a gigabit switch for a while now, so I did that today, replacing the 10/100 that was connected to the DSL modem. I was able to turn in three quests without a problem, and just as my confidence started rising, the fourth quest crashed the modem. To do more serious testing tomorrow, I’ll have to move the G5 into the same room as the modem, so I can easily try with and without the switch in the loop. I’m coming to believe that it’s simply the LAN port on the modem that’s flaking out, not the software actually crashing. Supporting evidence is the fact that it’s still up enough to detect the disconnection of the phone line and reconnect when I plug it back in.]

Dear Adobe,


While preparing a faithful, high-resolution copy of the Mac OS X kernel-panic screen (to submit a patch to XScreenSaver’s BSOD module, now that JWZ has gotten it mostly working as a native Mac screen-saver), I ran into several problems. First, the result of my efforts:

Mac OS X 10.3-10.4 kernel panic screen

Now for the problems. I started out working in Photoshop, mostly because I hate Illustrator and wish CorelDRAW 4 had been stabilized and ported to every useful platform, but quickly gave up. Even for a simple graphic like this, it’s just annoying to work without real drawing tools.

The power button took about fifteen seconds in Illustrator, leaving me to concentrate on the text (12.2/14.6pt Lucida Grande Bold and 13/14.6pt Osaka, by the way). The Japanese version took the longest, obviously, especially with the JPEG artifacts in my source image.

Mind you, the above PNG file wasn’t exported from Illustrator, because all of my attempts looked like crap. The anti-aliasing made the text too fuzzy. To produce a smooth background image with crisp text, I had to manually transfer the two layers to Photoshop. I exported the background graphic at 300dpi without anti-aliasing, resized it in Photoshop using the Bicubic Sharper mode, then created a text field, pasted in the text, set the anti-aliasing mode to Sharp, and nudged it into the correct position.

The real fun came when I wanted to take the text I’d so painstakingly entered and paste it into another application.

I couldn’t.

Selecting the text in Illustrator CS2 and copying it left me with something that could only be pasted into Photoshop or InDesign. Fortunately, InDesign was written by people who think that text is useful, and after pasting it there I could copy it again, ending up with something that other applications understood. See?

You need to restart your computer. Hold down the Power button for several seconds or press the Restart Button.

Veuillez redémarrer votre ordinateur. Maintenez la touche de démarrage enfoncée pendant plusieurs secondes ou bien appuyez sur le bouton de réinitialisation.

Sie müssen Ihren Computer neu starten. Halten Sie dazu die Einschalttaste einige Sekunden gedrückt oder drücken Sie die Neustart-Taste.

コンピュータを再起動する必要があります。パワーボタンを数秒間押し続けるか、リセットボタンを押してください。

A Class I refuse to claim membership in...


I remember hearing about these morons a while back, when they wanted to sue the major computer companies for fraudulently advertising disk capacity using the exact same units as everyone else in the industry, using the sizes provided by the hard-drive makers.

Apparently, the howls of laughter with which this argument was received led them to retarget their suit against the hard-drive makers:

You are receiving this notice because our records indicate that you purchased an aftermarket Western Digital Corporation ("WD") hard disk drive between March 22, 2001 and February 15, 2006. "Aftermarket" purchasers are those who purchased their hard disk drives separately rather than pre-installed by an original equipment manufacturer into a computer.
A proposed class action settlement may affect your legal rights. If the settlement is approved, you may be eligible to receive free hard disk drive backup and recovery software from WD. Read below for a summary of the proposed settlement. For a detailed legal notice and complete terms, please visit www.wdc.com/settlement.
A class action lawsuit entitled Safier v. Western Digital Corporation is pending in the U.S. District Court for the Northern District of California. The lawsuit claims that in the sale and marketing of its hard disk drives, Western Digital overstates the useable storage capacity. According to the lawsuit, when attached to most personal computers, a hard disk drive advertised as having "80GB" will only show an available capacity of "74.4GB." The lawsuit alleges that one reason for this disparity is the existence of two different measurements of a "GB," one of which is used by computer operating systems and another of which is used by hard disk drive manufacturers. The lawsuit seeks restitution, damages, punitive damages, and injunctive relief. The lawsuit is case number 05-03353 BZ.

Emphasis added. I won’t be joining this one, and if I can find a way to send a message to the greedy little bastards behind the suit, it will consist of two words:

Bite Me

The first step is proving you have a problem...


So, it initially looked as if swapping the DIMMS around and reseating everything fixed my PowerBook. Paranoia is an old friend, however, so I decided to do some more testing before trusting it.

First up, TechTool Deluxe, a piece of software that Apple gives you when you buy AppleCare support. I ran the full suite of tests half a dozen times, with no errors.

Next up, World of Warcraft. I booted normally, logged in and had one of my characters stand in the middle of the busiest city, opened up the Activity Monitor, and… success! Or, more precisely, failure. It locked up good and hard, filling the screen with garbage.

Packed it up, made a support appointment at the Apple Store, walked over at the appointed time, waited 40 minutes for someone to get to me, and then spent the next 40 minutes proving that the problem really existed.

Standard diagnostic tools passed with flying colors. The tech’s random mix of apps worked just fine. We ended up testing each DIMM separately, loading up memory and CPU with World of Warcraft, QuickTime Player (random music video set to loop), and VLC (random VOB file set to loop). With the DIMM that I initially had figured was the good one, this produced several crashes within five minutes. The other DIMM worked fine, and in fact it’s been running for about half an hour now back in my office.

They’ll have a replacement DIMM for me in a few days, and meanwhile I’m going to keep stressing the machine to make really sure there’s nothing else wrong. Then I’ll migrate back from my G3 iBook.

Update: I spent a few days abusing the replacement RAM, and now everything’s back to normal. It was interesting using the G3 iBook for a while; it was perfectly adequate for use at work (Terminal, Safari, Mail, iTunes, MS Word, SSH Agent, Cisco VPNClient, Firefox, and Thunderbird), and only really showed its age when confronted with video clips (no, Choco Party is not work-related, or particularly work-safe, but it was certainly popular, especially after I googled out the name of the featured model, Miri Hanai).

I don’t plan on buying one of the current MacBook Pro models, even after they sort out all the early hardware problems (I’ve had enough early-adopter fun with Apple for a while, thanks). It will probably be a year before it’s worth the effort of migrating my primary machine to the new platform, but an x86 Mini is a possibility. We’re buying some for the office, so I’ll be able to check it out soon.

Here’s my simple RAM-thrasher. Kicking off half a dozen of these is more predictable than standing around in Ironforge in World of Warcraft:

#!/usr/bin/perl
open(In,"/dev/random");
foreach (1..250000) {
    read(In,$x,1024);
    push(@x,$x);
}
@y = sort @x;

“Need a clue, take a clue,
 got a clue, leave a clue”