CM7DX2 WIFI and Dialer fix/mod (enable cron scheduler)!

Search This thread

Moon Shadow - NM

Senior Member
Jul 14, 2011
455
502
Albuquerque
CM7DX2 WIFI and Dialer fix/mod!

If you are having problems with WIFI staying connected... Read this! :eek:

If you are having problems with the Dialer dialing out 30-120 (or more) seconds after hitting the call button... Read this! :eek:


DISCLAIMER: This have ONLY been tested to work on CM7DX2! Also, as with any of my mods or fixes, you are doing this at your own risk. I cannot and will not be held liable or responsible for what YOU choose to do to your phone.

The reason I chose to implement the cron instead of just running scripts or something like that was because I didn't want anyone to have to download one or more apps to do this, and I also wanted to keep the overhead as low as possible.


Now, on to the good stuff! :D
If you are impatient, download the flashable zip and flash it in BSR. No need to wipe data, cache, or dalvik-cache, although wiping cache and dalvik-cache can't/won't hurt.

In addition to flashing this, you also, MUST enable WIFI Never Sleep! Goto Menu -> Settings -> Wireless & Networks -> Wi-Fi Settings -> Menu -> Advanced -> Wi-Fi- Sleep Policy, then tape Never and hit the back button 4 times!


Background:
After test driving CM7DX2 for DragonZKiller, I had turned it into my daily driver. Everyone who has tried it knows that it is a very stable ROM and works very well. Anyhow, after having it as my daily driver for about 2 weeks, I noticed, on some occasions, it would take 30-120 (or more) seconds to actually dial the call AFTER I hit the Call button, or worse, it would FC on me. Over time, this became very frustrating to me because I could reboot my phone and my outgoing calls would be sent practically the moment I tapped the Call button. This was frustrating to no end because I couldn't nail down what or why it was doing it.

I then started keeping a log of my use of my phone and my observations (yes, true engineer here). I noticed after about 60 minutes of idle time, me not futzing with my phone, the dialer lag (or FC) would appear. That got me to thinking that something was killing the dialer, so I started looking at the CyanogenMod settings as I remembered there was a setting to "Purge Assests" or something like that... Because I set the setting weeks earlier when I was playing with the phone...

I found the setting in Menu -> Settings -> CyanogenMod Settings -> Performance Settings -> Allow Purging of Assets. I removed the check mark next to it and, to be safe, rebooted the phone.

Again, I went back to logging my usage on my phone... Again, after about 60 minutes of idle time, the dialer lag (or FC) would be back.

This has me very frustrated now, because, silly me, I would like my phone to act like a phone when I need it to be a phone... And, not just a development tool, or a device to play Angry Birds, or... You get the idea.

I started poking around to see what was happening to the dialer, when I remembered that ZepplinRox had a thread somewhere pertaining to renicing an app... [FIX] Bulletproof Background Apps! Hot damn! I think this is what I need to look at! Now to find the dialer...

This is easier said then done. I thought I would be a smart ass and just type:
Code:
ps | grep dialer
Well, that didn't work. Okay, then I tried:
Code:
ps | grep Dialer
and various permutations of dialer. Still can't find any process called dialer! Damn it! WTF? I then remembered taking with DZK during the development of the CM7DX2 ROM and he was saying something about the phone/dialer not working... Wait.... Phone?!?!?! Okay, so back to ps..

Code:
ps | grep phone
radio     2179  2037  147608 25472 ffffffff afd0c7cc S com.android.phone
BINGO! :D Pay dirt! Well, almost. :eek: So, I found the "dailer" process... com.android.phone. Great! Now what? Then I remembered DZK saying something about rild... And there was a problem there that was linked to the radio/phone/dialer. Wait, radio?!?!?! Rild?!?!?!?! WTF now? Now I have to look at renicing two things? Great... *sigh*

So, I started looking at ZepplinRox's scripts to renice the dialer, phone, rild, radio... What ever! I was trying to figure out a consistent way to run the renice command at a specific interval... Wait, ZepplinRox is using init.d to run his scripts and it has a sleep command in the script so it sleeps for that long then restarts the command. That is good, but what keeps the android scheduler from killing the script... Android Scheduler?!?!?! Wait... Hold on a sec! I think that is where the problem lies! So, off to do more research!

So within adb, I started running htop to watch the nice level on the com.android.phone process, and in another adb session, I reniced the process com.android.phone. After about 35-40 minutes, I noticed the nice level on the com.android.phone process was being elevated. Then at about 60 minutes, when I tried to use the dialer, it lagged. Ah ha! Now, how do I renice the dialer so that is sticks and works.

I understand cron in Linux, and thought about enabling the cron on Android. I found this blog by imoseyon: cron on android is awesome which pointed me in the right direction.

The Solution:
After much work, I finally was able to have cron running on my DX2!

I created a flashable zip that would install the cron files and enable it on boot. I then created a folder in /data called scripts and put my cron called script (com_android_phone.sh) in there. I set up the cron job to run every 30 minutes. this script doesn't actually renice the process, it renices ALL processes owned by the user radio, which is both com.android.phone and /system/bin/rild. That way, they both stay at a low enough nice level to stay active.

I also enabled logging on the crond and logging for the script which logs to /data/scripts/log/com_android_phone.log. Then, I thought that the script's log file (which logs the renice every 30 minutes) would, over time, fill up all available space in /data. I then created a second cron job that would delete this log file every Sunday morning at 5:00AM.

Myself, litetaker, lesismore, and a couple of others have been testing this and the WIFI cron job and it seems to be working.

WIFI cron job:
So, then I wondered if the Android Scheduler could possibly be affecting WIFI in sleep mode as well. I found there is a user WIFI that owns the wifi process /system/bin/wpa_supplicant, and the wpa_supplicant process is present with both open and secured access points, and is only running when WIFI is connected.

So, I created a cron job to renice all processes owned by wifi and have that one running every 15 minutes because I noticed that the disconnects seem to happen after 15-30 minutes of idle time. (In my original thread, I stated that I was not having WIFI connection issues... This is not entirely true, I use tasker to activate/deactivate several wifi situational profiles, so I wasn't seeing it.) This script also writes a log to /data/scripts/log/wpa_supplicant_renice.log every time it runs so I have that script being deleted every Sunday morning at 5:00AM as well.


I sincerely hope this mod helps everyone that has WIFI issues on CM7DX2. This mod MIGHT work on other DX2 ROMs, but I specifically did not test other ROMs as the problem was primarily in CM7DX2.

If you know what you are doing, feel free to open up the zip and port to cron to other ROMs. Also, make sure you set the correct permissions on and scripts you create and on the root "crontab" are all correct, to avoid issues with the scripts not running.

DOWNLOAD:
cron_scheduler_signed.zip

If you have issues, please note them in this thread, or better yet, come to IRC at http://webchat.freenode.net and join channel #cm7dx2. I'm usually in there. Enjoy!

Ciao!
 
Last edited:

jsgraphicart

Senior Member
Nov 25, 2011
6,295
1,884
OnePlus 7T
Google Pixel 7 Pro
Good to see someone made a fix for this. I dont have wifi problems since I use llama location profiles which keeps my wifi on based on my home location. But I may be flashing this to my girlfriends DX2 sometime soon because she's always complaining about this. I will report back on how hers does when I do and let her use it for a while.
 
  • Like
Reactions: Jaydizz

Moon Shadow - NM

Senior Member
Jul 14, 2011
455
502
Albuquerque
Good to see someone made a fix for this. I dont have wifi problems since I use llama location profiles which keeps my wifi on based on my home location. But I may be flashing this to my girlfriends DX2 sometime soon because she's always complaining about this. I will report back on how hers does when I do and let her use it for a while.

Yeah, I use Tasker so I wasn't "seeing" the WIFI problem.

Sounds great! Looking forward to hearing how it goes for her.

Ciao!
 
Last edited:

Pixelation

Senior Member
Jan 14, 2012
559
103
Jersey
CM7DX2 WIFI and Dialer fix/mod!

If you are having problems with WIFI staying connected... Read this! :eek:

If you are having problems with the Dialer dialing out 30-120 (or more) seconds after hitting the call button... Read this! :eek:


DISCLAIMER: This have ONLY been tested to work on CM7DX2! Also, as with any of my mods or fixes, you are doing this at your own risk. I cannot and will not be held liable or responsible for what YOU choose to do to your phone.

The reason I chose to implement the cron instead of just running scripts or something like that was because I didn't want anyone to have to download one or more apps to do this, and I also wanted to keep the overhead as low as possible.


Now, on to the good stuff! :D
If you are impatient, download the flashable zip and flash it in BSR. No need to wipe data, cache, or dalvik-cache, although wiping cache and dalvik-cache can't/won't hurt.

In addition to flashing this, you also, MUST enable WIFI Never Sleep! Goto Menu -> Settings -> Wireless & Networks -> Wi-Fi Settings -> Menu -> Advanced -> Wi-Fi- Sleep Policy, then tape Never and hit the back button 4 times!


Background:
After test driving CM7DX2 for DragonZKiller, I had turned it into my daily driver. Everyone who has tried it knows that it is a very stable ROM and works very well. Anyhow, after having it as my daily driver for about 2 weeks, I noticed, on some occasions, it would take 30-120 (or more) seconds to actually dial the call AFTER I hit the Call button, or worse, it would FC on me. Over time, this became very frustrating to me because I could reboot my phone and my outgoing calls would be sent practically the moment I tapped the Call button. This was frustrating to no end because I couldn't nail down what or why it was doing it.

I then started keeping a log of my use of my phone and my observations (yes, true engineer here). I noticed after about 60 minutes of idle time, me not futzing with my phone, the dialer lag (or FC) would appear. That got me to thinking that something was killing the dialer, so I started looking at the CyanogenMod settings as I remembered there was a setting to "Purge Assests" or something like that... Because I set the setting weeks earlier when I was playing with the phone...

I found the setting in Menu -> Settings -> CyanogenMod Settings -> Performance Settings -> Allow Purging of Assets. I removed the check mark next to it and, to be safe, rebooted the phone.

Again, I went back to logging my usage on my phone... Again, after about 60 minutes of idle time, the dialer lag (or FC) would be back.

This has me very frustrated now, because, silly me, I would like my phone to act like a phone when I need it to be a phone... And, not just a development tool, or a device to play Angry Birds, or... You get the idea.

I started poking around to see what was happening to the dialer, when I remembered that ZepplinRox had a thread somewhere pertaining to renicing an app... [FIX] Bulletproof Background Apps! Hot damn! I think this is what I need to look at! Now to find the dialer...

This is easier said then done. I thought I would be a smart ass and just type:
Code:
ps | grep dialer
Well, that didn't work. Okay, then I tried:
Code:
ps | grep Dialer
and various permutations of dialer. Still can't find any process called dialer! Damn it! WTF? I then remembered taking with DZK during the development of the CM7DX2 ROM and he was saying something about the phone/dialer not working... Wait.... Phone?!?!?! Okay, so back to ps..

Code:
ps | grep phone
radio     2179  2037  147608 25472 ffffffff afd0c7cc S com.android.phone
BINGO! :D Pay dirt! Well, almost. :eek: So, I found the "dailer" process... com.android.phone. Great! Now what? Then I remembered DZK saying something about rild... And there was a problem there that was linked to the radio/phone/dialer. Wait, radio?!?!?! Rild?!?!?!?! WTF now? Now I have to look at renicing two things? Great... *sigh*

So, I started looking at ZepplinRox's scripts to renice the dialer, phone, rild, radio... What ever! I was trying to figure out a consistent way to run the renice command at a specific interval... Wait, ZepplinRox is using init.d to run his scripts and it has a sleep command in the script so it sleeps for that long then restarts the command. That is good, but what keeps the android scheduler from killing the script... Android Scheduler?!?!?! Wait... Hold on a sec! I think that is where the problem lies! So, off to do more research!

So within adb, I started running htop to watch the nice level on the com.android.phone process, and in another adb session, I reniced the process com.android.phone. After about 35-40 minutes, I noticed the nice level on the com.android.phone process was being elevated. Then at about 60 minutes, when I tried to use the dialer, it lagged. Ah ha! Now, how do I renice the dialer so that is sticks and works.

I understand cron in Linux, and thought about enabling the cron on Android. I found this blog by imoseyon: cron on android is awesome which pointed me in the right direction.

The Solution:
After much work, I finally was able to have cron running on my DX2!

I created a flashable zip that would install the cron files and enable it on boot. I then created a folder in /data called scripts and put my cron called script (com_android_phone.sh) in there. I set up the cron job to run every 30 minutes. this script doesn't actually renice the process, it renices ALL processes owned by the user radio, which is both com.android.phone and /system/bin/rild. That way, they both stay at a low enough nice level to stay active.

I also enabled logging on the crond and logging for the script which logs to /data/scripts/log/com_android_phone.log. Then, I thought that the script's log file (which logs the renice every 30 minutes) would, over time, fill up all available space in /data. I then created a second cron job that would delete this log file every Sunday morning at 5:00AM.

Myself, litetaker, lesismore, and a couple of others have been testing this and the WIFI cron job and it seems to be working.

WIFI cron job:
So, then I wondered if the Android Scheduler could possibly be affecting WIFI in sleep mode as well. I found there is a user WIFI that owns the wifi process /system/bin/wpa_supplicant, and the wpa_supplicant process is present with both open and secured access points, and is only running when WIFI is connected.

So, I created a cron job to renice all processes owned by wifi and have that one running every 15 minutes because I noticed that the disconnects seem to happen after 15-30 minutes of idle time. (In my original thread, I stated that I was not having WIFI connection issues... This is not entirely true, I use tasker to activate/deactivate several wifi situational profiles, so I wasn't seeing it.) This script also writes a log to /data/scripts/log/wpa_supplicant_renice.log every time it runs so I have that script being deleted every Sunday morning at 5:00AM as well.


I sincerely hope this mod helps everyone that has WIFI issues on CM7DX2. This mod MIGHT work on other DX2 ROMs, but I specifically did not test other ROMs as the problem was primarily in CM7DX2.

If you know what you are doing, feel free to open up the zip and port to cron to other ROMs. Also, make sure you set the correct permissions on and scripts you create and on the root "crontab" are all correct, to avoid issues with the scripts not running.

DOWNLOAD:
cron_scheduler_signed.zip

If you have issues, please note them in this thread, or better yet, come to IRC at http://webchat.freenode.net and join channel #cm7dx2. I'm usually in there. Enjoy!

Ciao!

I used to have wifi issues, BUT since the last SBF around two weeks ago I have had no problems...I have not altered any crucial settings nor installed any mods/scripts... Thank you Moon Shadow, your continued effort is appreciated! :)

:) SMILE :) It's Not Illegal Yet :)
 

RyanThaDude

Senior Member
Jul 20, 2011
259
55
Nexus 6
Google Pixel 2 XL
It doesn't seem to be fixing my wifi. Just unlocked my phone from sitting for about an hour and wifi was disabled again. Toggling wifi off/on didn't fix, have to reboot. As far as the dialer, I couldn't tell you if it worked or not as I never stumbled upon this problem.
 

Moon Shadow - NM

Senior Member
Jul 14, 2011
455
502
Albuquerque
here is a alt host for when original goes down

Don't worry Dev it has a dl counter: Download CM7DX2 WIFI and Dialer fix/mod!

Thanks, however, I host my files on my own website. :D I appreciate it, though!

Ciao!


It doesn't seem to be fixing my wifi. Just unlocked my phone from sitting for about an hour and wifi was disabled again. Toggling wifi off/on didn't fix, have to reboot. As far as the dialer, I couldn't tell you if it worked or not as I never stumbled upon this problem.


Hrm... :-/ That is interesting. Is your WIFI settings set to Never Sleep?

Ciao!
 

DaveRichardson

Senior Member
Aug 2, 2011
266
57
I'll be eagerly watching this thread for people's results/impressions. I just SBF'd my X2 to sell it, but if this means I can run CM7 without wifi issues, I might reconsider and keep 'er after all.
 

Moon Shadow - NM

Senior Member
Jul 14, 2011
455
502
Albuquerque
That I do. Restarted a few times and let set for 1/2 hour. Just unlocked my phone from the nap and wifi was once again disabled.

Okay, I hate to ask this, but in order to troubleshoot this farther, I am going to ask you to SBF back to do the following: (If you aren't able or willing to do this, I understand, but I will be very limited as to the support I can give.)

1. SBF back to stock.
2. Perform a Factory Reset and wipe dalvik-cache.
3. Activate (if necessary).
4. Root.
5. Install the ORIGINAL BSR.
6. Boot into the BSR.
7. Flash CM7DX2.
8. Flash the CM7 gapps.
9. Perform a Factory Reset and wipe dalvik-cache.
10. Make sure WIFI is set to Never Sleep. (See OP.)
11. Reboot and install the CM7 BSR.
12. Boot into BSR and flash the cron scheduler.
13. Boot normal and test.
14. After about 4 hours, PM me with these log files (in a zip file): /data/cron/log/crond.log, /data/scripts/log/com_android_phone.log, and /data/scripts/log/wpa_supplicant_renice.log.
15. Also include a "logcat *:E *:W *:I". I'm hoping you have adb installed and are familiar with it. If so, use: "adb logcat *:E *:W *:I > logcat.log" and put that in the zip file as well.

I understand this is a PITA, but, again, it's really the best way for me to try to see what is happening with your phone.

Also, if you are using Titanium Backup, only restore your apps and their data, DO NOT restore any system apps or data (the ones in green or red).

Thanks.

Ciao!
 

robocuff

Senior Member
Jul 23, 2011
710
275
I tried flashing it and it ended up aborting the flash due to an error. I'd have to try again to get the exact error but it was something to the effect E: couldn't mount whatever the zips name was. :) I downloaded it again and got the same error so rather than fighting it, I installed it manually. I take it it's working as I see the entries in the logs.

Anyway, I put the phone down a couple hours ago and just checked now and wifi was still active and connected. Might be too early to say for sure but so far, so good for me. I'll give it a day and then post back.
 

RyanThaDude

Senior Member
Jul 20, 2011
259
55
Nexus 6
Google Pixel 2 XL
Hopefully I'll be able to do this later tonight.

---------- Post added at 06:14 PM ---------- Previous post was at 06:11 PM ----------

I just pulled the crond.log and this is what's in it:
Code:
rond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7

Does this help anything?
 

Moon Shadow - NM

Senior Member
Jul 14, 2011
455
502
Albuquerque
Hopefully I'll be able to do this later tonight.

---------- Post added at 06:14 PM ---------- Previous post was at 06:11 PM ----------

I just pulled the crond.log and this is what's in it:
Code:
rond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
crond: user root: parse error at 7
Does this help anything?

Yeah, that does. That means it's not reading something correctly.

Check the permissions on /data/scripts/com_android_phone.sh and /data/scripts/wpa_supplication_renice.sh. They both should be 755 (-rwxr-xr-x). If not, issue "chmod 755 " (put each file name where is).

Also check /data/cron/root and make sure that is 644 (-rw-r--r--).

Also, check the time stamp on the log file. That will tell you when it was last updated.


Thanks.
 
Last edited:

smallzfsu

Senior Member
Jan 21, 2012
89
12
Just removed wifi keep alive, rebooted, put the phone in my pocket for ten minutes and wham dead wifi. Just flashed this zip and will report back.

By the way on boot after flashing this I got the triangle data icon and no service for about 30 seconds, then it came back, don't be scared!

Thanks so far Moonshadow!

Sent from my MB870 using XDA App
 

kenjesse

Senior Member
Jul 15, 2011
654
561
Florida
Haven't been having the wifi issue which I believe is because I use JD Ultimate with wifi preferred set to on. This extends the time the phone allows for a wifi connection to be made before turning on 3g. I have been having problems with the dialer recently and will let you know if this takes care of that issue. And as always thanks for the work and the great lesson regarding the problem and fix...a very interesting read.

Sent from my MB870 using Tapatalk
 

smallzfsu

Senior Member
Jan 21, 2012
89
12
Yeah, that does. That means it's not reading something correctly.

Check the permissions on /data/scripts/com_android_phone.sh and /data/scripts/wpa_supplication_renice.sh. They both should be 755 (-rwxr-xr-x). If not, issue "chmod 755 " (put each file name where is).

Also check /data/cron/root and make sure that is 644 (-rw-r--r--).

Also, check the time stamp on the log file. That will tell you when it was last updated.


Thanks.

I checked all three script files and permissions were 755, and the root file was 644, and I'm getting the same errors as Ryan in the crond log.

Not getting any updates or modification to the one log file in /data/scripts/log/dhcpd_renice.log. Mod date on that file is 2008-8-1 07:00. Modify date on crond log is today 10:57pm.

The other logs have updates, and my wireless hasn't ever been this stable on cm7. Never had any problem with the dialer, but it's still working. So hurray there!!!

So what's up with the dhcpd script, anything I can look at further to get at why it's not logging/failing in the crond log?

Sent from my MB870 using XDA App
 

Top Liked Posts

  • There are no posts matching your filters.
  • 28
    CM7DX2 WIFI and Dialer fix/mod!

    If you are having problems with WIFI staying connected... Read this! :eek:

    If you are having problems with the Dialer dialing out 30-120 (or more) seconds after hitting the call button... Read this! :eek:


    DISCLAIMER: This have ONLY been tested to work on CM7DX2! Also, as with any of my mods or fixes, you are doing this at your own risk. I cannot and will not be held liable or responsible for what YOU choose to do to your phone.

    The reason I chose to implement the cron instead of just running scripts or something like that was because I didn't want anyone to have to download one or more apps to do this, and I also wanted to keep the overhead as low as possible.


    Now, on to the good stuff! :D
    If you are impatient, download the flashable zip and flash it in BSR. No need to wipe data, cache, or dalvik-cache, although wiping cache and dalvik-cache can't/won't hurt.

    In addition to flashing this, you also, MUST enable WIFI Never Sleep! Goto Menu -> Settings -> Wireless & Networks -> Wi-Fi Settings -> Menu -> Advanced -> Wi-Fi- Sleep Policy, then tape Never and hit the back button 4 times!


    Background:
    After test driving CM7DX2 for DragonZKiller, I had turned it into my daily driver. Everyone who has tried it knows that it is a very stable ROM and works very well. Anyhow, after having it as my daily driver for about 2 weeks, I noticed, on some occasions, it would take 30-120 (or more) seconds to actually dial the call AFTER I hit the Call button, or worse, it would FC on me. Over time, this became very frustrating to me because I could reboot my phone and my outgoing calls would be sent practically the moment I tapped the Call button. This was frustrating to no end because I couldn't nail down what or why it was doing it.

    I then started keeping a log of my use of my phone and my observations (yes, true engineer here). I noticed after about 60 minutes of idle time, me not futzing with my phone, the dialer lag (or FC) would appear. That got me to thinking that something was killing the dialer, so I started looking at the CyanogenMod settings as I remembered there was a setting to "Purge Assests" or something like that... Because I set the setting weeks earlier when I was playing with the phone...

    I found the setting in Menu -> Settings -> CyanogenMod Settings -> Performance Settings -> Allow Purging of Assets. I removed the check mark next to it and, to be safe, rebooted the phone.

    Again, I went back to logging my usage on my phone... Again, after about 60 minutes of idle time, the dialer lag (or FC) would be back.

    This has me very frustrated now, because, silly me, I would like my phone to act like a phone when I need it to be a phone... And, not just a development tool, or a device to play Angry Birds, or... You get the idea.

    I started poking around to see what was happening to the dialer, when I remembered that ZepplinRox had a thread somewhere pertaining to renicing an app... [FIX] Bulletproof Background Apps! Hot damn! I think this is what I need to look at! Now to find the dialer...

    This is easier said then done. I thought I would be a smart ass and just type:
    Code:
    ps | grep dialer
    Well, that didn't work. Okay, then I tried:
    Code:
    ps | grep Dialer
    and various permutations of dialer. Still can't find any process called dialer! Damn it! WTF? I then remembered taking with DZK during the development of the CM7DX2 ROM and he was saying something about the phone/dialer not working... Wait.... Phone?!?!?! Okay, so back to ps..

    Code:
    ps | grep phone
    radio     2179  2037  147608 25472 ffffffff afd0c7cc S com.android.phone
    BINGO! :D Pay dirt! Well, almost. :eek: So, I found the "dailer" process... com.android.phone. Great! Now what? Then I remembered DZK saying something about rild... And there was a problem there that was linked to the radio/phone/dialer. Wait, radio?!?!?! Rild?!?!?!?! WTF now? Now I have to look at renicing two things? Great... *sigh*

    So, I started looking at ZepplinRox's scripts to renice the dialer, phone, rild, radio... What ever! I was trying to figure out a consistent way to run the renice command at a specific interval... Wait, ZepplinRox is using init.d to run his scripts and it has a sleep command in the script so it sleeps for that long then restarts the command. That is good, but what keeps the android scheduler from killing the script... Android Scheduler?!?!?! Wait... Hold on a sec! I think that is where the problem lies! So, off to do more research!

    So within adb, I started running htop to watch the nice level on the com.android.phone process, and in another adb session, I reniced the process com.android.phone. After about 35-40 minutes, I noticed the nice level on the com.android.phone process was being elevated. Then at about 60 minutes, when I tried to use the dialer, it lagged. Ah ha! Now, how do I renice the dialer so that is sticks and works.

    I understand cron in Linux, and thought about enabling the cron on Android. I found this blog by imoseyon: cron on android is awesome which pointed me in the right direction.

    The Solution:
    After much work, I finally was able to have cron running on my DX2!

    I created a flashable zip that would install the cron files and enable it on boot. I then created a folder in /data called scripts and put my cron called script (com_android_phone.sh) in there. I set up the cron job to run every 30 minutes. this script doesn't actually renice the process, it renices ALL processes owned by the user radio, which is both com.android.phone and /system/bin/rild. That way, they both stay at a low enough nice level to stay active.

    I also enabled logging on the crond and logging for the script which logs to /data/scripts/log/com_android_phone.log. Then, I thought that the script's log file (which logs the renice every 30 minutes) would, over time, fill up all available space in /data. I then created a second cron job that would delete this log file every Sunday morning at 5:00AM.

    Myself, litetaker, lesismore, and a couple of others have been testing this and the WIFI cron job and it seems to be working.

    WIFI cron job:
    So, then I wondered if the Android Scheduler could possibly be affecting WIFI in sleep mode as well. I found there is a user WIFI that owns the wifi process /system/bin/wpa_supplicant, and the wpa_supplicant process is present with both open and secured access points, and is only running when WIFI is connected.

    So, I created a cron job to renice all processes owned by wifi and have that one running every 15 minutes because I noticed that the disconnects seem to happen after 15-30 minutes of idle time. (In my original thread, I stated that I was not having WIFI connection issues... This is not entirely true, I use tasker to activate/deactivate several wifi situational profiles, so I wasn't seeing it.) This script also writes a log to /data/scripts/log/wpa_supplicant_renice.log every time it runs so I have that script being deleted every Sunday morning at 5:00AM as well.


    I sincerely hope this mod helps everyone that has WIFI issues on CM7DX2. This mod MIGHT work on other DX2 ROMs, but I specifically did not test other ROMs as the problem was primarily in CM7DX2.

    If you know what you are doing, feel free to open up the zip and port to cron to other ROMs. Also, make sure you set the correct permissions on and scripts you create and on the root "crontab" are all correct, to avoid issues with the scripts not running.

    DOWNLOAD:
    cron_scheduler_signed.zip

    If you have issues, please note them in this thread, or better yet, come to IRC at http://webchat.freenode.net and join channel #cm7dx2. I'm usually in there. Enjoy!

    Ciao!
    4
    Reserved for future use.
    3

    Sorry all. I had to take down my website when I was laid off from my job. I have uploaded the file to my Dropbox and updated the OP. The file is located here: https://www.dropbox.com/s/r92ivzl7i9yr3qq/cron_scheduler_signed.zip?dl=0

    If there are other files that someone needs, please PM me, reference the thread they were on, and I will get them uploaded and updated. Please note that it might take me some time to do this. Thank you.
    2
    Found a mirror http://www.4shared.com/postDownload/-7HcpKan/cron_scheduler_signed.html
    Filename: cron_scheduler_signed.zip
    Size: 131.33 KB (134482 bytes)
    MD5 Sum: 8451e828641eb5da335af12ed3c26861
    Uploaded DevHost -- XDA
    1
    Good to see someone made a fix for this. I dont have wifi problems since I use llama location profiles which keeps my wifi on based on my home location. But I may be flashing this to my girlfriends DX2 sometime soon because she's always complaining about this. I will report back on how hers does when I do and let her use it for a while.