March 2008 - Posts - Jon Galloway

March 2008 - Posts

Running the Mono VMWare image in VirtualPC

A lot of people love VMWare, but it bugs me. I think the main reason is that it installs with a bunch of Windows services that run automatically, every second my computer is running, whether or not I use VMWare. Since I don't use virtual machines every day, that's annoying. So, after running the free VMWare Player for a few times times, I banished it from my computer.

The Mono team publishes a VMWare image which makes it really easy to check out Mono on Linux without installing or building anything. If you're happy with VMWare, you can grab their free player and run the image. If, like me, you'd rather run this on Virtual PC, follow along and I'll show you how.

If you don't use VirtualPC, or if you don't mind having several virtual machine hosts on your computer, this post obviously isn't for you. Thanks for stopping by, though!

Grabbing the VMWare Image

You can download the Mono VMWare image from the Mono Downloads page. They offer both are http and torrent download options.

Converting the Virtual Hard Disk image

I use Vmdk2Vhd from vmToolkit to convert the hard disk images. It's free, although there's an annoying registration step (which you can probably bypass with BugMeNot). The interface is really simple - browse for the vmdk file, enter the destination filename, and click the "convert" button.

Converting VMWare to VirtualPC with Vmdk2Vhd

Creating the new VirtualPC Machine

Start up the VirtualPC console and go through the following steps:

  1. Select "Create A Virtual Machine"
  2. Set the Operating System to "Other"
  3. You'll have to decide how much memory you can allocate to the virtual machine; on my workstation with 2GB RAM, I allocated 768MB RAM.
  4. Select "Use an Existing Virtual Hard Disk" and browse to the location of the VHD file you created earlier using Vmdk2Vhd. I left "Use undo disks" unchecked.
  5. Hit "Finish" and you should have a new virtual machine shown in your VirtualPC console.

Mono 1.9 in VirtualPC

Setting up the Video Driver

VirtualPC and Linux have a long standing feud over video drivers. VirtualPC emulates an S3 Trio video card with 16 bit color depth, while the Linux X Server defaults to 24 bit color depth since that's what a real S3 Trio supports. The result is that Linux video under VirtualPC is always a pain in the neck. So keep with me as we jump through a few hoops to get Linux to recognize VirtualPC's video card.

When you start the virtual machine we created earlier, hit the down arrow to select failsafe defaults and hit enter.

Note: Previous openSUSE images required me to also fix the mouse by adding "i8042.noloop" to the failsafe boot parameters, but this appears to have been fixed for the 1.9 image.

Mono VMWare Image Failsafe Startup

After the boot process completes, you should be looking at a console window. You'll need to log in (root / mono) and enter "sax2 -m 0=fbdev" like so:

VirtualPC Linux Video - SAX2

SaX2 churns for a bit, then comes up in graphics mode. You can change the configuration, but I just clicked on OK.

Linux-SAX2

At this point, you'll need to reboot. You can do that in the VirtualPC menu (Action / Reset), or you can just type "shutdown -r 0" at the command prompt. When it comes back up, you can boot to Mono 1.9 / openSUSE 1.3 without using the Failsafe options.

Mono 1.9 in VirtualPC

We've got one more thing to set up - the network connection is disabled by default. You can connect by clicking on the network icon in the lower right-hand corner, then on "Wired".

openSUSE Network Connection

Stay tuned - in the next post, we'll make use of this image to take a look at Moonlight, the open source implementation of Silverlight on Linux.

Posted by Jon Galloway | 4 comment(s)
Filed under: ,

[Speaking] 3/25 at Code Trip / San Diego .NET User Group about Silverlight (Hard Rock, Video.Show, etc.)

I'll be speaking at the San Diego .NET User Group meeting on 3/25 when the Code Trip comes to town. Michele Leroux Bustamente will be talking about consuming services from Silverlight, and I'll be covering some of the cool front end Silverlight work we've been doing at Vertigo lately, including Hard Rock Memorabilia and Video.Show.

Here's some information on the San Diego CodeTrip event. If you can't make that one, be sure to catch them at one of the remaining stops on the CodeTrip tour.

UPDATE: Here are my slides from the talk

----------------------------------------------------------------

Cool Stuff in Silverlight
(That You See)

Jon Galloway
weblogs.asp.net/jgalloway
www.vertigo.com

----------------------------------------------------------------

MultiScaleImage
--Hard Rock Memorabilia (demo)
--Let's see if we can hook one up
----Seadragon Composer
----Simple Website
----Adding in mouse handling

----------------------------------------------------------------

Video - Timeline Markers
--Fire an event sync'd to video
--Can add client side (the cool part)
--Video.Show (demo)
--Code
----Look at the code (1.0 / Javascript)
----Look at a managed code example

----------------------------------------------------------------

Hello World in Silverlight
--(time permitting)
--Silverlight Link
--ClientBin
--XAP (zip file)

----------------------------------------------------------------

More Information
--silverlight.net/GetStarted
--silverlightcream.com
--Adam Nathan's book

weblogs.asp.net/jgalloway
www.vertigo.com
(get paid to do this stuff!)

----------------------------------------------------------------

Hard Rock Memorabilia

Video.Show

Posted by Jon Galloway | with no comments

Why Silverlight 2 Deep Zoom Really is Something New

The Hard Rock Memorabilia site got a lot of press MIX 08; TechCrunch called it the coolest part of the MIX keynote. It takes advantage of a new Silverlight 2 feature called Deep Zoom, which allows for smooth zooming and panning over a large collection of large images. It's really the kind of thing you have to see; words don't capture it well.

To frame the conversation, I'm going to include a video, but you really should just browse the site instead so you can see the smooth transition between the zoom levels, etc.. Go ahead browse the Hardrock Memorabilia site - Silverlight 2 installs in seconds, and doesn't require a reboot or anything. Well, it should install smoothly for you unless you're an Adobe Flash staffer who might not want it to install smoothly - can't help you there.

Since it's a visual experience, I recommend watching the video fullscreen. I've seen a lot of comments from folks not wanting to install Silverlight to see if it's worth installing Silverlight. Fair enough, I'm hosting the video at Viddler, using a Flash based player.

In a nutshell, the site allows you to smoothly zoom from a wide angle display to an extreme closeup on items such as Bo Diddley's guitar.

Capture Capture

Haven't I seen this before? Google Maps, Zoomify, Zoomarama, etc?

The reactions to this have fallen into two groups. Some folks say it's incredible, and some say they were impressed when they saw it in 2005, was called Google Maps (and zoomed all the way from outer space to their house). The unimpressed folks point out that there are other Flash applications that handle this, too, like Zoomify and Zoomarama. Haven't we seen this before?

For example, when TechCrunch called the Hard Rock demo the Coolest Bit of MIX Keynote One, commenters were quick with the "Yawn, seen it before" talk. A few days later, Lee at The Flash Blog showed off a collection of DEA photos on Zoomarama, saying that it illustrated how Flash can do the same thing.

cm

Yes and no. There are a few important differences.

Native support

While Flash (and even AJAX - more on that later) have been capable of delivering large images via progressive downloads for a while, neither have supported it natively. You had to install additional server software, write a lot of custom code, and / or give up a lot of control over your application. For example, a free service like Zoomorama is really cool way to show off your own photos, but it’s an advertising supported service which limits you to 150 mb per album. They store your photos for 90 days (renewable up to 6 months), then they delete them. None of that would work for a site like Hard Rock, which serves up over 4 GB of images in a custom interface, and probably plans to be online for longer than 6 months.

Zoomify is a more appropriate comparison for professional use, but it costs $795 per server. By comparison, Deep Zoom is built into the Silverlight plugin. You’re free to host your photos where you’d like, without restrictions on ad support or licensing requirements. So you could build and host a Silverlight / Deep Zoom site like Hard Rock without paying a single cent to anyone, including Microsoft. There's no reason that you couldn't host a Deep Zoom site on Linux / Apache (and could view the site on Linux, Mac, and of course Windows).

Customization

The fact that Deep Zoom is built in as a native Silverlight element - a primitive, like an image or a textbox) means that you have full control over how it works, including user interface composition, interaction, and programmatic integration. The Zoomify viewer can be customized, but from what I've read in the FAQ's it looks a lot more complex than working with the Deep Zoom MultiScaleImage. There are also some limits to what you can customize with Zoomify - I'm guessing that with enough work you could get it to look and act how you wanted, but I'm just about certain that it would require a lot more work than an equivalent experience would take in Silverlight.

Deep Zoom compared to Google Maps API

Taking a step back, there's nothing magic about the RIA approach to browsing these big images. Whether you're you're using Flash, Silverlight, or AJAX to request the appropriate image information from the server and make the transitions between images look good, it's valid to point out that the Google Maps AJAX approach has been doing a pretty good job with this for a few years now.

For instance, take a look at the xRex sample viewer. They're using the Google Maps API (JavaScript) to display their collection of high resolution images, such as this one Chicago. Here, I'm zooming from a city-wide zoom to display individuals; if you look at the zoomed image full size you can read license plates and street signs.

 xRez - Chicago - Wide Angle xRez - Chicago - Zoomed

Google Maps uses a QuadTree to store a pyramid of images at different resolutions. As long as you've got your images chopped up correctly, the Google Maps API (a.k.a. Javascript include) handles requesting the appropriate image files to display the current view, and transitions smoothly (well, kind of smoothly) between zoom levels. It's easy to see what's going on by running the Firebug network monitor while zooming in.

xRez - Chicago - Firebug

Firebug doesn't pick up the individual image requests from Silverlight Deep Zoom. I initially jumped to the wrong conclusion, as others have: I guessed that Deep Zoom was using a wavelet based image format (like JPEG 2000 or HD Photo). That would make sense, since Photosynth apparently used HD Photo. After a bunch of work to write a comparison of HD Photo and JPEG, I suspected Firebug was misleading me. First of all, I knew that the source files on the server were simple JPEG's. Secondly, since Silverlight is server agnostic there couldn't be any server side magic going on. Sure enough, Fiddler shows that browsing the Hard Rock Memorabilia collection does the same thing:

Deep Zoom - Traffic in Fiddler

So, on that point, we've got a draw.

To recap: Flash ZUI (zoomable UI) components are workable but have drawbacks. An AJAX ZUI approach, like Google Maps, seems to do the same thing under the hood that everyone's doing - pulling JPEG tiles from the server on demand. So, how is Deep Zoom better than AJAX?

Collection Support

The Hard Rock Memorabilia site also has support for collections. Look at the screenshot below and take a look at the navigation area on the left. Those collection navigation links let you filter the view by artist, subject type (for instance, instruments), decade, genre, and location. The Google Maps system is browsing over one large image, and you really only have control over zooming and panning. By contrast, Deep Zoom is smoothly panning and zooming through collections of large images (at different resolutions) which can be dynamically rearranged by user action.

Hard Rock Collections

Software Support

Here's one more big difference - the tooling for Deep Zoom is really nice. Last night I downloaded the Deep Zoom Composer (free) and built a collection in a few minutes. The longest part of the the process was digging around for some images, deciding that my photos could be better organized, and then just deciding to use the sample photos that come with Vista. Other than that, it was just import, position, and export - it took about five minutes. Here's the compose screen.

Deep Zoom Composer

As I was mentioned before, collections can include multiple images of widely different resolutions, overlapping or aligned however I choose. For instance, I could have shrunk all the other images and hidden them as Easter Eggs in the tree; you'd only notice them when you zoomed in, but could zoom to the full resolution on the embedded images.

Next, I export the images:

Deep Zoom Export

That creates a folder tree holding JPG images at different resolutions, which are referenced via the info.bin index file.

Deep Zoom FolderDeep Zoom Image Tiles

I found some applications out there which will slice up photos for use by the Google Maps API, like the Google Maps Image Cutter and GMap Uploader (not suitable for large photos, as it's a web based tool). They'd probably do a fine job of cutting up a single image, but since the Google Maps API doesn't support collections, these don't either. And while I'm a big fan of community software, I'd rather have a free, supported image slicing application provided by the same company that's building the image zooming framework.

The Legal Question

The Google Maps API Terms of Service states:

For individual users, Google Maps, including local search results, maps, and photographic imagery, is made available for your personal, non-commercial use only. For business users, Google Maps is made available for your internal use only and may not be commercially redistributed, except that map data may be accessed and displayed by using the Google Maps API pursuant to the API terms and conditions.

Additionally, while Google Maps is currently a free service which currently does not contain ads, Google states in their terms of use that they reserve the right to display ads in the future.

So, what does that mean? It seems that those terms would prevent me from using the API for a public site for business use, and that would mean that I couldn't build a commercial site like Hard Rock Memorabilia with the GMaps API. It's fuzzy, because the Google Maps API TOS probably have mapping in mind, and I wouldn't expect that Google would sue Hard Rock over their use of the JavaScript... but they could. I'm not trying to spread FUD, I'm just saying that as a business user I'd have some degree of concern that the GMaps API isn't really a "redistributable" API.

In contrast, the Silverlight plugin is freely redistributable, so there's no licensing concern there.

I see how this works, I could totally code it myself

Some people have looked at Deep Zoom and said, "Oh, they're just downloading image tiles on demand. There's nothing hard about that, I could totally build that..." Yeah. I've made that mistake before. Understanding the technologies a system uses does not mean that it's trivial to build or maintain your own version. This is hard stuff, and there's a very low payoff in becoming an expert here when there are free, tested solutions out there. But, you know, knock yourself out, and be sure to let us know how it went for you by leaving a comment below.

Disclaimer: I work for Vertigo, the company that built the Hard Rock Memorabilia site. I didn't work on the project.

Posted by Jon Galloway | 22 comment(s)
Filed under:
More Posts