Sunday, July 26, 2009

Jack for Mac

So, in previous articles I've written about Soundflower and how I was able to use it to route audio between Mac applications. Well, it appears that Soundflower is, if not dead, at least on hiatus; the developers are not answering bug reports, and the preliminary reporting says that it is not compatible with Snow Leopard. So, the alternatives are to fix it, or find something else to use. I might still be able to scrape together enough time to see if I can get the thing compiling and dig into what is wrong with it, but with full-time work and four kids, that is far from guaranteed. So I did some spelunking and came across Jack.

Jack is a port of a Linux sound routing tool to Mac OS X. As such, it is a bit more command-line oriented. Instead of being a CoreAudio driver, it interfaces with a CoreAudio driver. Soundflower is a simple bus, of two or sixteen channels; Jack is much more configurable, allowing you to route audio in all kinds of ways, even generating feedback loops if you care to.

It's also a little more complicated to configure. The routing user interface is not polished at all; in fact it is pretty far from intuitive. The GUI for editing audio routing is in desperate need of a patch bay-like editor, that works the way Apple's Audio MIDI Setup editor lets you draw wires between MIDI devices. But after a little head-scratching I'm pleased to report that it worked, and it worked really well, using a very small amount of CPU time. And it seems to have more options: I have not tried them yet, but there are plug-in adapters to let you route audio from inside Logic or other tools.

Jack for MacOS X is here:

http://www.jackosx.com

I will in all likelihood be posting more about Jack in the very near future.

DVD Backup on Leopard (Mac OS X 10.5.7) with FairMount, VLC, and Apple's Disk Utility

So, let's say you have a legally purchased DVD you want to back up to a DVD+R DL. What's the best way to do it?

You can do it with a commercial tool, but a little bird told me that the cool Mac kids are using VLC and FairMount, which smears cream cheese on your DVD, or something. Wot?

Well, actually what it does is mount the disc as another virtual volume, which is decrypted on the fly by VLC, so that you can back it up.

Note that this (the "backing up," no the decrypting on the fly) may be technically illegal. There is a "fair use" exemption to copyright that should, in some sense, apply here, but I've also heard that copying a protected DVD was made explicitly illegal as part of the DMCA. I feel it is ethical to back up a disc which I paid for, especially with a house full of small children who can destroy a DVD in seconds flat, but the legal arguments are far too complicated for me to fully compile -- or even parse -- so I'll leave that to you.

In this post I showed one technique I had worked out for creating a backup of an unprotected video DVD that would then play on a home DVD player.

The situation with commercial encrypted DVDs is more complicated, but VLC 1.0 and Fairmount 1.0.4 seem to make it a lot less complicated.

I don't need to run VLC -- I just need to have it installed. I put in my commercial (encrypted) DVD, and then run FairMount. FairMount will unmount the original disc and mount a "fair" virtual disc that decrypts itself on the fly as you read it. I think it uses a library from VLC to do this. If Apple's DVD Player program started automatically when I put the DVD in, I quit it.

To just back up the DVD to video files that will play on the computer, I could just drag-copy the Fairmount-mounted volume to a folder on my hard drive. But what I want instead is an image file that I can use to burn a DVD+R DL -- with a correctly laid out UDF file system -- that my appliance DVD player can play.

I have a fresh stack of Verbatim 2.4x, just ready and waiting to turn into coasters -- let's go!

In my previous article, I described how I was unable to do something similar, using unencrypted content, with Disk Utility. But that was with a previous version of MacOS X. Disk Utility is, largely, a GUI wrapper on top of several Apple-supplied command-line tools. If it won't drive the command-line tools the way I want it to, I ought to be able to drop down and do it directly. But first, let's see if I can do it from the GUI, which many users might find easier.

When I run Disk Utility, I can see the mounted DVD twice: the DVD in the drive, and the virtual file system provided by Fairmount and VLC. I can just select the virtual file system, and make a new image. The format I want is "DVD/CD master." This ripping will take a while. Even though this machine has 8 cores, the DVD drive can only pull data off the spinning disc so fast. The bottleneck is the drive, not the processors. So, I'll be back after a cup of coffee.

Well, there was no coffee made so I had a wee dram of Lagavulin instead, and watched part of a video on mathematicians who went insane. But now I've got a .cdr file created by Disk Utility. I can mount it in the Finder as if it were a read DVD.

If I select the mounted volume and chose "Get Info," I see that it is a UDF (not HFS) file system, which is a good sign. I ought to be able to eject the decrypted volume provided by Fairmount and VLC, and the original DVD, and still play the new image using Apple's DVD player, using the "Open DVD Media..." menu item.

That works. This normally requires encryption keys that are on the original DVD's lead-in area, and it isn't present anymore, so this tells me the video in the image file has been successfully decrypted, and the DVD's data stored not just to a set of files, but to a mountable image file.

So now let's see if I can burn it for my home DVD player. The burning process has to produce a contiguous file system on the DVD media, since home "appliance" players need the data to be optimized in this way. I quit DVD player, open up Disk Utility, hit the "Burn" button, and tell it where the .cdr file is. I put in one of my DVD-R DL discs. It reads the disc to figure out what it can do with it. For the sake of reliability, I tell it to burn at 2.4x, and ask it to verify and eject. This also will take a while; at least an hour, so I'll be back after an errand!

OK -- errand run, and I've got my burned DVD-R DL; it passed verification and it mounts on my Mac. "Get Info" shows it to be of file system type UDF, and the Apple DVD player application plays it. But will my Sony DVD player play it? (One moment please...)

The answer: yes, it appears to work fine. Navigation, chapters, special features: all there! That's a lot easier than it was last time; no need to mess with DarwinPorts or fink or extracting a binary tool from an application. It just works! [FOOTNOTE 1]

Note that this technique won't let you put a commercial double-layer DVD onto a single-layer DVD-R. That ought to be obvious, but I just thought I should mention it. There are commercial tools (DVDRemaster, for example) which can do this, but they require re-encoding the files into smaller files and so the result is not a perfect copy of the original.

[FOOTNOTE 1] I made backups of 3 commercial DVDs. All of them passed verification on my Mac. On the Sony appliance DVD player, though, one of them seems to work perfectly, one freezes after the menu, and one has a single glitch that causes the video to freeze for a moment and the playback to skip forward ten seconds (although if you carefully back up nine seconds, you can see most of what it skips).

A fresh copy of the disc with the minor glitch worked fine. It seems that the Mac's SuperDrive is better at reading DVD+R DL discs than the Sony appliance player is. That's no great surprise, especially given that the Sony is seven or eight years old. It also seems that DVD+R DL media is just a little bit tetchier than pressed commercial discs. It is after all quite a complex technology, and relatively new; I burned a lot of coasters on one of the first available consumer CD-R drives, back when they were new. DVD+R DL discs are semi-transparent: the laser has to be able to focus and write on two different planes of dye material -- in other words, it has to be able to shine through the first layer without writing it to focus on the second layer. I'm still slightly amazed that they work at all.

For the other disc, the one that wouldn't play at all, a new copy from the image file didn't work either. It seems I must have done something wrong -- perhaps I didn't specify the correct image type? So I ripped a fresh image file tried again, following my own instructions. It worked, which means I burned three usable discs and two coasters out of five tries. Not great, but it could have been worse!

Saturday, July 18, 2009

The Dance Party Playlist, 11 July 2009

During our recent the Julian Woods Community in Pennsylvania, I had the opportunity to deejay a little dance party, using my new Vestax VCI-300 and Yamaha STAGEPAS 300 PA system.

The party didn't go exactly as planned -- it was delayed due to a thunderstorm, which turned into violently blowing rain and lightning. We had to quickly shut down the power and pile everything into the center of the tent, and then try to dry it all out. I was nervous about wet equipment and the hundreds of feet of extension cords running into the tent; I was running around drying wet power strips and gear, and hanging the joints between extension cords off the ground to make drip loops, to try to make sure that no one would get electrocuted by a wet cord. But eventually we got it all looking reasonably safe, and I started the music. The STAGEPAS system performed admirably, with very clean sound and a decent amount of headroom in a portable system. A subwoofer would have been nice, but I could only fit so much gear in the van.

Crafting the playlist for this party was a bit of a challenge. I had a group with an extremely wide age range -- babies to elders. I had been handed a CD of mostly slower world-ish danceable stuff and asked to include some of it, and I had some general requests to play some "African stuff" and also some Motown, plus one guy who was a big, big Michael Jackson fan. Veronica was very adamant that I play the gummi bear song. (One of the funniest moments was mixing in that track, gritting my teeth a bit wondering how it was going to go over, and then looking up to see thirty people of all ages happily dancing along with my four-year-old girl). I had come up with what I thought were a couple of great sets, but then had to heavily revise the pre-planned set lists to accommodate the shortened schedule and some additional breaks for announcements, as well as last-second requests.

I was going to post my exact saved playlist, but apparently Serato ITCH has something I consider a rather severely broken feature. It saves what you've played in a "Review" window so you can keep track of what you've played. There is a "clear" button to let you empty the review window and start a new set. I was going to transcribe my set from the review window later, when I got a chance, but it appears the contents of the review window is not persistent between launches of the software. So I've lost the exact playlist. But here is my best recollection. The numbers in parentheses are the beats per minute, as calculated by ITCH. For the most part, the beats per minute gradually increase, except for the breaks for some slower songs. This allowed me to beat-match some of the transitions.

Joe Jackson: Steppin' Out (80)
Bob Marley and the Wailers: One Love/People Get Ready (Extended Version) (78)
The Police: One World (Not Three) (84)
Plan 9: Flaming Red Hair (from the Fellowship of the Ring Complete Score) (85)
Buckwheat Zydeco: Mardi Gras Mambo (84)
Lou Bega: Mambo No. 5 (87)
Boiled in Lead: Sher (95)
MC Yogi: Ganesh is Fresh (feat. Jal Uttal) (100)
Wyclef Jean: La Bamba (101)
Bee Gees: Stayin' Alive (Teddybears Remix) (102)
Baha Men: Dancing in the Moonlight (114)
Information Society: What's on Your Mind (Pure Energy) (118)
Michael Jackson: Don't Stop 'Til You Get Enough (Single Version) (119)
The Archies: Sugar Sugar (Pistel Remix) (121)
Eddy Grant: Electric Avenue (122)
A:Xus: You Make Me Feel LIke (Peace and Love and Happiness) (124)

(BREAK)

Joe Cocker and Jennifer Warnes: Up Where We Belong (70)
Crowded House: Don't Dream It's Over (82)
Enigma: Return to Innocence (88)
Angelique Kidjo: Sedjedo (Featuring Ziggy Marley) (100)
Erasure: A Little Respect (113)
Michael Jackson: Wanna Be Startin' Somethin' (Single Version) (122)
Basement Jaxx: Rendez-Vu (125)
Les Rhythms Digitales: Jacques Your Body (Makes Me Sweat) (126)

(BREAK)

Spandau Ballet: True (97)
Johnny Clegg and Savuka: Dela (103)
Stevie Wonder: I Wish (106)
Lou Rawls: You'll Never Find Another Love Like Mine (110)
Fatboy Slim: Praise You (110)
Sister Sledge: We Are Family (116)
Brainstorm: We're On Our Way Home (117)
Kool and the Gang: Celebration (Single Version) (121)
Gummibar: Ich Bin Ein Gummibar (German Version) (128)
Erick Morillo and Sacha Baron Cohen: I Like to Move It (from the Madagascar soundtrack album) (130)
Countdown Singers: Mamboleo (130)
Michael Jackson: Thriller (Single Version) (118)
Village People: Y.M.C.A. (Single Version) (126)
Basement Jaxx: Bing Bango (130)
Earth, Wind, and Fire: Boogie Wonderland (131)
Lou Rawls: Groovy People (134)
MC Yogi: Be the Change (Niraj Chag's Swara Mix) (95)
Roxy Music: Avalon (68)

I got a lot of compliments on the set. It was a lot of fun!