yashsingh1/xdaforums huggingface dataset:
[Nexus 9 Original Android Development] USBhost:
Hmm... I can't tell what's wrong... I'm no ROM debug guy :silly:

Wifi only?

Anyone else have this problem?

I'm on Android N ATM... No problems with Bluetooth...
[Nexus 9 Original Android Development] Bryanx86:
Yea, wifi only. Thanks for taking the time to look.
[Nexus 9 Original Android Development] USBhost:
K10.4.1 is up

K10.4.1

-| latest: f2fs

-| latest: from google

-| some minor installer bugs fixed

Enjoy guys!!

PS. OT. "No Man's Sky" is great!

[MENTION=7396816]Bryanx86[/MENTION] do you still have that Bluetooth problem?
[Nexus 9 Original Android Development] Bryanx86:
No, clean flashed pure Nexus again, let it boot. Flashed your kernel and everything works great. Still don't know what caused Bluetooth issue. Reposted to pure Nexus ROM thread the update, thought I did here too. Apparently not. Error was on my end.
[Nexus 9 Original Android Development] hoof hearted:
Stopping by to say thanks.

10.4.1 up and running on 7.0 NRD90M factory image. Rooted, unencrypted, data/cache F2FS, and AdAway. Feeling good so far. :highfive:
[Nexus 9 Original Android Development] AL2000EX:
N9 is just like NMS

Both are unoptimized and don't live up to the hype

¯\_(ツ)_/¯
[Nexus 9 Original Android Development] NYCHitman1:
Zing!

NMS was boring as hell.
[Nexus 9 Original Android Development] USBhost:
That may be true but,

I have faith in NMS. :fingers-crossed:

It will get better in time. You always have mods hehe

If only Nvidia did not abandon our N9 it could be greater!

The problem with our N9 is not because of lack of optimization

It's because of lack of ram. If they would have put 4/3gb that would have been

a completely different story.
[Nexus 9 Original Android Development] NYCHitman1:
I picked up a Dragon (Pixel C) from eBay a while back, which has been EVERYTHING that Flounder should have been.
[Nexus 9 Original Android Development] lilliput222:
i wish i could ever be Great Kernel Compiler / maker like u , but right now i dont even know anything about making custom kernels
[Nexus 9 Original Android Development] Choochter:
TWRP v.3.0.2-1 with encryption support for Nougat is up:

https://dl.twrp.me/flounder/
[Nexus 9 Original Android Development] WhammyDroid:
Edit: nevermind.
[Nexus 9 Original Android Development] USBhost:
You can man you can! I started as a noob with kernels(I still am), I just said to myself that I would make a kernel for my Nexus 9 when I get it and I did(I even thought about quitting at first). Even just building the kernel is a start! Knowledge will come just give time, it will come slowly but surely. So don't let your dreams be dreams just do it!

Back in the old times

https://web.archive.org/web/2014110...s-9/orig-development/kernel-fire-ice-t2930451 memorys man memorys!
[Nexus 9 Original Android Development] WhammyDroid:
[MENTION=5501864]USBhost[/MENTION], are you updating your version of recovery based upon the 3.0.2.1 changes?
[Nexus 9 Original Android Development] USBhost:
just flash the updated recovery then reflash the kernel.

because flashing the kernel will patch recovery
[Nexus 9 Original Android Development] USBhost:
K10.4.2 is up

K10.4.2

-| linux: 3.10.103

-| latest: from google

-| changed to cortex-a72 optimization (seems better than cortex-a57)(GNU only)

-| made installer more nougat friendly

-| FI.d: v51

Note's:

Well guys this is my last day i have off from school.

I'm starting on the 29th so i say to all who start on that day...

GOOD LUCK AND SAFE JOURNEYS!

So this is my last gift to you all (JK)(updates will come for the duration of my N9)

i look forward for the days to come and to see

what it lies in store!

cortex-a72

I saw somewhere in my N9 logcat that

it was using cortex-a72 as a target. So

i thought let's try it out and i did! :good:

i do not know if it's a real improvement but

hey this is FIRE-ICE an forever beta so... :laugh:
[Nexus 9 Original Android Development] WhammyDroid:
I'm running a different kernel (elementalx). Could the recovery be updated?
[Nexus 9 Original Android Development] USBhost:
ok.. i will have that up today

edit: [MENTION=2682197]WhammyDroid[/MENTION]

its up
[Nexus 9 Original Android Development] USBhost:
so how is everything? :confused:

faster, slower?
[Nexus 9 Original Android Development] Choochter:
Cant honestly say I notice any difference, certainly no problems to report. Great stuff as usual
[Nexus 9 Original Android Development] brutalv4:
Have tried GNU's GCC K10.4.2.

IMHO one is slower then GNU's GCC K10.4.1.

About to try Google's GCC K10.4.2 :fingers-crossed:

IMHO the last fastest one was GNU's GCC K10.4.0. Haven't tried Google's.

Thnx for your work. Good luck with school ;)
[Nexus 9 Original Android Development] porschet:
K10.4.2 working great on latest PN rom. N9 doesn't seem to get as hot. Thanks!
[Nexus 9 Original Android Development] USBhost:
I know of 3 things that like to kill battery and/or make heat.

com.google.android.gms:snet

this seems to run only on n9's :: none of my other devices gets it

com.google.android.gms.persistent

this one is known to go bad

com.google.android.gms.unstable

this seems to go bad every so often when snet is killed idk...

So i decided to make a script that will check every 5s to see if any gms processes goes rouge.

Note: com.google.android.gms:snet will be the exception to be frozen not killed because that process

has a nasty habit of restarting a lot so just freeze it.

This will be on K10.4.3.

also if anyone here can check my script to make sure it's fool proof :fingers-crossed:

B=/system/etc/BB/busybox;
while true;
do
select="$(top -n 1 -m 1 | grep com.google.android.gms | $B awk '{print $11}')";
percent="$(top -n 1 | grep $select | $B awk '{print $5}' | grep -o '[0-9]*')";
if [ "$percent" >= "25" ]; then
pid="$(pidof $select)";
if [ "$select" != "com.google.android.gms:snet" ]; then
kill -9 "$pid";
elif [ "$select" == "com.google.android.gms:snet" ]; then
kill -SIGSTOP "$pid";
fi
else
sleep 5;
fi
done
[Nexus 9 Original Android Development] ElwOOd_CbGp:
Lots of freezing up with the google build but the gnu one is buttery and I can actually switch more than one or two apps without making them reload. (except chrome of course) I'm running DU from about 2 months ago waiting for their final mm release. Will report back if I run into any issues. Thanks for the updates [MENTION=5501864]USBhost[/MENTION]

....also lolz check this out https://imgur.com/a/evShV

I also have all the related receivers disabled too and everything still working, no issues. Too much of that stuff is totally unnecessary for a tablet that rarely leaves the house.
[Nexus 9 Original Android Development] enriquejones666:
Wait, is that built into Nougat, or is that a separate app? I wanna do that too!
[Nexus 9 Original Android Development] Choochter:
I use this:

https://play.google.com/store/apps/details?id=cn.wq.disableservice
[Nexus 9 Original Android Development] ElwOOd_CbGp:
OK LET ME WARN YOU FIRST... Although I said everything is working, and it is, the ROM I use has a setting that suppresses force close notifications. Changing many of these things can easily send your device into a fc loop (gms.core) thats hard to get out of. Its quite obvious that Google does not like ppl messing with these. I also use the xposed module, by the same dev as disable service, that prevents them from auto changing back, because they will. http://xdaforums.com/xposed/modules/mod-myandroidtools-xposed-module-0-1-t3337822

With that said, here are screenshots of the receivers that I cut off too because if they are still on but the services off you could end up screwing yourself over BAD. THIS IS A WARNING AND ITS NOT MY FAULT IF YOU HAVE TO REINSTALL YOUR ROM!!!!!

plz don't reply about this here, you can pm me if you want

Receivers: https://imgur.com/a/5IV17

Also, sorry OP for going off topic but I felt that this was necessary after my previous comment.
[Nexus 9 Original Android Development] jolinnard:
I've wrote a new script that could be faster. Because busybox top is faster than Android top, also calling it once is better.

My proposal:

#!/system/bin/sh

B=/system/etc/BB/busybox

while true
do
$B top -n 1 -b | grep com.google.android.gms | grep -v grep | awk '{print $NF" "$(NF-2)}' | while read process cpuusage
do
cpu_usage=${cpuusage/./,}

if [ "$process" = "com.google.android.gms" ] && [ "$cpu_usage" -ge "25" ]
then
kill -SIGSTOP $(pidof com.google.android.gms)
elif [ "$process" = "com.google.android.gms.persistent" ] && [ "$cpu_usage" -ge "25" ]
then
kill -9 $(pidof com.google.android.gms.persistent)
elif [ "$process" = "com.google.android.gms.unstable" ] && [ "$cpu_usage" -ge "25" ]
then
kill -9 $(pidof com.google.android.gms.unstable)
fi
done

sleep 5
done

I'll try to test it tomorrow in real situation... Should work, but who knows... :laugh:
[Nexus 9 Original Android Development] USBhost:
awesome thanks for the help!

so far this is my updated script

with debugging

date >> /data/kill.log;
B=/system/etc/BB/busybox;
while true;
do
select="$(top -n 1 -m 5 | grep -m 1 com.google.android.gms | $B awk '{print $11}')";
percent="$(top -n 1 | grep -m 1 "$select" | $B awk '{print $5}' | grep -o '[0-9]*')";
if [ "$percent" -ge "50" ]; then
pid="$(pidof "$select")";
echo "Killing: $select $pid CPU:$percent%" >> /data/kill.log;
if [ "$select" != "com.google.android.gms:snet" ]; then
kill -9 "$pid";
elif [ "$select" == "com.google.android.gms:snet" ]; then
kill -SIGSTOP "$pid";
fi
else
sleep 5;
fi
done

looking at yours thinking... man i need to work on my awk and loop learning lol

i will most likely move on to something like yours after my debugging is done.

also why wasnt com.google.android.gms:snet there? that's the very reason why the script was made.

also we do not want to freeze com.google.android.gms because that will most likely cause bad things.
[Nexus 9 Original Android Development] jolinnard:
Ok... if I understand right, com.google.android.gms:snet should be freezed and the rest of the process killed.

So new approach: percent set to 50%. Also added debug.

#!/system/bin/sh

B=/system/etc/BB/busybox
PERCENT=50

# The log
LOGFILE=/data/kill.log

echo "Script started at: $(date)" >> $LOGFILE

while true
do
$B top -n 1 -b | grep com.google.android.gms | grep -v grep | awk '{print $NF" "$(NF-2)}' | while read process cpuusage
do
cpu_usage=${cpuusage/./,}

if [ "$process" = "com.google.android.gms:snet" ] && [ "$cpu_usage" -ge "$PERCENT" ]
then
date "+%Y-%m-%d %H:%M:%S" >> $LOGFILE
echo "Freezing: com.google.android.gms:snet CPU:${PERCENT}%" >> $LOGFILE
kill -SIGSTOP $(pidof com.google.android.gms:snet)
elif [ "$process" = "com.google.android.gms" ] && [ "$cpu_usage" -ge "$PERCENT" ]
then
date "+%Y-%m-%d %H:%M:%S" >> $LOGFILE
echo "Killing: com.google.android.gms CPU:${PERCENT}" >> $LOGFILE
kill -9 $(pidof com.google.android.gms)
elif [ "$process" = "com.google.android.gms" ] && [ "$cpu_usage" -ge "$PERCENT" ]
then
date "+%Y-%m-%d %H:%M:%S" >> $LOGFILE
echo "Killing: com.google.android.gms.persistent CPU:${PERCENT}" >> $LOGFILE
kill -9 $(pidof com.google.android.gms.persistent)
elif [ "$process" = "com.google.android.gms.unstable" ] && [ "$cpu_usage" -ge "$PERCENT" ]
then
date "+%Y-%m-%d %H:%M:%S" >> $LOGFILE
echo "Killing: com.google.android.gms.unstable CPU:${PERCENT}" >> $LOGFILE
kill -9 $(pidof com.google.android.gms.unstable)
fi
done

sleep 5
done
[Nexus 9 Original Android Development] USBhost:
My rough clean up.

There's no need for all those ifs

because "while read" reads one at a time.

how can we fix "cpu_usage=${cpuusage/./,}"

#!/system/bin/sh

B=/system/etc/BB/busybox;
PERCENT=50;

# The log
LOGFILE=/data/kill.log;

echo "Script started at: $(date)" >> $LOGFILE;

while true;
do
$B top -n 1 -b | grep com.google.android.gms | grep -v grep | awk '{print $NF" "$(NF-2)}' | while read process cpuusage;
do
[COLOR="Red"]	#FIXME: this gives "0,0" percentage wont work, even if it was "0.0" still it wont work. percent is broken
# it can not have a "." or "," needs to be a full number. we just need to remove that "," or "." then make
# PERCENT 500
cpu_usage=${cpuusage/./,};[/COLOR]

if [ "$cpu_usage" -ge "$PERCENT" ];
then
date "+%Y-%m-%d %H:%M:%S" >> $LOGFILE;
if [ "$process" = "com.google.android.gms:snet" ];
then
echo "Freezing: "$process" CPU:$cpu_usage%" >> $LOGFILE;
kill -SIGSTOP $(pidof "com.google.android.gms:snet");
else
echo "Killing: "$process" CPU:$cpu_usage%" >> $LOGFILE;
kill -9 $(pidof "$process");
fi
fi
done

sleep 5;
done

PS. its seems com.google.android.gms:snet is no longer going rogue

after my last script. the only things that are being killed are

Wed Sep 7 22:22:28 PDT 2016
Killing: com.google.android.gms 1266 CPU:55%
Killing: com.google.android.gms.unstable 10787 CPU:50%
Killing: com.google.android.gms.unstable 14332 CPU:57%
Thu Sep 8 19:34:33 PDT 2016

so im a little confused that com.google.android.gms used 55% cpu

im monitoring my cpu 24/7
[Nexus 9 Original Android Development] jolinnard:
You are correct:

flounder:/ # /system/etc/BB/busybox echo $(( 50,5 / 2 ))
2
flounder:/ # /system/etc/BB/busybox echo $(( 50.5 / 2 ))
sush: 50.5 / 2 : unexpected '.'
1|flounder:/ # /system/etc/BB/busybox echo $(( 50 / 2 ))
25

This is the weirdest thing I've seen recently.... :eek::eek::eek:

So, to remove percent decimals, use this instead:

${cpuusage%.*}

I was thinking the same about all the "ifs". It will only make sense if we need to do something different for each process.

I noticed the same, can't see com.google.android.gms:snet anymore. Google is changing gms??

Will try to monitor my CPU too...

EDIT: Anyway, I don't like top... It uses 10% CPU each time:

Mem: 1763264K used, 118020K free, 2972K shrd, 46252K buff, 702724K cached
CPU: 7.6% usr 11.5% sys 0.0% nic 80.7% idle 0.0% io 0.0% irq 0.0% sirq
Load average: 1.06 2.29 1.21 1/1032 6806
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
6806 6804 0 S 9336 0.5 0 9.6 head -10
6805 6804 0 R 2064 0.1 1 9.6 /system/etc/BB/busybox top -n 1 -b

I'm trying to use /proc/pid/stat instead, but it needs some work, because you need to compare some values during some seconds to calculate the percentage.
[Nexus 9 Original Android Development] jolinnard:
Continuing last post:

I'm testing to replace top with dumpsys... what do you think? Maybe we should kill only if it appears in dumpsys... It seems that it takes little time to appear though.

#!/system/bin/sh

B=/system/etc/BB/busybox
PERCENT=50

# For debugging add "debug" as the first parameter
if [ "$1" = "debug" ] || [ "$1" = "-d" ]; then
debug=1
fi

# The log
LOGFILE=/data/kill.log

echo "Script started at: $(date)" >> $LOGFILE

while true ; do
dumpsys cpuinfo | grep com.google.android.gms | awk '{print $1" "$2}' | sed -e 's/%//g' -e 's/\// /g' | sed -e 's/:$//g' | while read cpuusage pid process ; do
cpu_usage=${cpuusage%.*}

# Only if debug enabled
if [ "$debug" -eq 1 ]; then
echo -e "$process pid:$pid cpu:${cpu_usage}%" >> $LOGFILE
fi

if [ "$cpu_usage" -ge "$PERCENT" ]; then
date "+%Y-%m-%d %H:%M:%S" >> $LOGFILE
if [ "$process" = "com.google.android.gms:snet" ]; then
echo "Freezing: "$process" CPU:${cpu_usage}%" >> $LOGFILE
kill -SIGSTOP $pid
else
echo "Killing: "$process" CPU:${cpu_usage}%" >> $LOGFILE
kill -9 $pid
fi
fi
done

sleep 5
done
[Nexus 9 Original Android Development] USBhost:
looks good.

still using my old script :)

Wed Sep 7 22:22:28 PDT 2016
Killing: com.google.android.gms 1266 CPU:55%
Killing: com.google.android.gms.unstable 10787 CPU:50%
Killing: com.google.android.gms.unstable 14332 CPU:57%
Killing: com.google.android.gms.unstable 23712 CPU:53%
[COLOR="Red"]Killing: com.google.android.gms:snet 24247 CPU:50%[/COLOR] looks like it's still here, also this makes me concerned that it was only 50%
Killing: com.google.android.gms.unstable 6231 CPU:62%
Fri Sep 9 09:01:36 PDT 2016
Killing: com.google.android.gms.feedback 2667 CPU:58%
Killing: com.google.android.gms.ui 25078 CPU:50%
Killing: com.google.android.gms.unstable 28555 CPU:52%

I'm thinking that the percentage is calculated by the cpu frequency which makes things unpredictable. Maybe we should take into count cpu frequency. Also i am thinking that we should list all the known processes so we dont start killing stuff with no reason, like what you had before. idk maby android's top is the one at fault... i'll try your dumpsys one to see what changes...

i'm using "cool tool" to monitor my cpu frequency :: looks like i need load also...
[Nexus 9 Original Android Development] jolinnard:
Yeah... I left script running all night and gave 0 kills. Also saw yesterday com.google.android.gms:snet process, but at 0-15% in top only a few seconds. Maybe we should change "kill" by a simple "echo" for some time and see what's happening.

It's possible that top is calculating wrong the CPU usage though. I was reading some posts in stackoverflow that was talking about it. From my experience, top, dumpsys and /proc stat seems to calculate in different ways CPU usage. I'm not sure which is the most accurate.

On the other hand, I'm experiencing some issues with memory usage, sometimes when I'm playing to some medium-heavy resource games, tab freeze because it can't free up memory, a problem that was solved in previous Android/kernel versions automatically killing apps in the background. I thought it was gms processes that was consuming CPU and causing this, but I'm not sure now. The script never killed gms in my case. Are you "forcing" someway gms to run and jump more than 50%?
[Nexus 9 Original Android Development] USBhost:
About those freezes I think I fixed it, it was something to do with gpu memory that messed up lmk.

Killing: com.google.android.gms.unstable 28555 CPU:52%
Killing: com.google.android.gms:snet 8401 CPU:50%
Killing: com.google.android.gms:snet 27760 CPU:50%
Killing: com.google.android.gms.unstable 28837 CPU:50%
Killing: com.google.android.gms 2295 CPU:53%
Killing: com.google.android.gms:snet 30106 CPU:52%

snet has been really bad today.

And I really need to add more debugging haha

Nothing really happens when our device sleeps.

So if no killings that's normal

PS quick fix for your script

Add an "$B" before awk

TIP: you may already know this but you can run "set -x"

to debug the script

Edit: [MENTION=2002216]jolinnard[/MENTION] i went ahead and built ps

so we can use something like this "ps -C mediaserver -o %cpu,%mem,cmd"

1|flounder:/data/media/0/proc # ./ps --help
********* simple selection ********* ********* selection by list *********
-A all processes -C by command name
-N negate selection -G by real group ID (supports names)
-a all w/ tty except session leaders -U by real user ID (supports names)
-d all except session leaders -g by session OR by effective group name
-e all processes -p by process ID
T all processes on this terminal -s processes in the sessions given
a all w/ tty, including other users -t by tty
g OBSOLETE -- DO NOT USE -u by effective user ID (supports names)
r only running processes U processes for specified users
x processes w/o controlling ttys t by tty
*********** output format ********** *********** long options ***********
-o,o user-defined -f full --Group --User --pid --cols --ppid
-j,j job control s signal --group --user --sid --rows --info
-O,O preloaded -o v virtual memory --cumulative --format --deselect
-l,l long u user-oriented --sort --tty --forest --version
-F extra full X registers --heading --no-heading --context
********* misc options *********
-V,V show version L list format codes f ASCII art forest
-m,m,-L,-T,H threads S children in sum -y change -l format
-M,Z security data c true command name -c scheduling class
-w,w wide output n numeric WCHAN,UID -H process hierarchy

and ps uses almost nothing lol

%CPU %MEM CMD

0.0 0.0 ./ps -A -o %cpu,%mem,cmd
[Nexus 9 Original Android Development] jolinnard:
Great :) will try next build.

Also, I was playing a bit with zswap and increase to 512, don't know yet if was a good idea... Anyway I haven't time today. Will try tomorrow.

Ok. Makes sense.

So that's why... I think that in my early files I set shebang to: #!/system/etc/BB/busybox sh

Sure, I do :) Very useful indeed.
[Nexus 9 Original Android Development] USBhost:
so much nicer!

flounder:/data/media/0/proc # ./ps -A -o %cpu,cmd | grep com.google.android.gms
0.2 com.google.android.gms.persistent
0.2 com.google.android.gms
0.0 grep com.google.android.gms
flounder:/data/media/0/proc #

what would happen if i replaced system's ps with my newly built one?

are you using Android N?

My new script vary debugging :fingers-crossed:

L=/data/kill.log;
PS=/data/media/0/proc/ps;
date >> /data/kill.log;
while true;
do
$PS -A -o %cpu,cmd | grep com.google.android.gms | grep -v grep | while read percent process;
do
cpu_usage=${percent%.*}
if [ "$cpu_usage" -ge "50" ]; then
date "+%H:%M:%S" >> $L;
if [ "$process" == "com.google.android.gms:snet" ]; then
echo "Freezing: $process CPU:$cpu_usage%" >> $L;
killall -SIGSTOP "$process";
else
echo "Killing: $process CPU:$cpu_usage%" >> $L;
killall -9 "$process";
fi
fi
done
sleep 5;
done
[Nexus 9 Original Android Development] jolinnard:
Wow, cool :)

Yes I'm running stock N. What ps is this? Do you build a new version?

If this new ps accept the same old options, should work, right?
[Nexus 9 Original Android Development] USBhost:
Yes I did build a new version that's the same as on my Ubuntu machine

because the stock ps on Android was cheap I needed more options :laugh:

I think it does but the running stock ps will give a different result than the one I built.

So far it seems to be working pretty well :good:
[Nexus 9 Original Android Development] jolinnard:
Really cool, finally can use "ps auxfww" like in my Archlinux machine :D

BTW, I've built N10.4.y branch with UBER aarch64-linux-android-6.x-kernel toolchain (compiled from last github sources), then used USBhost_defconfig as config. I also had to make a new zip to flash Image.gz-dtb, because first I've tried to replace image in your zip, but tab can't boot (very weird :( ) but with this method all seems in the right place. Will test how it works with last Revert "Revert "Revert commit ;)