yashsingh1/xdaforums huggingface dataset:
[HD2 Android Q&A, Help & Troubleshooting and Genera] cedesmith:
using below options.smd

passive
noipdefault
defaultroute
usepeerdns
novj

works without dns settings in build.prop with the following ip-up

#!/system/xbin/sh
#author: cedesmith
#notes:
# this requires busybox because sh does not have test command
# if you don't have busybox installled in your build consider removind "[ -n "$DNS1" ] &&" and "[ -n "$DNS2" ] &&"
# but internet may not work if dns are not provided by pppd as build.prop dns setings are overwriten

#set proper PATH
PATH=/sbin:/system/sbin:/system/bin:/system/xbin

[ -n "$DNS1" ] && setprop net.dns1 $DNS1
[ -n "$DNS2" ] && setprop net.dns2 $DNS2

please note that ip-up must have 0755 permissions and that busybox installed on the build is required.

i spent many hours trying to figure why a simple [ -n "$DNS1" ] does not work only to figure path is not set right by pppd and desire hd's sh lack test command
[HD2 Android Q&A, Help & Troubleshooting and Genera] noellenchris:
LeTama & Hastarin, well I gave Hastarin's 8.5.1 kernel and all the options a go and all seemed well until today about 2 1/2 days and I guess it crashed, got the stuck data and cpu to 100% and had to reboot. attached is the logs.
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
Thanks. It's the same as the last crash you had with my kernel. :(

So you're still managing to completely run out of kernel (low) memory somehow. There must be a memory leak somewhere. The only way to correctly debug this would involve steps that I'm afraid are beyond me for debugging remotely and since I don't get it locally I can't reliably debug it here either.

I'm still unsure why things are crashing instead of just returning a NULL/0. :S

My best guess is something is leaking kernel memory (ie allocating and not freeing it), but debugging what would be the hard part.

If you're interested please PM me and I'll see about creating a version similar to LeTama's 2k patched kernel for you to test to see if that avoids the problem.
[HD2 Android Q&A, Help & Troubleshooting and Genera] tyween:
I had the same thing happen to me yesterday. My logs look just like yours so there is no need for me to upload them. You are not alone my friend! It happened to me when I was streaming last.fm.
[HD2 Android Q&A, Help & Troubleshooting and Genera] ATomCZ:
I have another 100% CPU problem, but maybe not related to RIL

I have mobile on the charger over night and morning system proces use 100% of CPU and in logcat is only this again and again>

E/ActivityManager( 236): java.util.NoSuchElementException
E/ActivityManager( 236): at java.util.StringTokenizer.nextToken(StringTokenizer.java:272)
E/ActivityManager( 236): at com.android.server.ProcessStats.getCpuSpeedTimes(ProcessStats.java:596)
E/ActivityManager( 236): at com.android.server.ProcessStats.getLastCpuSpeedTimes(ProcessStats.java:568)
E/ActivityManager( 236): at com.android.server.am.ActivityManagerService.updateCpuStatsNow(ActivityManagerService.java:1616)
E/ActivityManager( 236): at com.android.server.am.ActivityManagerService$4.run(ActivityManagerService.java:1542)
E/ActivityManager( 236): Unexpected exception collecting process stats

I have also full bug report log.

It happen already twice time.

I have now MDJ s7.1 kernel, now I get try back hastarin 8.5.1
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Hello Noellenchris and Hastarin,

In fact, Noellenchris has plenty of low (84M) and high memory (53M), what is depleted is the lowmem_reserve (0, 0, 0):

<4>[113729.258636] lowmem_reserve[]: 0 0 0

<4>[113729.258636] Normal: 7782*4kB 4468*8kB 1032*16kB 22*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 84088kB

<4>[113729.258697] HighMem: 269*4kB 5000*8kB 773*16kB 6*32kB 0*64kB 1*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 53764kB

I don't know if we could dump allocation in the lowmem_reserve, but it would be interesting to understand what happens there.

Well, in fact, it effectively returns NULL/0. It doesn't crash, the issue is that it stays forever in the for loop because avail = smd_read_avail(info->ch) will never be 0 until everything is read from modem and pushed to tty.

If you want to avoid that, you have to add a test on avail after tty_prepare_flip_string and break the for loop if avail == 0.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Hi AtomCZ,

Effectively, this doesn't seem to be related to ril/ppp/wrapper. However, I'd be interested in dmesg log and also the result of top -m 5 -n 1.

Thanks,

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
I'd seen this one several weeks ago. It's one of the reasons I originally switched to not overclocking to see if it went away, and it did. I've since started overclocking again (though only to 1113MHz) and haven't seen it lately and I've had uptime of over 5 days recently.

When it happens I'd noticed running SetCPU would sometimes correct it temporarily, but you'd eventually have to restart.

The process that shows up in top is system_server and it only happens after a day or two.

The SLUB allocator lets you debug all sorts, but I don't know enough to use it atm.

I thought the page allocation failure was causing a crash/dump. Is the dump just being triggered by the loop?

Yeah thanks, I'll modify my patch to be a variation between it and your 2k patch when I get the time to hopefully avoid this issue.

noellenchris will be the perfect test candidate too. :)

Hopefully I'll get time on the weekend to throw it together.
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Yes... We're using slab, not slub, but I think it also have some debugging..

Well, the dump is only information triggered by kmalloc because of the memory allocation failure. It doesn't crash, and the for loop make it retry immediately, resulting in cpu up to the roof.

I'm running with a variant of my patch at 8000, it has the advantage of not triggering the limit so often and probably doesn't impact performances as much. Or you could just add the break to avoid the infinite loop and see if memory is freed elsewhere.

I agree! ;)

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] noellenchris:
Ready to pop another kernel whenever your ready..:P Thanks guys for the cooperation to tweak the HD2 kernel even more. Your expertise has turned our wm phones into a new device and it's work like this, that has had me addicted to xda and technology for years. You keep my life interesting ....at least for nerds...hehe

on the other hand, my wife hates everyone of the devs and xda. I've been told that xda is first hand responsible for thousands of break ups and divorces..:P

Chow,

Chris
[HD2 Android Q&A, Help & Troubleshooting and Genera] Datfoooo:
So has the ppp dis connect been resolved? or is it still on the testing faze?
[HD2 Android Q&A, Help & Troubleshooting and Genera] noellenchris:
It's very close, with the 2k limit added to kernel and .7 wrapper, I can't get it to fail. Hastarin is going to make another kernel with these latest tweaks and without all the test stuff in the kernel this weekend. Hopefully that will make the kernel very tight and ppp should be sweet and stable. Plus of course aussiebum's options which seem to dramatically reduce the disconnection. the 2k limit and elimination of the loop issue will fix the loop problem which would cause the cpu to ping to 100% and require a reboot. then the sky is the limit!

Soon

Chris
[HD2 Android Q&A, Help & Troubleshooting and Genera] ATomCZ:
Here is full report made with 'adb bugreport' I don't know if contain also dmesg.
[HD2 Android Q&A, Help & Troubleshooting and Genera] ReX83:
Download speed with ppp (wrapper 0.7, hastarin's 8.5.1, aussiebum's options, mdj's froyo HD build) is very BAD for me: it's always slower than upload. Rarely I get more than 60kb/sec and usually the speed is around 10-20kb/sec even if in WM I get always more than 140kb/sec in the same are (HSDPA).

Now the disconnection problem is solved for me but the speed was much better with the first relaseas of evo kernel. Maybe the latest kernels (since september, I don't remember "the switching point") have introduced some bugs in memory allocation (buddy allocator?).
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Hi ATomCZ,

adb bugreport is very complete, it does have everything... I don't see the problem you described previously in it, did you do it while it was happening ?

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] alik713:
I'm so friggin' glad I ran across this post!

My setup.

TMOUS, Evo Carbon Remix v0.3.2

Letama's rilwrapper v0.7

Data would get stuck on "H" up arrow. Usually, when trying to play Pandora.

Following the instructions in the above post, and, seeing that TMO can provide speeds up to 21up/5.7down

http://t-mobile-coverage.t-mobile.com/hspa-mobile-broadband?WT.z_unav=mst_coverage_speed

I upped the build.prop settings to

ro.ril.hsdpa.category = 14

ro.ril.hsupa.category = 6

from the default 8 & 5.

No data drops, period! No data getting stuck! Yay!

Now, the Evo Carbon by motoman234 is truly all-you-can-use-all-day build!
[HD2 Android Q&A, Help & Troubleshooting and Genera] ATomCZ:
Yes, there is string "java.util.NoSuchElementException" in my bug report.

But I will try to make dmesg log if it happen again.

UPDATE: added DMESG log!
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
I posted a Beta kernel here:

http://xdaforums.com/showpost.php?p=9576379&postcount=3225

I've done a different patch to smd_tty. LeTama I'd love your feedback on if I'm being silly and should just break the loop or if you think what I'm trying (setting low latency 0 so the request goes in a work queue) might work?
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Honestly, I'm not sure. I don't think it makes a difference because you don't have anything to push as you don't have flip buffer. So, it doesn't hurt, but it doesn't help either. However, as I don't understand in original code why they do a low_latency/tty_flip_buffer_push when avail==0, it may do something else. So, yes, worth a test...

However, in final patch, I would limit avail to a little less to 32K as tty_prepare_fill_string() will always fail above and we never get a chance to go back to normal situation if pending data is above that.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
If I'm understanding correctly, and my brain is currently fried from working on the new battery driver and extended battery...

Asking for a larger avail shouldn't matter as it will just return what it can find and go with that.

It will only fail (and trigger the printk and break) if it can't get any buffer at all.
[HD2 Android Q&A, Help & Troubleshooting and Genera] dds517:
Edge on PPP really slow?

Has anyone noticed that edge is super slow on ppp? I switched between rmnet and ppp roms in the same locations and notice that the edge on ppp is always very slow at like 5kb/s while on the rmnet I get up to 20kb/s.
[HD2 Android Q&A, Help & Troubleshooting and Genera] Easemypain:
Hey I wan't help to improve the dataconnection. I switched to a ppp build and installed logcat. But I never played with filters and alogcat. Can I preconfigure the filter and switch between the different filters? I set up the first from the first page but if I add the second the first is gone.
[HD2 Android Q&A, Help & Troubleshooting and Genera] cedesmith:
back with some improvements:

options.smd :

i added ipcp-max-failure 15 to get rid of bad dns servers received sometimes (10.11.12.13 and 10.11.12.14).

it seams that without it ppd quits retrying after 3 attempts and we left with dummy dns servers

now my options.smd is like this:

passive
defaultroute
usepeerdns
novj
ipcp-max-failure 15

ip-up:

i updated the ip-up script i posted last time to use google public dns if pppd does not send dns servers or send dummy dns.

also don't set net.dnsX if wifi is on and android dns is wifi dns (android turns off mobile data anyway but does not hurt to check)

my script is as follows:

#!/system/xbin/sh
#author: cedesmith
#notes:
# this requires busybox because sh does not have test command

#set proper PATH
PATH=/sbin:/system/sbin:/system/bin:/system/xbin

#if empty or bogous dns received put google public dns
[ -z "$DNS1" -o "$DNS1" == "10.11.12.13" ] && DNS1="8.8.8.8"
[ -z "$DNS2" -o "$DNS2" == "10.11.12.14" ] && DNS1="8.8.4.4"

#set ppp dns properties in case wifi disconnects
setprop net.ppp0.dns1 $DNS1
setprop net.ppp0.dns2 $DNS2

#if empty system dns or diff from wifi dns
#ConnectivityManager is suposed to do this but it runs before we have dns servers
[ -z "`getprop net.dns1`" -o "`getprop net.dns1`" != "`getprop dhcp.eth0.dns1`" ] && setprop net.dns1 $DNS1
[ -z "`getprop net.dns2`" -o "`getprop net.dns2`" != "`getprop dhcp.eth0.dns2`" ] && setprop net.dns2 $DNS2

ip-down:

i added this to remove ppp0 dns because ConectivityManager will set left over dns next time we connect or if wifi disconnects and ppp is off

is something like this:

#!/system/xbin/sh
#author: cedesmith
#notes:
# this requires busybox because sh does not have test command

#set proper PATH
PATH=/sbin:/system/sbin:/system/bin:/system/xbin

#clear ppp0 dns servers or else ConectivityManager will use old ones next time we connect
setprop net.ppp0.dns1 ""
setprop net.ppp0.dns2 ""

/system/bin/pppd needs to have 4755/6755 ( setuid/setuid+setguid exe )

/etc/ppp/ip-up and /etc/ppp/ip-down 0755

/etc/ppp/options.smd can have any (read) but i use 0644

with these ril-wrapper is just perfect :) it uses provider dns server for quicker response time.

prev version worked for majority of ppl on my desire_hd2 build.

this should work for everyone even if provider does not send dns servers.

the attached zip contains the files above..

just one more thing...

many many thanks LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
Nice stuff.

I have 2 questions.

1. Is there a reason you don't have the noipdefault?

2. Shouldn't you still be creating and deleting the pid file? Perhaps it's not needed with the 0.7 wrapper?

I'm still hoping to check out your Desire HD build when I get time. :)
[HD2 Android Q&A, Help & Troubleshooting and Genera] jae-v:
Hey letema and hastrin, been doing some research on server issues and it seems all the builds have this problem. If you guys could open up speedtest.net app from market and see what server its connecting to maybe you can see what i'm talking about. No matter what build i try in the latest roms and almost all the old ones the server by default is somewhere in WA. i'm actually in dallas. I can see in my day to day browsing as well the latency just doesn't seem right. In bangsters 1.5 build however this problem doesn't exist. Detects the nearest server and works well. Which is the only build i've tested that doesn't do so.
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
I'm not sure what you're trying to say here.

Speedtest uses the location API to try and get a server near you to test speed against.

It's got nothing to do with kernels, rilwrappers, PPP options, or what server you're actually connected through when browsing, etc

If you're not getting a server near you but Google Maps is showing your location correctly then it's simply a bug in Speedtest.
[HD2 Android Q&A, Help & Troubleshooting and Genera] jae-v:
i see i see, just didn't understand why it would work on one build and not the others
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
Just a quick note. I thought I'd play with a new build (cedesmith's desire hd build) and have already managed to crash smd_tty (installing about 6 apps at once). :(

I didn't have the kernel tweaks applied so they are almost definitely of benefit!

I guess I'll try yet another patch, closer to LeTama's 2k patch and maybe leave those tweaks out for now to see what happens.
[HD2 Android Q&A, Help & Troubleshooting and Genera] cedesmith:
1. I was trying to receive a remote ip so i took it out and never put it back in. Is seams it doesn't make any difference anyway.

2. pid file is used only as a lock at disconnect. It is correct to have it but does not seam to make much difference.

Pid file would be more useful if ril wrapper would postpone request complete until ip and dns are in or rise a configuration change event so ConnectivityManager would set net.dns1 and net.dns2 and we don't have to force them.

.... but no biggie :)
[HD2 Android Q&A, Help & Troubleshooting and Genera] noellenchris:
well, you got it to loop pretty quick.:P The test kernel you made for me is still kicking, it's tough to test since you can't reboot, once you reboot it seems to clear the area that seems to get full or something. Thx and good luck w/the new build, my son's phone seems to work well with it for now.

Well, I'm out to test my new leaf blower, brrrr it's cold and windy too...about 28 degrees F.
[HD2 Android Q&A, Help & Troubleshooting and Genera] fi3ry_icy:
the newest mdeejay desire hd rom does not suffer from disconnect problems.. only problem i have had is lag due to desire hd rom..

http://xdaforums.com/showthread.php?t=859817&pp=50

maybe the pros would like to take a look at it and see how it goes from there..
[HD2 Android Q&A, Help & Troubleshooting and Genera] aussiebum:
Nice stuff - gonna give it a try over my old ppp tweaks:)
[HD2 Android Q&A, Help & Troubleshooting and Genera] ax0r:
Data drop was a big issue and stuck on up arrow. Installed new hastarin and Pushed new wrapper by letama and ppp tweak. Still a problem. Then I set the hsdpa settings to match tmous and dns settings as well on build. Prop and have not had a issue since. This is on tyuung nexus build
[HD2 Android Q&A, Help & Troubleshooting and Genera] dharvey4651:
What were the T-Mobile US HSDPA settings that you used? I didn't have any luck with this. The DNS settings I got working with no issue.
[HD2 Android Q&A, Help & Troubleshooting and Genera] MeatyCoins:
im somewhat familiar with ADB when i used my G1, but curious how would i go about pushing this patch onto my phone? im using mdj froyo sense v2.4
[HD2 Android Q&A, Help & Troubleshooting and Genera] ala380:
Wow, I've been a way for a few days. I see that there are some new ppp options to play around with as well as a new kernel from hastarin. Going to take some time today and test everything out. I am having slightly more stable data after switching over to TMOUS dns servers but that, obviously, doesn't solve the memory issue :)
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
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.

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);
[HD2 Android Q&A, Help & Troubleshooting and Genera] noellenchris:
Thanks Hastarin, you took the fun out of troubleshooting the smd loop and ppp issues. Now what will I do? I already fixed my slow wake ups and data corruption by using a "good" sd card and not the cheap class 10 POS.

LOL, well what's next...merry xmas...:)
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
hehe I think xmas is next. ;)

After that I have a list of issues to look at, or any of the devs to look at.

For me personally I'm looking forward to trying the Beta of the next version of WiFi Fixer in the hope it finally make my WiFi more stable.
[HD2 Android Q&A, Help & Troubleshooting and Genera] dinopall:
Hi, excuse me, but I have a problem with PPP and PAP authentication with user/passwd not NULL. The connection seems work but the phone only trasmit, the network doesn't reply. T have this problem in some build but if I test the connection on a native ANDROID phone (DESIRE) all is OK.

Another thing: if I force a wrong user/Passwd, the system seems not discovery that, the connection is up but only the phone transmit, the network no.

The same APN in the same phone with WM work.

Thanks in advance.

D.
[HD2 Android Q&A, Help & Troubleshooting and Genera] ReX83:
Hi Hastarin,

i think the problem is not solved, but now your and Letama solutions avoid the data disconnection / arrow stuck.

I've always bad download speeds: every time I get better upload than download and it's quite strange. In the same area I get more than double speeds in WM6. I've tried a lot of builds (and now I'm using the new Darkstone's one but before I tried Desire HD build from MDJ).

I think the memory allocation problem is still here and because of it the download speed is half than the normal speed.
[HD2 Android Q&A, Help & Troubleshooting and Genera] noellenchris:
Can u provide some logs when you suspect data to only be at half speed? I run speedtest a lot in areas where I know TMobile has enabled the hspda+ and I get speeds around 3.5-4.5mbs down. So I don't think it affects download, but who knows, maybe it could be better and maybe your logs will help. Thanks
[HD2 Android Q&A, Help & Troubleshooting and Genera] ReX83:
Ok, I'll log as soon as possible. I'm sure that it's an Android related problem: I bechmarked the download in different way (one of them is the speedtest app from the Market) and always I've around 60kb/sec download and 110kb/sec upload under HSDPA coverage (Wind operator - Italy).

Before switching to PPP, I could get 180kb/sec in download with RMNET Evo kernel.

Also now, in WM6, I can can get 180kb/sec.
[HD2 Android Q&A, Help & Troubleshooting and Genera] :
i have been getting dropped calls like crazy, so its time for a change.

so im guessing all the fixes are in sir hastrains new kernel?

edit: and sorry, theres no old cam version of kernel r8.6?
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Hey Guys,

Hastarin, I saw your comment on lighthouse and your patch, I prefer this patch to your previous one. Do you have feedback on it ?

I'm not decided yet on what we should push to git, your patch is good because it doesn't change radically existing behavior, mine is good because limiting to 8K is giving more chance to get memory.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
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
[HD2 Android Q&A, Help & Troubleshooting and Genera] chn110:
Being using hastarin's latest kernels. 3G is stable and fast.

Thanks.
[HD2 Android Q&A, Help & Troubleshooting and Genera] ala380:
Sorry I haven't given much feedback. I haven't had a lot of time to play around and report. I, too, am having great luck with the latest kernel and the combination of fixes above. So far I really can't complain because my data has never ever been as stable as it is now :) Thanks for all of the work that everyone has put in to this!!!
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
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