Last week, when up at the in-laws' in Carrickfergus, I was given a Canon MV600 DV camera on extended loan - the idea being that Bananas' grandparents would get more videos of her doing the sort of stuff we see every day, but they don't get to see other than when we (or they) come to visit.

There was only one catch - there was only 1 video tape with the camera, and that contained a load of footage of recent vacations that Henry wanted to keep, so I promised I'd burn a DVD of it, and post it up.

As a computer-video newbie (I much prefer photography), I didn't quite realise the extent of what I'd promised - I'm still using a 2002 17" G4 iMac at home for media stuff, and converting 60 minutes of video to DVD takes up a lot of disk space, and an awful lot of processing power. Disk space that I didn't have, and processing power that meant my Mac has been on for much of the weekend crunching away on this task - which more modern hardware would no doubt laugh at.

I solved the disk space problem by storing the files on my Solaris box on ZFS, sharing to the Mac via NFS. The processing-power problem was more interesting though.

Last night, I checked in on my machine - looking to see how iDVD was getting on. Uhho - dreaded spinning beachball of death, and alt-apple-esc was showing iDVD (Application not responding). Generally a bad sign. It was about 50% through the task of encoding the video, and I didn't relish the thought of having to kill the app, and start all over again.

I had a poke around to see what sort of observabilty tools were on the Mac - ktrace. Hmm, not too useful, the application looked like it was spinning around some system calls, but that's about all I could determine. I found myself wishing for DTrace for OSX - which is on it's way, but I needed it now. However, since I'd saved the footage on a Solaris box, and was working over NFS, I had a better idea.

I was able to log in to that machine, and a quick utterance of dtrace -n 'fbt:zfs:zfs_read:entry {printf("%x",arg0);}' got me the address of the vnode being accessed, which I then passed into mdb -k to print the <addr>::print vnode_t vdev_path giving me the full path of the file being accessed. Popping in a call to the DTrace stack() function allowed me to verify that it was indeed the NFS server that was serving accesses to this file. With a bit more digging, I found that different parts of the file were being accessed, so I suspected that iDVD was still doing something useful. I decided to leave it running to see what would happen, and went to bed.

(btw. I've since found out that dtrace -n 'fbt:zfs:zfs_read:entry {printf("%s",stringof(((vnode_t*)arg0)->v_path));}' would have been more efficient here.)

Anyway - it's now Sunday morning, and iDVD has finally completed and I've now got a shiny DVD containing holiday footage from in-laws' vacations past. The problem was, iDVD hadn't hung, it was just really busy, but I wonder how many of the other 11,000 hits for "iDVD application not responding" on Google are just from either impatient people running old hardware or the system not being polite enough to tell you what the application was actually doing ? Having observability right into the application in future versions of OSX will be a god-send with DTrace coming in 10.5 - hope they get it working on PowerPCs as well. Damn, does this mean Apple gets another $129 from me :-(

Anyway, so there you go: DTrace - not just for developers or sysadmins, it's helps you score brownie points with the in-laws too!


Comments:

I had a similar problem, but I was working on a local disk. I used <code>lsof | grep iDVD</code> to determine which files was iDVD touching, and I found the ones where iDVD was working. Later, <code>du</code> on those files showed they were growing, and that modification dates where being updated, so it was fine to leave iDVD working. I guess some sampling of iDVD from the Activity Monitor would have given useful information, too. Hope there is dtrace support from the Activity Monitor in Leopard. Again, either iDVD or Mac OS X should give better information on what's going on, but it seems the NSApp loop wasn't getting any hits.

Posted by Juan de Dios Santander Vela on July 09, 2007 at 05:23 PM IST #

My tips for iDVD on an old machine (I've a G4 Sawtooth - from late 1999 that I still do video work on). 1) renice: bump that priority up, especially if you aren't using the computer for something else 2) turn off screen saver - I use that iPhoto slideshow screen saver - which my blazing fast 450 MHz G4 can barely handle (hot corners are handy for this) 3) check the last modified time for the output files - iDVD stores them in your iDVD document. You might have to poke around a bit to find where it is writing, but it is possible. Sounds like you did a fancy version of that.

Posted by Phil on July 09, 2007 at 05:28 PM IST #

Thanks guys, yeah - guess my main pint here, is with DTrace, problems like this become a lot easier to diagnose. (Getting a port of iDVD to Solaris would solve most of my problems I reckon :-)

Posted by Tim Foster on July 09, 2007 at 05:34 PM IST #

s/pint/point/g (hmm, thinking about beer already, and it's only 17:34!)

Posted by Tim Foster on July 09, 2007 at 05:35 PM IST #

Wow Tim, you got linked by daringfireball.net!

Posted by Niall Murphy on July 09, 2007 at 06:13 PM IST #

This happened to me multiple times on an old machine. Usually it wouldn happen when I got impatient, swtiched to/opened another application, and came back. So, basically, just let the slower machine be. Also, it'd be interesting to know if the spinning beach ball actually slowed the process down at all, or if it just seems to.

Posted by Reid Bode on July 09, 2007 at 07:33 PM IST #

I've got a nice fast 2.66Ghz x 2 MacPro with plenty of memory, semi-speedy drives, and every time it hits the audio processing portion the beach ball shows up. So even on faster machines its an issue. It always finishes, but its a very annoying user feedback issue that I really wish Apple would fix. I've wondered if the pro-apps are better at this or if its a universal problem between the two.

Posted by Doug M on July 09, 2007 at 09:10 PM IST #

I usually just launch Mac OS X's Activity Monitor and "Sample" a process a few times to see what it's up to.

Posted by 128.122.47.39 on July 09, 2007 at 10:20 PM IST #

Might also be worth a look at the “fs_usage” command? :-

fs_usage -- report system calls and page faults related to filesystem activity in real-time

Posted by ManxStef on July 10, 2007 at 02:05 PM IST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by timf