Smith's simple android boot script - Touch Pro2, Tilt 2 Android Development

Ok, so there are a few things I've ran into when it comes to running android.
1.) If you have WinMo overclocked, Android will not boot.
2.) If you have WinMo handling your backlight, then sometimes the backlight will always be turned on, even if you "power off" your phone.
3.) Lastly, after running android, my WinMo time gets messed up, very very messed up. (Still coming up with a solution for this)
So, In order to remedy all of the above problems, I've created a simple android startup script, complemented by a WinMo startup script.
Well, here they are, simple, but effective!
Code:
#Android Boot Script
#Sets proper WinMo settings for booting Android
#################################
If(Question("Boot Android?","Droid", "OkCancel")=CANCEL)
Exit
Else{
RegWriteDWord ("HKCU", "ControlPanel\BackLight", "LightDetectOn", "0")
Copy("\Storage Card\andboot\backlight.mscr" , "\Windows\Startup\backlight.mscr" , TRUE)
Run("\Program Files\OverClockTool\OCT_Stop.exe")
WaitForActive("OCT: message" , 5)
SendOk
Run("\Storage Card\andboot\haret.exe")}
endif
As seen above, in line 2 of the actual code, that script mentions "backlight.mscr" so here is that as well:
Code:
#WinMo settings restore
#Simply sets autobacklight back on.
#################################
RegWriteDword("HKCU", "ControlPanel\Backlight", "LightDetectOn", "1")
Delete("\Windows\Startup\backlight.mscr")
Again, simple, but effective.
I would love to see what others would like to add to this!
Regards
Smith

Related

Howto: MS VC 1.6 with WMXL .20 WORKING!!!

Update: ZaJules has created a One step cab fix off these instructions - should make things much easier Read his post here! http://forum.xda-developers.com/showpost.php?p=1161652&postcount=11
I left the contents of the old post bellow incase people wanted to check the steps but probably the one step install created above will be much easier for most people!
Well after a long bit of searching reading I finally got it to work!!!
This is with a Motorola H700 bluetooth headset though I'm guessing it will work with any compatible headset
thanks to BKbroil's post (http://forum.xda-developers.com/showpost.php?p=1146407&postcount=317) I followed his directions.
it still didn't quite work - after fiddling with the registery a little bit (he didn't include what type of reg entries they needed to be) it finally started working!
Here are the steps I followed:
1. Install VC 1.6 (make sure it is in Main memory)
2. Download Bluetooth Voice Command 0.9f.cab
3. Download BTVoiceCommand.exe
4. On your phone, create the Folder \Program Files\Bluetooth Voice Command
5. Copy BTVoiceCommand.exe into this folder
6. Extract the "Bluetooth Voice Command 0.9f CAB.zip" file, then copy the cab to the phone and run it
7. Create the following Registery Entries:
HKLM\Software\OEM\VoiceCommand:
Default - String - (value not set)
LaunchAPEnable - DWord - 1 (decimal)
Path - string - \Program Files\Bluetooth Voice Command\BTVCBasic.exe
VoiceCmdDuration - Dword - 30 (decimal)
VoiceCmdEnable - Dword - 0 (decimal)
and
HKLM\SOFTWARE\Microsoft\Bluetooth\AudioGateway:
BTAGExtModule - string - \Windows\btagext.dll
This last one was already set for me but his directions had it so I included it for you to check
8. Go to newly created BT Voice Command config (in Programs) and tick off the check box "Enabled"
9. Set command duration to 30
10. Save settings and exit
11. Soft reset TyTN
12. Delete Headset Pairing
13. Recreate Headset Pairing.
14. Set button 5 to VoiceCommand
15. Reset Device
Hope this helps people out there!!!
Chy
P.S. - I take no credit for anything here except pulling together everything into one neat place and figuring out the registery entries that worked for me - all the hard work was done by the smart guys in this thread! http://forum.xda-developers.com/showthread.php?t=283412
EDIT - attached the files I needed (not including VC 1.6) - they were scattered throughout that other thread and hard to find - thought it would be easier if they were in one place and clarified instructions!
Edit 2 - Here is the Exported Registery entries if it makes it clearer - I understand it the way I wrote it more but I suspect the smart people here will understand this more:
[HKEY_LOCAL_MACHINE\Software\OEM\VoiceCommand]
"VoiceCmdEnable"=dword:00000000
"VoiceCmdDuration"=dword:0000001e
"Path"="\\Program Files\\Bluetooth Voice Command\\BTVCBasic.exe"
"LaunchAPEnable"=dword:00000001
[HKEY_LOCAL_MACHINE\Software\Microsoft\Bluetooth\AudioGateway]
"BTAGExtModule"="\\Windows\\btagext.dll"
hmmm, when i try to enable xcsdm`s hack an unexpected error occurs in btvc config.exe (nullreferenceexception ...).
what is wrong?
Oh I actually had that happen to - then I went to check on the registery settings (which were the next step) and they were not there -I manually edited them and then went back and did that step again and this time it worked fine! Perhaps I should edit the post and reverse those steps (even though that's the order he had them in)
Sorry that I forgot to mention that!
EDIT: I have gone and revised the instructions above to follow my exact steps as opposed to quoting his steps as before then listing my corrections after - I think this makes the directions clearer and easier to follow - if you have any further questions - let me know - I'll do my best to answer!
could you please post what kinds of regvalues have to be created? f.e. dword etc.
thanks
jammerlappen said:
could you please post what kinds of regvalues have to be created? f.e. dword etc.
thanks
Click to expand...
Click to collapse
They are there - they were listed down bellow but have since been edited into the post above. However here they are again
HKLM\Software\OEM\VoiceCommand
Default - String - (value not set)
LaunchAPEnable - DWord - 1 (decimal)
Path - string - \Program Files\Bluetooth Voice Command\BTVCBasic.exe
VoiceCmdDuration - Dword - 30 (decimal)
VoiceCmdEnable - Dword - 0 (decimal)
and
HKLM\SOFTWARE\Microsoft\Bluetooth\AudioGateway
BTAGExtModule - string - \Windows\btagext.dll
still no progress, the same error occurs. though values are saved ):
jammerlappen said:
still no progress, the same error occurs. though values are saved ):
Click to expand...
Click to collapse
Go over one more time the steps since I've edited them - I just hard reset it and reinstalled following them exactly as stated and following the instructions point by point the way I posted them worked first time no errors!
Is there anyone that would be kind enough to make a cab that creates the registry settings?
I must be doing something wrong because the registry ones I keep making aren't working..
VERY Helpful!
@chymmylt: Super job - thanks for making this so much easier!
Dean
Can you clarify step 10
OK here is a one step cab to fix Voice Command 1.6
Please test it and let me know if there are any problems
Instructions:
Install Microsoft Voice Command 1.6 (Duh)
Copy this cab file to your device and tap to install.
Then go to Start > Programs > BT Voice Command Config
and tick enable.
Tap "Save"
Tap "Exit"
Go to bluetooth devices and remove your headset.
Power off your Device (Hold the power button till it asks to shut down)
Restart device.
Re pair your headset.
make sure button 5 is set to Voice Command (Settings > Buttons)
Reset Device.
This works perfectly on my device.
Credit to all the brains on XDA-Devs (you know who you are). This is not my work I only packaged it for easy install.
Jules
Just tried and when I click save I get a
An unexpected error has occured in BTVC Config.exe
Select quit and then restart this program, or select details for more information.
slimsaturn said:
Can you clarify step 10
Click to expand...
Click to collapse
Sorry bout that - written way past my bed time - now step 10 is as it should be - save and exit (cut and pasting when you're tired should not be allowed!)
ZaJules said:
OK here is a one step cab to fix Voice Command 1.6
Please test it and let me know if there are any problems
Instructions:
Install Microsoft Voice Command 1.6 (Duh)
Copy this cab file to your device and tap to install.
Then go to Start > Programs > BT Voice Command Config
and tick enable.
Tap "Save"
Tap "Exit"
Go to bluetooth devices and remove your headset.
Power off your Device (Hold the power button till it asks to shut down)
Restart device.
Re pair your headset.
make sure button 5 is set to Voice Command (Settings > Buttons)
Reset Device.
This works perfectly on my device.
Credit to all the brains on XDA-Devs (you know who you are). This is not my work I only packaged it for easy install.
Jules
Click to expand...
Click to collapse
Good work! I'm not good at creating installers but I figured it wouldn't be long before somebody compiled it into an easy installer!
@ZaJules and chymmylt
I just tried the cab along with your instructions and it worked like a charm. Excellent and great work to all that were involved.
I don't understand why the program crashes for me but works for others..
Mine is on a fresh install of .20 ROM with VC 1.6 and my exchange server and thats all I have done..
Hmmm.. Not sure. as I said, I didn't write any of these files, I just read through this post http://forum.xda-developers.com/showthread.php?t=283412 and pulled together everything I did into a single post to try to make it easier for people. It seems to be working for a number of people but there are a few people that it is not working for.
Did you install VC to your voice or your storage card - everything I've read said not to install it to your storage card - install it to your device - you might check that. If you installed through Zajules cab, try looking through my instructions and check that everything checks out. I'd also try reading through the forum above and see if anything strikes you.
I've seen reports of it working on an 8525 and I have a TyTN (And I suspect it should work on any hermes hardware). I have the 1.34 radio rom though I don't know if that should make any differnce (It might - Bluetooth is controlled by the radio - I really have no idea if that would help and hate to suggest anything that could brick a device - just brainstorming here). I don't have exchange installed so I couldn't say if that has anything to do with it.
Out of curiosty, when you run \Program Files\Bluetooth Voice Command\BTVCBasic.exe manually does it work?
Yes everything is installed to device and that file you asked me about launches the VC for me to input something..
I have tried to add the registry settings but I am very clueless and they aren't coming out right..
Okay I looked and
HKLM\Software\OEM\VoiceCommand
Default - String - (value not set)
LaunchAPEnable - DWord - 1 (decimal)
Path - string - \Program Files\Bluetooth Voice Command\BTVCBasic.exe
VoiceCmdDuration - Dword - 30 (decimal)
VoiceCmdEnable - Dword - 0 (decimal)
This entire string is missing..Heck the whole folder VoiceCommand is missing and I can't for the life of me figure out the correct way to add it..
Ok finally figured out how to make the registry keys that are missing so now the applicationlaunches with no error and all the registry settings match but it still won't launch when I press the headset button.
It has worked before WM6 so I know my headset works..
Man If I could just get this going its all I need.. :-(

Changing a Registry Key Automatically on Startup.

Hi everyone. Trying to find a way (if possible) to automatically change a registry key every time the device reboots. Every time I reboot I have to go in and change one registry key manually, I know it's not that bad but I would love it if it could do it by itself. The key is to Enable Audio Booster without using a headset (I use a stereo bluetooth).
The key is: HKLM/System/State/Hardware/Headset
The default is 0, and I have to change it to 1 after a reboot.
You could use Mortscript and create a little script to run on startup
I don't know anything about creating scripts, is it pretty easy or self explanatory?
Not sure about self explanatory, but I am not a programmer and I was able to look at sample scripts and figure out something simple. My original Tilt had an issue where when exchange password was enforced something was setting the backlight to 10 seconds and it drive me nuts. I created a script that was:
RegReadDword HKCU,"ControlPanel","Backlight",BatteryTimeOut
if equals %8%,1
regWriteDword HKCU,"ControlPanel","Backlight","BatteryTimeOut",60
Endif
And that solved my problem 95% of the time.
That's exactly what I did, looked at some scripts that were close to what I wanted and just through trial & error whittled it down to what I needed & it worked!
For anyone who wants it I posted the file here, because I can't be the only one who needs this. You just need to place it in the "StartUp" folder. I named the file ABWBTH.mscr (Audio Booster With Bluetooth Headset).
The Script is very simple:
RegWriteDword ("HKLM", "System\State\Hardware", "Headset",1)

Dealing with "debuggerd" high cpu usage, suggestions?

I did a basic search of the GNex section of the forum and didn't find any conspicuous information, thus I wanted to see if anyone had any suggestions for dealing with the "debuggerd" system process.
I have a yakjuux 4.0.4ota with franco-kernel milestone3. I started with 4.0.1 and no mods, upgrading to the 4.0.x otas as they came out. I have had this phone about 4-5 months now. I have been rooted and unlocked since I have had 4.0.1.
Not exclusively to the 4.0.4 nor the franco-kernel I have noticed a process "debuggerd" running on my phone. rcently, twice in a day I found that process consuming 30+% of the cpu, causing a sudden drain in my battery. Prior to 4.0.4 I had not gathered any empirical data as to how much debuggerd was consuming, but did have times when the battery would radically drain, and I did notice debuggerd running.
I was able to launch a shell on my phone and kill the process-id for debuggerd at which point cpu load would drop instantly.
I tried freezing (via Titanium) many of my apps that would use data or were running at the time of the high cpu load (I wasn't sure if that would free up what triggered the process, just thought it was worth a try). I turned off a lot of software (eg. tasker, alarmapps, etc). As I froze/disabled apps en masse it was still using up the cpu. I tried killing apps from within watchdog. Still debuggerd would maintain a high cpu load. A reboot did get rid of it once, but in that session it did come back. Played with the USB debugging mode. I didn't reboot between many of these test.
I'll continue to kill it's pid if it shows, which the signs are really obvious in watchdog app (set my system warning low enough to catch it). I'm just familiar with the problem now.
* Any suggestions on tracing what's triggering debuggerd?
* Thoughts on alternative methods to prevent it from being used?
* I doubt deleting that bit of software is a good idea, right?
* Substitute it with something inert?
* Maybe I should create a button that gets it's pid and kills it?
Thoughts?
I found a shell script on http://en.androidwiki.com/wiki/Android_Shell_tips_and_tricks
It finds the pid by name - which is handy since pid's can be random.
I can run the shell script with SManager (which can provide the shell script any required arguments) from the phone desktop without having to go into the console.
It's a bandaid but it works. I can quickly and easily kill the (or any) errant processes that are not apps.
#!/system/bin/sh
# usage: kill "/full/command/line -with arguments"
for file in /proc/[0-9]* ; do
cmd=$(cat $file/cmdline)
iseq=${cmd%$1}
if ! ( (echo ${cmd:?}) > /dev/null 2>&1) ; then
continue
fi
if ! ( (echo ${iseq:?}) > /dev/null 2>&1 ) ; then
kill -9 ${file#/proc/}
fi
done
I share the same problem. debuggerd is cpu hog.
I dont want to kill it as it is not normal in my case. It has been lasting for more than an hour with high cpu usage.
I am using franco kernel 158 and Samsung GNexus ROM 4.0.4 IMM76K.
any help would be appreciated. Thanks.
mcdull said:
I share the same problem. debuggerd is cpu hog.
I dont want to kill it as it is not normal in my case. It has been lasting for more than an hour with high cpu usage.
I am using franco kernel 158 and Samsung GNexus ROM 4.0.4 IMM76K.
any help would be appreciated. Thanks.
Click to expand...
Click to collapse
McDull,
I'm not sure what you mean by you don't want to kill it. Regardless, you could kill the process (not via any task manager, since dubuggerd isn't an app to force-stop). If you do want to stop it you could manually one of a couple ways.
On the phone by hand:
I'm assuming you have root and su access.
From google-play download:
--- "Top" (by Junichi Uekawa).
--- "Android Terminal Emulator" by Jack Palevich.
Use Top to find out what the process id# for debuggerd is.
Open Terminal Emulator:
--- I can't remember if you need "su" powers, I always enter "su" mode tho.
--- Execute a kill of the pid: kill xxxxxx
Switch to Top, see if the debuggerd resets itself. Kill again if necessary
You can do all of the above via adb shell from your computer too.
Somewhat more automated:
From google-play download "SManager" (script manager) by devwom.
Write a shell kill script like in my first post.
Using smanager you can create a desktop icon that executes the kill command.
(I'm glossing over the details a lot because I'm at work and didn't have time to write in depth smanager instructions to do this. sorry!!)

[Q] Bad DeepSleeping

I know my phone is deepsleeping, but for some reason, when i try to wake it, it would take up to a minute for any response, on top of that I found that android OS is using about 40% of my battery, used Android tuner( the one that requires xposed framework) to see, and it turns out that the battery drain was caused by the android os, "sh" thread.
Any ideas to fix this?
MinChains said:
I know my phone is deepsleeping, but for some reason, when i try to wake it, it would take up to a minute for any response, on top of that I found that android OS is using about 40% of my battery, used Android tuner( the one that requires xposed framework) to see, and it turns out that the battery drain was caused by the android os, "sh" thread.
Any ideas to fix this?
Click to expand...
Click to collapse
"sh" = shell
It seems that something installed on the phone is starting shell (it's a text terminal) in a background and not stopping it. It may be a broken script installed in /etc/init.d or some app that is broken. The worst case scenario is a malicious program that resides in background to do something (not very probable). It will be hard to find the cause as "sh" is a part of the system - please try to correlate the beginning of the problem to installation of some program. Try to use Teminal Emulator and issue the command "su", press enter, write "top -n 3" and enter, to list all tasks running in the system. Scroll up to check column headers, find CPU% and by that locate this rouge "sh" process. Look in column UID to find who has started it (user id). Post your search result.
Found it pid 32444 bu doesnt really help as i can lt find it activitymanager.runningappprocessinfo
Any idea what this is?
32444 2 24% R 1 896K 428K root /system/bin/sh
Rebooted, pid changed to 4790
Update:
After i killed this prpcess, swapoff takes over and causes an i/o storm for abour 2 mins then system ui and surfaceflinger uses about 30% and 20% cpu respectively it doesnt go down even after 5 hours.
Using agni kernel for 4.3 btw patched to fix network error
What cpu governor are You using?
Try to set ondemand.
Sent from galaxy n7105

Serious issue with sudden turnoffs

I've noticed that my device has suddenly turned off on several occasions; I only notice because it does not respond to the power button and to use it I must take out and reinsert the battery.
I am running the latest installer build. Is this an issue with CM, the phone or something else? I need it fixed quickly because I am missing important text messages and phone calls. Should I flash M9 over the installer build, or is it something serious enough to merit a deeper change?
RaymieHumbert said:
I've noticed that my device has suddenly turned off on several occasions; I only notice because it does not respond to the power button and to use it I must take out and reinsert the battery.
I am running the latest installer build. Is this an issue with CM, the phone or something else? I need it fixed quickly because I am missing important text messages and phone calls. Should I flash M9 over the installer build, or is it something serious enough to merit a deeper change?
Click to expand...
Click to collapse
It sounds like you're having issues with your phone not waking up. A couple things you can try immediately(these are terminal commands to enter in terminal emulator or adb):
### lower wakeup thresholds
Code:
su
sysctl -w kernel.random.read_wakeup_threshold = 64
sysctl -w kernel.random.write_wakeup_threshold = 128
### increase max frequency
Code:
su
echo 1200000 > /sys/devices/system/cpu/cpu0/cpufreq/screen_off_max_freq
When your phone screen doesn't turn on when you press the power button, try plugging it into the charger to see if turns on then.
Also this can sometimes be a kernel related issue. Try flashing some afterstock kernels like Fancy or Dirty V.

Categories

Resources