Jump to content
Guest

[KERNEL] [Y300/G510] Stock Huawei

Recommended Posts

One guy on czecho-slovak forums said that he run with phone 18days without charge but idk if its true (he is using cm 10.1)

Share this post


Link to post
Share on other sites

Is it normal when you use your phone in 2g and only for phonecalls, no data connection/wi-fi, mp3, nothing, just like a nokia 3310, Romagnolo1973 did tests with FusionX and Cm10.1, and in both cases reached about 20 days if i remember well, but, of course, with FusionX reached an higher duration.

Share this post


Link to post
Share on other sites

yes fonz remeber well

Batteria.jpg

20 day in a "Moto StarTac" way, only 2G for 1 call a day and some messages, with Fusion was possible, now new Google services are more battery eater than one year ago, plus the battery is not new anymore, but I reach 15 days with some internet connections, 12 if I play mp3 sometimes

Share this post


Link to post
Share on other sites
Guest

My battery seems to be broken then :P

 

I usually recharge very 2 days. But I'm using my device from time to time of course. Some hours of MP3, a little bit browsing on the Internet. SMS/calling, ...

Share this post


Link to post
Share on other sites

My battery seems to be broken then :P

 

I usually recharge very 2 days. But I'm using my device from time to time of course. Some hours of MP3, a little bit browsing on the Internet. SMS/calling, ...

Just like me... with some browsing, sms and calls, sometimes email app and some music

Share this post


Link to post
Share on other sites
Guest

Updated build (- nightly -): http://www.mediafire.com/download/vby6h8dut4uijnw/kernel_y300_synopsis_20140817.zip (according feedback there seems to be an wake-up issue out from deep-sleep on several ROMs. Stock B199 doesn't seem to be affected - that's the one I'm using myself)

 

  • add UKSM API ("better KSM") --> http://kerneldedup.org/en/projects/uksm/introduction/
  • add new setprop options (only need to be set once. they persist during reboot, unless you restore an backup of your data partition):
    • persist.synopsis.frandom (1: enabled; 0: disabled; needs reboot to get applied)
    • persist.synopsis.ksm (1: enabled; 0: disabled; needs reboot to get applied - this is for both, either KSM or UKSM. currently the kernel is using UKSM)
    • persist.synopsis.zram (1: enabled; 0: disabled; automatically setup of ZRAM after boot)
    • persist.synopsis.zram_size (0...xx MB)
  • re-enabled support for G330/G330 devices

If you set 'persist.synopsis.zram' to '1' and got a size set (persist.synopsis.zram_size), ZRAM will be automatically available after reboot, without the need of any script or APP. Same goes for the other features listed above.

Edited by Guest

Share this post


Link to post
Share on other sites

 

  • add new setprop options (only need to be set once. they persist during reboot, unless you restore an backup of your data partition):
    • persist.synopsis.frandom (1: enabled; 0: disabled; needs reboot to get applied)
    • persist.synopsis.ksm (1: enabled; 0: disabled; needs reboot to get applied)
    • persist.synopsis.zram (1: enabled; 0: disabled; automatically setup of ZRAM after boot)
    • persist.synopsis.zram_size (0...xx MB)
  •  

 

These are fantastic !!!!!!!!!!!!!

Share this post


Link to post
Share on other sites
Guest

Also I've tested them, I cannot guarantee that they are 100% bug free. Let me know in case they cause issues ;)

Share this post


Link to post
Share on other sites

We have to set the half of the value of zRAM size? because i set 60 but it gave me 120 MB

 

Edit: Yes, we have to.

 

 

 

Interesting features, by the way :)

Edited by fonz93

Share this post


Link to post
Share on other sites

Yes because now the zram device are two !!

This code is fantastic i love it

# ZRAM
on property:persist.synopsis.zram=0
        start synopsis-zram

on property:persist.synopsis.zram=1
        start synopsis-zram

on property:persist.synopsis.zram_size
        start synopsis-zram

# FRANDOM
on property:persist.synopsis.frandom=1
        start synopsis-frandom

# KSM/UKSM
on property:persist.synopsis.ksm=0
        write /sys/kernel/mm/ksm/run 0
        write /sys/kernel/mm/uksm/run 0

on property:persist.synopsis.ksm=1
        write /sys/kernel/mm/ksm/run 1
        write /sys/kernel/mm/uksm/run 1

Share this post


Link to post
Share on other sites
Guest

It's MB per device. I were already thinking about changing it. And I guess I will, since it's more logically to set an TOTAL amount of MB, instead per device.

 

I will let you know when I changed the calculations wink.png

 

Good job luca. You've found those changes rather quickly though happy.png

 

But currently I'm not sure if this one works:

 

on property:persist.synopsis.zram_size
          start synopsis-zram

 

I wanted to re-start the zram initialization on each change of this value. Doesn't work though. You have to change the size, set persist.synopsis.zram to 0 and then to 1 again to reload ZRAM with the new sizes.

Edited by Guest

Share this post


Link to post
Share on other sites

So now the amount of mb is for each cpu ??

So if we set zram to 40 we have 80 Mb of swap ??

 

Thanks i always unpack te boot.img on mine linux mint

Edited by luca020400

Share this post


Link to post
Share on other sites

In servive.zram.sh there is an error

#!/system/bin/sh

#
#  ZRAM enabler
#        by moddingg33k
#
# NOTE: set 'persist.synopsis.zram' to '1' to auto-start
#       this script at boot.
#

STATUS=`cat /data/property/persist.synopsis.zram`
ZRAM_SIZE=`cat /data/property/persist.synopsis.zram_size`
ZRAM_DEVICES=`ls /dev/block/zram* | cut -d"/" -f4`

#
# DISABLE
#
disable_zram()
{
    for device in $ZRAM_DEVICES; do
        swapoff /dev/block/$device
        echo 1 /sys/block/$device/reset
        log -p I -t synopsis "*** ZRAM *** disabled on /dev/block/$device"
    done
}

#
# ENABLE
#

enable_zram ()
{
    if [ $ZRAM_SIZE -gt 0 ]; then
        for device in $ZRAM_DEVICES; do
            swapoff /dev/block/$device
            echo 1 > /sys/block/$device/reset

            echo $(($ZRAM_SIZE*1024*1024)) > /sys/block/$device/disksize
            mkswap /dev/block/$device
            swapon /dev/block/$device -p0
            log -p I -t synopsis "*** ZRAM *** enabled on /dev/block/$device ($ZRAM_SIZE MB)"
        done
    else
        disable_zram
    fi
}

#
# MAIN SCRIPT
#
if [ $STATUS -gt 0 ]; then
    disable_zram
    enable_zram
else
    disable_zram
fi
 

You call two times disable_zram when you enable zram

Edited by luca020400

Share this post


Link to post
Share on other sites

Is the /data mounted when you start init.synopsis.rc ??

Edited by luca020400

Share this post


Link to post
Share on other sites

Found the problem

# NOTE: set 'persist.synopsis.zram' to '1' to auto-start

if [ $STATUS -gt 0 ]; then
        disable_zram
        enable_zram
else
        disable_zram
fi

 

The zero should be 1
 

Share this post


Link to post
Share on other sites
Guest

Thx for the hint. When the code became quite large and I notice I do the same stuff several times I simply created 2 functions. Forgot to properly clean it up. It's a quickly written script though happy.png

 

And nope. $STATUS(persist.synopsis.zram) can be either 0 or 1 and is getting pulled every time the script get's called. It's nonindependent on $ZRAM_SIZE (persist.synopsis.zram_size). So whenever you change the value for 'persist.synopsis.zram_size' I intended to let the script run, which would notice, that STATUS=1 and should run the zram re-enabling routine.

 

 

By the way there should be a notice on LogCat whenever you enable/disabled ZRAM, which also reports the set size(s) :D

Edited by Guest

Share this post


Link to post
Share on other sites
Guest

Is the /data mounted when you start init.synopsis.rc ??

 

After on post-fs it is

Share this post


Link to post
Share on other sites

Modding,your work is awesome but i have to ask:are these kernel source so terrible that y300 and g330 can't get 1.2 GHz? And why? Sorry if i am asking so noob questions

Share this post


Link to post
Share on other sites
Guest

It's not the source code, it's the way our hardware is working. There seems to some kind of "lock" on hardware side, which makes it impossible to overclock above 1.048.000 Hz. I've attempted to overwrite the hardware register for the clock divider already, but without success.

 

This CPU simply isn't made for 1.2 GHz sad.png (it's supposed to be an low budget chip)

Share this post


Link to post
Share on other sites

So i create this fixed script

#!/system/bin/sh

STATUS=`cat /data/property/persist.synopsis.zram`
ZRAM_SIZE=`cat /data/property/persist.synopsis.zram_size`
ZRAM_DEVICES=`ls /dev/block/zram* | cut -d"/" -f4`

disable_zram()
{
        for device in $ZRAM_DEVICES; do
                swapoff /dev/block/$device
                echo 1 /sys/block/$device/reset
                log -p I -t synopsis "*** ZRAM *** disabled on /dev/block/$device"
        done
}


enable_zram (){
        if [ $ZRAM_SIZE -gt 0 ]; then
                for device in $ZRAM_DEVICES; do
                        swapoff /dev/block/$device
                        echo 1 /sys/block/$device/reset
                        echo $(($ZRAM_SIZE*1024*1024)) > /sys/block/$device/disksize
                        mkswap /dev/block/$device
                        swapon /dev/block/$device -p0
                        log -p I -t synopsis "*** ZRAM *** enabled on /dev/block/$device ($ZRAM_SIZE MB)"
                done
        else
                disable_zram
        fi

if [ $STATUS -gt 0 ]; then
        enable_zram
else
        disable_zram
fi

And removed these line from init.synopsis.rc that is usless

# ZRAM
on property:persist.synopsis.zram=0
        start synopsis-zram

on property:persist.synopsis.zram=1
        start synopsis-zram

on property:persist.synopsis.zram_size
        start synopsis-zram

And added this

on property:persist.synopsis.zram
        start synopsis-zram

Now should work correctly

 

I removed the property:persist.synopsis.zram$ because the script can read this and run the choice without these lines

Edited by luca020400

Share this post


Link to post
Share on other sites
Guest

I guess we should discuss this via PM rather than on this post wink.png

 

There is one issue: the script doesn't call itself, so it won't recognize changes of those settings, unless it's getting called again smile.png

 

You cannot put the call to "disable_zram" into the "enable_zram" function. If you do this, following thing will happen:

 

  • LOOP #1
    • call to -> disable_zram --> disables BOTH devices
    • enables zram_device #1
  • LOOP #2
    • call to -> disable_zram --> disables BOTH devices
    • enables zram_device #2

So you end up with only 1 of 2 devices being enabled at the end wink.png

 

My corrected version looks like this:

#!/system/bin/sh

#
#  ZRAM enabler
#        by moddingg33k
#
# NOTE: set 'persist.synopsis.zram' to '1' to auto-start
#       this script at boot.
#

# persist.synopsis.zram
STATUS=`cat /data/property/persist.synopsis.zram`

# persist.synopsis.zram_size
ZRAM_SIZE=`cat /data/property/persist.synopsis.zram_size`

ZRAM_DEVICES=`ls /dev/block/zram* | cut -d"/" -f4`

#
# DISABLE
#
disable_zram()
{
    for device in $ZRAM_DEVICES; do
        swapoff /dev/block/$device
        echo 1 /sys/block/$device/reset
        log -p I -t synopsis "*** ZRAM *** disabled on /dev/block/$device"
    done
}

#
# ENABLE
#

enable_zram ()
{
    if [ $ZRAM_SIZE -gt 0 ]; then
        for device in $ZRAM_DEVICES; do
            echo $(($ZRAM_SIZE*1024*1024)) > /sys/block/$device/disksize
            mkswap /dev/block/$device
            swapon /dev/block/$device -p0
            log -p I -t synopsis "*** ZRAM *** enabled on /dev/block/$device ($ZRAM_SIZE MB)"
        done
    else
        disable_zram
    fi
}

#
# MAIN SCRIPT
#
if [ $STATUS -gt 0 ]; then
    disable_zram
    enable_zram
else
    disable_zram
fi

 

Please try to use "[ SPOILER ]", girls & guys. That keeps more overview if you post an large text or image :)

Edited by Guest

Share this post


Link to post
Share on other sites

sorry for this question;)

im in 3.4.0 build aug.13

and i already flashed 100mb swap(zram enebler of luca020400) the question is... waf if i flash this latest build..do i have to disable the 100mb of zram(how to disable) or not?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

By using this site, you agree to our Terms of Use.