yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] Janis:
Ditching userinint.sh

I rm'ed user.conf and userinit.sh to use Cyanogen's default compcache and default CPU scaling. I re-downloaded Swapper and set up to use my 128mb (overkill) linux partition.

I got lights & vibrate at the end of the first ring, I got caller ID and ring just about halfway into the second ring.

Using the attached user.conf I didn't get ring or caller ID until the end of the second ring, sometimes after.

So I installed missed call (donation) and maxed it out. No change. Still getting first response at the end of the first ring, and ring and caller ID about 1/2 way into the second ring.

Maxed out my CPU at 528/528 with SetCPU. Got about .1 of a second advance. It starts to ring and gave me caller ID about 1/4-1/3 of the way into the second ring. Hard to tell, but a bit earlier than 1/2. The second and third time I tried it, it wasn't as fast. Caller ID came up just barely into the 2nd ring, but ring didn't start until the end.

I think the first ring is network time. For the duration of it, I'm guessing, the call isn't at my G1 yet. This sucks.

I think the phone app is set to vibrate and light the phone first, and leaves time for this to happen. It may be because it's the fastest way to alert the user, since looking for ringtone, handling it and sending it can (doesn't always) take some time, it just uses the reliable method and then triggers the less reliable, already slower ring process.

So maybe Cyanogen, or anyone who's familiar with it, can see if this ring vs. vibrate lag can be eliminated. I'd rather have the phone look for a ring first.

But, if you need to get to calls that quickly, set it to vibrate for now?

I downloaded the ogg ring package from the custom userinit thread. Trying that next.
[G1 Android Development] beartard:
This doesn't contribute anything to the thread at all (except maybe encouragement) but I'm glad someone is bringing this annoying "feature" up for public discussion.

I keep myself updated with CM and kspec oreo as a theme. As it is right now, I get one ring and the call goes to voicemail. The caller ID display actually lights up after the call has been forwarded. Hope the culprit (if there is just one) is found soon.
[G1 Android Development] jady:
There has been a parameter on some of my previous phones called slot index. It was available through a keypad menu, it set how often the phone polled the tower. It sped up the ring responce dramatically.
[G1 Android Development] Janis:
Tried the ogg files, woohoo!

I've got my CPU set to 528/384 with SetCPU, Linux partition swap 128mb with Swapper (I can set them on the fly without rebooting), and used the ogg files in media/audio/ringtones, and I get ring and caller ID at or before the beginning of the second ring, a split second after the vibrate started. I tried messing with CPU speeds, and it does seem to make a difference as to when the ring actually sounds. I'd say about 1/2 a ring between 245 idle and 528 idle with 528 max for both.

I also have my frequency scaling at 16. So I think that means if 16% of my CPU power is being used, it hops it up from min to max. OK, maybe not 16%, I don't know how the numbers translate, but 16 is low, so I'm running at 528 when a squirrel farts outside.

I have BatteryLife and Missed Call enabled.

So there's the pause after the first ring to deal with, but I really don't think it's the phone after this. maybe we need to join forces and barrage T-mobile with complaints. I mean, why have the ringing on the calling end start if the network isn't connected?

Well, at least we won't ever have to worry about appearing too desperate.

2 or 3 bars, so my signal isn't that great. I'm in the suburbs (not that I love it, but it's where I am).

I'd be very curious to find out if others who have their CPUs running high and are using ogg files are getting a different response. I'm also going to try it in different locations.

I am going to suggest to Cyanogen to include the ogg fles as part of his add-on collection.
[G1 Android Development] Janis:
Face of Ring

I think I may uninstall this, even though I love it. It bumped the ring to after the caller ID. Caller ID still popped up during the pause after the first ring, but the ring and vibrate didn't happen until mid 2nd ring.

(I'm using rings to measure because 1. it's easier 2. the rings/pauses are shorter than a second 3. in large part it's the caller experience we're concerned about. I don't have a stellar chronometer handy, either.)
[G1 Android Development] overground:
Well, thanks for starting this thread, Janis. It's a common complaint across all builds. I've grudgingly resorted to calling my phone after every reboot, just to try to keep the ringtone and I'm guessing Phone.apk?? in memory for as long as it will stay in there. That definitely helps for awhile. I know we're trying to make these phones more into computers, but they're still phones and as such calling and communications should be the main priority. I've converted to .ogg, however they are larger files than the .mp3's I converted from. Maybe I should have used a smaller bitrate. Anyhow, it doesn't seem to make much of a difference. I've tried placing them in /sdcard/media/audio/* and /system/sd/media/audio/*. Does not seem to make much of a difference.

I want a hardware hack to increase the RAM...I hate the trade off we're facing. Losing physical keyboard to obtain greater memory. Or make a "Dream plus" with more RAM. I'd even be happy with just a slight increase in internal storage or none at all and more RAM. The devs here have done wonders with the hardware provided, and the implementation of apps to sd has really made this seemingly poor thought out device (in areas), one of the best. I remember, before I was brave enough to attempt apps to sd, having to decide which app to uninstall, just to make room for one I might want more. Seems like ages ago. While I'm reminiscing, I'd like to give a retro shout-out to Lucid and MarcusMaximus who were pioneers in this area and others.

Sorry, about the tangent...but we've made great strides on the computer end of this device...let's regress, so to speak, and make the phone the primary function, hopefully without backsliding on progress we've made on our phones as a mobile computing device.:eek:

EDIT: I've also uninstalled "AutoLock" for this reason, because I'd read somewhere that this may be the culprit...I may have seen positive results, or possibly just placebo.
[G1 Android Development] xdviper:
I have the app "Caller Lookup" installed and have noticed tha that app comes up before caller id and or the ringtone. Its there after 1 or 2 vibrate pulses.
[G1 Android Development] Janis:
make sure T-mobile, or whomever, has your time-before-forwarding maxed

My poor 74-year-old mom was having a heckuva time getting to her phone in time. As per the instructions from a Tmobile service rep, we punched a # and some digits and got a 65 second ring time. This was a year ago or so. I was told that same week that if my OS on my WinMo phone couldn't do it, there was no way they could (there's a way to set it in WinMo), which was BS.

I know it takes network time/space/bandwidth to let it ring, and it's not paid time. I wonder, not to be a rabble rouser (heh), if we kept calling them, maybe hundreds of us if we could get it going, and made them spend more money on customer service than that bandwidth, if they'd bump that.

Anyone?
[G1 Android Development] mattseg:
I don't know why, but all the sudden I'm getting next to no latency. Calling from my GF's T-mob Phone (could be a network thing) to mine, 1/4 into first ring I get a vibrate & ring, 7/8ths into the first ring I get light and caller id.

So those testing with skype, or landlines, that might explain a bit of the difference. I'm running the latest stable cyanogen, with the newest radio, and a very few widgets.

first test was a hair slower, and that was phone at a dead sleep, second as shortly after, not sure how long it takes for the phone to reset to slower cpu speed.

So what I'm thinking is it may have more to do with network than anything else.
[G1 Android Development] Janis:
1000 user-friendly ways to speed up your (rooted) phone

Get Advanced Task Manager from Market. See what apps and services you have running. It's likely they're running all the time, and taking up RAM. Shut down or uninstall (I know it's tough) the ones you don't really need. If you want more control than that, AutoStarts gives you that, also on Market.

Get SetCPU for a buck, or whatever. I've had good luck with with 528 max, 348 min, and in Advanced settings, with a Powersave bias of 200 and an Up threshold of 16. I don't mess with the sampling rate becase there's been too much discussion about it. I really haven't noticed a huge dent in battery, but I don't have a set schedule in may day where I have charge times to compare day to day (in Cyanogen's world, that's pretty much ROM to ROM). I generally charge at about 2 pm. I haven't run out of battery and been screwed. I have a backup battery, and I'm using the 1700mAh battery from Fommy.com, too.

I've heard conflicting arguments, but I can't imagine a class 6 sd card would hurt. Since my ringtones, and apps, are on my sd....

Get Swapper on the Market. Although a Linux swap partition is said to be faster, a swap file also helps a lot. Most say that 32mb is plenty. I'm using 128, which is overkill, but I'm ready for the worst, and hopefully wearing a wider rather than deeper hole in my card. (sd cards have a limited number of times they can read/write, and swapping does it all the time).

Take the plunge, live without your theme, and get a Cyanogen ROM. I don't know first hand about the others, but I guess there's been some comparing. I found 3.9.9.1 and 3.9.10 to be stable when I flashed the radio over the top of them, and it's mighty fast. If you do have trouble, though, it's quite a read; 4000+ posts, most of them crap, but use the search function within the thread and you're good to go.

If you've been flashing ROMs, wipe, delete your ext2/3/4 partition and recreate it, go back to RC29, reroot, and start fresh. This is the simple way to blast anything that might be slowing down your phone. I don't know why crap gets left behind, but it does. I hate this part of flashing, but I've always found it beneficial, like castor oil, or the old pink penecillin I bet only a few of us remember.

Um, that's 6.......

Tape it to a 22-year-old boy's bumper. Odds are it'll be going way too fast. (And yes, I say boy because it takes a man to properly bugdet his time and prioritize the safety of the families in the other cars over fun, impressing friends & girls, and getting a few extra minutes of sleep or on a hacking forum. Preaching done. But fast phone, eh? Better yet, tape it to a 28-year-old girls bumper. Ok, I better stop, but for criminy sakes people, for the price you could pay in blood or guilt, it's not worth it. Driving is the single most dangerous thing we do. Take it seriously. Make you phone fast the functional way.)

I'm stumped after that. Anything besides caffeine to make my brain faster? Any other ideas?
[G1 Android Development] wpbcubsfan:
There is absolutely NO need to go back to RC29 and reroot! :eek:
[G1 Android Development] alapapa:
please tell me you're not a vigilante fast-lane-speed-limiter...

on topic. I tried decompressing my custom tone into a wav to see if that speeds up things (it may slow things down if it loads the whole file into memory before beginning to play it).

will report back w/ results
[G1 Android Development] alapapa:
yep...wav is definitely slower than mp3

Next idea
[G1 Android Development] innerspace:
Hi Janis...

First off, thanks for starting a dedicate thread on this issue. It is at the top of my list of concerns regarding the Dream. I've seen similar performance issues across several ROMS and am completely baffles as to what the issue is.

I've switched to the OGG package you mentioned.

I have my ringtones moved to the ext partition via userinit.sh

I see the CallerID app come up well before the Phone app even hits the home screen. Sometime CallerID pops up before I even get vibration.

Long story short, this is a problem. I don't think its a ROM specific issue but I do not recall having these issue back when I ran JF 1.5. I think compcache/backing swap or linux swap may have something to do with it, but alas, I too am frustrated by this phones lack of RAM and am just too stubborn to ditch out on the development of a solution.

So... what can I do to help the great minds at xda troubleshoot this issue?
[G1 Android Development] vishurao:
strange, when i started a similar thread, people thought i was crazy ( http://xdaforums.com/showthread.php?t=534113 ) and that i was one of the few UNLUCKY ones to be facing the issue.

Anyway, here are somethings that i know from my experience:

1. Ogg ringtones are better.

2. keep your wifi off.

3. renice -u -20 com.android.phone does help a little.
[G1 Android Development] alapapa:
the "-u" option to renice gives me an error:

"setpriority: No such process"

works fine without -- i keep it in my userinit.sh
[G1 Android Development] t1h5ta3:
i have the issue as well.

i notice the green led comes on, a half sec later it vibrates, half sec later i get a ring tone, then sometimes it seems 2 sec before the screen comes on, then caller id
[G1 Android Development] Digitalthug:
the "-u" goes after the -20. So the correct command is "renice -20 -u com.android.phone"
[G1 Android Development] Janis:
Great idea! Wouldn't a clocker on logcat be slick? Would logcat be able to see if the file gets loaded first? I'm very interested to see what happens with different file compressions/formats.

(No; that's nearly as dangerous as going too fast. There are emotions out on the road, too. Statistically, a median speed of traffic should be the safest, and we'll all get there. Honestly, I drive a little faster than that. Though I am very tempted to brake for tailgaters when I've got someone right in front of me.)
[G1 Android Development] sdlong92:
I was having the same issue with not being to get to the phone in time to answer before voicemail picked it up either. It's even worse running a Hero rom (currently on JacxHero 1.2). But there is a solution, albeit not a perfect one as it's more of a bandaid. What I did was just called T-Mobile and had them change the default 4 ring to voicemail (which is 20sec) to their max 6 ring (which is 30 sec). I find this is enough time to answer even with Hero lag, haven't missed a call in a week!

The associate/tech who answered was very nice and it takes 5min to do (this is moslty just hold time), anyhow I realize this may not be what everyone is looking for as far as a solution is concerned, but it should help tremendously until someone finds a better solution.
[G1 Android Development] notxel21:
Change # of rings before phone goes to voicemail without calling CS.

If you want to increase (or decrease) the number of rings before an incoming call goes to voicemail, from your mobile phone dial **61*(your phone number)**15#.

Where "(your phone number)" is your 11-digit phone number (including 1 and the area code), and "15" is the number of seconds (from 5 to 30 in 5 second increments) that you want your phone to ring before going to voicemail. (The default seems to be 10 seconds.)
[G1 Android Development] sir*mez:
i get:

call fowarding problem or invalid MMI code.

and i did what you stated.
[G1 Android Development] notxel21:
Some people get that and I don't know why but it worked fine for me.

Are you rooted and if so what rom are you on?

reboot and try again.

*edit* I see you're on a Cyan build!
[G1 Android Development] mzrdisi:
It didn't work for me either.
[G1 Android Development] devsk:
It seems like its the phone look up from google storage that's causing the delay. Its the bottleneck.

I was watching the 'top' output while I rang my phone multiple times. First com.android.phone and system_server occupy the cpu, then /system/bin/mediaserver and system_server, and then, android.process.acore joins them. And then all of these procceses get blocked for IO (go into 'D' state). They don't come out of blocked D state until com.google.process.gapps comes along and occupies the cpu completely and delivers the caller id. The ringtone sound may appear sooner or later depending on when com.google.process.gapps gets scheduled and how long it sits on the cpu.

So, renicing com.google.process.gapps lower may help. trying that now.
[G1 Android Development] wpbcubsfan:
Instead of "(your phone number) it should be (your voicemail number). In my case, it's my Google Voice number. ;)
[G1 Android Development] sir*mez:
I tried that also and it didnt work.
[G1 Android Development] devsk:
So, here is what I did and it seems to help. My G1 now rings with the ringtone before the beginning of the second ring on the caller's phone, which is satisfactory for me.

renice +20 `pidof com.google.process.gapps`
renice -20 `pidof com.android.phone`
renice -20 `pidof mediaserver`

Note that the renice commands posted earlier don't do anything because com.android.phone is the process name and not the username or userid, hence setpriority call always gets '0' value if you do that, which means its setting the priority of the calling process and its group. You need to pass pid to the renice command.

Let me know if this helps anybody. It is designed to make phone wakeup quick and sound the ringtone quick. The look up and caller ID showing up will be slightly slower. We may have to play with numbers a bit to suit some scenarios.
[G1 Android Development] miketaylor00:
I'm trying this now. I'm going to set my gapps to +5. I'm a little worried that it might run into problems if it has the lowest possible priority.
[G1 Android Development] miketaylor00:
I noticed that the caller has to wait longer to hear the first ring with these settings. The G1 starts ringing after the 1st ring on the callers end but there is about a 3 second delay for the caller before the phone starts ringing.

Edit: Tmobile seems to be having trouble in my area. I think the delay I am seeing on the caller's end is related to that.
[G1 Android Development] devsk:
I did not find this difference. Are you sure? Can you revert (by rebooting, because 'ps' or 'top' don't report current priority of the process on G1) and test? And then set these settings after a fresh reboot (through userinit.sh) and test again?

You need to try four five times and with phone put to sleep with 'End' button and in fully awake condition, to get good averages.

Without this trick, you will notice that sometimes (depending on the scheduling) you get through in 2 rings and sometimes 4 or even 5 rings. With the priorities set, its average is between to 1 to 1.5 rings, whether the phone is awake or asleep.
[G1 Android Development] miketaylor00:
I edited my post after the fact. I think Tmobile is having issues in my area.
[G1 Android Development] sir*mez:
slowed down my phone. it take longer to hear ringtone and to wake.
[G1 Android Development] miketaylor00:
Are you sure you got the values right? The first time I set media server to +20 instead of -20

:o
[G1 Android Development] miketaylor00:
There is no way to know if you typed the command right. I just set the priority for 'pidof blah' and it didn't give me an error.
[G1 Android Development] devsk:
You need to do clean comparison with and without settings applied, and after a fresh reboot in each case.

You need to do with and without the phone sleeping.

You need to do at least 4-5 calls in each of these combinations so that you can average out the the effect of other processes running on the system.

It is entirely possible that this hack doesn't work for everybody because your phone may be chewing CPU, processing other tasks when the call comes in. When I did the experiment on who it was, I found it to be gapps. So, if you can watch CPU usage in 'adb shell' when call comes in, you can probably find another one of your apps is eating the CPU. So, you may need to change the commands a bit for that app.
[G1 Android Development] devsk:
This renice in G1 is a wrapper around 'toolbox' and is limited. Also, it assumes many defaults and hardly gives any error. If you don't read its man page or watch its system call trace with 'strace' command, you won't know what it passed to 'setpriority' system call.
[G1 Android Development] miketaylor00:
This is exactly right. This whole problem revolves around a process that is getting in the way of the phone answering. There tons of applications that can hog the CPU, even when the screen is off.
[G1 Android Development] stellarman:
Thank you very much for this.

I had tried the 'renice -20 -u' command, and found that it didn't have any effect. Now I know why -- wrong value being passed.

I thought I would try it first with the "renice +20 `pidof com.google.process.gapps`" line commented out, and see how it does with just the other two given higher priority. I can already see a difference and I like what I see. I will try more time tomorrow, and try with all three lines running.

WOOT!! Finally, something that makes a difference!
[G1 Android Development] Nedlinin:
This definitely made a difference for me on Cyan 3.9.11.2

Thanks for the work everyone! Going to throw this in my userinit.sh and see if there are any long term side effects (phone slowing down after 24hours or what not)
[G1 Android Development] miketaylor00:
I tried running strace from adb and I can't figure it out. Can you tell me what you did to run it?
[G1 Android Development] devsk:
$ adb shell
From within adb shell:
# ash (I typically like ash because of better history and command editing)
# strace renice -20 `pidof mediaserver` > /sdcard/strace.out 2>&1
# vi /sdcard/strace.out
Inside vi, type '/setpriority' without single quotes.

Mike, you probably know this but adding it for others benefit. Notice those chars around `pidof mediaserver` are backticks (`) and not single quotes (').
[G1 Android Development] miketaylor00:
Awesome! thanks, now I have a new toy to play with :)
[G1 Android Development] miketaylor00:
Maybe the guy who said it didn't work was using single quotes.
[G1 Android Development] etiennepb:
Read this thread and started doing some testing on my phone. For reference I have a rooted Dream running CyanogenMod 3.9.10 on the Rogers network in Canada. I've only tested this between my phone and another cell(on a different network) but I get pretty good response time. About halfway through the ring on the outgoing phone the dream vibrates and by the end of said ring the ringtone kicks in. Perhaps it's simply a network issue.

Cheers,

Etienne
[G1 Android Development] miketaylor00:
Suggested Settings

If you are using an mp3 ringtone, it will take a few seconds to load it the first time you get a call. After that it will respond very quickly but the first time you get a call it will take 2 or 3 rings to start playing the ringtone. If you really want to use an mp3 file I suggest you do the following:

renice +20 `pidof com.google.process.gapps`
renice -20 `pidof com.android.phone`
renice -18 `pidof mediaserver`

By giving the mediaserver a slightly lower priority you will prevent it from getting in the way of the phone. That can cause the phone to do pretty much nothing while it is waiting for the mp3 to load. This way, you will still get the vibrate and caller ID even if it is taking a few seconds to load the mp3. I tried it on my phone and it seems to work well. I don't have the blank screen during the first 2 rings that I used to have. Again, this is only going to affect things the first time that you get a call with an mp3 ringtone, although it might be a good idea to give your phone a higher priority even if you don't use mp3 ringtones.
[G1 Android Development] Ohsaka:
Looks like command format changed on 4.0...

# renice
renice
USAGE: renice [[-r] priority pids ...] [-g pid]

I see the usage message print out in the logcat during boot, so I assume its complaining and not actually doing anything...
[G1 Android Development] devsk:
which commands are failing? with '-u' or the commands I posted?