Flashing a Kindle Fire with CyanogenMod

Those of you that follow me on Google Plus (or Facebook) already know this, but the other day I was wondering about whether I should have flashed my Kindle Fire (first generation) with CyanogenMod instead of keeping it with the original Amazon operating system. This is the tale of what I did, which includes a big screwup on my part.

But first, a small introduction. I’m the first person to complain about people “jailbreaking” iPhones and similar, as I think that if you have to buy something that you have to modify to make useful, then you shouldn’t have bought it in the first place. Especially if you try to justify with the name “jailbreak” an act that almost all of the public uses to pirate software — I’m a firm maintainer that if we want Free Software licenses to be respected, we have to consider EULAs just as worthy of respect; that is that you can show that they are evil, but you can’t call for disrespecting them.

But I have made exceptions before, and this mostly happen when the original manufacturer “forgets” to provide update, or fails to follow through with promised features. An example of this to me was when I bought an AppleTV hoping that Apple would have kept their promise of entering the European market for TV series and movies so that it would come to be useful. While now they do have something, they have not the ability to buy them to watch in the original English (which makes it useless to me), and that came only after I decided to just drop the device because it wasn’t keeping up with the rest of the world. At the time to avoid having to throw the device away, I ended up using the hacking procedure to turn it into an XBMC device.

So in this case the problem was that after coming back home from Los Angeles, I barely touched the Kindle Fire at all. Why? Well, even though I did buy season passes for some TV Series (Castle, Bones, NCIS), which would allow me to stream them on Linux (unlike Apple’s store that only works on their device or with their software, and unlike Netflix that does not work on Linux), and download to the Kindle Fire, neither option works when outside of the United States — so to actually download the content I paid for, I have to use a VPN.

While it’s not straight forward, it’s possible to set up a VPN connection from Linux to the iPad, and have it connect to Amazon through said VPN, there is no way to do so on the Kindle Fire (there’s no VPN support at all). So I ended up leaving it untouched, and after a month I was concerned about my purchase. So I started considering what were the compelling features of the Kindle Fire compared to any other Android-based tablet. Which mostly came down to the integration with Amazon: the books, the music and the videos (TV series and movies).

For what concerns the books, the Kindle app for Android is just as good as the native one — the only thing that is missing is the “Kindle Owners’ Lending Library”, but since I rarely read books on the Fire, that’s not a big deal (I have a Kindle Keyboard that I read books on). For the music, while I did use the Fire a few times to listen to that, it’s not a required feature, as I have an iPod Touch for that, that also comes with an Amazon MP3 application.

There are also the integration of the Amazon App Store, but that’s something that tries to cover for the lack of Google Play support — and in general there isn’t that much content in there. Lots of applications, even when available, are compatible with my HTC Desire HD but not with the Kindle Fire, so what’s the point? Audiobooks are not native — they are handled through the Audible application, which is available on Google Play, but is also available on my iPod Touch, which means I have no point about it.

So about the videos — that’s actually the sole reason why I ordered it. While it is possible to watch the streamed videos on Linux, Flash would use my monitor and not let me work when watching something, so I wanted a device I could stream the videos to and watch on… a couple of months after I bought the Fire, though, Amazon released an Instant Video application for the iPad, making it quite moot. Especially since the iPad has the VPN access I noted before, and I can connect the HDMI adapter to it and watch the streams on my 32” TV.

All this considered, the videos were the only thing that was really lost if I stopped using the Amazon firmware. So I looked it up and found three guides – “[1]”:http://forum.xda-developers.com/showthread.php?t=1632375 “[2]”:http://forum.xda-developers.com/showpost.php?p=30780737&postcount=180 “[3]”:http://forum.xda-developers.com/showthread.php?t=1778010 – that would have got me set up with an Android 4.1, CyanogenMod 10 based ROM. Since the device is very simple (no bluetooth, no GPS, no baseband, no NFC) supporting it should be relatively easy, the only problem, as usual, is to make sure you can root and flash it.

Unfortunately, when I went to flash it up, I made a fatal mistake: instead of flashing the bootloader’s image (a modified u-boot), I flashed the zip file of it. And the device wouldn’t boot up anymore. Thankfully, there are people like Christopher and Vladimir who pointed me at the fact that the CPU in that tablet (TI OMAP) has an USB boot option — but it requires to short one very tiny, nigh-microscopic pad on the main board to ground, so that it would try to boot from there. Lo and behold, thanks to a friend of mine with less shaky hands who happened to be around, I was able to follow the guide to unbrick the device, and got the CM10 ROM on top of it.

Now I finally got an Android 4 device (the HTC is still running the latest available CM7 — if somebody has a suggestion of a CM10 ROM that does not add tons of customization, and that doesn’t breach the Google license by bundling the Google Apps, I’d be happy to update), I’ve been able to test Chrome for Android, and VLC as well — and I have to say that it’s improving tons. Of course there are still quite a few things that are not really clean (for example there is no Flickr application that can run there!), but it’s improving.

If I were to buy a new tablet tomorrow, though, I would probably be buying a Samsung Galaxy Note 10 — why? Well, because I finally got a hold of a test version of it at the local Mediamarkt Mediaworld and the pen accessory is very nice to use, especially if you’re used to Wacom tablets, and that would give sense to a 10” laptop to me. I’m a bit upset with my iPad inability to do precise drawing to be honest. And since that’s not very commonly known, the Galaxy Notes don’t use capacitive pens, but magnetic ones just like the above-noted Wacoms, that’s why they are so precise.

I’m happy I didn’t replace my phone!

Since I’ve been to the US, I’ve been thinking of replacing my cellphone, which right now still is my HTC Desire HD (which I was supposed not to pay, as I got it with an operator contract, but which I ended up paying dearly to avoid having to pay a contract that wouldn’t do me any good outside of Italy). The reasons were many, including the fact that it doesn’t get to HSDPA speed here in the US, but the most worrisome was definitely the fact that I had to charge it at least twice a day, and it was completely unreasonable for me to expect it to work for a full day out of the office.

After Google’s failure to provide a half-decent experience with the Nexus 4 orders (I did try to get one, the price was just too sweet, but for me it went straight from “Coming Soon” to “Out of stock”), I was considering going for a Sony (Xperia S), or even (if it wasn’t for the pricetag), a Galaxy Note II with a bluetooth headset. Neither option was a favourite of mine, but beggars can’t be choosers, can they?

The other day, as most of my Twitter/Facebook/Google+ followers would have noticed, my phone also decided to give up: it crashed completely while at lunch, and after removing the battery it lost all settings, due to a corruption of the ext4 filesystem on the SD card (the phone’s memory is just too limited for installing a decent amount of apps). After a complete re-set and reinstall, during which I also updated from the latest CyanogenMod version that would work on it to the latest nightly (still CM7, no CM10 for me yet, although the same chipset is present on modern, ICS-era phones from HTC), I had a very nice surprise. The battery has been now running for 29 hours, I spoke for two and something hours on the phone, used it for email, Facebook messages, and Foursquare check-ins, and it’s still running (although it is telling me to connect my charger).

So what could have triggered this wide difference in battery life? Well there are a number of things that changed, and a number that were kept the same:

  • I did reset the battery statistics, but unlike most of the guides I did so when the phone was 100% charged instead of completely discharged — simply because I had it connected to the computer and charged when I was in the Clockwork Recovery, so I just took a chance to it.
  • I didn’t install many of the apps I had before, including a few that are basically TSRs – and if you’re old enough you know what I mean! – including Advanced Call Manager (no more customers, no more calls to filter!), and, the most likely culprit, an auto-login app for Starbucks wifi.
  • While I kept Volume Ace installed, as it’s extremely handy with its scheduler (think of it like a “quiet hours” on steroids, as it can be programmed with many different profiles, depending on the day of the week as well), I decided to disable the “lock volume” feature (as it says it can be a battery drain) and replaced it with simply disabling the volume buttons when the screen is locked (which is why I enabled the lock volume feature to begin with).
  • I also replaced Zeam Launcher, although I doubt that might be the issue, with the new ADW Launcher (the free version — which unfortunately is not replacing the one in CyanogenMod as far as I can tell) — on the other hand I have to say that the new version is very nice, it has a configurable application drawer which is exactly what I wanted, and it’s quite faster than anything else I tried in a long time.
  • Since I recently ended up replacing my iPod Classic with an iPod Touch (the harddrive in the former clicked and neither Windows nor Linux could access it), I didn’t need to re-install DoggCatcher either, and that one might have been among the power drains, since it also schedules operation in the background and, again as far as I can tell, it does not uses the “sync” options that Android provides.

In all of this, I fell pretty much in love again with my phone. Having put in a 16GB microSD card a few months ago means I have quite a bit of space for all kind of stuff (applications as well as data), and thanks to the new battery life I can’t really complain about it that much. Okay so the lack of 3G while in the US is a bit of a pain, but I’m moving to London soon anyway so that won’t be a problem (I know it works in HSDPA there just fine). And I certainly can’t lament myself about the physical strength of the device… the chassis is made of metal, I’d venture to say it’s aluminum, but I wouldn’t be sure, which makes it strong enough to resist falling into a stone pavement (twice) and on concrete (only once) — yes I mistreat my gadgets, either they cope with me or they can get the heck out of my life.

Tethering the Milestone

Last year, just before leaving for FOSDEM, I replaced the Nokia E75 I broke with a Motorola Milestone running Android 2. I was pretty much sastisfied with it but for one problem: tethering didn’t work. Sure there has been a few methods to make it share the connection via WiFi as an hotspot (but I have sincere doubts about the sanity of such a choice), and at least one program that was designed to share the connection as a Bluetooth Dial-Up Network service without requiring root access, but even that one only worked with OS X and Windows.

To qualify the statement, the application in question is PDAnet which seems to be now entirely free outside of North America. The first problem with this application is that the USB tethering requires special software available only for Windows and OS X (and that doesn’t work for me, you’ll soon understand why). On the other hand, it does support providing a standard Bluetooth DUN service, even without a rooted phone, but when GNOME-Bluetooth/NetworkManager enquire the phone to see what it can do, it gets stuck until everything goes into timeout, probably some AT command is not properly implemented.

With all this considered, I was pretty much disappointed: my Dell laptop is now working quite well, but when I’m somewhere where I lack an accessible connection, I’m stuck. How do I solve that? I mused my disappointed on Identica and Twitter, and even though Alex (wired) and Nirbheek prodded me in the right direction, what appeared like the complete solution was given me by Mike (FireBurn): move to Froyo, that is supposed to allow tethering natively.

Now, Motorola seem to not care about providing 2.2 firmware for the Milestone, at least for the Italian market, which means I cannot simply upgrade to Froyo. The other option is the usual aftermarket one: CyanogenMod. Unfortunately CyanogenMod developers don’t support the Milestone, just its half-brother Droid (they are less similar than one would expect internally, as it seems). Thankfully FireBurn pointed me at an ongoing CyanogenMod 6 port on the Milestone that should solve the problem for me, giving both a rooted phone and an updated one.

Installing the port has been less straightforward than I’d have liked, and I was really worried at some point I bricked the baseband altogether (I didn’t, you just have to apply the baseband update linked on the same page), as I had to reflash the whole phone with a pre-2.1 system just to be able to run unsigned updates. But I have to say I’m pretty happy with the new system, even though there is at least one problem with the battery charge display (it says “charged” way too soon).

Unfortunately, tethering still doesn’t work with this firmware: the bluetooth option does not appear anyway at all, and the USB one… well, it simply doesn’t work; it seems to be a limitation of the Motorola base firmware, which makes it impossible to provide new options over the USB interface. And this cannot be worked around because the Milestone comes with a pretty sturdy closed bootloader. The CyanogenMod port shows that there is an application that can solve the issue, but it does so by providing network access with the same interface used by Motorola’s drivers — drivers that are, as you guess, available for Windows, but not included in the Linux kernel.

Now to be honest there are drivers’ package for Ubuntu, and they could probably be made to work with Gentoo, but I really don’t want to go that route at this point.

Luckily, an alternative approach is available in the Android Market: tetherBlu an application that only works on rooted phones, and provides Bluetooth PAN (Personal Area Network) access. It is a closed, proprietary and commercial application, but it has an acceptable price range (about €5), and works quite fine here. For whatever reason, though, I’m unable to start up the connection through NetworkManager, so following Alex’s suggestion I’m using BlueMan to connect it; works quite well.

For those wondering why I’m not using the WiFi hotspot that is so common nowadays, and easy to setup, I simply have bad feelings about WiFi in general. Not the kind of feelings of people wanting to ban them, but rathert he fact that they simply are too much of an interference to me and others. I guess most people reading me here have seen the trouble they caused at Apple’s keynote last year… I don’t blame Apple on that débâcle, but rather the need to project such wide networks just to connect from a your lap to your pocket. It says a lot if we have the technology (Bluetooth) but it was made so stupidly broken that we can’t rely on it.

And most importantly, Bluetooth uses much less battery than WiFi!