yashsingh1/xdaforums huggingface dataset:
[HD2 Android Q&A, Help & Troubleshooting and Genera] chn110:
I could not start 3G data with 0.6. I am using Android-Mdeejay_FroYo_Sense_v._2.5_NextSense-2101-11-07 build with the stock and the test kernels. There seems to be two separate issues here:

- pppd goes away from time to time, during bad signal conditions etc. This may be by design but is recoverable by toggling 3G off/on. Or the wrapper can restart pppd for user.

- pppd is running but data is stuck. This typically is not recoverable and requires a reboot. When it happens, I see kernel constantly dumping "smd_tty_work_func: tty_prepare_flip_string fail" message. This looks like drivers running out of buffers and because the kernel is repeatedly trying to get buffers and fails and logs the msgs, the phone gets very hot. And very occasionally, I see kernel log saying packet checksum error for packet from 8.8.8.8:53 (DNS), which suggest driver issues at ppp, because UMTS physical layer should checksum packets before they get delivered to the driver. When we get a corrupted packet, I will venture to guess that the ppp driver did not get a full buffer it needed and ended up deliver a half packet to the upper layer. It looks like we need to look into ppp deriver to make sure there are no buffer leaks that can result in this condition.

BTW, 'cat /proc/meminfo' showed a 36KB buffers, which seems unusually small to me. Also, anyone knows how to dump this count: tty->buf.memory_used from the kernel?
[HD2 Android Q&A, Help & Troubleshooting and Genera] ATomCZ:
I upload some dmesg logs. I hope that help you.

Problem with my data was solved. I changed rights to all /data/data folder and files to 777, make Titanium Backup and restore it to clean data.img and new build. Everything work again.
[HD2 Android Q&A, Help & Troubleshooting and Genera] chn110:
With the test kernel I got into this condition a lot more often. Does it have a smaller buffer size setting? Thanks.
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Thanks ATomCZ,

So, you did the same kind of activity with these logs ? Problem didn't show up at all. It means that my workarounds are not even used and that git head doesn't seem to have the smd_tty problem.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Ahh! please post dmesg here, I want to take a look.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Could you please send me the dmesg logs with the test kernel ?

It has special traces to show memory_used. And I chuck stuff if it goes above 32K as it's the limit for tty.

Thanks,

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] jan-willem3:
Letama how to make logs without adb. I want to use alogcat since data don't happen at home. But how can I set it so you only get pppd and dmesg
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Hey LondonTownGuy,

Thanks for your donation! Greatly appreciated!

So, the dummy is normal...

Cheers,

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
If you're courageous enough, you can type commands in terminal in developer tools, or run a script from gscript lite.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] noellenchris:
Letama, I had some sudden phone disconnections when talking to others the last 2 days. I tried to reproduce and get logs, but I only have a log from about 5 min after disconnect. I was just checking to be sure, but your script in the wrapper can't cause that will it? I mean if it detects no data (due to call) i was on Edge will it try to toggle the ril-daemon? Or anything like that? Thanks.

If you want the logs I will post, but if it happens again I will post them too. :)

So far the data connection has failed here and there and it recovers everytime at least for the last 4hrs. Thanks

Edit: here is the logs anyhow , maybe too late though
[HD2 Android Q&A, Help & Troubleshooting and Genera] chn110:
Please see the attached log. For some reason it didn't get stuck all these time. But I did see data paused a bit here and there and then resume. I am not using the wrapper. Thanks a lot.
[HD2 Android Q&A, Help & Troubleshooting and Genera] jan-willem3:
Ok prepared my gscripts tommorow I will post some logs.
[HD2 Android Q&A, Help & Troubleshooting and Genera] chn110:
Here is the log for a different scenario - Phone starts up no 3G, repeated toggling 3G does not bring data at all. pppd was running. Hope it helps.
[HD2 Android Q&A, Help & Troubleshooting and Genera] chn110:
Correction: Just noticed I wasn't running the test kernel at the time - it remember it flashed the led and has character console while booting rather than displaying the HTC logo.
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Hi noellenchris,

Well, it shouldn't interfere with voice, but who knows... However looking at your log, I see this:

11-17 12:14:48.186 D/RILJ ( 304): [0370]> LAST_CALL_FAIL_CAUSE

11-17 12:14:48.196 D/RILJ ( 304): [0370]< LAST_CALL_FAIL_CAUSE {65535}

11-17 12:14:48.196 D/GSM ( 304): [GSMConn] onDisconnect: cause=ERROR_UNSPECIFIED

with no activity from wrapper during the call. I presume random network or radio fluke here.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Thanks chn110, that's what I wanted to see...

Now I have to try to understand the meaning of memory dumps ... :)

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] chn110:
Here is the log for a good case for you comparison - Phone starts up with 3G immediately connected, no toggling needed.
[HD2 Android Q&A, Help & Troubleshooting and Genera] aussiebum:
I've noticed that the logcat for pppd (ie. the mainlog) actually never seems to stop itself, so I kill it manually when I want it to stop logging. The radiolog logcat always finishes dumping by themselves without me having to kill it, so that's why the mainlog goes on for longer than the radiologs. Maybe if the -d option wasn't used, might be able to get extended radiologs?

Yeah, my provider doesn't require us to have a username/password set to use data - I guess they somehow authenticate by phone number or something.

I'll keep in mind to start logging after connection comes up instead of as soon as it drops next time. In the meantime, just a set of logs from this morning - data connection seems to always timeout and drop overnight.

Thanks again

EDIT: I've been trying out a bunch of pppd options based on common settings used in normal linux distros for pppd and the following seems to have helped connection stability (ie. avoid dropouts) immensely:

noipdefault
defaultroute
usepeerdns -> I believe this particular setting helped the most. It queries your provider for dns servers, so no need to hardcode them anymore
novj

I've attached the modified options.smd with the above pppd options and a modified ip-up (optional - modified to generate resolv.conf which the usepeerdns option is supposed to generate according to the man page but doesn't - doesn't seem to matter much though) script for those who want to give it a try and can't be bothered editing their own files - just copy and paste the files into /etc/ppp/ and flick Airplane mode on/off to start using the new pppd options.

To make these settings permanent across reboots, place files in /system/etc/ppp/.

If the modified ip-up is used, also run the following command as root in /etc/ (and /system/etc/, if you want to make the changes permanent):

ln -s ppp/resolv.conf resolv.conf

From pppd option testing, it also appears that the "net.dns" settings in build.prop aren't actually used by pppd at all for establishing data connections, whether they're set or not in build.prop doesn't matter.
[HD2 Android Q&A, Help & Troubleshooting and Genera] xxljmzlxx:
I have a question regarding installation of the libhtc_ril_wrapper.so

I'm using mdj clean 2.3 and there is no original libhtc_ril_wrapper.so to rename... Do i simply drop the libhtc_ril_wrapper.so into the F:\Android\root\system\lib

Thanks!
[HD2 Android Q&A, Help & Troubleshooting and Genera] noellenchris:
Hey Letama,

ok, tonight I was using gmaps and in a known good data area, maps was working, but then connection stalled, no up/down arrows. Data wouldn't work.

Test Kernel & .6 wrapper

Had to reboot, tried data toggle and airplane with no luck
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Hi aussiebul,

Well, if you redirect output to a file, you are supposed to use the -d flag to quit at the end of the log. If you do not, logcat will stay up to keep display log and will have to be killed.

I took a look at your log, the only thing I see is the first failure after boot. I don't really want to fix it as it's much trouble for something that you should see only once and that is recovered.

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

A build without any wrapper is probably a rmnet build, rmnet doesnt' need wrapper.

It's quite complicated to change a build to run ppp. I suggest looking at the build thread to see if a procedure is there if you really want to go with ppp.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Hey Noellenchris,

Thanks for the logs, they're showing the kernel memory problem with smd_tty.

I have a theory about it: I think the problem is that smd_tty allocs memory with kalloc, which implies contiguous physical memory. After time, memory gets fragmented and such big chucks (32K) are not available and therefore the tty_swap fails even though free memory is still reasonable, 10M in your case:

Normal: 864*4kB 923*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 10840kB

If I read this correctly, we only have 4 and 8 KB blocks available.

I will try something: limit the tty buffer swap size to 2K that would result in 4K (tty doubles memory usage).

I think that smd_tty was never really designed to handle the high volume we are pushing with ppp and 3G. It's supposed to handle mostly modem commands and GPS that are far less demanding. That could explain why I don't see it with my phone, 3G is crappy around here.

We'll see if this kernel hack could help things.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] ATomCZ:
Interesting. I tested 0.6 version of RIL also with Hastarin 8.3 and it also work correctly, but there was many commit in GIT related to battery and cleanups. I also have different build of Android based on Evo. I will be testing in more intensively. Sometimes happen that Internet connection doesn't work but only for short time, it reconnect again.
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
Interesting theory! That would fit for the crash in pppd for compression too. I know nothing about it but I wonder if there is a way to trigger a de-fragmentation of the memory.

Some related links:

http://bit.ly/aP9IbH

Sounds like we need to figure out how to upgrade to 2.6.35

http://bit.ly/9UtYQp

Sent from my HTC HD2
[HD2 Android Q&A, Help & Troubleshooting and Genera] aussiebum:
I already have the -d flag for the pppd logcat... it just seems to keep logging for quite a lot longer than the radio logcat. Will leave it alone next time - maybe the longer logs might be useful.

That's interesting, because I got those logs after I unplugged my phone from the charger overnight - it hadn't been switched off or rebooted during that time. I guess several hours of idle ppp connection is similar to the conditions for first failure after boot?

Anyways, a few more logs from various dropouts using 0.6 wrapper. Tried to run one of the logs several minutes after the dropout as suggested.

pppd negotiation still seems to take a while to reconnect (noticed it only seems to happen around the house... guess reception is not great), and one time (which I didn't manage to log) the negotiation appeared to have completed, but when I checked resolv.conf, it had just assigned dummy ip addresses to the DNS server mappings, hence the data timeouts. pppd pulled in correct DNS server details after I did on/off Airplane mode.

Hope these are more useful

Thanks again
[HD2 Android Q&A, Help & Troubleshooting and Genera] LUIMI31:
letama.

I noticed that when I have good 3 G coverage I have many disconnections .

when I have bad no disconnections

have any sense?
[HD2 Android Q&A, Help & Troubleshooting and Genera] lanwin:
Again thanks for looking at it. I made some more investigations. There really must be something wrong with iptables and PPP.

I tough this dose not happens, but it dose. The data connection get lost after 10-15 seconds if i add this ipconfig rules and access any page in the browser.

iptables -P INPUT ACCEPT

iptables -P OUTPUT ACCEPT

iptables -P FORWARD ACCEPT

iptables -F

iptables -t nat -F

iptables -X

iptables -t nat -A OUTPUT -o ppp0 -p 6 ! -d 139.7.29.1 -j REDIRECT --to-port 1025

The u2nl program dose not needs to be run to get this effect. I also tried it with the latest kernel "[18.11.10] -=For MDJ's builds=- S6/S6.1". And again the same iptables rules work in rmnet (only the ppp0 is changed to rmnet0).

Dose someone know how to log iptables? Dose not find anything useful about that.
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
I think Markinus tried to upgrade to .35 (or was it .34?), but he faced some issues and couldn't boot it until now. We'll see.

Anyway, I hope we can workaround this problem.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Strange, it shouldn't.

Well, it could be, yes. Modem going to deep sleep and taking some time to wake up maybe.

Yes, I saw negociations that takes forever before kicking. From what I read recently, it means that the modem didn't really catch completely the gsm signal and is doing ping/pong until it does.

In your case, wrapper now behaves properly, except when Android does the pdp poll that kills the connection when it's probably not needed. The "hack" is in place, I just have to fix the .active value and we'll see how it behaves.

Do you see the same kind of problem in wince ? I suspect that the radio you have may not be the best one for your network.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Without logs, difficult to say, but it could make sense regarding smd_tty problems with memory. Having good 3G will push more data to it and therefore expose the problem quickly.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
I don't know if it works the same with android iptables, but to log, you have to enter -j LOG --log-level debug on the rule you want to log.

I'm not an expert in iptables, check the web if you can get more details.

One issue you could face also with ppp is that the interface is not persistent like rmnet, you could have to re-initialize iptables in ip-up script.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
Yeah we'll get there.

http://bit.ly/caMWLF

This seems to be what we need. I wonder if it could be ported back... Though probably make more sense to try updating to .35 as a whole I guess.

Sent from my HTC HD2
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
Yes, I don't like much porting single feature back, it could end weird side-effects especially as it's a 32-35 jump, who knows how memory management evolved in 34.

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
New test kernel

Hi guys,

I posted a new test kernel for the smd memory problem. I didn't test it yet, but it's the same as the previous one with only a limit at 2K instead of 30K. Let me know if it does any good and push dmesg even if it works.

I also posted a new wrapper with only the fake smd call list active field set to 1, no further improvement. This is mostly for aussiebum that triggers it quite often, but it shouldn't harm upgrading.

Thanks,

LeTama
[HD2 Android Q&A, Help & Troubleshooting and Genera] Nismo300zx:
i think it dont work on r8 because of his ppp fix in the kernal

"Added PPP patch from http://docs.openmoko.org/trac/ticket/2212"
[HD2 Android Q&A, Help & Troubleshooting and Genera] htcvidi:
Hang on boot. Stay on HTC logo.

Tested with FroyoStone Sense - V3.2 with darkstone and hastarin r8 kernel.

Same troubles.

EDIT : Same trouble with FroyoStone 3.1 (kernel before ppp patch).
[HD2 Android Q&A, Help & Troubleshooting and Genera] tyween:
Hang on boot AndroidMedaUltimate V1.3 (HyperDroid donator version) + hastarin r8.
[HD2 Android Q&A, Help & Troubleshooting and Genera] Jwatt0918:
Hang

Hang on boot.....MIUI and DJ Froyo Sense Hasartin 7.7
[HD2 Android Q&A, Help & Troubleshooting and Genera] ChrisM001:
Going back to hastarin 7.7 as r.8 seems to have not enough stability in the moment.
[HD2 Android Q&A, Help & Troubleshooting and Genera] fredulus:
Hang on boot hastarin 7.7 & 8 hyperdroid ultimate

Sent from my HDroid2
[HD2 Android Q&A, Help & Troubleshooting and Genera] noellenchris:
strange, I have no hang on boot with R8 and wrapper. Still running strong all day...

sorry I'm no help ...
[HD2 Android Q&A, Help & Troubleshooting and Genera] imphoking:
same here hang on boot with evosense harstain r7 and r8
[HD2 Android Q&A, Help & Troubleshooting and Genera] letama:
maxh2005, thanks for the log.

From what I read, data get stuck, android detects it, stop the connection and restart it.

Do you confirm that the connection was completely lost, even few seconds later ?
[HD2 Android Q&A, Help & Troubleshooting and Genera] maxh2005:
Yes, the 3G/H icon disappeared entirely and I got a "page cannot be displayed". A few seconds later the connection was re-established, but that might have happened after the logs finish. Phone signal level was at four bars the whole time.
[HD2 Android Q&A, Help & Troubleshooting and Genera] seaman2k:
+1111111

my build darkstone HD2Froyo V3 with hastrian 8 no longer drop :)
[HD2 Android Q&A, Help & Troubleshooting and Genera] zoth:
Mine to it's stuck at HTC logo, using R8 and 2.3 Rev. Just to clarify it decided to test out of my one free will so it's no one's fault. People that will just blame the dev. for the error place stay away from this thread.
[HD2 Android Q&A, Help & Troubleshooting and Genera] fig_jam_uk:
All ok for me so far, using the following:

Android rom: Mdeejay_eVo_Sense_v._2.3Revolution

Radio: Radio_2_12_50_02_2

Winmo: Energy.Leo.21916.Sense2.5.Oct.20

Don't know if any of this info is of any help or consequence.

Forgot to say a very BIG thanks.
[HD2 Android Q&A, Help & Troubleshooting and Genera] z_rudy:
Just wanted to drop a note. I am using the latest hastarin v8 kernel with Mattc Froyo+Sense 1.8 and Radio 2.14.50.04.

On WM and on Android, I lose my signal every while when I'm at home. It's probably a problem with my horrible service provider.

Whenever I lose signal, all I have to do is dial any number and hang up, and the signal is back. However, at that time, the PPP connection would have froze. I only experience PPP problems when the signal drops and comes back. When I'm outside home where the signal is better, this never happens. On old RMNET builds, the data connection would STAY ONLINE and working even if Android displays that I have no signal (an "X" sign on the signal indicator), weird...

Could it be a problem on the radio side whereby a loss of signal is happening, and the radio is reconnecting but causing pppd to fail? Just an idea :)
[HD2 Android Q&A, Help & Troubleshooting and Genera] gumataotao:
I only encountered a problem with r8 and new wrapper when I first installed using root explorer. For some reason it didn't save correctly and I had no data. I copied it over again, did airplane mode, rebooted, and it has been working great all day. Thanks for this fix.
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
Random thought for the day. I wonder if there are two modem chips out there.

The reason I'm thinking this is simple. Telstra version has UMTS 850MHz support, others don't. I have the Telstra version.

Since gauner last updated the wrapper I have not had data drop out without it auto reconnecting itself except when it hangs completely due to smd_tty and requiring a reboot. WiFi is another issue there but that's off topic, so I'll ignore that.

I can't boot with this new test wrapper, mdeejay can with an identical build.

Anyway, LeTama hopefully this might help.
[HD2 Android Q&A, Help & Troubleshooting and Genera] Cass67:
When the radio dies pppd dies, the wrapper watches for this and restarts it ... rmnet may have been keeping the data channel open somehow, what you have seen sounds weird but in some tests i have done i have seen this behavior with pppd also .. with pppd its incorrect behavior but with rmnet .. who knows ...
[HD2 Android Q&A, Help & Troubleshooting and Genera] DJMirage:
New wrapper works until reboot

So I originally had the PPP fix on my phone. Removed the line for the service in init.rc. Rebooted phone. Then put the phone in airplane mode. Copied the new wrapper to /system/lib/ using root explorer. Then I took the phone out of airplane mode. The wrapper

appears

to work fine. Once I rebooted it hangs on the HTC screen.

Pushed the original wrapper back.

EDIT: added nand_boot=0 to startup.txt and it reboots fine now. Testing in progress.

BlueTopia 0.4 (FroyoStone Sense 3.2) / Hastarin R8

Radio: 2.15.50.14

Hope this helps...
[HD2 Android Q&A, Help & Troubleshooting and Genera] parleyp:
I have the same set up as this one--using hastirin r8 and have no issues. I have rebooted and it still is working...no hanging.

Thanks so much.
[HD2 Android Q&A, Help & Troubleshooting and Genera] hastarin:
Requires nand_boot=0 in startup.txt cmdline!

OK I seem to have found out why I was getting the modem crash at the initial boot logo thanks to Cass.

The wrapper looks for "nand_boot=0" in the command line but since the kernel no longer needed that I'd removed it.

I'm now up and running with this wrapper. Will provide any further feedback if/when I manage to crash things.
[HD2 Android Q&A, Help & Troubleshooting and Genera] aussiebum:
Well, I haven't been using WinMo for a while (and basically none at all since moving to 2.14 radio), so can't really say. I've been using US HD2 Tmobile radios for a while for the fullram access and don't recall ever having connection dropout problems. Then again, I only used to connect data when I needed to, instead of leaving it on 24/7.

Might try an earlier radio anyways to see what happens later.

Thanks
[HD2 Android Q&A, Help & Troubleshooting and Genera] ala380:
Hey, thanks for the updates letama. I will have a lot of time today to do some testing and hopefully get some logs up. Thanks for your continued effort.
[HD2 Android Q&A, Help & Troubleshooting and Genera] chn110:
Good theory! Which raises more questions here :D Why does smd_tty need a large contiguous physical memory? Traditionally tty drivers uses small chained buffers. What is different with smd_tty? Is it trying to be more efficient by using a larger buffer? Or to support memory based IO? When you say limit the buffer size to 2K, does it use only one 2K buffer or multiple chained 2K buffers? If one it could damp 3G speed I would think.

Also, what is causing larger memory blocks to be used up? I got into the memory failure immediately after booting up the phone. So it does not look like fragmentation. Is there a way to dump memory block stats/ownership (who owns how many what)?

I am trying the new kernel. So far so good. Still can't use the 0.7 wrapper - 3G won't turn on. Thanks!