[phpBB Debug] PHP Warning: in file [ROOT]/ext/spaceace/ajaxchat/controller/chat.php on line 220: Trying to access array offset on value of type bool
atvXperience : The Forum • My Init.d folder
Page 1 of 1

My Init.d folder

Posted: Tue Sep 03, 2019 3:22 pm
by ricklar
For those that don't know about init.d, it is the folder that contains the boot scripts to adjust and tune the whole device after the boot.img has completed running. A lot can be achieved with the correct script to gain performance or turn off or on a hidden feature of android.

So since I have been running some different scripts to what most of you guys have in your devices with the standard v2FF or v2H, I thought I would share and get some feedback if anybody wants to review the scripts and/or test them out themselves.

Be warned these scripts are setup for a 3GB Ram S912 device, do not use them in a 2GB device.

My Init.d folder

Posted: Tue Sep 03, 2019 4:42 pm
by dankell
Thank you Sir for all your time and help ,
Hopefully this file will sort my remote control problem. Time to dig in and take a look.

Best Regards,

My Init.d folder

Posted: Tue Sep 03, 2019 5:35 pm
by dankell
Just a few questions please @ricklar before I proceed mate.
I suspect I must make sure that this full folder has the correct read and write permission properties adjusted ? So should I check on my system of the properties of my folder and adjust your folder to suite?

Upon opening and looking through the init.d folder I can see a list , position 6 03amlogic_tune
I open this file with notepad++ and a text list shows pasted below .
I have placed the text ( echo nosleep > /sys/power/wake_lock) at the bottom of the list is this correct ? or should it be place at a certain position or numbered line ?
Thank you for your time and help,

PS: Forgot to ask....or should I just totally replace my init.d folder with yours and make sure I have added the text line (echo nosleep > /sys/power/wake_lock) into the 03amlogic_tune script .? and set folder permissions to what my folder permission are.

Best Regards,

#!/system/bin/sh
# Settings correspond to init.amlogic.rc

echo 1 > /sys/module/amvdec_h264/parameters/dec_control
echo 1 > /sys/module/amvdec_mpeg12/parameters/dec_control
echo 1 > /sys/module/di/parameters/bypass_hd
echo 1 > /sys/module/di/parameters/bypass_all
echo 1 > /sys/module/amvideo/parameters/smooth_sync_enable
echo 1 > /sys/module/amvdec_h264/parameters/error_recovery_mode
echo 1 > /sys/module/amvdec_h264_4k2k/parameters/error_recovery_mode
echo 1 > /sys/module/amvdec_h265/parameters/double_write_mode
echo 1 > /sys/module/deinterlace/parameters/deinterlace_mode
echo 0 > /sys/module/di/parameters/nr2_en
echo 0 > /sys/class/tv/policy_fr_auto
echo 1 > /sys/module/di/parameters/nr10bit_support
echo 4 > /sys/class/mpgpu/scale_mode
echo 650 > /sys/class/mali_freq/max
echo nosleep > /sys/power/wake_lock

Edit Update: unfortunately it did not work for me .. I replaced the full init.d folder with yours and the edited in
echo nosleep > /sys/power/wake_lock in the amlogic_tune
Rebooted the system and tested...But my RC still does not wake the box once it`s put to sleep...Won`t even power on the box after you power it off.
I am now at a loss as what to do next.
Edit Update:
Just for complete verification and to set my mind at ease , as I was wondering if an hardware issue had occurred...... I did I full factory firmware restore and checked all the functions out on the RC....All functioned OK
So I now know for sure it`s not hardware relate.

Edit Update:
So I have been f@@king around with this for hours now and finally...after a factory firmware install and then a fresh H2 image install ..I tested the RC which would power down the box ...and then when you press the RC power button ..it would ignite the box back to life from sleep ..But then no directional or movement could be done with the original RC remote.
I then proceeded to delete the RC Config file and replace with the stock... Still The same scenario... I then decided to delete the init.d folder and replace it with your folder ( Edited with: echo nosleep > /sys/power/wake_lock ) which I had previously used without success.
I rebooted the box and again tested the RC............ tapped the red button powering off (sleep mode) ..then waited a few seconds and tapping the button and powering back on... tried the directional buttons praying this time for movement. :pray: Finally it worked.....But now I have to go about and start installing all the tweaks and stuff again, The box keeps f@@king me up the Arse ....it`s beyond a Joke.....I thought I had this sorted yesterday until I realize that there was this huge problem with the stock RC power button sleep function and wake up problems .
Hopefully nothing major else occurs and I get to finally finish this Box and get everything backed up in correct working order .
I will now make a TWRP backup as this is my starting point .....and now proceed to install the tweaks and then test as I go along....Hopefully everything go`s well.... But considering.......I suspect something else will pop up and f@@k me . :$
I hope not. lol

My Init.d folder

Posted: Wed Sep 04, 2019 7:08 am
by ricklar
So long story short you got the "Sleep-Wakelock" command added into script and working and decided to use my entire init.d folder without any major issues after the fact :grin:

I like using TotalCommander file manager because when root switches are on, it shows the file permissions under each file and folder name, a good thing if editing stuff. You probably just ran into a issue with the permissions why it didn't work on first attempt. Tip is just always double check the 'folders and files'afterany moving or copying done inside android. AND after any System changes always do a Restart, to be even more safe I boot into TWRP and do Advanced Wipe of just Dalvik-Cache & Cache, then Reboot. Side-note V2FF had the programming in framework that if you hold long-press the Power button you get the option to Power OFF or Restart, can't remember if that was included in V2H or not.

Cheers, hopefully your daughter will enjoy the H96 when she finally gets it :')

My Init.d folder

Posted: Wed Sep 04, 2019 10:17 am
by dankell
[mention]ricklar[/mention] Thanks mate for all your time and help.

I have installed everything I need and now it`s all backed up and ready to go.....So I thought ....LOL ....
One minor problem...which has occurring at infrequent interval on this fresh atvXperience_S912_LPDDR3_V2H.img install ...... This occurrence has also happened on other ATVx Custom ROMS ( minixfreak ) which I had previously tested and also needed to keep reapplying the QC9377_BT_Fix.zip.
For some strange reason the WiFi sporadically disconnects and then the system reboots (all within a nano second) When the OS reloads the WiFi is off. So I try to turn it on via the tab and it just keeps flicking back to the off position. So I am now forced to apply the QC9377_BT_Fix.zip via TWRP install zip to get it back working correct.
When I 1st installed the atvXperience_S912_LPDDR3_V2H.img , totally vanilla from the stock firmware Box , I never had to do the QC9377_BT_Fix.zip install , as the atvXperience_S912_LPDDR3_V2H.img already had the fix inbuilt ,
(it just worked )........So why does it do this?
Has this problem ever been reported before ? and if So , can I somehow fix this if possible ? Maybe via some files from the stock firmware ? ...... it would be nice...but I suppose I can live without it as this Box is going to be hardwired.
Thanks again Mate! for all your advice and help.

PS: Yes The H image power option is enabled for me where I can Long press on the RC power button and it does give me the option to Power OFF or Restart.....short tap puts it to sleep and tap brings it back to life.
I will Try TotalCommander file manager in future, Thanks for the Tip!

Best Regards,

My Init.d folder

Posted: Wed Sep 04, 2019 1:03 pm
by ricklar
dankell wrote: Wed Sep 04, 2019 10:17 am [mention]ricklar[/mention] Thanks mate for all your time and help.
One minor problem...which has occurring at infrequent interval on this fresh atvXperience_S912_LPDDR3_V2H.img install ...... This occurrence has also happened on other ATVx Custom ROMS ( minixfreak ) which I had previously tested and also needed to keep reapplying the QC9377_BT_Fix.zip.
For some strange reason the WiFi sporadically disconnects and then the system reboots (all within a nano second) When the OS reloads the WiFi is off. So I try to turn it on via the tab and it just keeps flicking back to the off position. So I am now forced to apply the QC9377_BT_Fix.zip via TWRP install zip to get it back working correct.
When I 1st installed the atvXperience_S912_LPDDR3_V2H.img , totally vanilla from the stock firmware Box , I never had to do the QC9377_BT_Fix.zip install , as the atvXperience_S912_LPDDR3_V2H.img already had the fix inbuilt ,
(it just worked )........So why does it do this?
Has this problem ever been reported before ? and if So , can I somehow fix this if possible ? Maybe via some files from the stock firmware ? ...... it would be nice...but I suppose I can live without it as this Box is going to be hardwired.
Thanks again Mate! for all your advice and help.
First suggestion is when using WiFi to set the connection protocol to Static-IP not DHCP. And see if that helps stay connected.

Maybe something in my scripts is causing the issue, not noticed disconnections when using WIFi but mainly use the box connected to ethernet since May. Possible fix is Delete the 14DVFS_Disabler script which basically turns Off the power-cap governor and maybe that is sending too much power to your WiFi chip somehow (note~ my board is the V3 green board). Another thing you can remove/delete the test script, with its 'bluetooth at boot' portion that somehow may be affecting WiFi.

Another thing I just thought of, If I remember correctly the QC9377.zip only replaces the one file in the vendor partition which stills leaves relevant files unchanged in system paritition, it may be better to use the TX7.zip that has been shared here in forum for fixing bluetooth/wifi because that zip does a full wipe of the relevant files and re-install all the correct files. I have not tested it myself, just opened up the zip and had a look around, from what I saw it was better then just the QC9377.zip.

Cheers,

My Init.d folder

Posted: Wed Sep 04, 2019 1:39 pm
by dankell
Thank`s Mate for your feedback...... 100% Certain that it`s nothing to do with your scripts or tweaks .
This was happening on previous tests I had done on ATVX ROMS way before I even tried your tweaks and folder swaps.

I recall this happened to me also (S912_LPDDR_REVISED.img minixfreak OS posted on freaktab ).......a few hours into testing the minixfreak OS image out... The same Exact symptoms occurred where it would sporadically panic and reboot and then there was no WiFi until I reapplied the BT Fix zip .. which fixed it , until it reoccurred again a number of hours later ..So I had to re-apply.
Now with the info you have gave..I will look and search for this TX7.zip and try this .. it`s all backed up ...So nothing too lose. :grinning:

Thanks for the Heads up Mate..... Hopefully that may stop the panic from the WiFi.
Update:
I done a quick search and found that BT_Fix-TX7.zip ... So going to give this a try and see if it solves the panic...... I suspect it could be a few hours or many hours before I even know if it`s sorted out the WiFi problem as with previous symptoms....They varied in time and occurrence.
Quick Update:
It`s like the Gods are now shinning down at me ....Just after I found the BT_Fix-TX7.zip ... I noticed that the Box just did it`s panic (fanny fit) and rebooted .(Exact same symptoms as described above ) .. So it took around 3 or 4 hrs ... That`s since I applied the previous standard BT Fix zip..... So hopefully I now have some sort of timescale. Could be just a coincidence as I do recall sometimes it took longer ... But the times varied and where very sporadic indeed.
Update:
So I just applied the BT_Fix-TX7.zip and it all went OK ..Booted up and WiFi is back.... Let`s hope it cures the fanny fitting WiFi.
Dam just checked the Bluetooth and this .zip breaks that. I have another one to try WIFI_FIX.zip which was found on this forum in the same thread I found the other test zip.
viewtopic.php?f=4&t=935&p=9157&hilit=BT ... .zip#p9157
Not Great News......None of the 2 .zips worked...Well they partially worked with the WiFi ...but both have broken the Bluetooth side of things.... I am going on the hunt inside the stock ROM to see if I can find the correct files.
Update:
So I just installed the original QC9377_BT_Fix.zip and now Bluetooth is still not working..... So my conclusion is that these 2 separate .zip fix`s may actually work as there must be some form of remnants remaining from prior installs and they are conflicting with each other rendering them inoperable.... Need to find a way to clean install each zip and then test.
I just did a backup restore and all is back in order ..All working fine ATM until it decided to WiFi panic again.
Edit Update:
So I have recently just been doing a little digging around concerning the QC9377 Wifi chip and I found a thread linked below with some very interesting information as to why this module acts like it does.... Now I have been using the WiFi 5 GHz range and after reading this thread ......I can sort of relate to what they say...it sounds very interesting .
I have not experienced the WiFi panic again and it`s been a few hours now ..... But I will most certainly take action .. to amend this with either changing to WiFi 2.4 GHz range or adjusting my frequency channel on the WiFi 5 GHz range.
I think this could be a very real possible fix for peeps whom find themselves in a similar situation.
https://discourse.coreelec.org/t/proble ... cb/3577/10

Upon further investigation into this problem apparently this is a VERY wide spread problem with theses s912 Amlogic Box`s ... This WiFi chip 5GHz range is causing untold problems.
I fixed mine again just a few minutes ago after it Panicked and did a reboot..
All I needed to do was to delete the file wpa_supplicant.config situated in
Device/data/misc/wifi/ and reboot device .. VIOLA!
I am now testing WiFi on the 2.4GHz range to see if this stops the problem on this box ..Just out of curiosity Now.
More details concerning this common problem with WIFI on these Box`s is posted on XDA, A user has also developed an .apk to combat this issue.
https://forum.xda-developers.com/androi ... i-t3384249
I am going to do a test soon if the 2.4 GHz fails......
I will delete the wpa_supplicant.config and reboot...Then once it re-populates the directory I will input the password .. My plan is to then change the file permission to read Only. I may have problems with inputting a new password ...But that`s not a problem if it`s a long term FIX.
I can always at any point delete that file and let the system repopulate a new one to create a new password if needed in the future. :relaxed:
Final Update
So as I suspected while the Box is on the 5GHz range it can become unstable due to frequency range interference and this occurrence puts the WiFi into a panic mode. Symptoms are: WiFi impossible to turn back ON ,Makes the Box do strange reboots , All types of strange sh@t , which then renders it inoperable until you clear the wpa_supplicant.config .
My testing on the 2.4 GHz range where perfect.... still up and running 16hrs in.
Finally this Box is now done. :grinning:
Thank you everyone whom help and supported me especially @ricklar Thank you Sir.

Best Regards,

My Init.d folder

Posted: Thu Sep 05, 2019 1:54 pm
by ricklar
[mention]dankell[/mention] Hi,
Like your 'updates' upon 'updates' postings, it will give future readers insight in to what works and doesn't.

After reading info from those links you shared, my conclusion is that anybody with QC9377 chip module must always set Internet connection to Static connection not DHCP, for WiFi this is usually found in "Advanced Settings" when setting up connection through main Android.Settings. And like that XDA-post said it has to do with Android corrupting it's internet connection files, which I had a fix for but just can't remember where I put it or in what forum tread I posted it in. Basically the fix tells android not to encrypt its WiFi config files, because the act of encryption was the reason the files get corrupted in the first place. And the only reason Android encrypts the WiFi config is so no dubious apps or malware infected apps can steal WiFi passwords which can be a problem for phones connecting to different networks wherever you go, but for a TV box at your house that is not really a problem.

And found post saying it may also have to do with the Permissions that are set, see link:
https://forum.xda-developers.com/showth ... ?t=2089314

Cheers,

My Init.d folder

Posted: Thu Sep 05, 2019 2:22 pm
by dankell
Thanks Mate! for all your time and help, I did a Final update: LOL :grin:

I will have a good look into that thread you linked also,
On a brighter note ..All my testing is finished and I can now send the box to my Daughter.
After 16+hrs on the 2.4GHz range....not a single glitch or murmur from the box. :grin:
The box will be Hardwired ,But that WiFi Glitch! was bugging the hell out of me and I wanted to find out why.

Hopefully peeps whom find themselves in similar situations may find our info useful.
Thank you again Sir for all your time and help...You Truly have been AMAZING!
ricklar wrote: Thu Sep 05, 2019 1:54 pm I had a fix for but just can't remember where I put it or in what forum tread I posted it in. Basically the fix tells android not to encrypt its WiFi config files, because the act of encryption was the reason the files get corrupted in the first place. And the only reason Android encrypts the WiFi config is so no dubious apps or malware infected apps can steal WiFi passwords which can be a problem for phones connecting to different networks wherever you go, but for a TV box at your house that is not really a problem.
PS: IF you do remember or find this post or thread of information , where you posted it, Please post results Here ............ Thanks,
One more small point Mate! I took a look at the XDA post permissions link and really unsure what or how to decipher what permissions he says to input. ?
( o the correct permissions for "/data/misc/wifi/wpa_supplicant.conf" are user: system (01000) group: wifi (01010) and "-rw-rw----". )
Sorry to sound Stupid ..But what exactly in layman`s terms do I have to set .?


Best Regards,

My Init.d folder

Posted: Thu Sep 05, 2019 5:33 pm
by ricklar
dankell wrote: Thu Sep 05, 2019 2:22 pm One more small point Mate! I took a look at the XDA post permissions link and really unsure what or how to decipher what permissions he says to input. ?
( o the correct permissions for "/data/misc/wifi/wpa_supplicant.conf" are user: system (01000) group: wifi (01010) and "-rw-rw----". )
Sorry to sound Stupid ..But what exactly in layman`s terms do I have to set .?
The second post from that thread has what you would put in terminal either through adb or on the running system in terminal interface app, just would need to switch to SU first, so you enter the following text with pressing enter after each line:

Code: Select all

su 
chown 1000.1010 /data/misc/wifi/wpa_supplicant.conf
chmod 660 /data/misc/wifi/wpa_supplicant.conf
OR

Code: Select all

su
chown system.wifi /data/misc/wifi/wpa_supplicant.conf
chmod 660 /data/misc/wifi/wpa_supplicant.conf
Permissions can always be modified in TotalCommander app with root switches on, to make things easier.