Monday, December 15, 2014

MotoG : Pure CPU Benchmarks, the limits

To point out pure CPU Benchmark flaws, we'll observe how does a moto G (Falcon or Peregrine, this has no relevance) behaves with Linpack Benchmark when running on Stock 4.4.4 Motorola ROM or CM11-20141124-nightly (4.4.4).


CyanogenMod Logo


We have seen previously that Linpack didn't use all cores and was limited to 3 threads in multi-thread benchmarking (when comparing s200 and s400 SoC).

Now, we will compare MFLOPS performance between two ROMs that has similar user experience (smoothness mostly)


Stock 4.4.4 Motorola ROM vs CM11
both @1190MHz, Interactive governor.


Stock Motorola features a nearly doubled score for both Single and Multi-Thread, but does that mean it is really better optimized?

  • In a way, yes, CM11 is made to be compatible with most devices, so we encounter similar problem seen with Windows against iOS : 
    • An OS that fits all against a fully optimized one made for a few specific hardware. Motorola obviously optimized their software to get the best of this great device
    • If you compare with the MotoG vs MotoE test, you'll see that the MotoG running CM11 has lower results than MotoE running stock ROM ...
  • On the other hand, that's not all a matter of optimization :
    • CM11 features KSM, zRAM, and many things that use CPU cycles to compress memory (zRAM) or merging merge-able things (KSM) ==> this reduces CPU pure performance but increase multi-tasking ability.
    • The war of versatility and customization against slickness and stability...
    • Honestly i can't see difference in user-felt performances...



Actually, i don't see any issues by using CM11 as a daily driver on my XT1032 (Falcon), it is not because a Benchmark say something that it is true in "real life"...

  • Don't use CM11 on Moto G if you want to show off with high CPU benchmark results ...
  • Stock Motorola ROM is close enough to AOSP to be acceptable as daily driver
  • Xposed helps you to get the best of stock ROM
  • CM11 is great for end-user customization


The real conclusion is the following :

Don't trust Benchmarks as incontestable truth, they helps to compare devices and  ROMs, but never really tell you how good devices/ROMs are.

Wednesday, December 10, 2014

Moto G and Moto E : snapdragon 400 vs 200


Snapdragon 400 vs Snapdragon 200

based on msm8926/8226 vs msm8610

Qualcomm Snapdragon Logo


It is now time to compare MotoE and MotoG:
Moto G and E features a Snapdragon 400 and 200 (respectively a Quad-core Cortex A7 @1.19GHz and a Dual-core Cortex A7 @1.19GHz)

Note that previous benchmarks were performed with ONDEMAND governor on CyangenMod11 ROM, but stock Moto ROM uses Interactive by default (i didn't expected that...) so the following has been made with interactive for both devices (needed to re-bench MotoG >_<)

to check above results are applicable despite governor modification : 

MFLOPS per governor on MotoG (Falcon, CM11) @1190MHz
MFLOPS @1190MHz for Interactive and ONDEMAND governors on Moto G (Falcon)


No significant difference between ONDEMAND and Interactive governors for the specified test.




Moto G (Peregrine) vs Moto E (Condor)

To improve accuracy, instead of using my Falcon (XT1032) running CM11, we will compare results obtained on a Peregrine (XT1039) running Stock Motorola ROM :
Both Benchmarks have been run on Motorola Stock 4.4.4 ROM on Moto G (Peregrine) and Moto E (Condor):

There is no differences between msm8226 (Falcon) and msm8926 (Peregrine) despite LTE capability of msm8926, that's why we will use a Peregrine for the following part.


MotoG (Peregrine) vs MotoE (Condor) @1190MHz, stock 4.4.4
MotoG (Peregrine) vs MotoE (Condor) @1190MHz, stock 4.4.4 Single and multi-thread

We have quite similar results on Single Thread application for one simple reason, the number of cores does not have any impact. Since the clock speed is the same, the results are the one expected.

On Multi-thread the difference is quite huge between the quad-core and the dual-core, though we don't see a x2 ratio by doubling the cores number.


MFLOPS divided per the amount of cores
x/4 for msm8926 and x/2 for msm8610, Single Thread as control.
MFLOPS divided per the amount of cores. Peregrine and Condor; single and multi-thread
We should have observed a similar result between Single and Multi/nbCore...
Is the msm8926 really shitty at multithreading? i don't think so, looks more like if linpack or the system only uses 3 Threads...

If we apply a corrective divider (3 instead of 4) the results are perfect :


MFLOPS divided per the amount of threads used
x/3 for msm8926 and x/2 for msm8610, Single Thread as control.
MFLOPS divided per the amount of threads actually used. Peregrine and Condor; Single and Multi-Thread

Moto E (Condor) and Moto G (Peregrine or Falcon) should have similar performance in single threaded applications.
Though the 4 Cores may no be used at their full potential in some apps, multi-threaded applications should be better handled by the msm8926/8226 featured by moto G.




Moto G? or Moto E?

Which one for What...

For moderate usage, Moto E is quite enough compared to Moto G : 


  • It is not weaker on Single Threaded applications
  • It has a smaller battery but both smaller CPU and half size Screen in pixels (960*540 vs 1280*720) will give it a great battery life.


Moto G is still the best quality/price in its category (prefer the Peregrine version and not the Moto G 2014 aka Titan)

  • Multi-threaded applications will obviously run better on it
  • The better Screen density improves user experience on long term usage
  • A far better Camera...



A complete Moto G - Moto E versus is available on versus.com (note that Moto G Peregrine does not have 16GB of internal memory ... but only 8, and an SDcard slot.)

Monday, December 8, 2014

Installing Opera 26 and Adobe Flash Player? Pepper Flash!

After the Linux Mint 17.1 upgrade, why not trying Opera 26 ? (Opera had not been updated for Linux since Opera 12 before this new release)
Getting to the Opera Web Page and downloading the x64-only .deb :



Installing the deb package : (the package will seek for dependencies)




If you want Opera to get its updates with system updates, then :

Need Adobe Flash Player ?
What about using Pepper flash instead of Adobe oldies?



sudo apt-get install pepperflashplugin-nonfree

Restarting Opera, and we're done!




Friday, December 5, 2014

CPU Freq and Performances : Single and Multi Thread

Linpack Benchmarking for Moto G, Single and Multi-Threads...
Linpack CPU Benchmark Logo

Before we compare Moto G and E Snapdragon 400 and 200 (respectively a Quad-core Cortex A7 @1.19GHz and a Dual-core Cortex A7 @1.19GHz), let's see how the Moto G performs with ONDEMAND governor and increasing CPU Clock.






MFLOPS and CPU Clock speed

On Moto G XT1032 aka Falcon, CM11


A MotoG XT1032, running CM11-20141124-NIGHTLY has been used for MFLOPS per MHz tests.

The CPU is downclocked at 787MHz, and then frequency is raised up to nominal Frequency that is 1190MHz. Here are Single and Multi-Thread MFLOPS results.


MFLOPS performance against MHz single and multi-thread
You can note that 998MHz had inconsistent results due to high standard deviation...



MFLOPS/MHz

A closer look to the results
Multi-thread results raise quicker than Single Thread, let's explore this closer :
CPU efficiency : MFLOPS per MHz against MHz : Single and Multi-Thread
As we can see, 
  • MFLOPS/MHz ratio does not increase much for Single Thread, but,
  • For Multi-thread the ratio increases between 787 and 998MHz but then stagnates : This means that MFLOPS increases in a linear way as Frequency is raised.

This can be explained by the following fact : 
The OS needs some CPU cycles to stay ON, so under a certain frequency it conflicts with Linpack work and decreases performances more than expected.


Conclusion?

As a conclusion, we can say that CPU clock increase is more effective on multi-threaded applications (in a quite linear manner) than on Single threaded ones.


Monday, December 1, 2014

2x5W Amplifier for mp3 player or line output (MK190) (part3)

Last update about the Audio-amplifier project,

While i was messing around to build a testing NAS with a Pentium D based set up (irrelevant to be used as a 24/7 NAS due to high power consumption of the platform...), i found an old 12Vcc/2.5A PSU from a broken external USB/Firewire HP DVD writer (that i had forgotten to own >_<).
What the DVD writer looked like ==> 



The wires were slightly damaged, so i simply re-soldered to the cable i previously made.

Here is the final result :


The Audio-amplifier project is now Closed and considered as finished. It is neither slick nor compact, but it's mine and works pretty well!



Tuesday, November 25, 2014

Moto E and Moto G : 2 White LEDs

After my articles about the "Two LEDs" discovered on MotoE (and suspected on MotoG) i received a lot of questions about them : 
Moto G Falcon notification LED charging triggerMoto E Condor notification LED charging trigger

  • Are there really Two LEDs there??
  • Are they really White and not RGB "mis-configured"?

So i made non-destructive tests using a microscope on Moto E:
For some reason, MotoE LED hole is transparent and we can see through it (that's not the case for MotoG)





2 LEDs

The proof that MotoE has 2 LEDs

Here is a picture taken at x100 of the notification LED ON (triggered through /sys/class/leds/white since the brighter one was too bright to allow me to take a pic of it lighten up with my set up)

Moto E Condor notification LEDs x100 microscopy

Each "yellow" rectangle is a LED chip (you can see the two wires on the left one)
This is proof there is two LEDs, i was able to light them both using the following : 


echo 255 >/sys/class/leds/charging/brightness #to light the left and brighter one
echo 255 >/sys/class/leds/white/brightness #to light the one on the right






White LEDs

The proof that Moto E has white only LEDs
Moto E Condor notification white LED microscopy (Blue and phosphor coating)


On the above picture, you can see a closer view of the LED: its inner components and something interesting :

  • there are 2 wires: this should correspond to +/- (proof of Single color LED)
LED basic Scheme from wikipedia[source : Wikipedia]

  • The light emitted is white (that could be RGB set to 255:255:255) BUT, there is a Blue shift (the blue luminescence you can see around the center of the LED) which  corresponds to a Blue LED with a phosphor substract coated on it giving the White light.
BLUE Phosphor coated LED spectrum from wikipedia[source : Wikipedia]


We now know that Moto E has 2 LEDs and that they are White only

I cannot prove it for motoG until complete teardown (the LED hole does not allow to see through it and observe the LEDs) but there are good chances that it also has 2 white LEDs regarding the behavior in previous tests.


Make sure you read these articles to understand how this started :

Monday, November 24, 2014

Moto E Playing with the LED

After we played with Moto G LED, it's time to do the same with MotoE's one :




It's always cool to know at a glance that your device is charging without the need of lighting the screen, here is how:

in /sys/class/leds/charging/trigger we have these triggers available : 

Code:
[none] bkl-trigger usb-online mmc0 mmc1 battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid bms-online
easy to change them using :
Code:
echo battery-charging >/sys/class/leds/charging/trigger
needs to set any value !=0 for brightness (LED is either ON or OFF on MotoE):
Code:
echo 1 >/sys/class/leds/charging/trigger
Moto E is quite different than Moto G :
If you pay attention, you can se that Moto E has Two little white LEDs soldered under the LED hole, the first one (left) is ruled by ./charging and the second one (less bright, ont the right) is ruled by the ./white.

/sys/class/leds/white/trigger, and /sys/class/leds/white/brightness configure the right LED and these settings are overridden has soon as a notification comes.

/sys/class/leds/charging/trigger and /sys/class/charging/brightness configure the left LED (the brighter one) and these settings are not overridden by notifications AND both can work toghether: 
You can see the left one kept ON while charging (using battery-charging trigger) and the right one Blinking with an incoming notification.


The above has only been tested on stock rooted ROM
Here is the XDA dedicated thread

Moto G : Play with the LED

Moto G has a White-only notification LED (as actual Knowledge, might be proved wrong later on... ==> proof has been given since then)

I miss the RGB led of my X10 mini, and the charging LED notification
We can't override the LED color since it turned out that the LED is White and not RGB, but we can play with the triggers :

in /sys/class/leds/, we can find the following folders (that are symlinks):
  • charging/
  • lcd-backlight/
  • led:flash_0/
  • led:flash_torch/
  • rgb/
  • torch-light/
  • white/
  • wled:backlight/

For a start, let's play with /sys/class/leds/charging/:
  • brightness
  • device/
  • max_brightness
  • power/
  • subsystem/
  • trigger
  • uevent

Brightness

Is that LED dimmable?

adb shell
su
echo 255 /sys/class/leds/charging/brightness


  • Using /sys/class/leds/charging/brightness this LED only takes two states: 0 and 255 (in fact 0 and != 0)
  • Using /sys/class/leds/white/brightness the LED can be set to any value between 0 and 255 (but it is overridden if a notification comes and the value is set bat to 0...


Triggers
Testing and setting the triggers

What are the triggers available ?

catching values :
cat /sys/class/leds/charging/trigger

output:
[none] bkl-trigger usb-online flash0_trigger torch_trigger mmc0 battery-charging-or-full battery-charging battery-full battery-charging-blink-full-solid bms-online 


The ones we know the use :

  • [none] (default, LED does nothing)
  • blk-trigger (used by ./wled:backlight/trigger)
  • usb-online (lights up when USB connected)
  • flash0_trigger (used by ./led:flash_0/trigger)
  • torch_trigger (used by ./led:flash_torch/trigger)
  • mmc0 (I/O triggered, lights when mmc0 is in use)
  • battery-charging-or-full (full time ON LED when charging or charged)
  • battery-charging (full time ON LED when charging)
  • battery-full (full time ON LED when charged)
  • battery-charging-blink-full-solid (blinks until charged)

To get Blinking during charging :
echo battery-charging-blink-full-solid >/sys/class/leds/charging/trigger

making sure it worked:
cat /sys/class/leds/charging/trigger

Output:
none bkl-trigger usb-online flash0_trigger torch_trigger mmc0 battery-charging-or-full battery-charging battery-full [battery-charging-blink-full-solid] bms-online 

Since */charging/brightness does not dimm LED, the LED stays at full power.


Comments

Some Strange behaviors :

During test i was able to show that using /sys/class/leds/charging/trigger overrides any other trigger (if a notification comes, then it won't change the pattern) in fact i recently found that MotoG has 2 LEDs and that they can be lighten up the same way it works for MotoE :

  • /sys/class/leds/charging/trigger → first LED, can be set to on/blinking while charging, although at full brightness.
  •  /sys/class/leds/white/trigger → second LED, can be dimmed, but the LED turns back off when a notification comes in.



Though using /sys/class/leds/white/brightness allows to use 0~255 values to dimm the LED it is overridden by any incoming notification that set brightness back to 0. ==> Cannot be used as battery blinking notification.

For now, the best way is to set "first" LED (/sys/class/leds/charging/) for charging using dedicated trigger and keeping the "second" one to none (and used as notification LED as it is by default) and get both working together this way.
What we need is to find a way to dim the "first" LED


Got the idea to play with LED thanks to carock @XDA

Tuesday, November 18, 2014

Setting up Moto E (XT1022 aka Condor)

From Unlocking bootloader to greenifying... 
A kind of speedrun. 30 minutes are enough from unboxing to the result ;)



Unlocking Bootloader


Unlocking Bootloader

This voids warranty unless you live in EU
#include <std_disclaimer.h>
/*
* Unlocking bootloader wipes your device's data.
* You will loose anything stored in there.
* Backup your files if any.
*/

First of all, we need to set up adb environment, and then unlock bootloader,....

Adding the needed rule to /etc/udev/rules.d

create or edit 99-android.rules
#moto normal mode
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}==”2e82″, MODE="0666"
#moto debug mode
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}==”2e76″, MODE="0666"
#moto fastboot mode
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", ATTR{idProduct}==”2e80″, MODE="0666"
#moto global debug 
SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666"

If you don't have adb or fastboot already installed, then install the android SDK


getting unlock code : 
Enable USB debugging on your Condor, and type
adb reboot bootloader

Once you are done, type 
fastboot oem get_unlock_data

You should get something like : 
$ fastboot oem get_unlock_data
 (bootloader) 0A40040192024205#4C4D3556313230
 (bootloader) 30373731363031303332323239#BD00
 (bootloader) 8A672BA4746C2CE02328A2AC0C39F95
 (bootloader) 1A3E5#1F53280002000000000000000
 (bootloader) 0000000

Turn it into something like :

0A40040192024205#4C4D355631323030373731363031303332323239#BD008A672BA4746C2CE02328A2AC0C39F951A3E5#1F532800020000000000000000000000

go to Motorola website, it's now time to check if the device is unlockable :
Is your device unlockable?

Agree, and request the key:


Get your Unlock Key

Get your email :
Unlock email




Unlocking for Real:

$ fastboot oem unlock UNIQUE_KEY


Wait your device to reboot, you should see this at startup:

Unlock Warning
Don't worry, first boot is really really slow.




Removing Unlock Warning

Fed up with Unlock disclaimer at boot? It's time to fix it.


  • Download this file
  • Extract logo.bin
  • Reboot to fastboot:
  • adb reboot bootloader

  • Open terminal where you logo.bin has been extracted or cd to it.
  • Type:
  • fastboot flash logo logo.bin

  • Reboot:
  • fastboot reboot

  • Enjoy!




Installing Recovery

What's a device without any custom recovery?
CWM Recovery

Download CWM recovery from here

fastboot flash recovery FILENAMEtoFLASH.img





Rooting

Unleash the Dragon sleeping in your device


SuperSU

  • Download SuperSU zip from here
  • Reboot to recovery:
  • adb reboot recovery
  • choose install zip from sideload and type (from a terminal opened in folder that contains SuperSU zip):
  • adb sideload FILENAME.zip
  • Reboot and enjoy RoOt Access!
Isn't that too easy?? 




The following is only there to give clues about how to take advantages of an unlocked/rooted device:


Xposed Framework

Getting Xposed to fully play with your device

Want to learn more about Xposed ?

"Xposed is a framework for modules that can change the behavior of the system and apps without touching any APKs. That's great because it means that modules can work for different versions and even ROMs without any changes (as long as the original code was not changed too much). It's also easy to undo. As all changes are done in the memory, you just need to deactivate the module and reboot to get your original system back. There are many other advantages, but here is just one more: Multiple modules can do changes to the same part of the system or app. With modified APKs, you to decide for one. No way to combine them, unless the author builds multiple APKs with different combinations."
Xposed

Download the installer from here, enable unknown sources and install the framework
==> try these modules to get the best out of your device ;)

  

Greenify your device!

The best way to prevent unwanted background services


Simply install from the playstore

Greenify

Playstore description : 
"Never should your phone or tablet become slower and battery hungrier after lots of apps installed. With Greenify, your device can run almost as smoothly and lastingly as it did the first day you had it!

Greenify help you identify and put the misbehaving apps into hibernation when you are not using them, to stop them from lagging your device and leeching the battery, in an unique way! They can do nothing without explicit launch by you or other apps, while still preserving full functionality when running in foreground, similar to iOS apps!
"


Since Xposed is installed, don't forget to enable "boost" mode in Experimental features : it will use the power of Xposed Framework through a module to get better performances.


Sources of knowledge :

  • RC-FAQ for Moto G [Collective work to get accurate knowledge]; 
  • FAQ for Moto E [by FalconG, based on RC-FAQ for MotoG]; 
  • How to Unlock BL for Moto G [by myself, now certified to be working for Moto E]; 
  • How to Root by deej_roamer
  • Motorola documentation

Sunday, November 16, 2014

Xposed & Moto E (XT1022 aka Condor)




Xposed & Moto E

For Moto E set-up for 'standard End-User' in addition to Motorola Stock ROM : 





  • Acdisplay by AChep (Apps' additional module)
  • Greenify by oasisfeng (Apps' additional module)
  • GravityBox [KK] by C3C076
  • Remove MotoG second SIM icons by MohammadAG (works perfectly on Moto E XT1022)
  • Battery Home Icon by MohammadAG 




  • >>> for moto G <<<