Showing posts from 2009

Tom Forsyth (Larrabee Dev) speaking at Stanford

I just noticed Tom Forsyth, aka tomf, is speaking at the Stanford EE CS Colloquium on January 6, 2010. The video will hopefully be posted on the web afterwards.
The topic is "To be announced", but is very likely to be Larrabee related.

3D toolchain musings

I'm writing a skinning sample for a future Android SDK. This has prompted me to construct a toolchain to get skinned animated models into Android applications.
I'm really only just getting started, but so far I'm thinking along these lines:
Wings 3D -> Blender 2.5 -> FBX ASCII -> ad-hoc tool -> ad-hoc binary file -> ad-hoc loader.
For what it's worth, right now Blender 2.5 doesn't support FBX export, so I have to do Collada -> FBX Converter -> FBX. But Blender 2.5 support should be ready fairly soon.
You may wonder why I'm considering using the proprietary and undocumented FBX standard rather than the open source Collada standard. I'm doing it for the same reason so many other tool chains (e.g. Unity, XNA) do, namely that FBX is a simpler format that just seems to work more reliably when exchanging data between DCC applications.

Blender 2.5 alpha 0 is looking pretty good

The open-source Blender 3D DCC tool has long suffered from an ugly, non-standard, hard-to-learn UI. I'm very happy to see that the latest release, which just entered alpha status, has a much improved UI. It's not quite Modo quality, but it's starting to get into the same league as commercial DCC tools.

Two very good talks on ECMAScript 4, 5, and 6

Yahoo continues to be a source of excellent information on recent and future versions of JavaScript / ECMAScript. Here are two very good talks from November 2009 about the evolution of JavaScript from 2000 until now:
Doug Crockford on ECMAScript 4 /5

Brendan Eich on ECMAScript 4 / 5 and Harmony

Prince of Persia Developer's blog

In the late 1980's Jordan Mechner single-handedly designed and programmed the original Apple II version of Prince of Persia and several other groundbreaking games. He published his development journals and technical design documents on his web site. The journals touch on:The development of the stop-motion animation techniques used so effectively in PoPThe tension in Jordan's life between his two callings: game development and feature film scriptwriting / directing.The difficulties involved in developing and selling a new game idea.A view into the late 80's / early 90's pre-web game development business.Although many games are now written by large teams of people, in the end, a lot of the business, artistic, and technical issues Jordan writes about remain relevant. I highly recommend these journals for anyone interested in an inside view of game development. (Or anyone interested in trying to break into Hollywood. :-) )

A Multi-threaded Go Raytracer

Above is the output of the raytracer. Below is a diagnostic mode showing which goroutines raytraced which section of the screen. Each goroutine has its own color to outline the pixels it traces:

I wrote a simple multi-threaded ray tracer in Google's new "go" language. It's an adaptation of Flying Frog Consultancy's Raytracer.
It runs single-threaded about 1/2 the speed of a comparable C++ version. I guess the C++ version benefits from a more optimizing compiler and the ability to inline small functions.
Compared to ordinary C/C++, the Go version was easier to multithread.
On my dual-core Macbook Pro I get an 1.80x speedup when running with GOMAXPROCS > 1:
$ GOMAXPROCS=1 time ./gotrace 1.52 real 1.50 user 0.01 sys $ GOMAXPROCS=2 time ./gotrace 0.82 real 1.50 user 0.01 sys $ GOMAXPROCS=3 time ./gotrace 0.81 real 1.50 user 0.01 sys
On an eight-core, 16 Hyperthread HP Z600 running Ubuntu 9.10, (with the source code chan…

How about that new Verizon Droid?

I've been working part time on the "Droid" project for the last year, and it finally shipped today. I wrote some of the graphics libraries.
At first I was skeptical of the industrial design. The early prototypes looked very much like a 1970's American car dashboard. But Motorola really improved the industrial design in subsequent versions. I like the high-grip rubber on the battery cover. It makes the phone very comfortable to hold.
The phone hardware is very fast, and the high resolution screen is beautiful. I think people will enjoy owning and using this phone.
My favorite feature is the turn-by-turn navigation software. My second favorite feature is the "Droooid" default notification sound. Oh, and the camera flashlight is very nice too!

Wired article about Demand Media's automated How To videos

Man, the web really does change everything!
The company "Demand Media" has developed a Google-like business model for creating how-to videos: Use data mining to figure out what people are searching for.Use semantic database to figure out what their search queries mean. (e.g. "how to draw a gun" vs. "how to draw a flower".)Find out how much advertisers are willing to pay for an ad that appears next to the video.Look at how much content already exists to answer the question.Use 1-4 to calculate the expected lifetime value of the how-to video.Automate the process of matching freelance writers, videographers, editors, and fact checkers to create the video as inexpensively as possible. (In the $30 per video range.)Host the resulting videos on Youtube (and other video sites) and monetize with ad keywords.They say that the algorithm produces lifetime values about 5 times higher than human editors do.
These guys have basically automated the "How to" video…

Ubuntu 9.10 gets a clue!

I was pleasantly surprised to see that the latest version of Ubuntu, 9.10 b1, comes with a nice selection of desktop backgrounds. This makes a huge difference in how beginners perceive the product, at very little cost to Ubuntu.

The new dark-brown default color scheme is also an improvement over the older schemes.

I published my first Android app

Now that the Android Native Development Kit has been released, I was finally able to publish the sources and binary to my Android Terminal Emulator. It's a fairly plain Digital Equipment Corporation VT-100 terminal emulator, with some features from newer terminals (like colors.)
This is my first application in the Android Market. There are at least 10 other terminal emulators in the market; we'll see how this one is received.
A bit of history: This was my first Android application. I wrote it for the original "Sooner" Android devices, and have kept it updated for the successive generations of devices. It requires native code because there's no public Android Java APIs for dealing with PTYs.
A bit of ancient history: I wrote two terminal emulators for the Atari 800 back in the day: Chameleon, in 6502 assembly, and a version of Kermit in the excellent "Action!" programming language. Kermit was one of my first "open source" programs. If you poke aro…

GLES Quake - a port of Quake to the Android platform

I've just published the source code to a port of Quake to the Android platform. This is something I did a while ago as a internal test application.
It's not very useful as a game, because there hasn't been any attempt to optimize the controls for the mobile phone. It's also awkward to install because the end user has to supply the Quake data files on their own.
Still, I thought people might enjoy seeing a full-sized example of how to write a native code video game for the Android platform. So there it is, in all its retro glory.
(Porting Quake II or Quake III is left as an exercise for the reader. :-)

What's different about this particular port of Quake?

Converted the original application into a DLL

Android applications are written in Java, but they are allowed to call native languge DLLs, and the native language DLLs are allowed to call a limited selection of OS APIs, which include OpenGL ES and Linux File I/O.

I was able to make the game work by using Java for:
The Andro…

IDF 2009 Larrabee demo

Intel showed their new Larrabee GPU publicly for the first time at their annual developer conference. They showed Larrabee running a ray tracer that was rendering QuakeWars geometry.

The enthusiast scene (e.g. beyond3d) was not impressed by this demo, because, frankly, it wasn't very impressive at an emotional level. The scene was static, no people in it, just waves and a few very small helicopters. It's strange that they didn't even move the camera, which is something that a ray tracing engine should easily be able to to. The camera angle they chose was effective for showing dynamic reflections, but keeping the camera locked down meant a much less interesting demo.

For the same amount of effort they could have come up with a much more visually and emotionally interesting demo. For example, a cascade of brightly colored chrome balls tumbling down a staircase, which would show off both physics and ray tracing.

That they didn't use this early opportunity to sell Larrabee in…

ICFP 2009 contest final scores

Final scores are out, and my team Blue Iris scored 80 out of 328 in this year's ICFP contest. Not as good as last year, ah well. :-) Next year: More sleep!
And here's a video of the contest results presentation from ICFP.

Brick Break - a Javascript Breakout clone

This weekend I wrote a Javascript clone of the old Atari "Breakout" game. Thanks to the "Canvas" tag it was very easy to write, but I did run into a few problems:

Javascript math is always floating point, so I had to use the "Math.floor" function to convert the results of a division to an integer. This was in the brick collision detection logic, where I am converting the ball's (x,y) coordinates to the bricks that the ball might be hitting.

I was evaluating document.getElementById too early in the document lifecycle, before the corresponding elements existed. This took me a long time to diagnose -- I ended up just moving the getElementById calls to their run-time use, rather than trying to cache the results.

Jack's Brick Break Breakout clone

ICFP 2009 paper on Haskell in the Real World

Here's a good paper on using Haskell to write a commercial application. The authors are practical commercial programmers who tried Haskell to see if it was a more effective language than Ruby:

Experience Report: Haskell in the “Real World”
Writing a Commercial Application in a Lazy Functional Language

Of special interest is the "Problems and Disadvantages" section. It seems that space leaks which are a continuing source of trouble in the authors' application.

Reading this paper reminds me of Tenerife Skunkworks Haskell vs Erlang Reloaded. In that experiment a developer found that Erlang was much better than Haskell for real-time programming.

Back to gnome

Well, 8 hours using wmii was enough for me. Too many apps didn't quite work right. So I'm back to plain-old-boring-but-familiar Gnome.

Technology Trends I'm Keeping an Eye On

In no particular order, here's what I've been studying lately:Javascript. I've avoided this language over the years because of its low speed and shoddy reputation. But the language implementations seem to be getting faster and the available libraries seem to be getting more interesting. I've just watched all of Doug Crockford's YUI lectures on JavaScript, and I'm thinking about trying to use the language in some toy projects.git gui - this git command, available in recent builds of git, make Git changes pretty easy to author.The Undercover Economist - this is a great book about economic theory. It's pretty easy to read while shaving, or waiting for compiles. Lots of good anecdotes and tools for modeling the behavior of consumers and firms. I took 3 economics classes in college, and they didn't teach me as much practical information as I've learned from reading this book.Hacker News - this link voting site has replaced alterslash and reddit programmi…

Dual XHD7714 Road Trip Report

After a month of using the Dual XHD7714, during which my family and I took a 4000 mile road trip, I have to say it's a pretty nice system. We used it almost exclusively as an MP3 player, rather than an HD Radio or a CD player. I loaded 800 songs from our home music collection onto an 8GB memory stick. It was great introducing my kids to some new music. By the end of the trip their favorite songs were Shock the Monkey and The Magical Mr. Mistoffelees.
Some problems specific to the Dual XHD7714:
Bluetooth issues: Bluetooth headset mode only syncs with one phone at a time. This seems to be a common limitation of low-end bluetooth car stereos, but it's quite frustrating for two-driver families like mine.Bluetooth audio streaming mode doesn't sound very good on this radio. However, I didn't experiment with this very much, so it may have been source-material related.USB MP3 player issues: It takes about 5 seconds per GB to index USB stick music each time it starts up.It only re…

Nehalem machines are very fast

I've just had a chance to use a Nehalem HP Z600 workstation with 2 Xeon E5520 CPUs. The machine has 8 cores, 16 hardware threads, and an absurd 12 GB of RAM.
It's very fast. It's about 2.5 times as fast (when building the Android sources) as the previously fastest machine I'd used, which was an HP xw6600 with a single Xeon E5420 CPU.
The machine's relatively small, no larger than an ordinary ATX tower. One way that HP kept the case small is by making the motherboard an odd shape: it is "C" shaped, with a cutout that leaves room for the DVD drive.

Too Many Words about Car Stereos

The other day my wife said to me, "Jack, we're going on a road trip soon. Is there any way we could hook up our MP3 player to the car stereo, so that the kids could listen to their favorite songs during the trip?"

Twenty hours of web research and $250 later we've got a new car stereo. It's a Dual XHD7714 from Crutchfield. I'm getting it installed by Best Buy tomorrow. Let's hope their AV installers do a good job!

First, why did I get a new stereo at all? Well, all I wanted to do was hook up an MP3 player. But there was no easy way to do that. My 2005 minivan came with a factory installed stereo that didn't have an auxiliary input. There are cheap FM transmitter systems that work with any radio, but they look clunky and the sound quality is supposed to be poor. A lot of web searching turned up some aftermarket accessories that allow hooking up either an audio input jack ($75 + $50 installation = $125) or an MP3 player and/or iPod ($125 + $50 = $175.) Bu…

Using a Mac keyboard with Ubuntu Linux

I frequently switch between Mac and Linux, and it's been troublesome to remember to type Command-whatever on the Mac, but Control-whatever on Linux. (For copy-and paste, for example.)
I did a quick web search and found out that it's easy to make Ubuntu Linux recognize the Command keys as an extra set of control keys:
Choose menu: System : Preferences : Keyboard Select the Layouts tab Choose "Layout Options" Open the "Alt / Win Key Behaviour" tab Check the "Control is mapped to the Win-keys" checkbox.

ICFP 2009 contest blog - Team Blue Iris

I just threw in the towel on the ICFP 2009 Programming Contest.

The problem this year was a set of 4 sub-problems related to orbital mechanics, plus a virtual machine spec. The virtual machine was used to enable the problems to be specified exactly, without worrying about differences in the order of math operations.

Implementing the virtual machine was easy and fun. Unfortunately, actually solving the final sub-problem required learning too much math and physics. I was able to solve problems 1 and 2, and make an entry for the lightning round. And I brute-forced a solution for problem 3. But now, 56 hours into the contest, I am giving up on problem 4.

I can see the general outline of how to solve it, but it would take sharper tools than I have now. For example, I'd like a way of solving Lambert's equations, but I'm having trouble deriving the code on my own, and the best example I've found while searching the web is a 30-year-old NASA Space Shuttle Fortran program. Also, …

Dandy in JavaScript

This weekend I wrote a JavaScript version of my old Atari 800 game Dandy.

Check it out: Web Dandy

It was my first JavaScript application. It was about as easy as writing the Python version. I have only tested it in two browsers so far (Firefox 3.0 and Chrome), and only on one platform OSX. I have already run into differences between the two browsers: Firefox 3.0 for OSX seems to double-post keydown events.

No sound or multiplayer yet. Oh, and I use the CANVAS tag, so I think older browsers (like IE 7) won't work.

Living La Vida Linux at Work

Android system-level development can be done on either Linux or OSX. For the past few years I've been using OSX, but recently I've switched over to using Linux.

Why? Mostly for the higher performance. The full Android system build takes about 30% less time under Ubuntu 8.04 LTS than it does on OSX 10.5 on the same hardware. Not to mention that it's much cheaper to buy a generic PC workstation than the equivalent Mac Pro.

I have had some early troubles:

It took me a while to get used to typing the "Ctrl" key instead of the "Command" key, and the ugly Linux fonts bothered me for a few days.

But since I'm mostly using the exact same programs on Linux as I was on OSX (FireFox, Eclipse, Android), after a few days everything clicked, and I think that I'm just as productive as I was before. And the faster builds and file system stuff (like grep) are wonderful.

It helped a lot to install the Blubuntu theme and some nice wallpaper to get away from the awful U…

See, this is why we can't have nice things (Ubuntu 9.04 Intel Drivers)

A few years ago I tried Ubuntu and predicted it would become a serious challenger to Windows, in about 18 months.

Well, it's about 18 months later, was I right?

Not exactly. Ubuntu seems to have stood still, if not actually gone backwards. In particular, the newer releases have much worse sound and video performance on my hardware (Intel CPU/GPU Mac Minis) than earlier releases.

The sound driver issue is because Linux, in its typical decentralized fashion, is trying to figure out how to provide a standard audio subsystem, and has two or three competing standards that are duking it out. Since they all suck it seems odd that people defend them so much. Just pick one already.

The video driver issue is because Intel decided to take several years to rewrite their Linux video driver stack, and Ubuntu decided to ship the new broken drivers rather than continue to use the old unbroken drivers. Very very lame on both Intel and especially Ubuntu's part.

And Phoronix's performance tests …

The diNovo Edge is a nice keyboard for HTPC

I just bought a Logitech diNovo Edge Mac Edition keyboard for my Mac Mini HTPC.

I bought the diNovo instead of the Apple Bluetooth keyboard because:
Built-in trackpad.Built in volume control slider.Dedicated media transport controls.
Nifty dock / recharger stand. It's my first Bluetooth device. So far I think Bluetooth works a lot better than IR, because you don't have to point it at an IR receiver.

The diNovo does have some flaws:
No key backlighting, which makes it hard to use in the dark.The mouse buttons below the trackpad are mushy and hinged at the outer edges, making them hard to press. (Happily tapping works and there is a separete left-mouse-button on the left edge of the keyboard. So for typical Mac usage you don't need to use the mushy buttons.)A skim of the Logitech support forums indicates that the function keys are not as programmable as some people wish. I don't use function keys that much so this hasn't been an issue for me yet.
My TV is a 40" LCD, a…

Larrabee Instruction Set Talks

Here's the first public version of the slides from Tom Forsyth and Michael Abrash's GDC 2009 talks on Larrabee's instruction set, by way of Japanese magazine PC Watch, as seen on Beyond 3D's Forums. (You have to manually click on each of the little thumbnails of each slide.):

Hopefully Intel (or GDC) will release a better version of these slide decks sometime soon.

Say, was it just me, or was blogging really light about GDC this year? In past years I was a lot more technical writeups than I saw this year. I wonder if blogging is down in general? Is everyone on Facebook and Twitter now? I can't imagine Twitter being very useful for reporting technical information.

Here's Michael Abrash's Doctor Dobbs Journal article on the Larrabee instruction set.

Here's the Intel GDC 2009 Larrabee talks:

Rasterization on Larrabee: A First Look at the Larrabe…

Using XBMC on Mac Mini using both OSX and Linux

The Xbox Media Center (XBMC) is a nifty open-source application for watching videos. It was originally designed for use on modified Xbox video game consoles, but has more recently become popular for Intel-based Home Theater Personal Computers. It has been ported to Windows, Mac, and Linux. It has no PVR features, instead it concentrates on displaying streaming and downloaded videos. Its big advantage over using the Xbox 360's similar application is that it handles a much wider variety of streaming video sources and downloaded video codecs.

I've been running Plex, an OSX-specific version of the Xbox Media Center, on my Mac Mini for several months now. Overall it's a good product, but I had some issues for my application. I wanted Plex to serve as a consumer electronic device that my mother-in-law (who doesn't use computers and can't read English) could use by herself to watch videos. The system I put together didn't work very well for her. The problems we ran in …

Intel describes Larrabee instruction set

Perhaps in preparation for Friday's GDC talks by Michael Abrash and Tom Forsyth, Intel has described the Larrabee instruction set:

Prototype Primitives Guide

Intel includes a C source file that implements their new instruction set, so people can play around with the instructions before Larrabee ships.

The instruction set looks alot like a typical GPU shader instruction set. Lots of "log" and "rsqrt" type instructions. But there are also some interesting variations on MADD, such as MADD233_{PI,PS}, which I assume help shave cycles off of inner loops. The compress and expand instructions also look very useful. I look forward to reading code examples from Abrash and Forsyth in the near future!

Listening to my home music at work with SqueezeCenter and Softsqueeze

For some time I've wanted to listen to my home music collection on my computer at work. I tried a bunch of different approaches, and finally came up with one that works pretty well:
I run the free SqueezeCenter program on my home machine to serve music.I run the free Softsqueeze program on my work machine to listen to the music.To keep the whole world from listening to my music, I set up an SSH tunnel.
The resulting system works pretty well.

In case you're wondering, the SqueezeCenter program's main use is to serve music to the Squeezebox brand of internet radios. The ability to use it with a regular computer, without purchasing a Squeezebox internet radio, is a nice gesture on the part of the Logitec company that makes and sells Squeezebox internet radios.

Future for cryptic Larrabee news

Phil Taylor, a long-time Microsoft graphics and gaming evangelist is now working for Intel on graphics tools evangelism. He started a blog, called Future GPU, where he drops hints and links about Larrabee development. He also tells Microsoft war stories for people in the mood for inside-baseball information about Microsoft's DirectX and game groups.

Back when I was working at WebTV and just learning about the 3D graphics world, Phil was nice enough to give me and a few of my WebTV co-workers tickets to the super-desirable GDC DirectX party. These parties were intended for external developers, so it was very hard for non-DirectX Microsofties to attend. Thanks Phil!!! :-)

From reading Phil's blog it sounds like Intel's developing a set of graphics debugging tools that they're going to announce at GDC. Could it be PIX-for-Larrabee?

I found Phil's site through a "Google Alert" that I set up for Larrabee news. It does a weekly search for Larrabee news. The web…

"Pixar Quality Graphics" is 720 Gflops

For at least 10 years GPU vendors have been talking about "Pixar Quality" graphics. But what does that mean? Well, according to this lecture on The Design of Renderman, the original goals for the REYES architecture were
3000 x 1667 pixels (5 MP)80M Micropolygons (each 1/4th of a pixel in size, depth complexity of 4)16 samples per pixel150K geometric primitives300 shading flops per micropolygon6 textures per primitive100 1MB texturesThat's a shading rate of 80M * 300 * 30 Hz = 720 Gflops. (They were probably more concerned about 24 Hz, but for games 30Hz is better.)

In comparison I think the peak shader flops of high-end 2008-era video cards are in the 1 TFlop range. (Xbox 360 Xenos is 240 Gflops, PS3 is a bit less.). Now, GPU vendors typically quote multiply-accumulate flops, because that doubles the number of flops. So it's more realistic to say that 2008-era video cards are in the 500 Gflop range. So we really are entering the era of "Pixar Quality" graphi…