[Dev] Call for test, ril wrapper for pppd, 18/11/2010: test kernel 2K and wrapper 0.7

Search This thread

letama

Senior Member
Feb 13, 2008
1,690
2,324
Dear All,

I modified libhtc_ril_wrapper to possibly fix the pppd disconnection problem.

As I don't have 3G at home, I'd appreciate some feedback to help me diagnose potential issues with it.

WARNING, there are reports of crash at boot, do a backup of your whole android directory before trying this!

Don't run this if don't have adb and know how to use it.

See post #2 for history and more information


To keep the thread clean, please only report problems and try to avoid unnecessary talking about it.

Don't report problem without logs, it won't help.

This is highly experimental, don't use it if you don't know what you're doing.


To install, just rename your previous wrapper and copy the attached libhtc_ril_wrapper.so to the same location.

Here are the logs I need:
Code:
logcat -d -v time -b radio > /sdcard/pppd_radiolog.txt
logcat -d -v time -s pppd:v > /sdcard/pppd_mainlog.txt
dmesg > /sdcard/pppd_dmesg.txt
/bin/ifconfig > /sdcard/pppd_if.txt
ps > /sdcard/pppd_ps.txt

Please review pppd_radiolog.txt before posting, it could show some personal stuff like phone numbers, feel free to remove these lines or refrain to post them

Wait 20 seconds to let the wrapper relaunch pppd and check connection again. If it doesn't work, please send the logs.

Grab the three files from sdcard root and post them back here.

I'm also experimenting some kernel tuning that can be activated with this:
Code:
echo 8 8 > /proc/sys/vm/lowmem_reserve_ratio
echo 8192 > /proc/sys/vm/min_free_kbytes

Nothing conclusive yet, but it seems to help.

Thanks to Hastarin, I also attached his root package that includes wrapper with ppp options and tweaks.

Thanks,

LeTama
 

Attachments

  • libhtc_ril_wrapper_v0.3.zip
    8.5 KB · Views: 1,990
  • libhtc_ril_wrapper_v0.4.zip
    9.1 KB · Views: 1,106
  • libhtc_ril_wrapper_v0.6.zip
    9.2 KB · Views: 735
  • smdtest_2K_kernel.zip
    2.3 MB · Views: 486
  • libhtc_ril_wrapper_v0.7.zip
    9.2 KB · Views: 2,331
  • ppp_tweaks_root.zip
    10.8 KB · Views: 1,318
Last edited:

letama

Senior Member
Feb 13, 2008
1,690
2,324
History

2010/11/24 Hastarin root package (ppp_tweaks_root.zip) added, it includes wrapper, ppp options and kernel tweaks.

2010/11/18 new kernel and wrapper v0.7
  • new test kernel with smd_tty trimmed to 2K.
  • wrapper fake data call list has now active=1

v0.6 - 2010/11/17
  • same as 0.5 without the stupid bug that trashed the code.

2010/11/16
  • Test kernel to diagnose the "tty_prepare_flip_string fail" error with high cpu usage, please check post here for detail
  • v0.5: delay changed for deactivate and fake data call list added.

v 0.4 - 2010/11/14
  • Changed tag to RIL_WRAP to improve log reading
  • Improved log messages
  • Signal tracking to try to find who kills wrapper monitor
  • Lower delay between AT commands
  • Sleep delays and sequence reworked
  • Tentative improvement to re-establish ppp
  • Tentative fix for wrapper monitor death with extra debug messages
  • Memory leak on deactivate fixed

v 0.3 - 2010/11/02
  • added network state detection to avoid doing ATD too early resulting in getting stuck.
  • changed nand handling, proper initialization for nand is now done by adding "nand_init" to wrapper command line in init.rc.
    (Ex: service ril-daemon /system/bin/rild -l /system/lib/libhtc_ril_wrapper.so -- -d /dev/smd0 nand_init)
  • added a wrapper command line switch "rmnet_mode" for rmnet, "active" file in /etc/ppp is no longer used nor required for ppp.

v 0.2 - 2010/10/31, first release
  • restarts pppd when it dies

Troubleshooting

  • How to verify if wrapper is running:

    In radio log (logcat -b radio -d), my wrapper write this at startup (do it quickly after boot, it disappears quite quickly over time):

    Code:
    ----------- HTC Ril Wrapper v0.7 starting ------------
    and you should have debug messages there starting with RIL_WRAP, not RILW.

  • Crash on boot (v0.2):

    Check if your kernel command line in startup.txt has "nand_boot=0". If it still doesn't boot, try to remove any other option and only keep "nand_boot=0"

  • Troubleshooting crash on boot

    Even if it crashes very early, it should be possible to grab early logs. To do that, start adb *before* starting android with this command:

    adb logcat -b radio -v time

    adb should say *waiting for device*, you can then start Android. Adb will show some logs before the device crashes. Please send me the logs if you are able to do so.

    If you see AT@BRIC=0 in the log, it means that the wrapper thinks you are on nand, and that's why you device crashes.

  • pppd-fix

    I saw in some logs that some are using Cass pppd-fix script with the wrapper. Cass script and wrapper are doing the same thing and are conflicting. So, if you have installed the pppd-fix, please remove it, it won't play nice with the wrapper.

Known issues
  • 2010/11/14: pppd first launch fails after boot. wrapper catch it, however it would be nice to have it working the first time. It adds few seconds to re-establish data, so be patient!
  • 2010/11/14: high cpu consumption. The issue comes from memory management in kernel, we still have to figure out what's happening.
  • 2010/11/04: pppd monitor process seems to die from time to time. I don't know why yet, looking at the code it doesn't seem possible. I'll look into it and maybe release a new version with more debug traces. You can see it in terminal by doing a 'ps', it will show one of the rild as zombie ( Z instead of S just before process name). The easiest way to restart it is to do a data off/on.
 
Last edited:

funky81

Senior Member
Jun 6, 2007
289
383
Jakarta
Hi letama,

Currently i'm using ppp-fix. Can I contribute here? or I have to remove the script from init.rc then I reboot the device so I can contribute?
 

Crusoe86

Senior Member
Jan 30, 2009
545
33
Cologne
Hi LeTama,

thank you for your work.
It seems that your fix work. I don't notice any dropouts.
But that could be a reason of the issue that the phone does not start android.
It boots WM then haret and then it freezes on the black screen with the green HTC logo...
I use [UPD][BUILD][30.10.10] MDJ FroYo Revolution v.1.1 [kernel: hastarin R8] and after copying your file with ES explorer I've rebooted the phone and now it hangs on the htc screen after running haret... :(
But the good news are, the dropouts are gone :)

Sorry but I can't post logcat messages without booting android complete :(

Which build do you recommend?
 

letama

Senior Member
Feb 13, 2008
1,690
2,324
Hi letama,

Currently i'm using ppp-fix. Can I contribute here? or I have to remove the script from init.rc then I reboot the device so I can contribute?

Hi Funky81,

Well, it's better to remove ppp-fix as I do the same thing in the wrapper now. The way it's done in the wrapper is cleaner and should have the same effect.

You can just comment it in your init.rc if you want to keep it, but keeping it active could have side effects.
 

letama

Senior Member
Feb 13, 2008
1,690
2,324
Hi LeTama,

thank you for your work.
It seems that your fix work. I don't notice any dropouts.
But that could be a reason of the issue that the phone does not start android.
It boots WM then haret and then it freezes on the black screen with the green HTC logo...
I use [UPD][BUILD][30.10.10] MDJ FroYo Revolution v.1.1 [kernel: hastarin R8] and after copying your file with ES explorer I've rebooted the phone and now it hangs on the htc screen after running haret... :(
But the good news are, the dropouts are gone :)

Sorry but I can't post logcat messages without booting android complete :(

Which build do you recommend?

You have adb on you pc ? You should be able to run adb even if android is not fully started.

With it, you can get logcat and even rename back the old wrapper to see if it starts booting again.
 

noellenchris

Inactive Recognized Developer / Retired Moderator
May 11, 2007
2,604
889
Marlton, NJ
So far it's working very nice, I will be out and about today and will try to crash your masterpiece...:p

I just wanted to publicly say a big "THANKS" for helping everyone out with the PPP issues, you have always listened when I've popped in on the IRC and asked questions and relayed info from XDA. Thanks for your time and expertise. Your DEV work has not gone unnoticed!:D

Now get ready to fix the wrapper after we all crash it. Or read all the post on how your wrapper has made their microwave burn their popcorn and how their wifi can now communicate with the satellites....bla....bla.......:rolleyes:
 

MartyLK

Senior Member
Apr 19, 2010
3,968
177
Oklahoma City
So far it's working very nice, I will be out and about today and will try to crash your masterpiece...:p

I just wanted to publicly say a big "THANKS" for helping everyone out with the PPP issues, you have always listened when I've popped in on the IRC and asked questions and relayed info from XDA. Thanks for your time and expertise. Your DEV work has not gone unnoticed!:D

Now get ready to fix the wrapper after we all crash it. Or read all the post on how your wrapper has made their microwave burn their popcorn and how their wifi can now communicate with the satellites....bla....bla.......:rolleyes:
Hehe...that may not happen. At least for my copy. I am giving mine a thorough flogging with Speed Test and can't make the data freeze. And I'm seeing over 3000Kb/s HSDPA speeds...with the common, single APN settings. By the way, I'd like to thank both of you for your hard efforts.
 

hastarin

Senior Member
Apr 19, 2007
772
603
Melbourne
You have adb on you pc ? You should be able to run adb even if android is not fully started.

With it, you can get logcat and even rename back the old wrapper to see if it starts booting again.

Sadly I got the same problem and it's the initial logo screen it's hanging at, not the boot animation, so no adb shell is possible. I did get you a dmesg via andlog though (attached).

Time to restore a copy of system.ext2 that I backed up before... Oh wait, I didn't. Oh well, time to restore the copy from the original build. :)

To anyone trying this I suggest first taking a copy of the system.ext2 from your Android folder, just in case. At least if you'd tweaked anything in it already (build.prop for example) like I had.

On the plus side I did setup a gscript with the commands you noted and test it before I rebooted the phone. From that I noticed I had some errors in my logs already. I've attached them in case they help. NOTE: This is on my kernel and it almost seems like your patch to hi/lo-mem and my patch to move ppp compression to hi-mem have countered each other. It's getting late here so I'll have to continue experiments tomorrow after work.
 

Attachments

  • pppd_error_logs1.zip
    26.3 KB · Views: 16
  • pppfix_crash_on_boot.zip
    10.6 KB · Views: 31

Dr Nicky

Senior Member
Oct 5, 2008
235
36
Bexley
Hope this helps

Here you go. I had a disconnect and sync fail (Exchange Server).
 

Attachments

  • pppd_mainlog.txt
    22.7 KB · Views: 39
  • pppd_radiolog.txt
    73.6 KB · Views: 24

noellenchris

Inactive Recognized Developer / Retired Moderator
May 11, 2007
2,604
889
Marlton, NJ

hastarin

Senior Member
Apr 19, 2007
772
603
Melbourne
Hastarin, you can mount the ext2 on your pc and replace the file ?

Your log show a modem crash, weird.

Yeah, mdeejay even sent me a whole build he had working with the wrapper and I got the same crash.

I'm back up and running now. Restored the original system.ext2 from the build and reapplied my few tweaks.

FYI I'm going to try the following in my init.rc
Code:
	 # Tweak inode caches
	 write /proc/sys/vm/vfs_cache_pressure 200

Based on this:
http://www.cyberciti.biz/faq/linux-page-allocation-failure-erro/

But now it's approaching 4am here and I really must sleep. :eek:

PS Giving up on testing your wrapper for now. It just really doesn't like me. :(
 
Last edited:

maximr

Senior Member
Sep 20, 2006
113
4
Seattle
I'm having the same issue as Hastarin - well, I've been using his latest kernel. Doesn't even boot.

Instead of restoring system.ext2, I just pushed an older lib and went back to the old method of restarting pppd.
 

maxh2005

Member
May 12, 2008
38
1
My own logs for a dropout that just occurred (3G/H icon vanished while loading a web page). For me, the wrapper didn't work with Hastarin r8, but does with r7.7.

Thanks for looking into this!
 

Attachments

  • pppd_dmesg.txt
    30.4 KB · Views: 12
  • pppd_mainlog.txt
    6.5 KB · Views: 11
  • pppd_radiolog.txt
    46.8 KB · Views: 14

Top Liked Posts

  • There are no posts matching your filters.
  • 7
    Dear All,

    I modified libhtc_ril_wrapper to possibly fix the pppd disconnection problem.

    As I don't have 3G at home, I'd appreciate some feedback to help me diagnose potential issues with it.

    WARNING, there are reports of crash at boot, do a backup of your whole android directory before trying this!

    Don't run this if don't have adb and know how to use it.

    See post #2 for history and more information


    To keep the thread clean, please only report problems and try to avoid unnecessary talking about it.

    Don't report problem without logs, it won't help.

    This is highly experimental, don't use it if you don't know what you're doing.


    To install, just rename your previous wrapper and copy the attached libhtc_ril_wrapper.so to the same location.

    Here are the logs I need:
    Code:
    logcat -d -v time -b radio > /sdcard/pppd_radiolog.txt
    logcat -d -v time -s pppd:v > /sdcard/pppd_mainlog.txt
    dmesg > /sdcard/pppd_dmesg.txt
    /bin/ifconfig > /sdcard/pppd_if.txt
    ps > /sdcard/pppd_ps.txt

    Please review pppd_radiolog.txt before posting, it could show some personal stuff like phone numbers, feel free to remove these lines or refrain to post them

    Wait 20 seconds to let the wrapper relaunch pppd and check connection again. If it doesn't work, please send the logs.

    Grab the three files from sdcard root and post them back here.

    I'm also experimenting some kernel tuning that can be activated with this:
    Code:
    echo 8 8 > /proc/sys/vm/lowmem_reserve_ratio
    echo 8192 > /proc/sys/vm/min_free_kbytes

    Nothing conclusive yet, but it seems to help.

    Thanks to Hastarin, I also attached his root package that includes wrapper with ppp options and tweaks.

    Thanks,

    LeTama
    2
    Sorry, I know this is an advanced thread, but I would really appreciate if you could tell me (and others) how to make those changes so I can also have a stable data connection. Are you using ADB? What do you type and where?

    - Take the kernel_memory.sh file inside the attached archive, and copy to gscript directory of your sdcard. You may need to create the directory first.

    - Start Android and install gscript app from the Market.

    - Start gscript app, click Menu button and select Add Script. Pick kernel_memory.sh.

    - Select the script to run it. That's it.

    Each time you start Android, run gscript app and run the script as soon as possible before you do anything else.
    1
    Solved?

    No activity on this thread in a week!

    Perhaps this is finally as good as it's going to get?

    Can I presume things are stable for everyone using the latest kernels and the various wrappers/scripts?


    I think mdeejay used LeTama's patch in his kernel, and I've used a simpler version (break if we see two failures) since my r8.5.3.


    Code:
    diff --git a/arch/arm/mach-msm/smd_tty.c b/arch/arm/mach-msm/smd_tty.c
    index 1d1802a..f994dd9 100644
    --- a/arch/arm/mach-msm/smd_tty.c
    +++ b/arch/arm/mach-msm/smd_tty.c
    @@ -47,6 +47,7 @@ static void smd_tty_work_func(struct work_struct *work)
     {
     	unsigned char *ptr;
     	int avail;
    +	int failcnt = 0;
     
     	struct smd_tty_info *info = container_of(work,
     						struct smd_tty_info,
    @@ -89,8 +90,13 @@ static void smd_tty_work_func(struct work_struct *work)
     			wake_lock_timeout(&info->wake_lock, HZ / 2);
     			tty->low_latency = 1;
     			tty_flip_buffer_push(tty);
    -		} else
    +		} else {
    +			failcnt++;
     			printk(KERN_ERR "smd_tty_work_func: tty_prepare_flip_string fail\n");
    +			if(failcnt > 2) {
    +				break;
    +			}
    +		}
     	}
     
     	mutex_unlock(&smd_tty_lock);
    1
    The patch I posted here has been in my kernel 8.5.3 and those since. Feedback has been minimal but positive.

    Noellenchris has been using it and hasn't crashed it that I've heard and I haven't either.

    At least combined with the wrapper, pppd options, and kernel memory tweaks it seems quite stable and fast.

    Sent from my HTC HD2

    OK. Then I'll push your patch with a comment about the 8K limit that could be added if it's not enough.

    Thanks,

    LeTama
    1