I Am Free, and so are you

Jewel Logo

Category: Accessories
Released Aug 9, 2008
Seller: N/A
(c) 2008 Owen Williams
Version: 1.0
24K

The red icon on your Nokia N800 or N810 always reminds you (and others when you show it to them) that you appreciate freedom. It’s a work of art with no hidden function at all.

You are free to install it from the Application Manager from the Extras repository.

You are free to install it with one-click download:

Chinook / Diablo (OS2008)

You are free to download it directly from my website:
i-am-free_1.0-1_armel.deb

You are free to download the sourcecode:
i-am-free_1.0.tar.gz

You are free to open it up, see how it works, make it better, email it to your friends, and do whatever you want.

What else are you free to do?

3 for 3.0, and Project Sandbox

There has been a lot of discussion recently about the future of GNOME and the stasis that the project seems to have reached ((I dislike the term “decadence,” because it seems to imply abundant wealth going to waste. GNOME will never be the wealthy-person’s OS of choice. That would be OS X)). I think that stasis is not a horrible place to be. As others have said, having a desktop that is stable, useful, and predictable is a good thing. Developers have worked hard to get the desktop where it is, so let’s give them all a pat on the back before we discount all that’s been achieved.

But, as an application developer, I see some shortcomings to GNOME that is preventing further progress in user interface design. There are technical limitations, but there are also social limitations working against progress. On the technical side, GTK needs some changes to allow more developers to take user interaction to the next level. On the community side, there needs to be an official GNOME-sponsored forum in which to experiment free from criticism.

To enable developers to try new things, GTK may need to break ABI stability and move to version 3. I call it “3 for 3.0” — the three features GTK needs to move forward:

  1. Multi-input from the ground up: Right now GTK reacts to one event at a time. It’s possible to make an application look like the user is doing many things at once, but true multi-touch and multi-user interaction is not really possible — or at least it’s too difficult for moderately-skilled developers (like me) to achieve.
  2. First-class Animation: GTK needs to perform animation by default. There are ways to make widgets spin, slide, and fade, but they are all hacks. I should be able to fire off an animation and perform other functions while it is animating. I should get a signal when the animation is complete. Built-in state management would be a key feature. There should be a standard library of basic transitions and special effects that anyone can use with minimal code (like fade, push, wipe).
  3. 3D-awareness: GTK doesn’t need to be 3D itself, but it should understand and be ready for 3D. 2D apps will never disappear, but there will be a need for a bridge between 2D and 3D. This could mean that GTK would support a z-buffer, or perhaps it would have a blessed 3d-canvas like Clutter. Or perhaps it could have access to OpenGL to provide various compositing and shader effects.

Perhaps some of these effects seem only useful for pointless flourishes that will slow down interactivity and increase processor overhead. I would argue that what GNOME needs right now is some stupid slow-ass eye-candy. Look at Compiz Fusion. It has dozens of gaudy effects, half of which are useless and most of which have way too many settings. But I love playing with it. It’s been a fertile sandbox for developers to go in and see what works. Maybe the “fire” transition is a waste of time, but there are a few Compiz features that are genuinely useful and I use all the time. The “enhanced zoom” feature, for instance, is a perfect way to blow up a youtube video without making it full-screen.

Every now and then I see a screencast from a GNOME developer working on a little pet project, and some of those demos have been amazing. Whenever I go to the GNOME Summit in Boston, there’s always some guy with his laptop, and he says, “take a look at this –” and proceeds to blow everyone away with some awesome thing he’s been working on. It’s rare, though, for those hacks to escape from that single laptop onto anyone else’s.

GNOME needs a Project Sandbox — an official, gory-edge (it’s past “bleeding”), parallel installable set of libraries and programs (“Toys,” perhaps? ((The exact terminology isn’t important, I’m just keeping the Sandbox metaphor going))) with all of the crazy hacks developers have been trying. It should be housed in a distributed SCM, so developers can push and pull from each other, mashing features and screwing around with GTK “3”, Clutter, Pyro, and whatever other toys people come up with.

The Sandbox should have two rules:

  1. No Kicking Sand ((alternate title: “No Pooping in the Sandbox”)) — ie, no stop energy. Anything goes, no matter how hacky. Developers should be able to prototype ideas quickly, no matter how cracked up they may be. The good ideas will stick and can be re-written cleanly. Nobody, not Apple, not Microsoft, not Nokia, knows what will really be useful in the future with multi-tap and 3D. Apple has a head start, but that doesn’t mean they have all the answers.
  2. Anyone Can Play: If I pull from your tree, I should be able to build and install what you’ve made. It does no good to have a toy if it only works in your corner of the sandbox. There might be some cases where a feature requires a certain video card, but developers should make a good faith effort to make code build and install on systems other than their own. Setting up a development environment is Hard, but I wouldn’t care if I needed 4 hacked copies of GTK each with different .so-names. Disk space is cheap! Computers are fast!

GNOME has done a good job of reining in developer craziness and promoting consistency and uniformity across the desktop. That was good, and was necessary while the desktop was maturing. Now it’s mature, and those reins need to be lifted, or at least relaxed. The stable desktop can plod forward steadily, but developers need a place to relax, rip off every feature from the iphone and Vista, and more importantly make that code public without fear of attack. What’s worse than a flame on Planet Gnome in response to a crazy feature? The feature that doesn’t get written for fear of being flamed.

PenguinTV’s third platform: maemo

This weekend I hosted a little maemo hackfest with my friend Mike with my goal being to get PenguinTV to launch in the maemo development environment. This meant building python support for mozilla embedding, which was hard. I’m used to checking out code and then building it, but the process of building the microb-engine packages was incredibly obtuse, and had no documentation. But I tried one thing, then another, then another, and finally it worked.

Once the gtkmozembed python module was finally built, porting the application was relatively easy. GTK is really wonderful because you can extract widgets, move them around, and plug them back in where you need them. I can take a toolbar that normally goes here and plug it in there, I can take a preferences window and throw in a scroll bar, and I can turn off that menu item or that button if it doesn’t apply. Sprinkle “if RUNNING_HILDON:” checks where necessary, and:

PenguinTV on Maemo

I always have to do some extra gymnastics because my program requires a lot of special startup initialization and shutdown finalization, but other than that the port was nice and straight-forward.

I’m now working on using all of the maemo-specific features like hardware buttons, network connection, and system messages. It should just be a matter of hooking up to some basic signals to existing functions.

My only big concern about is the “state-saving” feature that allow hildon to completely shut down a program when the user switches away, then restored when the user switches back. Because of all of my threads, database connections, and caches, my startup and shutdown are very slow. I’m not sure if it’s going to be possible to save fast enough. I also don’t know if it’s possible to save the scroll position of a mozilla widget, because when the user switches back they’ll expect to have everything scrolled how they left it. Since gtkmozembed is a black box, it’s just going to start scrolled at the top, which is not acceptable.

Along with olpc and the desktop, PenguinTV now runs on three different platforms using a single code-base.

Back in Business

This Monday morning, I started up my laptop to check the weather report like usual. Although it booted, it quickly crashed. I tried again, and it froze again. I tried memtest86, and that froze too. And so began My Time Without Half My Brain. Something in my thinkpad’s motherboard fried so I had to send it in to IBM to get repaired. Although they assured me the average turnaround is 5-7 days, I knew from experience that, with shipping time, this would be more like two weeks.

This really sucked because after 6 straight weeks of finishing shows and this week being my last, 20th show of the year, I was planning to take much-needed next week off and do some hacking on the OLPC version of PenguinTV. Without my laptop it would be next to impossible to find another linux machine and get it to the point where I’d feed productive on it.

On Tuesday, I got the ez-ship box from DHL and shipped off the poor little laptop Taking care, of course, to remove my not-officially-supported-harddrive with not-officially-supported-OS and insert my original-low-capacity harddrive for them to reimage. DHL: you rock for calling ahead and confirming my address which IBM had wrong.

With my minidock naked and empty, I salvaged some tomboy notes and bookmarks from my backup drive and uploaded them to a VMWare Fusion instance on the mac on my desk By the way, VMWare Fusion is totally awesome and I recommend it highly. I had a fully-functional Ubuntu desktop in the time it takes to download the pre-made image. You can even drag and drop files from the host OS to the guest OS desktop!. This gave me a workable solution for checking email and such, but I still felt slow and stupid without my various array of calendars, bookmarks, and email archives.

Today, I was presented with a package from DHL. My laptop is completely fixed and working again. This is the fastest turnaround time I’ve ever experienced for a laptop repair, and after popping back in my own harddrive everything is just as I left it. And because I got a three-year warranty, it was free.

Now, my hacking plans for next week are back on, and even better I also got an email that I’ve been accepted into the Nokia n810 developer program, so I’m soon going to have two separate mobile platforms for which to develop PenguinTV.

IBM / lenovo / whoever it was: you rock. I’m sorry I ever thought about getting my next laptop from HP.

Avid Symphony Nitris – hope you like progress bars

It’s one thing putting up with Avid because of their kludgy made-it-up-as-they-went interface. I’ll grant that video editors are not particularly technical people, so the cost of modernizing the UI wouldn’t be worth the retraining costs.

But if we pay 90,000$ for the best Avid editing station, which includes 4,000$ for a quad-core Xeon workstation, it should bloody well use more than one processor at once when rendering effects:

If your code is so old and krufty that you can’t support multiple processors for something as simple as effects or video encoding, it’s time for a rewrite.

Audioscrobbler support in Sonata

As I’ve mentioned before, Sonata is my favorite music player. One shortcoming, however, is that it lacks support for last.fm’s audioscrobbler, which allows music players to automatically submit songs to the service and help build one’s musical profile.

No more: sonata-audioscrobbler.diff

I whipped this up in a couple hours, so be on the lookout for bugs. It’s not so good at reporting bad passwords, so you have to look at the console output for that information. Either you see “BADAUTH” (bad) or “Uploaded 1 tracks successfully” (good). If the Sonata author adds feedback for mpd authentication problems, I’ll hook up to that.

I’ll also update my sonata olpc package to include this patch.

Update: Added a check to ignore songs that don’t have all the metadata that audioscrobbler wants.

Buddha Box music — now with more zen

At FUDCON 2007, someone brought a Buddha Machine, aka Buddha Box. It was very cool, and I was pleased to see that the sound tracks are available for download.

However, Track 1 has some nasty high-frequency distortion in the wave file that renders it extremely not zen. I decided to run a filter over it to clean it up, and turned to my usual go-to sound program (which I dislike) called Audacity. Audacity wanted no part of Buddha:

audacity: layer3.c:2633: mad_layer_III: Assertion `stream->md_len + md_len - si.main_data_begin < = (511 + 2048 + 8)' failed.
Aborted (core dumped)

So I turned to the new kid on the block, Jokosher. It actually worked quite well. Sometimes it was difficult to know when to right click, when to left click, and when to doubleclick[1], but once I figured that out I was able to apply a lowpass filter and an EQ to clean up the audio. I feel much calmer now.

Here's the resulting ogg file: buddamachine01.ogg (fixed)

These files (transcoded to ogg with oggenc) play great inside my sonata activity on the olpc. Add one of the files to the playlist, right-click the playlist and select "repeat."

[1]answers: Right click on timeline of audio file instrument to import file; doubleclick on an effect to open effect properties

March Madness — nerd style

My work is doing a silly contest around the whole NCAA thing. Back in high school kids used to run around comparing their brackets and arguing over every detail, and I hated it. I don’t follow basketball at all, and other than knowing that Duke ususally does well I have no basis upon which to make any choices except the seeds.

So I decided to write a bracket-generating algorithm that uses the seeds to generate weights for a random function and pick teams that way. The algorithm works as such:

  • for a pair of teams, take their seeds and invert them (make small numbers big)
  • divide each seed by the total of the two seeds to get values 0 < = x <= 1
  • get a random number 0 < = r <= 1. If team a’s chance is >= that value, they win

The actual code isn’t as nice as that explanation, but it should be mathematically equivalent. Any errors in programming only make these results more my own. I took the results from the first run that (a) worked, and (b) had Wisconsin (my alma mater) not getting knocked out in the first round.

Based on brackets.py, the final four will be: Arizona, Kansas, Texas, and Ohio St.

Kansas will win.

Source code after the break:
Continue reading “March Madness — nerd style”