PenguinTV 4.0

I’ve released a new stable version of PenguinTV, my RSS reader / podcast downloader / media player thing. I really don’t have a lot of time and energy to do proper releases these days, so it hasn’t been tested as well as it should have.

The real reason for doing this release is that there’s a lot of massive code refactoring that I want to do, but I can’t do it without introducing instability. It makes sense to finally release 4.0 before I make a clean break and start screwing around with things.

I’m past the point of trying to push really hard to sell this application to other people, because as long as it works for Char and me that’s all I care about. I spent years making posts, trying to get contributors, etc, but no one seemed really interested in giving it a chance. If someone else finds it useful, good for them.

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.

Why RSS on a laptop for kids?

I’ve been happy to see some recent articles about the OLPC that mention PenguinTV, although not by name. The BBC and AP both mention the existence of an RSS reader, and both understandably felt it necessary to describe what that means:


The machine comes with a web browser, word processor and RSS reader, for accessing the web feeds that so many sites now offer.


A wide range of programs can run on it, including a Web browser, a word processor and an RSS reader — the software that delivers blog updates to information junkies.

I have a feeling that people reading these descriptions will wonder why the heck 5th graders would care about RSS feeds. While these are decent enough descriptions of what RSS is traditionally used for, it misses the point of why I worked to bring RSS to the olpc. When I was envisioning how the children would use PenguinTV, this is what I saw:

School Example 2

(Let me be clear here, this was my own personal hope and dream. It does not reflect the official position of olpc).

What’s important are not the specific images, subjects, and examples I’ve used, but how the data are presented. On the left is a list of subscribed feeds, representing classes the student is taking. On the right is a list of entries, of which there is one per class session. Each entry has associated notes and classroom materials. Every day this information would be automatically downloaded to the child’s laptop from the school server.

I think future students (if not current ones) will expect all classroom materials to be available online, whether from an internet server or a school server. I know I would have appreciated all my homework assignments as downloadable PDFs instead of crumplable, tearable, losable paper. Furthermore lectures for older kids could be recorded as audio or video and attached to the entry, meaning older students could catch up on missed classes. The storage of all these documents is managed directly by PenguinTV meaning that the student doesn’t need to know exactly where the files are stored on the hard drive.

So while RSS is known right now as a standard for “news junkies,” I hope that people can see how it can be used in other ways, including a classroom context.

With the introduction of The Journal, PenguinTV’s role has changed. The Journal will be a central part of the laptop experience and will keep track of all the user’s activities and files in an interface that may look similar to the screenshot above. This makes PenguinTV somewhat redundant for those uses. It still may have a role in retrieving data or as an offline web browser, but it’s probably not going to be the central class materials browser I envisioned.

Lately, it seems that my software has turned out to be a good testcase as a large software program with lots of dependencies. PenguinTV relies on Mozilla (to draw feeds), GStreamer (for audio and video playback), SQLite (for data storage), BitTorrent (for large files), and more. This makes it a great full-featured desktop program, but strains the laptop’s RAM capacity. (Right now most of the RAM is being used by mozilla, so improvements being made there are the most beneficial). Most of my work has been focused on improving PenguinTV so that it runs leaner and faster. If I can get it to perform well on the tiny laptop, not only will it be good for the children (should they become news junkies :)) but everyone running the desktop version as well.

I’m not at all disappointed to see the Journal doing what I imagined PenguinTV might do. After all, it must have been a good idea if someone else came up with it! The Journal is going to be one of the applications most often used by the children, so it needs to be much, much smaller than I could ever make PenguinTV. Because the Journal won’t be using html they won’t need mozilla, and they will probably use a more efficient storage mechanism than sqlite. Also PenguinTV does not work well with many entries in one feed, whereas the Journal will need to work for years-worth of data. So while it won’t be my own software, the kids will be getting the computer I wish had been available to me when I was in school. Lucky punks!

PenguinTV database accesses: more optimal than ever!

I’ve been working to push database accesses down further on PenguinTV to lessen the load it puts on the disk. If the system is under heavy disk load to begin with, PenguinTV slows to a crawl and becomes unusable. Following up on my previous optimization work, a database hit for an unread entry is now this:

SELECT title, creator, link, description, feed_id, date, read FROM entries WHERE id=? (93729,)
SELECT id,entry_id,url,file,download_status,viewed,length,mimetype FROM media WHERE entry_id = ? (93729,)
UPDATE entries SET read=? WHERE id=? (1, 93729)
UPDATE media SET viewed=? WHERE entry_id=? (1, 93729)
SELECT id FROM feeds WHERE feed_pointer=? (322,)

We only read from each table once, and only write to each table once. That’s about as good as it can get, I think.

Adventures in virtualization

I’ve been adapting PenguinTV for use on the olpc, which is not entirely easy. For an all-python application it’s not too hard, but I have precompiled libraries that I need to distribute with PenguinTV because the olpc doesn’t provide pycurl. Since I run Ubuntu Edgy and the olpc is based on Fedora Core 6, I need to do some sort of virtualization to test my activity.

The recommended practice is to download an OLPC OS Image and run it with qemu. Unfortunately, the image is broken for Debian-based distributions like mine.

The next option is to download the OS image and chroot inside it and run sugar-emulator from there. That also doesn’t work for me.

My solution is really complicated: Run Fedora Core 6 in VMWare, and then chroot inside the OS image from there. Success!

So here’s a picture of PenguinTV, running inside olpc build 142, chrooted on FC6, running inside VMWare Workstation, on Ubuntu. It’s not a pretty way to do software development, but it seems to work.



I think I have removed all of the crack from my tag selector. It took about four different branches including experiments with treeviews, comboboxentries, menus, and entrycompletions. The final user experience is not overwhelming for users with few or no tags, and manageable even for users with many tags. Check out the final screencast.

Am I Crack or Not, part 2

I tweaked the new tag selector some more, although I’m getting the feeling that at this point I’m just trying to duplicate a combo box or menu. A few people have suggested I have a box where people can type in a tag name. I don’t want to add another entry box, so I think I might add that functionality to the main search box above the tag list. I still like being able to have a few tags that are always one click away.

Latest tag selector screencast

Actually the more I look at this, the more it seems like I really just want a regular drop-down menu with a submenu containing all tags. At the bottom of the main part of the menu I could have an item that would spawn a dialog that looks like my current view, and that would be just for selecting and reordering favorites.