Of the Atrix, XDAndroid, and Kernel.org (plus a short memorial mention)

Howdy folks. Been a while since the last post, so I thought I’d fire off a quick update about what I’ve been doing personally…

First off, XDAndroid. We’re still doing some work on the gingerbread branch. Michael (emwe) has fixed the GPS library and is currently working on some smaller items, including the proximity and light sensors. He’s currently the one getting most of the work done. We’re still working on the critical crasher for TI devices (non-RHOD) when activating bluetooth. Once that’s done, we can finish/clean up the merges from froyo and make a release.

On a related note, kernel.org is still down. This means, for our project, that we cannot merge any changes from the upstream Android project. Google’s public Android source code was hosted exclusively on kernel.org, so until those services are restored (or Google relocates its git repositories), we cannot pull any of their changes into our forked repositories. Additionally, users are currently unable to download or update our source tree, since the majority of source tree is unmodified Android code.

In the headline, I mention the Motorola Atrix 4G. This is a Tegra-based phone which, of course, runs Android natively. On XDA, there has been an ongoing effort to port CyanogenMod 7 to the Atrix. Since nobody had stepped up to port vanilla Android to the Atrix, I snuck into their development channel on IRC, stole their code, and got (most of) the job done. I plan to release the source tree to the public as soon as kernel.org is restored, or perhaps earlier if I can gather clones of the Android source tree. To be clear, this is going to be targeted at ROM developers (or the “chefs” term I so dislike to use). It’s working extremely well as an everyday phone for me, thanks to the wonderful work of the Atrix Dev Team, but I’m not confident in my solo efforts to bring vanilla Android to their awesome stability. Therefore, I cannot offer proper support for end-users. I’ll be making another post about Atrix stuff after I go public with a released build.

Finally, a short, somber note I must make… This past week a very good friend of mine, my boss at work, passed away suddenly. This was a wonderful man who I’ve known my entire life and was like a father to me. He always showed an interest in the side projects I’ve been doing (especially the Android ones, since I could physically show him the results), despite not being technologically adept. Thanks for everything Luis; you and your family are always in my thoughts.

New Froyo Release: FRX07

Here’s a new release for you, folks. This is a major release with a ton of changes, new features, and fixes. Our friend hyc/highlandsun did most of the heavy lifting for this release. Highlights include a rewritten RIL with support for world phones and greatly improved CDMA support; fixes for the media codecs; fixes for MMS on Sprint; increased security with the Superuser app.

A list of changes is included below. The FRX07 system image is available for download now, and will require the use of a new rootfs image, also available now. Additionally, we have a new bundle containing everything needed to enjoy a full FRX07 system.

Note: Due to the incredibly long list of changes, this is a somewhat condensed, terse changelog describing only the overall scope of the changes.FRX07:

  • frameworks/base:
    • Major frameworks changes for CDMA/GSM dual-mode worldphone support. (hyc)
    • Fixes for data connection handling to improve startup time. (hyc)
    • Fixes for wifi handling to avoid issues on hanged drivers. (hyc)
    • Stagefreight (media codecs) fixes. (hyc/viruscrazy)
    • Fixes for Sprint’s wonky MMS markup structure. (hyc)
    • Fix MediaScanner not finding audio files (including ringtones) in system.ext2
  • hardware/libhardware_legacy:
    • Minor GPS driver fixes. (Alex[sp3dev])
    • Rename wifi interfaces to wlan0 on all devices (hyc)
  • hardware/xdandroid-ril: Major RIL refactoring for improved performance on all devices, and added CDMA/GSM dual-mode worldphone support. (hyc)
  • packages/apps/Gallery3D: Switched back to Gallery3D as the gallery app (closes bug #111)
  • packages/apps/Mms: Fixes for Sprint’s wonky MMS markup structure. (hyc)
  • packages/apps/Phone: Fixes for CDMA/GSM dual-mode worldphone support. (hyc)
  • packages/apps/Superuser: Added the Superuser package for authorizing su privileges. This, along with our signed builds, provides greatly increased security for the end user (mostly against malicious apps from the Market).
  • system/extras/su: Added as a dependency for the Superuser package
  • vendor/qcom/android-open: Include missing stagefright codec symbols. (hyc/viruscrazy)

To coincide with the FRX07 system image, the following rootfs changes have been made:

  • init.froyo.rc modifications…
    • Adjust wpa_supplicant service for the new abstraction provided by libhardware_legacy, as well as interface rename
    • Abstract the hciattach service to provide bluetooth support on both chipsets
  • Rename wifi interface to wlan0 on all devices
  • apns-conf.xml updated
  • keymaps completely reorganized, and RHOD end-call key has been remapped to be the Home key in Android.
  • default.prop: set ro.secure=1 to lock down the adb shell – su can be used with the Superuser app to authorize root access in adb if needed.

What About FRX07?

It’s been a long time since the last release — and for that matter, my last post here. A lot has been going on, both in the XDAndroid Project and in the real lives of developers, which has made posting updates a bit of a low priority.

Users love to know what’s going on, though. Since most of our users frequent the XDA forums, but not our mailing list or IRC channel, it seems to them that there isn’t a whole lot happening with the project. In reality, there’s been a huge amount of progress made by a few contributors, in terms of both fixing bugs and adding features.

Because of that progress, the next iteration in the Froyo series, FRX07, is going to be a major release. One of the main contributors to this release is hyc, who has largely rewritten our RIL, proposed rootfs reforms, improved wifi driver handling, and proposed various other changes so far. hyc has kept the team very busy with testing and implementing merge requests.

Additionally, some work has been done by virus_crazy (on the forums) for bluetooth, including implementation for Rhodium and improvements for other devices. Alex (on #htc-linux) has been doing some work on improving the GPS driver and has a kernel update project using the 2.6.35 codebase.

For technical users, information about all pending changes can be found in the merge requests section on my personal Gitorious page. Go there, look for the third box down in the right-side column, and click on “merge requests” to see the long list of changes submitted by the aforementioned folks.

Thanks to these brave code warriors, the next release of XDAndroid will be huge. And don’t forget, any donations you make will go to our contributors. Thanks!

Dual XDAndroid Releases – FRX06 and new Gingerbread

It’s that time again! And this time we’ve got a release for both froyo and gingerbread.

First of all, our official froyo branch release, FRX06… We’ve got a couple minor changes, backported from Gingerbread:

  • Switched to touch-friendly dialer, along with the VGA layout improvements as seen in Gingerbread
  • Added HSPA icon (for GSM models)

FRX06 is available for download now as a system.ext2 update.

And for Gingerbread, we’ve also got just a couple minor updates:

  • Further tuned keyboard sizing to be useful on VGA (also made the key labels bigger)
  • World-phone settings support (very important for future RIL enhancements especially on CDMA)
  • Enabled HSPA icon (someone on GSM please let me know if it actually works)

The new Gingerbread testing image is also available for download now as a system.ext2 update.

New Gingerbread Testing Image Available

Evening folks. Got another release for you tonight!

Decent list of changes…

  • Further keyboard size fixes, should be perfect now (and goes fullscreen in landscape)
  • Updated Google apps package (Books phone version is now included)
  • Switched to GLES1.1 library with patches from bzo (you probably won’t see much difference here)
  • Phone app switched to touch-friendly in-call user interface (and fixed its layout on Raph)

Regressions from the last system image that were fixed:

  • Added the missing camera bits
  • Re-added a graphical speed-up that was accidentally lost in merge

A few of these changes are important.

The software keyboard should be considered functional (but with some small bugs) at this point. If you see any issues, please report them on the bug tracker after searching for them to make sure it’s not a dupe.

The Phone app change is important for a couple reasons. On Rhodium, this allows us to set the end-call key to Home without crippling the user in a call, since there’s now a nice big button on the screen for hanging up. This will be further improved by implementing the proximity sensor. Our support for VGA devices precluded using this UI due to the buttons blocking some of the dialpad keys in the in-call screen. This has been fine-tuned to be useful on both resolutions.

Google Apps speaks for itself. Updated stuff, woo.

Anyway, without further ado, you may download the updated system image.

XDAndroid 2.2.2 (Froyo) Build FRX05

Another release!

This time it’s the Froyo branch. We’ve got build FRX05 available for download now. This is a minor release with a major new feature. :)

The short list of changes from FRX04 to FRX05…

  • Camera support – both photo and video capture (without sound currently) are working. This depends on kernel support, so only Rhodium and Topaz are supported currently. Huge thanks to Jerome Bruneaux (viruscrazy on XDA) for basically doing all the work.
  • Switch build variants from engineering to user-debug for slight speedup.

There’s no OTA update.zip this time. I accidentally got rid of the FRX04 target files, needed to generate the incremental patches.

Thanks for using XDAndroid!

Another Gingerbread Testing Image

Evening everybody. Got another testing image for you.
Changes:
  • Google apps should all be fixed now (tested with gmail particularly) — we’ve switched javascript engines and are now using V8
  • The accelerometer driver I’ve blogged about is now included in this build
  • Android codebase sync’ed to latest 2.3.3
  • Not included in this build is some preliminary work on GPS. It crashes Android (and freezes my RHOD400) so it’s been removed from the system image.
  • Proper hardware 3D driver provided in this system. Neocore still doesn’t work.
  • Gallery3D added to the build to test a possible fix for rotation issues. I’m mainly interested in results on RAPH.
Thanks again for everybody testing and providing feedback on these releases. This is signed so old data.img from our previous Gingerbread tester release may work. Again, if you have any problems, we suggest clearing out data.img before reporting them.

XDAndroid Gingerbread Accelerometer Support

Back when I started work on XDAndroid Gingerbread, I had a long list of features that were missing. One of the big entries on that list was the accelerometer. For accelerometer support, we rely on a sensors driver in the system.ext2 image that listens for events from the device.

In Gingerbread, a lot of the glue between those drivers and the Android system has changed, resulting in the incompatibilities we see now. This meant a rewrite was necessary for the driver we use. Today, I did the rewrite and got accelerometer support for Gingerbread. Those of you building from source can repo sync and get the updates now. Users will have to wait for a new system image (sorry).

The new driver is based on the HTC Passion (Nexus One) sensors driver, which is written in C++. The driver uses a few simple classes to do the heavy lifting, so the end result is a very manageable, simple and easy to understand driver. Down the line, we can also add proper proximity sensor support to the driver for Rhodium.

For developers and advanced users, the driver now resides in our device/xdandroid tree to follow upstream conventions. Please see the relevant commit for reference (and ignore the GPS change which I accidentally stuck in BoardConfig).

Thanks for reading!

XDAndroid Gingerbread Public Test Build

We’re pleased to finally release the first public testing system image of XDAndroid Gingerbread.

This is, of course, a work-in-progress build. Lots of things don’t work yet. However, what does work is working pretty well. Performance is either on-par with or an improvement over our Froyo versions. This is already a well-polished build. Gingerbread will be very nice when we get all the hardware support updated.

As I said, there is a lot that does not yet work at all. Here’s a list of known issues:

  • Google Apps will behave badly from time to time (arrrghhh noted blank window issues, for example)
  • GPS is not working (driver needs to be reimplemented) and Location services are generally missing as well
  • Accelerometer support is missing (driver needs to be reimplemented)
  • Bluetooth is not working, even on TI devices (crashes when activating – disabled in this build)
  • Other functionality and stability issues will occur

This has been signed with our release keys, which means you might be able to use a froyo data.img with it, but this is in no way supported (it’s a testing build after all). If you have issues with previous data images, start fresh and try again before reporting issues.

If you try out this build, please let us know of any issues via our IRC channel or bug tracker. Thanks!

Slaying the system_server Bug

(The following is a technical glimpse at a current XDAndroid development topic aimed at intermediate or advanced users and developers.)

Chances are if you’ve been using XDAndroid on a Rhodium, you’ve been hit by this annoying bug: the device is painfully slow from the time the XDAndroid boot animation begins. This is a bug seen mostly be Rhodium users and of varying degrees of consistency. Some people see it nearly every boot, others see it once in a handful of boots. When investigating the running environment while it’s happening, there is no interesting logcat or dmesg output, and top shows system_server hogging at least 95% of the CPU time.

An effective workaround has been to place a short phone call to the voicemail service and hang up. For whatever reason, this would cause system_server to calm down and act normal for the rest of the XDAndroid session. A more radical (and perhaps less effective) solution was to re-enable Dalvik’s JIT execution and put up with the various bugs it would potentially reintroduce. Somehow, JIT was able to mitigate the bug to the point that casual testing did not reproduce the system_server issue.

Upon further investigation by several XDAndroid team members (most notably arrrghhh and WisTilt2), the bug had been tracked down to the userland libraries used by XDAndroid for hardware support. This meant it was either an issue in the RIL, GPS or sensors (accelerometer) drivers. After even more testing by arrrghhh, who readily volunteered to test an unfinished internal Gingerbread build, it was determined that the likely culprit was the sensors driver, which remains missing in Gingerbread.

At my request, arrrghhh performed repetitive testing on our latest Froyo release (FRX04) with JIT disabled. With the sensors driver in place, the issue was reproduceable on essentially every boot. After removing the sensors driver, it could not be reproduced once. This was a very telling result, so it was time to figure out where the issue was in the sensors driver.

Finding the issue was actually relatively trivial. Such a runaway process usually indicates an uncontrolled loop. The sensors driver continuously checks for data from the sensors devices while Android is running. In our driver, the code responsible for that check is seemingly prone to infinite looping in a specific case where incomplete data is received from the sensors device. In practice, this case occurs frequently on Rhodium and sends system_server into fits. I’m guessing that making a phone call causes Android to query for a proximity sensor, which bails the sensors driver out of that loop to process the request (and then it goes back into the loop and is able to read data normally).

So, since the logic generally looked sound in the loop, the simplest and most likely solution was to add a delay while handling that corner case of incomplete data. For testing, we used an unreasonably large delay and added it in the general case for the loop, ensuring that the loop could never become a runaway in proper runtime conditions. Through more tedious testing, arrrghhh was able to confirm that the delay solved the runaway system_server issue (while making the sensors unusable).

After making that loop delay much shorter and placing it in the corner case exclusively, testing continued to show success. So it seems like the system_server bug is finally defeated. We’ve already released a new rootfs with the relevant change integrated. Give it a try and let us know how it works out, via the IRC channel or the aforementioned bug. Thanks for reading!