dimanche 28 octobre 2012

Mele_HTPC_0929_BETA_V1.3 Revised version: en_US v3

Here is a new firmware version:
What is fixed:
- fixed the reboot bug. Many thanks to tuscanman from the Russian forum 4pda.ru that gave the solution. Google Market did not get the right permissions, fix inside android.policy.jar: http://4pda.ru/forum/index.php?showtopic=342683&st=1420
- added the xpad.ko kernel module (/system/vendor/modules/xpad.ko, http://melea1000.blogspot.co.uk/2012/08/xbox-360-controller-errors.html )
- added the /etc/init.d/ facility. At boot, all scripts inside this directory will be called. This allows the user to run custom commands at boot (look at the script 99test that writes a test file at boot). You can add commands in this script or clone it to add some other commands (like insmod /system/vendor/modules/xpad.ko)
- called mksh where busybox sh is not really necessary in startup scripts. Abuse of busybox eats memory, well this gives minor effect.

Edit: the reboot bug stilll persist, I still get a system hang at reboot... sadly.
Edit(2): I just saw that on the serial console you have a login. Here is the logcat output, need to analyse it now...: logcat_reboot_fail.log

lundi 22 octobre 2012

Mele_HTPC_0929_BETA_V1.3 Revised version: en_US [again]

To be short, don't use the firmware in my previous post, generated a firmware from the update.zip provided on this site: http://bbs.mele.cn/showtopic-1102.aspx
Use this one:
The reboot bug is still present (reboot never ends). Here is a typical console log: minicom_fail.cap

For the long story:
The previous firmware was buggy:
Mele_HTPC_0929_BETA_V1.3 Revised version: en_US is easy
1/ Going back from sleep mode, with F10 remote plugged-in, CPU consumption gets to 100% due to system_server.
The root cause is an additional library (that was not present in firmware 1.1), that adds some event capabilities to the F10 remote. But adds so many spurious events that it makes the system behave slowly.
The events can be seen doing "adb logcat".

D/Sensors ( 155): Sensor data: t x,y,z: 0.000000 0.000000, 0.000000, 0.000000
D/Sensors ( 155): Sensor data: t x,y,z: 3387016.000001 0.000000, 0.000000, 0.000000
I/EventHub( 155): Removing device '/dev/input/js0' due to inotify event
I/EventHub( 155): Removing device '/dev/input/event4' due to inotify event

The additional library is: /system/lib/hw/sensors.exDroid.so

2/ Some users burned this firmware, but it does not go further than the boot animation step.
I experienced this issue, but not at first boot (after several installs).
On the serial console you can see the consequence of this bug (I did not record the logs but should look like this):
init: waitpid returned pid 139, status = 00000009
init: process 'netd', pid 139 exited
init: process 'media', pid 140 exited
... in a loop.
It comes most probably from memory shortage at start. When memory is needed, Android kills background processes. But if background processes are essential to the system start... it fails.

As a consequence, in this _2 firmware image:
1/ renamed /system/lib/hw/sensors.exDroid.so into /system/lib/hw/sensors.exDroid.so_deactivated so that the system does not load it
2/ busybox is relatively huge:

size system/bin/busybox
   text   data    bss    dec    hex filename
1457781   2496  18304 1478581 168fb5 system/bin/busybox

compared to toolbox:

size system/bin/toolbox
   text    data     bss     dec     hex filename
  90234    7552   21348  119134   1d15e system/bin/toolbox
and mksh:

size system/bin/mksh
   text   data    bss    dec    hex filename
 143144   3184  19572 165900  2880c system/bin/mksh

So I re-applied the "toolbox" symlinks to minimize the busybox impacts,and replaced
/system/bin/sh -> busybox
/system/bin/sh -> mksh
Also, I replaced in /system/bin/preinstall.sh the shell:
#!/system/bin/busybox sh
so that it loads mksh instead of busybox (for just a if [ ] then elif, should be sufficient).

Hope it works...

lundi 15 octobre 2012

Mele_HTPC_0929_BETA_V1.3 Revised version: en_US is easy

The 1.3 beta revised version (http://tmerle.blogspot.fr/2012/10/melehtpc0929betav13-revised-version.html) comes as an update.
It contains the original launcher as expected (at start, you have the choice in the launcher), with Google Play, and busybox commands are symlinked.

Edit: here is the equivalent PhoenixCard image, customized in en_US:
Edit(2): Look at my updated firmware, fixing the CPU hog bug: http://tmerle.blogspot.fr/2012/10/melehtpc0929betav13-revised-version_22.html

Since this is an update.zip, no more PhoenixCard flashing process is needed, just a vfat formatted sdcard as a base media is sufficient.

From the archive, put on your sdcard:
- MeleTool.apk
- recovery.img (this is a CWM recovery image with Mele F10 recognition)
- bootloader.img (choose your flavor depending on the desired output VGA, HDMI,...)
- update.zip
You can edit system/build.prop in update.zip at your convenience. For example, you can setup the updated system in en_US directly.
So my customization is only a modified build.prop that you can put into update.zip (be careful to put it in system/)

Insert the SDCard in the device, install MeleTool.apk
Then launch the MeleTool.
Choose the option #4 talking about "Recovery" (wait a little so that the recovery img is written in nandg flash)
Choose the option #5 talking about "bootloader", the device will reboot after having written down in flash the nanda bootloader.
At this stage the device is stuck since it tries to boot on SD, remove SD, remove power, put power.
You should enter into CWM recovery. Insert again the SD.
Choose "apply sdcard:update.zip" (wipe data/cache before if needed)
After that, reboot and you are done.

dimanche 14 octobre 2012

Mele_HTPC_0929_BETA_V1.3 Revised version

Another version of the V1.3 Beta release:
Direct link to firmware: Mele_HTPC_0929_BETA_V1.3 Revised version
With a new package: Mele tools: http://bbs.mele.cn/attachment.aspx?attachmentid=1525
This application enables in order:
- shutdown,
- reboot in normal mode,
- reboot in recovery mode,
- write recovery img from SDCard
- write bootloader.img from SDCard
- go on the weibo site (don't know what for)

I found here: http://www.hdpfans.com/thread-156730-1-1.html some explanations about this newest firmware modifications, seems to be rebased on the V1.1 version instead of the V1.2 version, and based on the v1.1 launcher.

I experienced system latencies with the previous v1.3 beta and now it refuses to boot.
Downloading to see if it works better...

jeudi 11 octobre 2012

Mele Android 4.0.4 ICS firmware v1.3 en_US customized

New Mele firmware: http://www.slatedroid.com/topic/36614-mele-a1000a2000-install-cwm-cm9aokp-all-mods/page__view__findpost__p__437531
Its name is Mele_HTPC_0929_BETA_V1.3.rar
but the changelog does not show many improvements...

Nevertheless I customized this one here: Mele_4.0_V1.3BETA_custom_en_us_apex.img

I made the same customizations:
- replacing the stock /system/app/Launcher2.apk by ApexLauncher
- removing /system/app/Mele_Launcher.apk
- adding /system/app/Vending.apk (Google Play)
- removing preinstalled applications (7StationGame_v1.1.15_DXsigned.apk 360buy_TV_v1.0.1_meleTV.apk Googlepinyin.apk MELE4.0_wasu_1.0.0.6_0906.apk QQ_1.9.1.apk VoolePlayV1.0SP4_mailea10_20251.apk AdobeFlashPlayer11.1.112.60.apk)
- adding service.adb.tcp.port=5555 in build.prop
- adding Andrew patch 1.0.apk 

This time I managed to preinstall these things automatically at first start. A script named /system/bin/preinstall.sh is here to perform that, I just patched it in order to load packages from /system/preinstall/ instead of /sdcard/preinstall.