[SCRIPT] KILL android.process.media FOR SAVING BATTERY

Search This thread

bamsbamx

Senior Member
Aug 2, 2011
571
591
Bilbo
livenfun.com
Of course, root is required... ;)

I was getting tired about seeing how mediaserver was draining my battery(see attached picture) so I researched a bit and I found how to kill mediaserver process...

attachment.php


Just replace .txt with .sh and execute it with script manager or terminal emulator...

Here is its code:

Code:
#!/system/bin/sh
killall -9 android.process.media
killall -9 mediaserver


-----------------------------------------------------------------------------------------------


If you have enabled int.d scripts, you can put this script in /system/etc/init.d/...
Or flash this zip: http://d-h.st/2bU (Thanks to acer73 ;) )

the idea is to schedule the execution of this script for example each 1 hour.... Because i think that when we start playing music media server starts again...

however, I must investigate a bit more....


-----------------------------------------------------------------------------------------------

to see which processes are running currently: just write "ps" in terminal emulator
 

Attachments

  • Screenshot_2012-12-16-13-38-11.jpg
    Screenshot_2012-12-16-13-38-11.jpg
    30.4 KB · Views: 93,811
  • 00mediaserver.txt
    76 bytes · Views: 6,363
Last edited:

polar2792

Senior Member
Oct 23, 2011
1,019
194
Gastonia, NC
Of course, root is required... ;)

I was getting tired about seeing how mediaserver was draining my battery(see attached picture) so I researched a bit and I found how to kill mediaserver process...

attachment.php


Just replace .txt with .sh and execute it with script manager or terminal emulator...

Here is its code:

Code:
#!/system/bin/sh
killall -9 android.process.media
killall -9 mediaserver

Undo?

Sent from my PC36100 using xda app-developers app
 

jarjar124

Senior Member
Apr 28, 2012
4,175
4,354
Brooklyn
Am I doing something wrong? Or is this how it is suppose to look?
Edit: seems like it won't let me post a pic of it. Can someone post how it is supposed to look on script manager?
Sent from my Nexus 4 using xda premium
 
Last edited:

bgener

Member
Oct 4, 2010
16
1
Hi so can I still play media after this? What exactly am I killing. Because it's rapping my battery for 30%. or is that just the usage from actually listening to music? I'm not a newb, but I feel like an explanation of what the service does would help ;)

Sent from my Nexus 4 using xda app-developers app
 

bamsbamx

Senior Member
Aug 2, 2011
571
591
Bilbo
livenfun.com
the idea is to schedule the execution of this script for example each 1 hour.... Because i think that when we start playing music media server starts again...

however, I must investigate a bit more....

to see which processes are running currently: just write "ps" in terminal emulator
 

exadeci

Senior Member
Jul 21, 2010
855
316
Sydney
The issue is not the media server but one or severals apps that run in services and keep it awake.
All the apps that are galleries or media player uses media server to play/show/scan so if you use any of those app mediaserver while be get a high percentage of battery usage and that's normal, the issue is when one of the apps is baddly coded an keeps awake media server even if you are not using the app
So you just need to hunt the ****ty app that makes mediaserver drain your battery
 
Last edited:

xdviper

Senior Member
Jan 5, 2009
1,732
169
The issue is not the media server but one or severals apps that run in services and keep it awake.
All the apps that are galleries or media player uses media server to play/show/scan so if you use any of those app mediaserver while be get a high percentage of battery usage and that's normal, the issue is when one of the apps is baddly coded an keeps awake media server even if you are not using the app
So you just need to hunt the ****ty app that makes mediaserver drain your battery

Would power amp be responsible? I don't know, because for the last few days I haven't had any drain from the media server process and just today it started.

Sent from my Nexus 4 using Tapatalk 2
 

ugotproblemz

Senior Member
Feb 16, 2009
494
31
New York City
I only use power amp as my primary music player. So are u suggesting that I switch players???

The total wake up on the media server is equivalent to how long I listen music to..

Sent from my Nexus 4 using xda app-developers app
 

lnfound

Senior Member
Jun 6, 2012
405
54
I only use power amp as my primary music player. So are u suggesting that I switch players???

The total wake up on the media server is equivalent to how long I listen music to..

Sent from my Nexus 4 using xda app-developers app

Then it's working as intended..

Sent from my Nexus 4 using Tapatalk 2
 

Top Liked Posts

  • There are no posts matching your filters.
  • 30
    Of course, root is required... ;)

    I was getting tired about seeing how mediaserver was draining my battery(see attached picture) so I researched a bit and I found how to kill mediaserver process...

    attachment.php


    Just replace .txt with .sh and execute it with script manager or terminal emulator...

    Here is its code:

    Code:
    #!/system/bin/sh
    killall -9 android.process.media
    killall -9 mediaserver


    -----------------------------------------------------------------------------------------------


    If you have enabled int.d scripts, you can put this script in /system/etc/init.d/...
    Or flash this zip: http://d-h.st/2bU (Thanks to acer73 ;) )

    the idea is to schedule the execution of this script for example each 1 hour.... Because i think that when we start playing music media server starts again...

    however, I must investigate a bit more....


    -----------------------------------------------------------------------------------------------

    to see which processes are running currently: just write "ps" in terminal emulator
    2
    Undo?

    Sent from my PC36100 using xda app-developers app

    just reboot..
    2
    For those with battery drain issues, i recommend this app :) It will help a lot

    http://xdaforums.com/showthread.php?t=2297948
    1
    i think this is better, but you must make sure you have pidof this command
    #!/system/bin/sh
    kill -9 $(pidof android.process.media)
    kill -9 $(pidof mediaserver)