MythTV: HD

A long while back I found out that mythtv supports capturing video over firewire. The idea is that as long as one has a cable box where the jack is turned on, it will spit out the complete video and audio signal for whatever channel you are currently watching, even if it’s HD.

Although I didn’t think my current mythtv machine (Athlon 1700+) would be fast enough to play back HD, I could still use the firewire connection to change channels instead of my current unreliable IR method. I bought a cheap firewire card, and it worked. So I knew that, one day, I could upgrade the machine and get full HD.

So recently, I dropped 350$ at newegg.com and bought:

GIGABYTE GA-M61P-S3 Socket AM2 NVIDIA GeForce 6100 ATX AMD Motherboard $84.99
AMD Athlon 64 X2 3600+ $69.00
WINTEC AMPO 1GB (2 x 512MB) 240-Pin DDR2 SDRAM DDR2 800 $44.99
Seagate Barracuda 7200.10 500GB $129.99

The upgrade was pretty smooth. Here are the steps.

  1. Back up the old machine onto a firewire drive. (I ran into problems here because newer ubuntu kernels have problem with firewire, and the old VIA chipset has USB issues. Most people would have no trouble here.)
  2. Rip out the guts of the machine, leaving only the case, power supply, and dvdr drive. (and one of the IDE drives which is 160 gigs and worth keeping.)
  3. Install new mobo with CPU, heatsink, and RAM already attached. Connect the drives. (I had to buy a little molex to SATA power cable, but that was cheap. thanks microcenter!)
  4. Also install old firewire card since mobo only has one connector.
  5. Boot up, see if it works! (I ran into a snag here because I didn’t connect a secondary 12V power cable to the motherboard. The manual helped me figure this one out.)
  6. Burn an Ubuntu CD, install. (So easy!)
  7. Use synaptic to install mythtv, xine, mplayer, etc. (So so easy. The mythtv packages are very nicely done)
  8. Set up new LVM for mythtv data, joining the bulk of the old 160 gig drive and the new 500 gig drive.
  9. Restore mythtv database and mythtv data (it takes a long time to copy 240 gigs of data.)
  10. Wrestle with firewire for a long time trying to get a signal. Peruse the mythtv wiki, which contains good solutions.
  11. Get little things working like lircd, mythweb, my xine script, and surround sound. (I haven’t got surround sound yet, it requires purchasing a little SPDIF bracket and a long toslink cable.)

    It took a full, busy day, most of which was spent copying the old data and trying to get firewire to work. Everything else was pretty low-impact, including such previous headaches as installing mythtv and configuring mysql. It’s still way too hard for the average user, but at no point did I feel like I was breaking a sweat. I’ve spent a lot of time with mythtv so I know where a lot of the “unbreakme” buttons are. I know I have to set this up, or tweak that option… things that should be defaults but aren’t. I’d say 90% of the difficult stuff was because I was transferring old data and had permissions issues. If this was a new install, the only blocker would have been the firewire issue.

    All in all, a day well-spent, and now I can record and play back native HDTV streams like they were youtube videos. It’s been a long time since I’ve been able to spread hardware all over the floor.

    Did I mention this cost me 350$? Compare that to the competition.

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.

Ben Folds, The Symphony, and Getting Punched in the Face

Char and I went to see Ben Folds at the opening of the Boston Pops season. It was fun, except for the part where some guy in the second balcony started punching some other guy in the face.

I’m not making this up!

Some guy whose post I found on technorati:

so i’m sitting here in the center on second balcony and to the left of me on the same level in the middle of the sound someone screams and everyone looks over there and it looked like someone was about to fall over the edge or something. then i kept watching and the guy goes up a couple rows and looks like hes talking to this other guy and then all of a sudden punches him. and then proceeds to keep punching him. the people around there try to restrain him and stuff, but it was really intense. and people were kind of screaming, so it even stopped the music for a couple minutes as they got it under control. but seriously who fights at a freaking boston pops concert. anyway.

That’s pretty much the way I remember it, although I missed the part where someone was about to fall off the balcony. I heard a woman’s voice cry out, and I couldn’t figure out where it came from. I thought maybe someone had too much to drink. And then I saw a commotion way over on the left side, and sure enough some guy just starts punching someone else in the face.

In the movies, when things like that happen, there is always the horrified “oh!” of gentle-men and -women in the audience. Funny enough, it actually happens in real life too! People were still mumbling to each other after the orchestra started up again.

Other than that, the concert was excellent. The hall sounded beautiful, and Ben Folds rocked the house. It was quite a meeting of two very different audiences — the regular Pops crowd, and a lot of Ben Folds fans. (Note: the altercation appeared to be between regular-pops-crowd-types, not rowdy young ben-folds-types.)

A night to remember!

Update: the em-ess-em picks up on the story

Update with picture!

This looks like it’s getting a decent amount of play, so you can probably take it from here and search google news for more info.

Grand Canyon Vacation

This year I went again to NAB, the annual convention for tv, film, and radio. Since Las Vegas is warm and sunny, Char thought it’d be fun to come along and take some vacation time while I checked out the show floor.

For this trip I did not bring my Thinkpad, opting instead to bring just my olpc. Although Char complained about the spacebar (fixed in b3, Char!) and its slowness (also fixed, Char!), it performed phenomenally. It easily picked up all the access points I needed and connected to them quickly. The web activity also handled any accesspoint payment sites perfectly. On one occasion when our cheap(er) hotel didn’t have free wifi, I was able to connect to the Best Western two buildings over and use theirs instead. It must have been 1000 feet away and still the signal was strong. Bravo olpc!

After I filled my brain with details about Final Cut Pro upgrades, digital asset management software, and other expensive new stuff, Char and I drove out to Arizona to go camping at the Grand Canyon.

Camping was cold, but we were prepared for it. The next morning we woke up and saw some very tame deer strolling through the campground

We had a whole day to spend at the canyon, so we donned our boots (Char bought hers a few days before) and took a hike. Interestingly, by default the Park Service does not provide very accurate maps which discourages morons like us from making up our own routes and getting in over our heads. Instead they offer a few basic trails with regular checkpoints to keep it nice and easy. I’m glad we talked to the park service lady, she recommended a very good hike.

[800×600][1600×1200]
It is big

The Grand Canyon is incomprehensively big. There’s just no reference to get any sense of scale, and because the opposite wall is 10 miles away you can’t see any other angle of it because you can’t get any paralax. It’s just huge and unmoving.

It was also eerily quiet. Char and I were trying to figure out what we expected to be hearing other than the grandiose symphonies and echoing eagle calls heard in gift shop videos. Although the day before had gusts up to 50mph there was very little wind when we were there, and because there are so few trees (it’s mostly shrubbery!) there was no rustling of leaves. There were also hardly any songbirds twittering away. Most of the birds were gigantic crows that wanted to eat our food.

[800×600][1600×1200]
Other people help provide scale

The trail we hiked was also used by mule trains which, according to my ear, nose, and throat doctor, carry supplies down to Phantom Ranch in the canyon. The men leading the mules were totally cool and legit. Real cowboys. Or I guess muleboys?

[800×600][1600×1200]
Mule Train

[800×600][1600×1200]
Char likes mules

[600×800][1200×1600]
Note the smoke

As you can see in the above photo, there was some smoke drifting out of the depths of the canyon that didn’t look right. Someone on the trail asked one of the cowboys what he thought it was, and he chalked it up to the park service “doin’ a controlled burn, and they lost control of it.” I am not doing the accent justice here. Try to imagine what Dubya wishes he sounded like when he clears brush.

[800×600][1600×1200]
Char makes a friend

[800×600][1600×1200]
Critter surveys the scenery

[800×600][1600×1200]
Char prepares to crush an enemy

[800×600][1600×1200]
I ponder bigness

Our descent ended when we could finally see the river for the first time near the omniously-named Skeleton Point.

[800×600][1600×1200]
Yes that is the river down there

[600×800][1200×1600]
I got there too

After eating our lunch, we started on the way back. There are not many pictures from the way back, not only because it was the same view, but because hiking back up 1800 feet is hard work! As we neared the top, though, another hiker pointed out a few condors hangin’ out on the rocks

[800×600][1600×1200]
The one on the right is labelled “99”

[800×600][1600×1200]
There was another one further away

As we got back, we realized if we camped again that night we would not have a chance to shower again for the whole trip. This would mean we’d have to drive back to Las Vegas smelly, see Bill Maher perform at the Hard Rock the next night smelly, stay up all night and wait for our flight smelly, and then fly home smelly. Also, it was supposed to be 22 degrees that night. It was only 30-35 the previous night, and that was cold enough, so we bailed and got a hotel. It was the right thing to do, especially since we were only out 18$ for the campsite. A shower and a good night’s sleep were greatly appreciated by all.

The next day we visited the Hoover Dam, but those pictures will have to wait until tomorrow.

mouse-over jokes

A few webcomics have bonus jokes in the title attribute of the image tag, meaning you don’t see the joke unless you hold the mouse over the image. These easter eggs necessitate new and glorious extensions just to make them work properly. Often the bonus joke isn’t all that great, but oh man, sometimes it’s funnier than the original punchline.

After discovering this trick in a webcomic I’ve been reading, I have to go back through the entire archives of a comic strip reading all the new jokes. Downside, or bonus?

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

Moment in the Sun

Chris Blizzard let me know a while back that Red Hat Magazine was coming to the olpc offices to shoot some promotional video, and that they might want to interview me. So I dropped on by after work and gave them some good bites.

They’ve posted the edited video, which is a pretty nice peek into the place where the magic happens. It’s not my best on-camera appearence ever, but luckily they cut away from me pretty quickly 🙂

Me appearing in the olpc video

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”

OLPC as a music player

One side project I’ve been having fun with is creating an activity to allow the olpc to play music. At first I was just going to port a MusicPD (mpd) client over to olpc to allow me to use the laptop as a remote control at parties. Mpd runs as a system-level service that plays music, and then users can connect to it with many dozens of available clients to tell it to play music. It turned out that porting over a client was so easy that I decided to create a bundle that had its own mpd daemon builtin as well.

The client I chose is Sonata. I’ve used a lot of music players, including xmms, rhythmbox, amarok, banshee, and muine, but the combination of Sonata+mpd is the best way to enjoy music on Linux. It’s really, really good, and it’s worth the slight headache of setting up mpd.conf to get it working on your machine.

Sonata is also written in Python and only took maybe 20 lines of alteration to sugar-ize it. The author, Scott Horowitz, was even nice enough to incorporate my alterations into the main codebase, meaning that my bundle isn’t a fork of his project.

The bundle also contains a specially-compiled and configured version of the mpd daemon. And since I hate freedom, I’ve bundled an mp3 library along with it (But it also plays ogg). Music should be stored in /home/olpc/.mpd/Music, which could be symlinked to a mounted mmc device or USB key for greater storage. When the activity is started, the daemon is automagically started as well.

By default the client will connect to the olpc’s mpd daemon, but one can right-click on the main window and change the preferences to connect to any other mpd daemon on the network.

While I don’t know if this bundle will be useful to the kids, it’s useful to me and it shows the power of the bundle architecture. It really is plug and play 🙂

Sonata OLPC bundle (v7)