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:
Mele_4.0_V1.3BETA_revised_en_us_2.img
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
Bugs:
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".
Example:

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
by
/system/bin/sh -> mksh
Also, I replaced in /system/bin/preinstall.sh the shell:
#!/system/bin/busybox sh
by
#!/system/bin/sh
so that it loads mksh instead of busybox (for just a if [ ] then elif, should be sufficient).

Hope it works...

19 commentaires:

  1. This time, it seems to reboot correctly. Thanks for your work!

    RépondreSupprimer
  2. First install does not exceed bootanimation..second attemp install after unplugged hdmi plug and f10 USB part. Start up and .... vuala system is open .congratulations Thierry and thanks
    now I'm enjoying a film later continue with testing

    RépondreSupprimer
  3. Ups reboot fails again seems to be after installing apps

    RépondreSupprimer
    Réponses
    1. Strange... seems that I did not fix this issue, and this issue is linked with Google Play. So I need to investigate further what kills the startup...

      Supprimer
  4. Dear Thierry,
    I have a problem to get through the captcha code (ArtRoulette) on the download page, could you please just explain briefly what one should enter in the captcha field?
    Thanks for your great work!

    RépondreSupprimer
    Réponses
    1. Sorry I cannot help since I don't see any captcha (my IP address is trusted for this site, and thus does not request any captcha for me).

      Supprimer
  5. After installing some apps, it doesn´t reboot again :(

    RépondreSupprimer
  6. I think I have the same problem as Maltés:
    1. I installed the image ok and configured wifi and google play
    2. Two successful reboots to check everything is ok
    3. I installed 3 apps and tested that they worked
    4. Another reboot ... and bubbles remains flying arount the mele logo forever

    I experimented the same result for v1.2_revised and previous v1.3_revised :(

    RépondreSupprimer
    Réponses
    1. Yes, seems that too many things eat RAM at startup. I will look at it since I experienced the issue.

      Supprimer
    2. Services u3gmonitor and, maybe, ril-daemon autostart can be switched off -- if someone needs 3g dongle, he will enable them.

      Also can you make phoenixcard image of you modified rom, to use only dd to install it?

      Supprimer
    3. Right, thanks for the trick. Indeed mobile networking is not the main aim of this device.
      And yes, I will provide a "ddimg" so that it will be easier to flash it from linux.

      Supprimer
    4. Tried, but the issue is still there.
      I am trying to retrieve the NAND content using a linux distribution (archlinux), but the NAND partitions seem to be different between the linux kernel and the android kernel... Need to recompile the linux kernel with modified partitions.

      Supprimer
  7. Thierry can be that deleting Market app and installing a replacement market app may be fixed boot isseu

    RépondreSupprimer
    Réponses
    1. Yes, but re-adding the market to get the applications you cannot find on alternate markets would lead to the same situation. Killing ril and u3gmonitor can save memory, I will try that.

      Supprimer
  8. Thierry, how do you transform a SD card burned with PhoenixCard into a "ddable" image?
    Thanks

    RépondreSupprimer
  9. I mean how to create a "ddable" image that is just the size of the firmware, not the full 8Gb og my SD card... Thanks!

    RépondreSupprimer
    Réponses
    1. Hmm... I don't know yet :)
      The phoenix_info tool should give me significitant information about that (https://github.com/linux-sunxi/sunxi-tools), it works on the flashed sd image.
      Don't know yet how to manage the output of this tool, but it is the starting point.

      Supprimer
  10. Any luck in solving the reboot issue? every time I reboot, the system just stays in the reboot mode and never finish the boot. I have to reinstall the img to start all over again.

    RépondreSupprimer
  11. On this version, unfortunately no way. Seems that there is an issue with the framework. Please try the latest one v2.0.3, the gapps installation is tricky but works quite well. Note that netflix doesn't work on it, that's the main issue.

    RépondreSupprimer