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

Search This thread

Irzard

New member
Jul 14, 2013
1
0
I think its called "Android System" in App Quarantine (Scary Name!!)

Thanks to rousku- in his/her earlier post mentioning "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)."

Please refer to my attached screen shot, it is the first item in red text colour.

Hopefully this helps.
 

Attachments

  • Screenshot_2013-07-14-20-30-31.jpg
    Screenshot_2013-07-14-20-30-31.jpg
    49.4 KB · Views: 657

NevadaUSA

New member
Aug 22, 2013
1
0
My input on this issue

I posted on another board, am reposting here since they say all the brilliant minds who eat and sleep code live here:

I've been banging around with this issue for a while, here is what I know so far:

  • It happens on multiple types of hardware
  • It happened to me on both stock JB 4.2.1 AND CM 10.1.0 (current OS is CM 10.1.0 on Galaxy S3 i747H)
  • I doubt the root cause is a specific application, but I suspect this is OS bug. I have read this dates back to 2010.
  • I have tried the various tweaks; reformat SD, look for wonky file names, corrupt files etc, etc.



See my screen shots for the wakelocks and battery stats as Mediaserver and AudioIn do their best to kill my battery. ONE CORRELATION I just noticed is this; I am losing the audio notification for events (text message, email), and this seems to coincide with the mediaserver drain/wakelock occurring. I suspect a connection between the lost audio notification and the wakelock under AudioIn.

I have tried everything I can think of and it's a dead end at the moment and very annoying. Any further suggestions are appreciated.
 

bfaf

New member
Oct 13, 2008
1
0
Sorry, but this is the sad true :(

Hello everyone. I've digged a bit in Android source code. All activities are started by Mediaserver. In fact the Mediaserver starts all audio, video and camera services no matter whether the activity needs them. This is not big deal. The real problem comes when activity can't be started for some reason. If that happens better just restart your device. Solving the issue by some other way is impossible or too compicated.

In general if you see the Mediaserver is eating your battery then some activity failed to start. Solution -> restart your device.
 
Last edited:

desgua

Member
Feb 7, 2009
10
2
disabled apps

I think bfaf is right. I had a lot of apps disabled and I was having this issue until I enabled them all. May be Media server was trying to open something that was disabled.
 

Houndcatcher

Senior Member
Oct 30, 2013
193
21
Worthing
A restart rarely fixes it on my S4. The phone will go for days and days without any media server issues cropping up then all of a sudden one day it ramps up and just eats the battery. Today it went from 100% at 9am this morning to 13% when I got home at 5pm. I've already removed my SD card and have no pictures or music in the phone memory either now. I'm about to go back to my iPhone as it's taking up too much time treying to fix it :(
 

shadowfist23

Member
Jul 8, 2011
26
0
Toronto
I got a Moto X recently (I adore my Desire Z, but it just wasn't keeping up) and also had this issue - 25% of my battery power was "Mediaserver". All the research I've done suggests that a "corrupt" media file is at fault, but there's no way whatsoever to determine what the file causing the issue is. Also, this has been a bug in the Android OS for at least 3 years. This boggles me. Maddeningly, this is the same media I had on my Desire Z without issue.

I deleted large swaths of my music collection and moved all my picture off the device, and it seems to have stopped happening (for now). I guess at this point I'm going to wait a few days and see if it returns, and if it doesn't I'll start putting my media back on the device a bit at a time until I can narrow down the problem file(s). My research on the subject suggests this is the only solution available. If you find another, by god please let us know.
 

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.