yashsingh1/xdaforums huggingface dataset:
[Hardware Hacking General] BenniBenassi:
If you install the newest Busybox from the Play Store and use the Smart Install option, it will install nanddump etc. No need to fiddle around with those commands you mentioned, ... I have the package, but the Busybox is more complete.

To me, cat /dev/nand_env/ gives following, but maybe its because I included in build.prob this line:

ubootenv.var.nandargs=

This is the what it gives:

QU▲▀batfull_threshold=98 batlow_threshold=10 baudrate=115200 bootargs=root=/dev/
cardblksd2 rw rootfstype=ext3 rootwait init=/init console=ttyS0,115200n8 nohlt v
malloc=256m mem=1024m logo=osd1,0x84100000,720p bootcmd=run nandboot bootdelay=1
bootfile=boot.img chipname=8726m6 console=ttyS2,115200n8 cvbscheck=setenv outpu
ttemp ${outputmode};if test ${outputmode} = 480i; then if test ${cvbsenable} = t
rue; then setenv outputtemp 480cvbs;fi;fi; if test ${outputmode} = 576i; then if
test ${cvbsenable} = true; then setenv outputtemp 576cvbs;fi;fi cvbsenable=fals
e display_bpp=24 display_color_bg=0 display_color_fg=0xffff display_color_format
_index=24 display_height=480 display_layer=osd1 display_width=720 ethaddr=c4:4e:
ac:00:e2:47 fb_addr=0x84900000 gatewayip=10.18.9.1 hostname=arm_m6 ipaddr=10.18.
9.97 loadaddr=0x82000000 loadaddr_misc=0x83000000 machid=4e27 mmcargs=setenv boo
targs console=${console} boardname=m6_mbx nandargs=run cvbscheck;nand read aml_l
ogo 0x84100000 0 400000;setenv bootargs root=/dev/cardblksd2 rw rootfstype=ext3
rootwait init=/init console=ttyS0,115200n8 mac=${ethaddr} logo=osd1,0x84100000,$
{outputtemp},full androidboot.resolution=${outputmode} nohlt vmalloc=256m mem=10
24m a9_clk_max=1512000000 nandboot=echo Booting from nand ...;run nandargs;nand
read boot ${loadaddr} 0 600000;hdcp prefetch nand;bootm;run recovery netmask=255
.255.255.0 outputmode=720p outputtemp=720p preboot=get_rebootmode; clear_rebootm
ode; echo reboot_mode=${reboot_mode}; if test ${reboot_mode} = usb_burning; then
tiny_usbtool 20000; fi; run upgrade_check; run updatekey_or_not; run switch_boo
tmode reboot_mode=charging recovery=echo enter recovery;run nandargs;if mmcinfo;
then if fatload mmc 0 ${loadaddr} recovery.img; then bootm;fi;fi; nand read rec
overy ${loadaddr} 0 600000; bootm serverip=10.18.9.113 sleep_threshold=20 switch
_bootmode=if test ${reboot_mode} = factory_reset; then run recovery;else if test
${reboot_mode} = update; then run recovery;fi;fi testaddr=0x82400000 update=if
mmcinfo; then if fatload mmc 0 ${loadaddr} aml_autoscript; then autoscr ${loadad
dr}; fi;fi;run recovery updatekey_or_not=saradc open 4;if saradc get_in_range 0x
0 0x50 ;then msleep 500;if saradc get_in_range 0x0 0x50; then run update; fi; fi
upgrade_check=if itest ${upgrade_step} == 1; then defenv_without reboot_mode;se
tenv upgrade_step 2; save; fi upgrade_step=2 usbnet_devaddr=00:15:18:01:81:31usb
net_hostddr=00:15:18:01:a1:3bcdc_connect_timeout=9999999999 usbtty=cdc_acm video
_dev=tvout cvbsmode=480cvbs has.accelerometer=0

And this is UART boot sequence logcat... in around 22 seconds, there are very interesting settings being handled....
[Hardware Hacking General] osm0sis:
Just going through the .rc files and noticed references to these:

/sys/class/mali_freq/max 333000

/sys/class/freq_limit/limit 0

My guess is freq_limit is what allows it to not use the proper scaling_available_frequencies

And if we can modify the mali max freq... :D

Edit: Was just reading some docs, and apparently the MALI 400 has a normal max of 500. Setting it directly in the shell didn't affect it. I'll try it on boot.

Edit: No effect on boot either.. Maybe it's just the userspace output of the kernel set max. If that's the case then a recompile would be required to alter it.
[Hardware Hacking General] BenniBenassi:
Doing the cat thing freezes my box, too. Seems it's normal behavior. I have one for testing, so if you tell me what to do I will seriously consider doing it.
[Hardware Hacking General] BenniBenassi:
Maybe the kernel can be patched without a recompile? I will look into it.
[Hardware Hacking General] osm0sis:
Have you ever had to nandwrite those nanddump backups? I tried it with just nandwrite and it threw up a warning recommending -p to pad the images to pagesize. So then I did nandwrite -p and it wouldn't boot. Restoring with your sdcard image now.

Examined the original dumped kernel image and my repacked one and padded it out appropriately, going to try again.

My only worry is that the last padded portion is all FF, and that ubootenv is ALL "blank" FF hex data where I expected it to contain variables we could hack, making me think it's a placeholder for something else, like the OOB info. So I'm worried that we're in a bit of a catch-22: If we dump the OOB then we can't edit the ramdisk; if we don't dump the OOB then the device won't boot after the image is rewritten.

Dumping with nanddump definitely worked well, though I didn't use -b since I wanted an exact copy. Anyway, if you know a method to write the images correctly again then I can definitely do ramdisk mods on this thing.

Edit: Hmm even won't work when nandwriting the original boot.img back.. Maybe if I try to dd it back.. Bad news is all my backups are likely useless and I'll have to set it up from scratch. :(

Edit 2: dd was also a failed experiment. Not sure how to write things back now. Any help here would be appreciated.
[Hardware Hacking General] relol:
Hi, i have the same board version, 2.22 but my system ans usrdata have different sizes than yours. I managed to compile cwm for the first version of this board and it works fine, then i compiled it for my board and it doesn't backup, it starts but freezes. I actually flashed a spanish rom and the device works fine, also Xbmc-linux works nice.

I have uart cable but it's very difficult to use it having pads instead of pins on the board. I will look through uart to see what's happening with cwm.

Anybody can give me a hand on this? Thanks!
[Hardware Hacking General] BenniBenassi:
Let me know what did you want to write on the nand? I will try to write on my box.
[Hardware Hacking General] osm0sis:
This doesn't grab a correct kernel image:

dd if=/dev/block/mtdblock5 of=/sdcard/mtd5-boot.img;

These definitely grab the kernel since the sha1sums match and I can unpack it afterwards perfectly:

nanddump -f /sdcard/mtd5-boot.img /dev/mtd/mtd5;

dd if=/dev/mtd/mtd5 of=/sdcard/mtd5-boot.img

But the opposite doesn't seem to result in a device that boots at all:

nandwrite /dev/mtd/mtd5 /sdcard/mtd5-boot.img; #or whatever, I did it correctly at the time. ;)

dd if=/sdcard/md5-boot.img of=/dev/mtd/mtd5;

And this just goes black after the bootlogo:

dd if=/sdcard/md5-boot.img of=/dev/block/mtdblock5;

Edit: Apparently that FF stuff I noticed before is just how nand handles empty pages:

http://stackoverflow.com/questions/11279473/how-to-correctly-nandwrite-a-nanddumped-dump-with-oob

Luckily your restore sdcard still worked in all these circumstances. Pretty frustrating though.. if I can write the kernel back in a working fashion then I can mod the ramdisk. Any ideas?
[Hardware Hacking General] BenniBenassi:
/block/mtdblock can't work because it does not exist on this reference board.

cd mtd

root@android:/dev/mtd # ls

mtd0

mtd0ro

mtd1

mtd1ro

mtd2

mtd2ro

mtd3

mtd3ro

mtd4

mtd4ro

mtd5

mtd5ro

mtd6

mtd6ro

mtd7

mtd7ro

mtd8

mtd8ro

mtd9

mtd9ro

Maybe the writing can be done in uboot only? By sf command?

http://forum.androidgadget.co.uk/showthread.php?tid=174&pid=964#pid964

And connecting the UART to this box is not so hard, all you need are these test hooks for about 1.6 dollars:

EBAY TEST HOOK

And this excellent UART connector for around 2.6 dollars

EBAY UART

Here are instructions and UART layout.

And picture of my connection with these test hooks:
[Hardware Hacking General] relol:
Thank you, i'm buying the test hooks but is there any homemade solution to work while i wait for the hooks to arrive? Thanks
[Hardware Hacking General] osm0sis:
[MENTION=4671084]BenniBenassi[/MENTION]

I decided I'd at least figure out the why of it not working after nandwrite, so I redumped after writing. The differences are pretty obvious:

00000000-00003FF0 (0-16384) Blanked with FF

Correct data...

00008000-0000BFF0 (32768-49152) Blank with FF

Correct data...

00010000-00013FF0 (65536-81920) Blank with FF

Every second 16384 sized block of data is blank. :confused:

I wonder if another nandwrite would handle it better? Going to try that one from the other thread. I've also got this vague hope that commandline options could resolve it if we could figure it out.

The good news is that you can nanddump with -b or without and you still get the same image sha1sum, so there aren't any bad blocks to worry about (at least on my device).
[Hardware Hacking General] BenniBenassi:
Try this app for Online Nandroid Backup:

https://play.google.com/store/apps/details?id=com.pommedeterresautee.twoborange3

It will make Nandroid Backup while you are booted, it does not need CWM.

You can try using images from there. These backups work, as I have flashed them back with my CWM.
[Hardware Hacking General] osm0sis:
Handy, but unless it can also restore booted it doesn't solve the problem of nandwrite only writing every second 16384 chunk of data from the image.
[Hardware Hacking General] BenniBenassi:
I have no idea, you could solder something if you have the usb to uart module, but be careful....
[Hardware Hacking General] relol:
Hi, i did some sort of homemade connection... It's very unstable and i can't do so much.

I'm sharing the pic, laugh is mandatory XD
[Hardware Hacking General] BenniBenassi:
LOL .... I thought of doing the same until after extensive googling I found these test hooks. Believe or not, it literally took me HOURS to find what I need. And then I started waiting for the hooks to arrive........:eek:
[Hardware Hacking General] osm0sis:
Cracked it. :D

There was an extra step (and binary) required: to wipe before writing. :victory:

busybox nanddump -f /sdcard/mtd5-boot.img /dev/mtd/mtd5 # readable image
busybox nandwrite /dev/mtd/mtd5 /sdcard/mtd5-boot.img # writes every second 16384-byte chunk

nanddump -n --bb=dumpbad -f /sdcard/test.img /dev/mtd/mtd5 # extra data, not readable image
nandwrite -n -N /dev/mtd/mtd5 /sdcard/mtd5-boot.img # writes garbage

nanddump -f /sdcard/mtd5-boot.img /dev/mtd/mtd5 # readable image
flash_erase /dev/mtd/mtd5 0 0 # extra step to wipe
nandwrite /dev/mtd/mtd5 /sdcard/mtd5-boot.img # writes readable image!

flash_erase /dev/mtd/mtd5 0 0 # extra step to wipe
nandwrite /dev/mtd/mtd5 /sdcard/mtd5-boot-osmod.img # error, image not page aligned

[B]flash_erase /dev/mtd/mtd5 0 0 # extra step to wipe
nandwrite -p /dev/mtd/mtd5 /sdcard/mtd5-boot-osmod.img # writes readable image![/B]

flash_image boot /sdcard/mtd5-boot-osmod.img # error on dump, flipped bits

flash_erase /dev/mtd/mtd5 0 0 # extra step to wipe
flash_image boot /sdcard/mtd5-boot-osmod.img # writes readable image!
# padded differently to nandwrite -p, more closely matches stock dump

These are the ones to use:

http://xdaforums.com/showthread.php?t=1902836

The built-in busybox ones work, as does a flash_image/nanddump multi-binary I found, but since you need flash_erase you might as well use the full stand-alone MTD-Utils set _n0p_ made, and have the extra commandline options. I'm thinking about making my own flash_image script to use instead.

Modding the ramdisk to try and get adb over tcp running at boot. Already have init.d in there. ;) :good:
[Hardware Hacking General] osm0sis:
Some really good conversation between some Elf II (also uses meson-cpufreq driver) devs, trying to figure out why they can't get it to use >1200 MHz even though they've set it to do so (3 pages):

http://www.slatedroid.com/topic/37745-elf-ii-kernel-development/page__st__160

By the looks of it, there's no way without recompiling from source with their patches though, unfortunately.
[Hardware Hacking General] relol:
Finally i don't need the uart connection anymore. My sdcard was fat16 instead of fat32. I've compiled cwm again with the latest kernel available, formatted my sdcard to fat32 and it backups and restores like a charm.

Feel free to test it. Note that microsd with adaptor produces strange behavior, also sdhci cards doesn't work properly. I'm using a 2gb sdcard and works fine.

https://mega.co.nz/#!bEIRTABa!N2lfOgBf3Zfr9BwVnhCYmEw8RWABVbnwn_2e4IVQgbU

---------- Post added at 08:11 AM ---------- Previous post was at 08:07 AM ----------

I forgot to mention, uncompress the file in a sdcard then boot the box with a toothpick inside the av hole. This cwm works from sdcard, it's not replacing the original recovery.
[Hardware Hacking General] osm0sis:
Guys, I made some new initlogos to replace the terrible GBox one. Any preference? :D

http://imgur.com/a/S1PKz/
[Hardware Hacking General] relol:
The first one is my favorite :)
[Hardware Hacking General] osm0sis:
Me too, though it's a lot to take in for the half-second it's displayed, and things get a little warped on my old 4:3 television. ;)

My girlfriend wants the GTV one on ours, but I won't force the branding on anyone else. :p

[MENTION=4671084]BenniBenassi[/MENTION], what do you prefer?

Edit: Using those MTD-Utils I simplified the commandline flashing process into a flash_image script:

http://xdaforums.com/showthread.php?p=40409361#post40409361

Things just got way easy! :D Doing a bit of testing, then I'll upload my modded boot.img which will also include all the MTD-Utils in /sbin/. :good:
[Hardware Hacking General] BenniBenassi:
Rainbow looks cool, haven't seen it before :)

And here is a nice init.d script that I use that will make the MX box somewhat smoother... (contains your specs aswell)

#!/system/bin/sh
# chmod -R 755 /system/etc/init.d
# allow network adb shell access
setprop service.adb.tcp.port 5555;
stop adbd;
start adbd;
# cpufreq tweaks
for i in /sys/devices/system/cpu/cpu*/cpufreq; do
echo 1512000 > $i/scaling_max_freq;
echo 1512000 > $i/scaling_min_freq;
done;
# tcp tweaks
echo "reno" > /proc/sys/net/ipv4/tcp_congestion_control;
rm -f /system/lib/egl/libGLES_android.so
busybox sed -i '/0 0 android/d' /system/lib/egl/egl.cfg
# Conservative Governor Tweaks
SAMPLING_RATE3=150000
busybox chmod -R 777 /sys/devices/system/cpu/cpufreq/conservative
busybox echo 95 > /sys/devices/system/cpu/cpufreq/conservative/up_threshold;
busybox echo 35 > /sys/devices/system/cpu/cpufreq/conservative/down_threshold;
busybox echo 10 > /sys/devices/system/cpu/cpufreq/conservative/freq_step;
echo 150000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate;
busybox echo 1 > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor;
busybox chmod -R 444 /sys/devices/system/cpu/cpufreq/conservative
# Disable I/O Stats
if [ -e /queue/iostats ]; then
busybox echo 0 > /queue/iostats;
fi;
# Default I/O Scheduler Tweaks
if [ -e /queue/rotational ]; then
echo 0 > /queue/rotational; fi;
if [ -e /queue/nr_requests ]; then
echo 1024 > /queue/nr_requests; fi;
# Disable Vsync
busybox mount -t debugfs debugfs /sys/kernel/debug
busybox echo '0' > /sys/kernel/debug/msm_fb/0/vsync_enable
umount /sys/kernel/debug
# Optimization of all sqlite3 databases each boot
for sqlite3 in \
# Ext4 File-Systems optimization & instant-mount
busybox mount -o remount,noatime,noauto_da_alloc,nodiratime,barrier =0,nobh /system
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodir atime,barrier=0,nobh /data
busybox mount -o remount,noatime,noauto_da_alloc,nosuid,nodev,nodir atime,barrier=0,nobh /cache
# External SD I/O Tweaks
busybox echo 8 > /sys/block/mtdblock0/bdi/read_ahead_kb
busybox echo 8 > /sys/block/mtdblock1/bdi/read_ahead_kb
busybox echo 8 > /sys/block/mtdblock2/bdi/read_ahead_kb
busybox echo 8 > /sys/block/mtdblock3/bdi/read_ahead_kb
busybox echo 128 > /sys/devices/virtual/bdi/7:0/read_ahead_kb
busybox echo 128 > /sys/devices/virtual/bdi/7:1/read_ahead_kb
busybox echo 128 > /sys/devices/virtual/bdi/7:2/read_ahead_kb
busybox echo 128 > /sys/devices/virtual/bdi/7:3/read_ahead_kb
busybox echo 128 > /sys/devices/virtual/bdi/7:4/read_ahead_kb
busybox echo 128 > /sys/devices/virtual/bdi/7:5/read_ahead_kb
busybox echo 128 > /sys/devices/virtual/bdi/7:6/read_ahead_kb
busybox echo 128 > /sys/devices/virtual/bdi/7:7/read_ahead_kb
busybox echo 4096 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
busybox echo 4096 > /sys/devices/virtual/bdi/default/read_ahead_kb
busybox echo 97 > /sys/devices/virtual/bdi/179:0/max_ratio
busybox echo 97 > /sys/devices/virtual/bdi/default/max_ratio
busybox echo 4096 > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
[Hardware Hacking General] osm0sis:
Nice! Thanks! I'll check these out and add them. I have some questions/comments though:

1) From what I can see our conservative doesn't have sampling_down_factor. Does creating it do something or do you just have that there because most conservative governors do?

2) Why are you disabling hardware acceleration for the system UI and launcher and disabling vsync?

3) The SQLite command appears incomplete; "for" usually goes with "do". Does this work?

4) nobh isn't set on Android. Type mount from Terminal. My mntsettings script has the optimized mount options (at least on most other devices) and I've already incorporated them directly. :)

5) Can you explain how the sdcard/external ones work? I've seen this sort of thing before but I don't get why different buffers are needed on all those virtual devices and which ones are which.

I also managed to get mali_freq to accept changes after some ramdisk changes. I've got it theoretically running at 400 now. :D
[Hardware Hacking General] BenniBenassi:
As I mentioned before, I'm not a specialist on init.d... these were from my tablet, I used some apps that were supposed to give extra speed and then checked what they did in the init.d, made a copy of the init.d scripts, combined them and uninstalled the apps to save space. Sorry, can't remember the name of the apps now, which I used. More than one... thats for sure.

There might be an error or two, but then these errors were caused by the authors of the scripts. I remember making the copy-paste action with extreme care.

So sorry that I can't explain the logic behind these scripts, but I have seen the result and it does make the box smooother.

For Vsync, I can explain this: the gpu is held back to match the refresh rate of the display. When I disable it, gpu is no more held back.

For disabling HW acceleration in system UI, I have noticed it is faster with software rendering. Don't ask me why, but it does seem like that.

I look forward to trying your work!

And could you also make the Mali to work with 500MHz... as a test? In case it overheats, I will mod my box with a cooling fan....

*****

EDIT:

Found the name of one of the app I used at first, it was Pimp My Rom, there was one more I used afterwards together with the PMR, I will try to refresh my memory..... anyway, I messed around with them and they started acting buggy in the end, my guess is they interfered with one and another, also, the starting up of the MX box was too slow, but when it fully booted it was faster than without the init.d script so in the end I just reinstalled the rom and set up the init.d script I found in the folder without the apk-s.
[Hardware Hacking General] BenniBenassi:
Yesterday, during an intensive movie night (until 5am) the movie night was suddenly stopped by the box overheating and refusing to reboot unilt it was cooled off... which I was too tired to wait for and (more than 15 minutes) but in the morning it booted just fine. Too bad I did not have my UART cable connected at that time.... could have checked the output.

So indeed, [MENTION=4544860]osm0sis[/MENTION], if your overclocking method succeeds, the box definitely needs to be hardmodded with a cooling fan.
[Hardware Hacking General] freejack2k:
Got this box myself and cannot get any display on tv

Have tried connecting via hdmi and av but nothing, have tried on 2 different tv's and got nothing.

All i can do is switch between blue and red light via remote.

Have tried booting to recovery via pin method and putting power in but all that happens is blue light comes on and still no display on tv

Anyone got any ideas that could help?

Thanks
[Hardware Hacking General] osm0sis:
Are you sure you don't need to shave down your AV connector like the OP did? As Benni said though, quality control isn't the strong suit here. Either both outputs are broken (somewhat like my not being able to see anything while in recovery) or your ROM came bricked. Maybe try and use Benni's emergency sdcard to update/reflash and maybe it'll help.
[Hardware Hacking General] osm0sis:
I think if we leave it at 696 MHz min it'll be okay likely. Hardlining it at 1200 along with the video decoding was probably the issue for you.

I've begun looking into the script you compiled. Unfortunately a lot of it doesn't work as-is because the directories it's referencing don't exist or aren't the same on our hardware, but I'm looking into whether they can be made to work.

For example, msm_fb is for another device, so here's all we have for vsync:

root@android:/ # busybox find | busybox grep vsync

/sys/module/amvideo/parameters/vsync_exit_line_max

/sys/module/amvideo/parameters/vsync_enter_line_max

/sys/module/amvideo2/parameters/vsync_hold_line

0, 0, 17 are their values. Echoing 0 out to the last blanks the screen, so I guess we're out of luck. :p

These could also be of interest, but currently I have no idea what we'd do with them:

root@android:/ # ls /sys/kernel/debug/mali/userspace_settings/

buffer_capture_compositor

buffer_capture_n_frames

buffer_capture_other

buffer_capture_resize_factor

buffer_capture_window

colorbuffer_capture_enable

depthbuffer_capture_enable

per_tile_counters_enable

stencilbuffer_capture_enable

sw_counters_enable

sw_events_enable

There's also lots under /sys/class/graphics/

We don't appear to have any SQLite databates that aren't part of apps like Chrome or TiBu, so I think we're safe there too, but I'm a bit worried that the external SD I/O tweaks (that you got from the Xperia U?) echo 8 as a read_ahead_kb out to mtd0-3, those are the bootloader, ubootenv, logo and aml_logo.. They default to 128, and most tend to bump it up to at least 256 or 512 on actual filesystem mounts... :confused:

Anyway still weeding through; it's all interesting stuff! :D

Edit: Even the guy that posted those Xperia U tweaks seems to be mistaken since there are not mtd mounts on it, it's mmc based. Doesn't sound like he knew what he was doing so I'm not sure I really trust his tweaks.. :(

Info on the GLES tweak: http://forums.androidcentral.com/sprint-lg-marquee/135633-improve-performance-tweak.html

MAY apply to us or may not, considering we aren't using PowerVR.

And the "busybox sed -i '/0 0 android/d' /system/lib/egl/egl.cfg" command is actually there to ensure hardware acceleration is enabled on the device by removing that line. The line is already commented out by default on ours so it's unnecessary. We could experiment with uncommenting it to force software rendering to see if it makes a difference.

Edit 2: Most of the tweaks I'm finding have basically already been built-in. :p

Here are the details on the efg.cfg tweak: http://xdaforums.com/showpost.php?p=36525998&postcount=9

and some build.prop tweaks for hw rendering we already have set: http://xdaforums.com/showpost.php?p=36533876&postcount=14
[Hardware Hacking General] freejack2k:
Many thanks for reply.

Power light is responding to remote control however when i put the sd card in i cant get in to recovery as there is no output to tv even if i put reset button in then plug power in, all that happens is blue light comes on when i put power cable in.

Guess ill have to send it back unless anyone else has any ideas?
[Hardware Hacking General] relol:
install "fing" in a Android phone, have a look at it while the box is powered on (blue light), then you will know if the box is working or not. Fing scans your network and shows the ip of all your devices, if your box shows up then your hdmi/tvout are not working.

this is not a solution but it can let you know where the fail is.

regards