"Who is this 'Mediaserver' and why is he sucking my battery dry?"

Search This thread

tronmech

Senior Member
Just solved a really annoying battery drain issue. Figured I'd post the results...

I noticed last week that my phone was going through the battery MUCH faster than normal. A check of Settings/About Phone/battery use told me that the "Mediaserver" was using over 35% of my battery, surpassing the phone standby -- which is saying a LOT given what my T-Mo reception is like.

Now, I'm still learning, so when the description says is does something with running apps, I assume that the issue is an app I recently installed, so I remove apps I recently installed or updated. Nope.

I saw another post about a laggy G2 that seemed to also have battery issues. It recommended using Watchdog Lite to see what was happening. So, off to the Android Market.

After installing Watchdog Lite, I saw that the CPU was 0% idle with 75-95% "nice." Well, no idle = battery suckage, so off to see what tasks are using CPU. The initial check didn't show anything -- until I enabled monitoring "Phone Processes." The alerts for the "mediaserver" "linux task" showed that this process was taking every cpu cycle it could. Off to Google.

Did a search on "android mediaserver loop" and found a couple of bugzillas that essentially said that a corrupt media file (pic, movie or sound) could send mediaserverover the edge. So, I started to move *every* picture off the sd card onto my computer's HD.

Knew I was on to something when mediaserver stopped going crazy once usb storage was turned on. So, I moved all the image and movie files off and turned off usb storage. The CPU spun back to100% busy, but slowed back down to about 9o% or more idle.

Now all I have to do is find the bad file or files, and I can add it to the bugzilla.

EDIT: It seems that this has also made the cooliris gallery wake up and start updating again. So anyone seeing that the gallery isn't updating may need to see if their mediaserver linux task is unusually busy. If so, offload as many media files as possible and see whap happens...

Sent from my T-Mobile G2 using Tapatalk
 
Last edited:

Neo-Nemesis

Member
May 23, 2010
27
0
Lyon
I believe that music player depend of mediaserver.

I have installed system panel and noticed a 30% cpu usage when I play some music with Cyanogen 7 RC2.

I will try with another Rom to compare the result.
 

itsforsab7

New member
Aug 11, 2011
1
2
Chennai
I found my cause for the problem

I got really frustrated with the Galaxy S2 because of this mediaserver issue...

From wat i have researched, I found that once the 'gallery' is opened and closed,

  • Phone keeps using the cpu 100%.
  • Phone's back becomes red hot.
  • The battery drains rapidly in 2-3 hours.
  • I plug it on to a charger it doesn't charge up
  • the mediaserver process comes up in the 'battery usage' with 60% usage


Now, I switch off the phone. Boot it up. Charge the phone to 100%. Its all perfect and no heating up too. After 7 hours of usage, no mediaserver process in 'battery usage'.

I went into the gallery once. Browsed some photos. And Closed it.
Now it all started again. I've tried this 3 times now.

And I have no idea wats wrong with the gallery.:mad:
 

goodolsen

Senior Member
Mar 2, 2011
460
36
D/FW area
could this mediaserver also be caused by lots of Pandora listening?

It seems to be related to streaming audio also. I'm trying to figure out why since moving to GB my battery is being drained by media server when I never had this issue on Froyo. It only seems to take up the majority of the battery time when I'm listeing to Pandora over Bluetooth during the day.
 

stopservice

New member
Apr 26, 2009
1
0
Solving the problem lies in the options build.prop
must be changed:
---
media.stagefright.enable-player = true
---
to:
---
media.stagefright.enable-player = false
---
If this option is not in the file, it is necessary to add.
 

diji1

Senior Member
Aug 26, 2006
132
17
Adelaide, SA
I started having the same issue (on Galaxy Note) today. Glad I found this thread in any case.

Once thing I noticed is PowerAmp plays sound files from games if you don't give it a media folder to stick to. I can only assume that it's using the media server to find these based on what someone in this thread said.

So it would seem that the .nomedia file method is definitely the best (to stop game sound files being found).

[Edit:] Oddly the behaviour stopped now. Mediaserver is no longer raping my battery. What do you think of the idea of putting .nomedia in every folder and then removing it from only folders you need (images, video and audio folders)?

You can easily do this by running:
Code:
for i in *; do cp file $i; done
from cli in Android (I think). "file" = <path to .nomedia>
 
Last edited:
  • Like
Reactions: Rollolo

zamiurratul

Senior Member
Dec 17, 2011
71
12
Dhaka
mediaserver was not a notable issue for me untill 2 days before i installed "sprit fm".... then boom ...... mediaserver just gone mad and taking upto 65% of my battery..... now uninstalling "spirit fm" and will see what happens.
 

JDubbed

Senior Member
Feb 18, 2011
199
32
Mediaserver and Arel WARS

Hey all! Glad I found this thread. Got a Samsung Galaxy SII Skyrocket I727 from AT&T. From what I researched mediaserver is part of a standard for DLNA. I am a newb on xda so I cannot post links however search on youtube "Android DLNA MediaServer" and you can get a downlow as to what it is meant for.

Anyways mediaserver gets to be 400+ and sometimes even 500+mb according to Watchdog when playing a GAMEVIL game called Arel WARS. This is the first time I have ever had a problem with mediaserver and ONLY happens when I play Arel WARS. I reboot my phone and see mediaserver at 2.7mb. I start Arel WARS and BAM 100+mb already. After playing for about 20 minutes my phone becomes laggy and the game freezes up. I check Watchdog and it shows 400+mb being used by mediaserver. I then kill Arel WARS and mediaserver is still sucking 400+mb. I try several types of app killers but none can even see the process in order to kill it. I try an app called "reboot" that is supposed to simulate a reboot by killing apps and processes but mediaserver is still sucking the life out of my phone. Bottom line the only way I can kill mediaserver is by rebooting the phone and then its back to 2.7mb and it stays that way ONLY until I start playing Arel WARS. I can launch gallery all day long and media player and mediaserver is good.

Just giving my two cents. I emailed Watchdog dev to see if he can help me out since Watchdog seems to be the only app that can actually see mediaserver and also emailed GAMEVIL to see if they might have a memory leak problem somewhere. I will update when I get word from either.

UPDATE:

I recorded my phones screen to show you mediaserver and it sucking the life out of my phone. There is no way to kill it to my knowledge and the more I play Arel Wars the more it consumes precious ram. Copy this link into your browser to download the video. Its about 10 minutes long and about 18mb.

dl.dropbox.com/u/6778642/Android/Mediaserver_ArelWars.mp4.

You should be able to play it in your browser.

BTW I am still waiting on either GAMEVIL or the dev of Watchdog to hit me up with an email so I'll update if and when I get word.
 
Last edited:
  • Like
Reactions: miniake and rousku-

Top Liked Posts

  • There are no posts matching your filters.
  • 19
    Just solved a really annoying battery drain issue. Figured I'd post the results...

    I noticed last week that my phone was going through the battery MUCH faster than normal. A check of Settings/About Phone/battery use told me that the "Mediaserver" was using over 35% of my battery, surpassing the phone standby -- which is saying a LOT given what my T-Mo reception is like.

    Now, I'm still learning, so when the description says is does something with running apps, I assume that the issue is an app I recently installed, so I remove apps I recently installed or updated. Nope.

    I saw another post about a laggy G2 that seemed to also have battery issues. It recommended using Watchdog Lite to see what was happening. So, off to the Android Market.

    After installing Watchdog Lite, I saw that the CPU was 0% idle with 75-95% "nice." Well, no idle = battery suckage, so off to see what tasks are using CPU. The initial check didn't show anything -- until I enabled monitoring "Phone Processes." The alerts for the "mediaserver" "linux task" showed that this process was taking every cpu cycle it could. Off to Google.

    Did a search on "android mediaserver loop" and found a couple of bugzillas that essentially said that a corrupt media file (pic, movie or sound) could send mediaserverover the edge. So, I started to move *every* picture off the sd card onto my computer's HD.

    Knew I was on to something when mediaserver stopped going crazy once usb storage was turned on. So, I moved all the image and movie files off and turned off usb storage. The CPU spun back to100% busy, but slowed back down to about 9o% or more idle.

    Now all I have to do is find the bad file or files, and I can add it to the bugzilla.

    EDIT: It seems that this has also made the cooliris gallery wake up and start updating again. So anyone seeing that the gallery isn't updating may need to see if their mediaserver linux task is unusually busy. If so, offload as many media files as possible and see whap happens...

    Sent from my T-Mobile G2 using Tapatalk
    5
    A temporary solution to the devious mediaserver!

    I couldn't find the cause either. I was on AOKP Build 25. First I noticed the Gallery and Music weren't showing any existing files on the sdcard. Then the phone was always warm, a couple media processes were sucking up all the CPU causing my battery to go down quickly.. What I did which solved the issue was backed up all the important files (pictures, music, titanium backups, etc...) to my PC, reformatted the sdcard, wiped, reflashed the ROM, problem solved.

    As much as I know reformatting usually solves all problems what prevents the problem from reoccurring if we do not know what caused it to begin with? If the problem happened before it will most likely happen again and when It does I want to be ready for it.

    Anyways no luck from GAMEVIL or Watchdog dev. I did however find an app called "System Tuner Pro" that actually sees and identifies mediaserver as a kernel based process and is located in /system/bin/mediaserver. And get this...DUN DUN DUNNNN!!! System Tuner Pro also allows me to kill the stupid process!!! WHOOHOO! Funny thing...when I am playing Arel Wars, which is the culprit behind my mediaserver taking up all my memory, and then switch over to System Tuner Pro and kill mediaserver I can then switch back over to Arel Wars continuing where I left off. So in other words mediaserver does not seem to have a direct impact on the game otherwise the game would error out or close if Arel Wars depended on mediaserver.

    Is this a permanent fix? Nope. But it allows me to kill mediaserver and clean my memory without having to perform a reboot every 5 minutes while playing Arel Wars. I have tried contacting the dev of System Tuner Pro about the problem in hopes I will get a solution, information or somehow to tweak System Tuner Pro to auto kill mediaserver at a certain point. Since it is considered a kernel base process System Tuner Pro will not allow me to put it on auto kill. I will let you know If I get a response.

    Also I have been able to get in contact with the dev of a task killer app called "Auto Memory Manager" which seems to be interested in the problem since the app cannot detect mediaserver. I will you keep you all informed.

    Bottom line this is just a temporary solution but its a lot more then what I have been able to find on other forums. Also consider using an app called "Resource Monitor." It's free and it puts a little monitoring window with the available memory and used CPU in front of all windows so when you are playing a game or listening to music you will always know your memory and cpu so you can take action.

    -peace

    <EDIT>

    By the way I am using stock 2.3.5 Gingerbread which is probably important that I mention. ;P
    3
    "mediaserver" and "Android media process" (media scanner) mixed up!

    Hi!

    I have been experimenting a week or so with this problem and here is what I have found so far:

    I have read many threads about and a common problem seems to be that people mix "mediaserver" and "Android media process" (media scanner) processes. I replied here because JDubbed seems to have analyzed the correct mediaserver problem.

    First I tried all the suggested tricks (putting .nomedia files everywhere, removing sd card, checking mp3s for corruption etc.) but I found that the problem is not the media scanner that people mistakenly think as a mediaserver. I used Watchdog to figure this out. When you unplug USB, the "Android media process" starts and it will use over 50% CPU time for a minute or two, depending how much stuff you have in your phone. It is true that corrupted files might slow this process down, but after a minute or two, the process is gone. It is not the source of the major battery drain and will not show as Media Server in the Android battery stats (it will show as Android system).

    Android media process
    Screenshot_2013-03-02-14-25-59.png


    However, the significant problem seems to be the background process called "mediaserver". This is an Android background process that is used on media streaming and playback. It will not show in Watchdog stats unless you you include phone processes in preferences. This is the Media Server you see in battery stats.

    mediaserver
    Screenshot_2013-03-02-14-19-58.png


    Once triggered, this process seems to stay running forever using same CPU time. I can only get rid of it by rebooting or killing it with System Tuner. I have found a lot of stuff that triggers mediaserver staying in the background. In the list of apps and games I use at least: Dungeon Hunter 3, Soundcloud and Mixcloud. So it is related to streaming media and/or playing audio. It also seems to eat more and more CPU time and RAM the longer you use these apps, like JDubbed found out. The problem is that even the 1,6% CPU time in the above screenshot is preventing my phone to go to deep sleep. It will cause 7-8% battery drain in an hour instead of 2-3% in deep sleep. Constantly raising CPU and RAM amount seems like a possible memory leak to me (it might be just a bugged app instead of bugged mediaserver process), but there might other reasons too. I am now starting to test different I/O schedulers. Maybe some schedulers just don't give media server any CPU cycles when CPU intensive app is running and it crashes while waiting. Anyways, I am running out of ideas and wanted to share this :) Maybe this will spark a new idea from someone.
    3
    the .nomedia method is an ancient method to keep media scanners and such from cataloging contents of a folder in regards to music/picture/NES-SNES roms/etc.

    Though instead of actually creating the file, you can simply go into adb shell:

    Code:
    touch /location/to/place/.nomedia

    It'll simply create an empty file of that name there.

    you can always check the content of a folder with ls -a (-a is for 'all')

    Just be weary of where you put it, and often the media server doesn't suck down your battery unless you're constantly mounting/unmounting the SD card and adding new stuff.

    ALSO you do not have to put it in every subfolder, if you place it at one level, it applies to all subfolders under it.

    Furthermore it helps to actually configure your applications, QuickPic for example lets you include/exclude folders from being queried.
    3
    Probably you have corrupted music/picture file(s) on your sdcard. Search for them and delete - should help.