yashsingh1/xdaforums huggingface dataset:
[HD2 Android Q&A, Help & Troubleshooting and Genera] Metastable:
Posting some logs with my data going absolutely nuts. It would how the up arrow stuck in with the H and would then drop to 3g with arrow still stuck. The connection would then reset, no longer any data, but would come back and still be stuck with up arrow. I believe I was using MDJs latest but I could be wrong because I switch to Hastarins 8.6 then back in hopes of remedying the situation. Anyways, logs attached.
[HD2 Android Q&A, Help & Troubleshooting and Genera] chn110:
For MDJ kernels you still need to set the following. I always set them even with Hastarin kernels.

echo 8 8 > /proc/sys/vm/lowmem_reserve_ratio

echo 8192 > /proc/sys/vm/min_free_kbytes
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Hi Metastable,

Your logs shows out of memory problem. I don't know what MDJ does regarding it, but you could try Hastarin's kernel to see if it improves things. And chn110 is right, you should also try the memory settings he mentionned.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] Metastable:
This seems to have greatly improved performance and reliability so far but I'll give it a longer run and report back. Thank you for the tip and quick response.

I've applied the settings and they are working great so far. I guess MDJ doesn't set this as a default. Thank you for the quick response.
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
Sounds reasonable to me. Thanks.
[HD2 Android Q&A, Help & Troubleshooting and Genera] KevlarTheGreat:
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?

FYI: I checked the date on the libhtc_ril_wrapper.so and it appears that MDJ is using the latest v0.7 ril_wrapper. I just need to make those memory tweaks.

Thanks
[HD2 Android Q&A, Help & Troubleshooting and Genera] chn110:
- 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.
[HD2 Android Q&A, Help & Troubleshooting and Genera] memin1857:
For stable PPP data connection

Try editing build.prop in /system with Root Explorer like this:

ro.ril.hsdpa.category = 4

ro.ril.hsupa.category = 5

ro.ril.hsxpa = 1

and restart.

This effectively limits bandwith to 1.8mbit/384kbit (Download/Upload) and it disables hsUpa support.

Normally it is 7.2/2.0mbit/s (D/U)

Actually even with 7.2/2.0 mbit/s bandwidth, many networks still manage between 1-2mbit's in reality so this workaround does not slow down the connection at all.

But it DEFINITELY makes it much more stable. (Well it is better to have a rock solid connection than a slightly faster but flaky connection)

If you want in between values you can try:

ro.ril.hsdpa.category = 6

ro.ril.hsupa.category = 3

ro.ril.hsxpa = 2

This will give you 3.6/1.46 (D/U)

v0.7 ril wrapper with a new kernel that includes the 2K patch (such as mdeejay 8.0) is recommended.

Note: Defaults are like this:

ro.ril.hsdpa.category = 8

ro.ril.hsupa.category = 5

ro.ril.hsxpa = 2
[HD2 Android Q&A, Help & Troubleshooting and Genera] aussiebum:
Heh, I put up a detailed post about these settings and how to update them back in late October (http://xdaforums.com/showpost.php?p=8885538&postcount=22), but I guess it's good to remind people that fiddling with these properties do help increase stability :)
[HD2 Android Q&A, Help & Troubleshooting and Genera] northern247:
Just want to say that this wrapper has been an amazing improvement, not only has it directly improved data reliability but it has evolved all recently updated kernels and builds. Hats off to letama for all the hard work :)

Sent from my HD2 using MDJ Gingerbread :)
[HD2 Android Q&A, Help & Troubleshooting and Genera] tampaboy1984:
Can someone please help me to apply this lib wrapper, I havent had to do this before and need guidance and im desparate to fix my data drops and inconsistency. Thank You in andvance.
[HD2 Android Q&A, Help & Troubleshooting and Genera] Unconn:
These are the logs requested, but this is BEFORE using any wrapper. This is an example of a PPP lockup occurring while using cLK. No RIL wrapper has been applied by me at this point (not sure if your scripts are compatible with CM7.)

bootloader: cLK 1.3.1

radio: 15.42.50.11U_2.15.50.14

kernel: 2.6.32.15-gb8d5b80-dirty cedesmith@phonix #2

Mod: CyanogenMod-7-03072011-NIGHTLY-Desire[Typhoon_v2.5.4]
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Unconn,

Your logs shows that:

- You have a wrapper running, it's a recent one, at least 0.4. I can't say for sure, I need logcat -b radio -d just after boot to see the version number.

- Your logs don't show memory problem, that's good.

- Your logs don't show any pppd message, we may need to increase debug level to understand your particular problem.

- If you took the log after network failure, the logs shows that pppd didn't die. So changing wrapper won't help for that, you don't fall into a ril_wrapper problem.

I suggest trying the options that helped other guys few posts back (network class, and forgot some...). And doing more debug, I would need for instance more details to correlate logs and timing and disconnection.

One thing you can try also when it happens, do a "killall pppd" in terminal when the disconnect happens and let me know if the connection goes back when signal is better.
[HD2 Android Q&A, Help & Troubleshooting and Genera] 2000impreza:
FYI- The rom(Typhoon_v2.5.4) unconn is using has v0.7 ril wrapper. Tyween confirmed this in another thread.
[HD2 Android Q&A, Help & Troubleshooting and Genera] 2000impreza:
ppp drop

Hi Letama,

I managed to log a ppp data drop. The logs appear to be similar Unconn. Doesn't show memory problems. Also ran "killall pppd" and the data connection recovered instantly.

Log: logcat -d -v time -b radio > /sdcard/pppd_radiolog.txt

File: "logcat_time_radio.txt" in zip file

Log: logcat -d -v time -s pppd:v > /sdcard/pppd_mainlog.txt

File: "logcat_time_pppd.txt" in zip file. Nothing was logged.

Log: dmesg > /sdcard/pppd_dmesg.txt

File: "dmesg.txt" in zip file

The other logs came up completely empty so didn't bother attaching it.

As a work around I added "killall pppd" as a script under gscript to reset the data connection when it hangs.
[HD2 Android Q&A, Help & Troubleshooting and Genera] M..N:
I've been thinking maybe something could be implemented in the ppp wrapper, so that if the connection gets stuck/ it disconnects it automatically detects this kills it and resets it.

Just a thought.
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Hi M..N,

Well, android does that natively, it checks connection and disconnect it if it's in failed state. The mechanism used could not behave well with ppp, but as I don't have this problem of pppd stuck, it's a bit difficult to troubleshoot. It could have changed too depending on android version, I didn't check it recently.
[HD2 Android Q&A, Help & Troubleshooting and Genera] M..N:
Okay thanks for the reply, I'm having a few disconnects / sticks but I feel there is still room for improvement as many others also have more extreme problems
[HD2 Android Q&A, Help & Troubleshooting and Genera] DimICE:
My ppp connection always stuck after a making call in 2G network. As workaround helps "killall pppd" after each call.
[HD2 Android Q&A, Help & Troubleshooting and Genera] M..N:
Well it would be good if that could be somehow done automatically
[HD2 Android Q&A, Help & Troubleshooting and Genera] Unconn:
Let me know how and I will do this.

It may not be a ril or ril_wrapper problem, but it seems a good 50% of people on PPP have this issue of losing signal (basement, lift/elevator) and it not reconnecting without killing pppd.

I have lowered some of the network class settings and this does seem to make data transfer smoother, but does not help with disconnections so far. I will continue to play, but I imagine I will not find some magic pill here missed by someone else.

Yes, this works, but i have to do it every time I get a mobile data connection time-out.

I have attached a new log set. The disconnection happened at 1101AM (EST or -5 UMT/GMT) approximately.
[HD2 Android Q&A, Help & Troubleshooting and Genera] jzibit17:
Wow, That's amazing that you guys are working on solving this issue. Exactly as its described. This has been happening with the americandroid for sd for a multiple of rom releases. It only happens when it loses signal while browsing mostly, sometimes after losing signal and trying to use the browser after you get signal it doesn't reconnect. Ill read about providing logs to help out. Thanks again
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Hi Unconn,

I need to dig into ppp options, long time since I didn't touch them.

Thanks for the logs, I think I know where the problem is:

and it explains why some have best results with v0.6 or lower.

Here, Android asks ril if the data call is still established.

In previous version, I let the call go to original ril and as it checks rmnet, it was always replying that the call has dropped. In most cases, the data call is fine, and therefore it causes an undesired disconnection.

So, in 0.7, I trap the request and reply that the call is fine, but I don't effectively check it (hence the "fake reply"). In your case, the call is not and we should reply that to Android, Android would drop the connection and redial the data call. It should fix the problem as it's equivalent to killall pppd.

Unfortunately, this is not easy to do as wrapper is sharing the modem with ril. I don't have enough time to work on that currently, but if someone wants to take over, I can try to help.
[HD2 Android Q&A, Help & Troubleshooting and Genera] warrenb213:
Kinda interesting but believe it or not Copenhagen and I have pondered this scenario and I've been thinking about what to do about it. I've actually been half tempted to program in a ping when connection claims to be established, if ping fails 5 times then clean up data connection(restart).

Since porting the cm .38 kernel has kinda left me feeling unsuccessful, perhaps ill pick up on this letama.

Sent from my HTC HD2 AmeriCanAndroid

Cofounder of AmeriCanAndroid :)
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
It would be great if someone can take over. Ping is bad, it would consume unnecessary bandwidth and battery if done too frequently. Too slowly, connection won't reset quickly.

It also duplicates what's already coded in Android. If I remember well, Android has stalled connection detection logic that checks outgoing packet, queries modem, reset connection and sometime pings to verify.

If you want to go further, here is I would do:

- Take a look at hardware/ril/reference-ril/reference-ril.c, this is generic ril that has source code for the DATA_CALL_LIST call (requestOrSendDataCallList function). Basically, it does a AT+CGACT? and AT+CGDCONT? to get the list of established calls and build the response. It should do what we need.

- You should be able to reproduce this logic and send these commands, unfortunately you won't have the ability to parse the response directly. With a little luck, you would get unsollicited notification that you could trap to get the response.

- If you don't have luck, the solution would be to do something that I wanted to do for a long time: establish a pseudo-pipe that would let you gain access to modem answers. There is some code around that shows how to spy a tty that works for smd device, I can give you pointers if you need it.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] DimICE:
How to compile libhtc_ril_wrapper ?
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
You need Android source code with build environment (aosp or cm7), then use it to build the library. cm7 has hd2 as a build target, however they removed lib wrapper and added something different, you'd have to add it back.

Source code is there:

https://gitorious.org/htc-hd2-android-libraries/libhtc_ril_wrapper
[HD2 Android Q&A, Help & Troubleshooting and Genera] cedesmith:
AT+CGACT? was my thought too, but i didn't know we can't read the modem answer.

spending some quality time with ppp is my 2nd on the list to do
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Yes, we can't read smd without stealing potential incoming message that should be processed by ril, and I think we'd probably need kernel patch to allow two readers on same tty. That's why I wanted to implement a smd pipe to intercept tty for wrapper while letting ril having normal read.

Another solution would be to rewrite our own ril, but it's a bit difficult to be as efficient as htc ones.
[HD2 Android Q&A, Help & Troubleshooting and Genera] Unconn:
I am only a hobby dev, but let me know if you need anything as a tester. I can repeat this 'failure to reconnect' at will.
[HD2 Android Q&A, Help & Troubleshooting and Genera] Unconn:
Someone mentioned (in the Typhoon thread?) that this might be a new problem with Gingerbread. So, I thought I would restore my old 2.2 CM6 ROM. It restored ok and I installed a cLK compatible kernel and booted up. I go no PPP disconnections. I am still testing, but the one I am currently testing is HDONE 1.2 but CMN 1.2 also seemed fine.

As a side note on CMN I could not get root, so I went to HDONE and I now have root, but Wifi never scans successfully. It is too quick and never finds anything.

I will report back with more testing tomorrow (my time).

-Unconnected

[EDIT]I have confirmed this. I have loaded up HD2ONE and a couple different cLK compatible kernels and have been using it for almost a day now. I have gone to the basement, watched it disconnect. I came back up the stairs and it reconnected just fine. So what is the difference between 2.2 and 2.3 that causes PPP to fail reconnecting. Is it possible that the ril-wrapper is actually not even working on 2.3?

I guess Wifi might have to do with the kernel configuration scripts (intrid?) but I am not sure.
[HD2 Android Q&A, Help & Troubleshooting and Genera] M..N:
Sounds good, would like to see the problems nailed in the head.
[HD2 Android Q&A, Help & Troubleshooting and Genera] boonbing:
I confirmed that this is an issue on Gingerbread 2.3... I tried to highlight this through to the ROM chef but did not get any response.

We really need the team from this thread to restart this investigation. I volunteer to help if necessary.
[HD2 Android Q&A, Help & Troubleshooting and Genera] M..N:
Well I have been testing what has been stated above and I can confirm that there a no problems on froyo so it seems this is an issue of 2.3
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Ok, this is interesting, it explains why we didn't have that problem until now... It seems that gingerbread pppd is more resilient than froyo one or doesn't detect ppp termination properly.

What I'd suggest to try is: get pppd executable from froyo and overwrite gingerbread one with it (don't forget to chmod suid). If it doesn't help, then the change is in the interface handling and would require work on wrapper side.
[HD2 Android Q&A, Help & Troubleshooting and Genera] neo.25:
thx we will wait u ;)
[HD2 Android Q&A, Help & Troubleshooting and Genera] Cass67:
so it seems the lack of extra commands for magldr is having an effect here .. to all reading this who have minimal clue .. dont remove this string unless you know your init.rc or initrd has no yaffs mount options ..
[HD2 Android Q&A, Help & Troubleshooting and Genera] imphoking:
thanks for the nand_boot=0 i get the boot perfectly. now question is after i reboot i dont have signal any more of any sort. im using evosense 2.2 with harstain r7 and in mobile network it says no sim found.
[HD2 Android Q&A, Help & Troubleshooting and Genera] boonbing:
Hi. This is my first observation in day-1 testing:

1) Got first data disconnect and it lasted more than a minute. When the data comes back on (ie. 3G logo comes reappears), it did not automatically reconnect (had waited more than a minute). Had to toggle flight mode to get it up again.

2) On 2nd data disconnect that lasted no more than 10 secs, it did automatically reconnect and I was back online.

I did not experience any crash during first boot after installation. Is there a time limit or max tries setting within the file to get data reconnection?
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Well, it tries few times quickly to re-establish connection, meaning that it should take from 5 to 10 seconds after drop. If it fails a few times, it will retry more slowly until it connects.

I'm interested in logs for your first disconnect. If you face the problem again and are able to log, I'll take a look.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] boldman78:
logs

hi,

first of all, thanks for your efforts.

second here are my files, hope it helps.

i am using htcclays 1.4, radio is 2.12.50
[HD2 Android Q&A, Help & Troubleshooting and Genera] Cass67:
All these logs are similar ... for your radio log you should use

logcat -b radio

for dmesg you need to type in a terminal

dmesg

and you seem to have just using logcat ok

refer to post 1 for the exact commands you need to do in order for them to be usefull
[HD2 Android Q&A, Help & Troubleshooting and Genera] boonbing:
i suspect my first disconnect is due to total service disconnect (ie no GSM network as well) rather than data disconnect only. Managed to duplicate the problem... see attached log file, hope it helps.
[HD2 Android Q&A, Help & Troubleshooting and Genera] tyween:
Thanks a lot.. no more hang on boot for me :). Will report logs if I get any crashes.
[HD2 Android Q&A, Help & Troubleshooting and Genera] nipuna:
Even with nand_boot=0 it won't boot for me... ;(

But before rebooting it worked pretty well...
[HD2 Android Q&A, Help & Troubleshooting and Genera] bokechukwu1:
Yeah it wouldn't boot for me either and I already had the nand boot line in my start up txt luckily I made a back up of my system file so didn't have to start from scratch hopefully this can get resolved because I want to try this out
[HD2 Android Q&A, Help & Troubleshooting and Genera] LondonTownGuy:
There is a "setcmdline wifi...etc" in kernels for fixing wifi such as Hastarin if you remove that line and leave "nand_boot=0" and "boot" it should boot. Again make a backup.
[HD2 Android Q&A, Help & Troubleshooting and Genera] MartyLK:
Installed this wrapper 2 days ago on BlueTopia w/Hastarin v7.5Alt and still going without a single data freeze. By the way, the boot string is just this: ""
[HD2 Android Q&A, Help & Troubleshooting and Genera] decumano16:
Installed the wrapper on a mdeejay froyo sense 3.1 where data was constantly dropping and now it doesn't :)

Seems to work quite well!
[HD2 Android Q&A, Help & Troubleshooting and Genera] Jwatt0918:
startup

Can someone please upload or post there an example noob friendly :) startup txt to help?
[HD2 Android Q&A, Help & Troubleshooting and Genera] jose makalolot:
anyone having problems copying this to the target folder?
[HD2 Android Q&A, Help & Troubleshooting and Genera] MartyLK:
This: set cmdline "nand_boot=0"

or

This: set cmdline ""

Works for me.
[HD2 Android Q&A, Help & Troubleshooting and Genera] mumbo_jumbo:
am i the only one?

in the last 3 days every time i try a new rom, update rom fresh install a free txt message fr tmo asking " we see your internet connection cannot be connect" you will recieve a confirmation code please enter your code in order to setup your data connection correctly, i did that and all apn set correctly and there was no data drop nomatter which rom i use, seem very strange to me, any one experience the same?
[HD2 Android Q&A, Help & Troubleshooting and Genera] northern247:
right, testing this now, will come back with results tomorrow evening as don't get 3G/H here at home.

For the sake of giving potentially useful info...

running shubs2.0

chuckydroid

radio 2.12.50.02_2

hastarin R8

amended start up text to include set cmdline "nand_boot=0"

wish me luck :p
[HD2 Android Q&A, Help & Troubleshooting and Genera] aussiebum:
Booted fine with new wrapper, see my sig for current setup. Have nand_boot=0 in startup.

Wonder if people are failing to boot up because of incorrect file permissions after copying the file into /system/lib?

EDIT: Oh, too early to know whether wrapper was an improvement or not. Will probably know by eod... I usually have at least one dropout per day anyways.
[HD2 Android Q&A, Help & Troubleshooting and Genera] M..N:
Could you please elaborate on how to overwrite
[HD2 Android Q&A, Help & Troubleshooting and Genera] 2000impreza:
Can anyone confirm if this is this the correct file to replace for ppp executable?

/system/bin/pppd
[HD2 Android Q&A, Help & Troubleshooting and Genera] seadersn:
yes, it is.
[HD2 Android Q&A, Help & Troubleshooting and Genera] karendar:
Can someone supply the old CM6 pppd here? I'll test it on my rig, because I get alot of ppp disconnects.

Thanks!
[HD2 Android Q&A, Help & Troubleshooting and Genera] karendar:
Usually through the adb command (adb push pppd /system/bin/pppd) and then adb shell chmod 755 /system/bin/pppd to set the proper permissions on the file. This is a very rough method, so anyone correct me if needed. ;)
[HD2 Android Q&A, Help & Troubleshooting and Genera] seadersn:
here it is (see attached file).
[HD2 Android Q&A, Help & Troubleshooting and Genera] Unconn:
Not sure if I am supposed to do this but here you are. [EDIT Bah, I was beat to it. Attachment removed]

I have replaced the file and set the permissions and was able to restart ppp, and then later restart phone with no problem. I have not been able to test cell provider disconnect and reconnect yet.
[HD2 Android Q&A, Help & Troubleshooting and Genera] seadersn:
so it's working with cm7? nice, will push it too now.
[HD2 Android Q&A, Help & Troubleshooting and Genera] Unconn:
Another method is to extract it to your SD card and then just mv, cp, and chmod after you have remounted your SD card. That is what I did. I was made a copy of my current pppd this way.
[HD2 Android Q&A, Help & Troubleshooting and Genera] Unconn:
Working, yes. Fixed? Won't really know until I go under ground or into a metal box. LOL.
[HD2 Android Q&A, Help & Troubleshooting and Genera] 2000impreza:
CM6 pppd

Edit2: After testing the system/bin/pppd from cm 6.1.1, I don't recommend this change to anyone except for testing only. While the data disconnect issue is less, I found the overall stability of the rom decreased.

Edit: Didn't realize it was post already on the previous page.

The attached cwm zip has system/bin/pppd from the official cm6 6.1.1. Not sure if the permissions is correct, may want to double check.
[HD2 Android Q&A, Help & Troubleshooting and Genera] seadersn:
permissions are 4755.
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Correct, you need suid flag to have pppd working, so from adb it's:

adb shell chmod 4755 /system/bin/pppd
[HD2 Android Q&A, Help & Troubleshooting and Genera] karendar:
Thanks for the file, guys. I'll be taking the subway (Which is a sure test for the pppd issues) later today, will post my results.
[HD2 Android Q&A, Help & Troubleshooting and Genera] M..N:
Great good luck
[HD2 Android Q&A, Help & Troubleshooting and Genera] karendar:
Just tested pppd while in the subway, went in subway, lost conection.

Came out of subway, connection tried to re-establish itself but failed (No data going through) so it seems "better", but still not a fix.

I'll install alogcat for the ride back and test again to see what's happening before I go in the subway and what happens when I come out of the subway...