Skip to main content

froyo_almond on Acer Liquid E

Great success!

No, really, that was (and still is) an interesting experience — bringing a newer kernel to a device abandoned by the vendor. The result is here acer_a1_froyo_almond_kernel and it requires the updated liblights for the LCD backlight and keypad LEDs to work.

So here are the interesting things:

RAM console

Before you start debugging the device, enable RAM console. This is a region in the device memory where the console output goes. You may not have UART console but RAM console is something that you will definitely want to have. Upon kernel panic or a spontaneous reboot the /proc/last_kmsg will have the contents of the last session. Since the memory of the device is not reinitialized on startup, you will be able to find the memory the way it was immediately before the reboot. Of course, if the RAM is powered down then there is some corruption, but during my tests that was not the case. Eventually I disabled the kpanic support because a) Acer changes could not be easily updated to match newer kernel and b) ram console provided everything I needed.

This functionality is now present in the mainline kernel as pstore driver but it appears that android starts using it only around 3.8 kernel.

Kernel patches

It looked like an easy task, one needs to find the revision the kernel was branched from, apply Acer changes and continue merging Codeaurora changes.

Not so fast.

Not only it was nearly impossible to figure at what time the branch was made, the cherry-picks of 2.6.32 features brought to 2.6.29 were not making it easier.

Since that was not crazy enough, Acer decided not to guard the changes they have introduced with the proper #ifdef's, so hunting for the useful changes became even harder. Eventually I managed to get Codeaurora eclair_chocolate kernel to boot with Acer patches, refactor some of them and bring them over to froyo_almond, but that was not a pleasant experience.

unlock_john

Qualcomm MSM kernel allows one to talk to the AMSS via diag interface, however it is by default guarded by a strong password. Before you enter that secret password, the diag interface is locked.

The password for unlocking is "acer.llxdiafkZidf#$i1234(@01xdiP" and the password to lock the device is "acer.dfzse,eizdfXD3#($%)@dxiexAA". These can be discovered by reading the diagfwd.c module in the released kernel, the firmware update application is using them before communicating with AMSS.

These passwords are long, so Acer developers found a better way to unlock the device, If you are running Acer kernel, echo unlock_john > /proc/debug_smem will unlock the diag interface for you. Reading that file would tell you the boot mode from the shared memory allocated by Acer in AMSS space.

The diag interface is fun if you have the information about what methods you can call, but all this info is proprietary.

Who is that John?

Userspace woes

Updating kernel is half the problem, userspace libraries may be even a bigger one.

In order to release Android 2.2 on Liquid E, Acer did not make anything better than bring ONLY the changes that are critical for Android 2.2 and apply these changes onto 2.1 libraries and 2.1 kernel (2.6.29). So when the kernel gets updated, the userspace breaks:

kgsl

KGSL is Kernel Graphics Support Layer and it provides the access to the hardware through the proprietary drivers. At some point (commit ebb6af2d125dca230c6ca539f58a63d0c077dc25) the 3D driver was split into 2 devices. Since Acer used old libraries, they are unaware of these changes. As these libraries are proprietary, it is not possible to bring in the newer userspace, so all kgsl commits had to be reverted. Without hardware acceleration support the screen went completely crazy, flickering and alternating between different framebuffer contents.

qaudio6

Update: Added a workaround to the kernel so notifications are played properly both from the headset and the phone speaker. It looks like the libaudio library is neither old nor sufficiently new. In any case a replacement is ready to be tested with bluetooth devices too (wired/speaker is ok).

Framebuffer format

If your screenshots appear red like the one pictured here, you should check that you have the proper framebuffer depth That's how a RGB565 framebuffer is read as RGBA8888:

/galleries/dropbox/device-2013-05-29-115731-180x300.png

Some other non-Acer devices had the issue too originally. As of 2013 it looks like no vendor releases a device with broken framebuffer setting.

FM2018

The legends say that original Acer A1 had 2 microphones so that it would be possible to get rid of background noise to achieve crystal-clear voice quality. Nexus One definitely had 2 microphones, but Acer decided to remove the hardware at some point.

Nowadays the kernel module is present, it is even being initialized but quits early after finding out that the hardware revision it is running at is newer than expected. I am fairly sure that there is no customer version of Acer Liquid E with dual microphones so that fm2018 module is completely useless.

Update: I found the pictures of the second microphone in early hw version in the service manual:

/galleries/dropbox/noise-reduction-mic.jpg

Wifi

Update: Most things are fixed. The key was to prevent wifi_carddetect to be disabled when the driver was switching the power on and off.

Summary

I am now using 2.6.32 as my main kernel, and it is actually working. It's not yet 2.6.35 and Android 2.3 is still far away with all the userspace issues but it is worth it. I learned how to use Git the hard way. I had over 500 different kernel builds and I will never buy a device made by Acer again.

Comments

Comments powered by Disqus