New: XDA launches forum for app developers. Discuss coding, tools, marketing, and more.
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
kruijs
Old
#1  
Member - OP
Thanks Meter 1
Posts: 42
Join Date: Aug 2008
Default Looking for kernel / build Without Audio stuttering on Blackstone!

Trying to solve audio stuttering...

I'm currently running the Eclair build from Kenia from
http://forum.xda-developers.com/showthread.php?t=827537
Like the speed, most things working fine.
... but playing media results in audio stutter.
Problem is apparently well known and affects more devices, see also
http://forum.xda-developers.com/show...11692&page=364
Indeed, killing battery service solves stuttering, but I'd like to keep it running, of course

Any build/kernel out there that does not suffer from this?
I'd like to find out what's different, since in the past it seemed to have worked, but with pushing more accurate battery readout in the latest kernels, this problem was introduced...
Maybe just putting an old battery service in a current kernel could work?

Cheers,
Robbert
 
g3rm0
Old
#2  
g3rm0's Avatar
Senior Member
Thanks Meter 81
Posts: 163
Join Date: Feb 2010
I can confirm that audio shuttering is a common problem, but I wasn't aware it can be related to the battery code. Can anyone check if killing battery service helps with shuttering audio (youtube maybe?) on other build (e.g. FRX03)?

TBH battery code is unfinished since Camro (the guy who did most of it) bricked his phone. If it's really a kernel issue maybe I'd could build test kernel w/o battery code sometime next week.
 
kruijs
Old
#3  
Member - OP
Thanks Meter 1
Posts: 42
Join Date: Aug 2008
Quote:
Originally Posted by g3rm0 View Post
I can confirm that audio shuttering is a common problem, but I wasn't aware it can be related to the battery code. Can anyone check if killing battery service helps with shuttering audio (youtube maybe?) on other build (e.g. FRX03)?

TBH battery code is unfinished since Camro (the guy who did most of it) bricked his phone. If it's really a kernel issue maybe I'd could build test kernel w/o battery code sometime next week.
Hi, g3rm0,
Always happy to do some more testing!

Took me some time to get a FRX03 build back working (not my daily build, Froyo is just too slow on blackstone, I'm afraid)
Anyway: Using the FRX03 build from
http://forum.xda-developers.com/showthread.php?t=711692
(full package, so using the included rootfs, zimage and modules.)
I can *confirm* that audio still stutters, and also on this build stuttering immediately disappears when battery service is killed!
Hope it helps?
If there's need to test different rootfs/zimage/modules/startup/..., just let me know!

Actually, for me, I just want to disable battery service so I can listen to music on my 15min bike ride to work!
But I am a linux Noob, so although "kill -9" is in my power to stop the service, actually restarting a service is momentarily out of reach...
Any help with restarting the [battery] service would be greatly appreciated!

Cheers,
Robbert
 
Stickman89
Old
#4  
Recognized Developer
Thanks Meter 1714
Posts: 1,236
Join Date: Apr 2007
Location: Milton Keynes

 
DONATE TO ME
You don't need to compile a kernel tbh, why don't you just create an init script which includes the "kill -9 28" command? The init script will get launched on startup therefore killing the battery service as desired.

Best Regards,

ST1Cl<^^aN
 
kruijs
Old
#5  
Member - OP
Thanks Meter 1
Posts: 42
Join Date: Aug 2008
Quote:
Originally Posted by Stickman89 View Post
You don't need to compile a kernel tbh, why don't you just create an init script which includes the "kill -9 28" command? The init script will get launched on startup therefore killing the battery service as desired.

Best Regards,

ST1Cl<^^aN
Hi, Stickman89,

Yes, I read this also somewhere, thanks for reminding me!
My bigger wish is to be able to restart the battery service after finishing listening to music, not having to restart Android (and first WinMo) because that takes way too much time.
How do I restart the service, any idea?

Cheers,
Robbert
 
Stickman89
Old
#6  
Recognized Developer
Thanks Meter 1714
Posts: 1,236
Join Date: Apr 2007
Location: Milton Keynes

 
DONATE TO ME
well to do that you would need to install a mobile terminal app from the market and create two scripts, one to disable the service and the other to enable it. Only problem is this would not be automated and you would need to execute the script via the terminal app installed.

Best Regards,

ST1Cl<^^aN
 
kruijs
Old
#7  
Member - OP
Thanks Meter 1
Posts: 42
Join Date: Aug 2008
Quote:
Originally Posted by Stickman89 View Post
well to do that you would need to install a mobile terminal app from the market and create two scripts, one to disable the service and the other to enable it. Only problem is this would not be automated and you would need to execute the script via the terminal app installed.

Best Regards,

ST1Cl<^^aN
I could live with that (still hoping for a proper fix, of course!)
Most builds come with a terminal app (Busybox is popular, if I remember correctly) that's what you mean?
But still I need the command line / script lines to execute, and that's where I'm stuck, since I know how to kill the service from the prompt of my terminal in the phone, but not how to "unkill" it!
"Disable/enable" sounds much better than "kill/unkill", but how???

As a side note, I also get the impression that the android terminal does not give me full access to a shell environment, since, for example, the "ps" command is severely limited! (wanted to find out more information on process "[battery]", but no chance with the crippled "ps" command...)
Maybe there are better (more functional) terminals out there?
Or do we actaully have access to "enable/disable service" commands in this "busybox" and I just don't know the proper command?
(just for reference: I'm running Kenia's eclair build that includes busybox 1.5 as terminal)

Cheers, Robbert
 
Stickman89
Old
#8  
Recognized Developer
Thanks Meter 1714
Posts: 1,236
Join Date: Apr 2007
Location: Milton Keynes

 
DONATE TO ME
Even better, look what I just found for you: http://forum.xda-developers.com/showthread.php?t=486486

Basically you can create a homescreen icon and assign a shell command to it, simply create an icon and assign the "kill -9 28" command to it which will kill the battery service, I would have to check out the process name to be able to start it again. Let me take a look for you (I don't think "start -9 28" will work as we have only issued the process ID and since it is no longer running will be useless)

Best Regards,

ST1Cl<^^aN
 
Stickman89
Old
(Last edited by Stickman89; 11th January 2011 at 07:10 PM.)
#9  
Recognized Developer
Thanks Meter 1714
Posts: 1,236
Join Date: Apr 2007
Location: Milton Keynes

 
DONATE TO ME
If you have a working adb setup then type: "adb shell ps -w"
or download a mobile terminal and type: "ps -w"

Ok here are the processes running, PID 28 is krpcserversd in our case which is incorrect so we need to look for the battery service which is PID 29 for me.

Code:
# ps
ps
  PID USER       VSZ STAT COMMAND
    1 0          312 S    /init.android
    2 0            0 SW   [kthreadd]
    3 0            0 SW   [ksoftirqd/0]
    4 0            0 SW   [watchdog/0]
    5 0            0 SW   [events/0]
    6 0            0 SW   [khelper]
    7 0            0 SW   [suspend]
    8 0            0 SW   [kblockd/0]
    9 0            0 SW   [cqueue]
   10 0            0 SW   [kmmcd]
   11 0            0 SW   [btaddconn]
   12 0            0 SW   [btdelconn]
   13 0            0 SW   [kondemand/0]
   14 0            0 SW   [smd_tty]
   15 0            0 DW   [rpcrouter]
   16 0            0 SW   [kadspd]
   17 0            0 SW   [detection/0]
   18 0            0 SW   [button/0]
   21 0            0 SW   [kswapd0]
   22 0            0 SW   [aio/0]
   23 0            0 SW   [panel_on/0]
   24 0            0 SW   [tty_wq/0]
   25 0            0 SW   [usb_mass_storag]
   26 0            0 SW   [kstriped]
   27 0            0 SW<  [krfcommd]
   28 0            0 SW   [krpcserversd]
   29 0            0 DW   [battery]
   54 0            0 SW   [mmcqd]
   71 0            0 SW<  [loop2]
   90 0            0 SW<  [loop0]
   94 0            0 SW<  [loop1]
  133 0         1736 S    busybox telnetd -b 192.168.20.1 -l /bin/sh
 1168 0         1740 S    /bin/sh /bin/userinit.sh -c /sdcard/conf/froyo.user.
 1226 0         1740 S    /bin/sh
 1227 1000       812 S    /system/bin/servicemanager
 1228 0         3728 S    /system/bin/vold
 1229 0         1736 S    /bin/sh /bin/netd
 1231 0          668 S    /system/bin/debuggerd
 1232 1001      5464 S    /system/bin/rild -l /lib/froyo/libhtcgeneric-ril.so
 1233 0        87964 S    zygote /bin/app_process -Xzygote /system/bin --zygot
 1234 1013     26664 S <  /system/bin/mediaserver
 1238 1002      1260 S    /system/bin/dbus-daemon --system --nofork
 1239 0          824 S    /system/bin/installd
 1240 1017      1612 S    /system/bin/keystore /data/misc/keystore
 1241 0         3340 R    /sbin/adbd
 1243 0         3720 S    /system/bin/netd
 1258 1000      246m S    system_server
 1330 10054     124m S    com.swype.android.inputmethod
 1345 10011     129m S N  com.google.process.gapps
 1434 1001      134m S <  com.android.phone
 1685 1000      123m S    com.android.settings
 2847 0            0 DW   [audmgr_rpc]
 3391 0            0 DW   [ksdiorqd]
 3392 0            0 SW   [tiwlan_wifi_wq]
 3400 1010      3004 S    /system/bin/wpa_supplicant -Dtiwlan0 -itiwlan0 -c/da
 3588 10007     107m S    com.android.quicksearchbox
 4937 10053     159m S    android.process.acore
 5076 10058     108m S    com.appspot.swisscodemonkeys.apps
 5083 10023     105m S    com.android.voicedialer
 5095 10004     110m S    com.android.vending
 5106 10026     114m S    com.google.android.googlequicksearchbox
 5113 10002     126m S    android.process.acore
 5233 10037     105m S    com.android.defcontainer
 5243 10030     112m S    com.google.android.apps.genie.geniewidget
 5273 10010     111m S <  android.process.media
 5284 10014     114m S    com.google.android.gm
 5338 0            0 SW   [pdflush]
 5462 10064     106m S    mobi.infolife.taskmanager
 5524 0            0 SW   [pdflush]
 5532 10070     123m S    stericson.busybox
 5584 10061     115m S    com.facebook.katana
 5631 0         1736 S    sleep 500
 5635 10059     114m S    cn.miren.browser
 5662 0          740 S    /system/bin/sh -
 5665 10060     122m S    com.voxmobili.phonebook2
 5691 10056     108m S    com.miui.player
 5697 10028     108m S    com.google.android.apps.uploader
 5705 0         1740 R    ps
Once the battery service has been located so in my case PID 29 then to kill that PID via adb simply issue "adb shell kill 29" (PID number may vary so please check) and to start the PID issue "command-removed".

So if you want to use the application i linked you to over at the G1 thread then simply assign the commands "kill 29" to kill the service and "command-removed" (remember that the PID number may vary so please check) to start the service again.

FYI charging will stop at this point and battery stats will freeze at there current percentage.

Best Regards,

ST1Cl<^^aN
 
g3rm0
Old
(Last edited by g3rm0; 11th January 2011 at 05:22 PM.)
#10  
g3rm0's Avatar
Senior Member
Thanks Meter 81
Posts: 163
Join Date: Feb 2010
Quote:
Originally Posted by Stickman89 View Post
Ok here are the processes running, PID 28 is krpcserversd, interestingly we also have the PID 29 which is battery.
Same here for me: PID is 29 (it may different in some builds) but... when I killed battery service (kill -9 29) audio shuttering stopped. It also solved "audpp: DMA missed" messages in dmesg so maybe we're on the right track.
IMHO killing battery service every time is not a solution. Maybe code just needs to be cleaned up a little.

Anyway, for now kill -9 is the only (known) way to achieve smooth playback.