Media scanner battery drain - searching for reason - Android Q&A, Help & Troubleshooting

Hi there,
As many folks around i am experiencing massive battery drain from *wakelock*/mediaplayer while music playback.
For now, i have tried everything:
- full wipe
- music playback on fresh wiped rom
- formatting sdcard / internal storage
- disabling media server
- debugging with logcat
- ...
Currently, the mediaserver drains more power then any other process, including screen. The phone gets not hot, but warm while only playing music with screen off. That was not happening before, as i listen music daily.
After all, the problem is most likely caused by a corrupt file, but how can i locate this file ? I have 2300 mp3s on my phone, so testing every single one would be a bit complicated...
Sent from my GT-I9100 using xda premium

Have you tried using another music player?
Sent from my HTC Wildfire using xda premium

Yep, apollo, poweramp, stock..
In case of poweramp i can differ, mediaserver holds a different wakelock as poweramp
Sent from my GT-I9100 using xda premium

Nothing new...
I killed my whole mp3 directory... left only one mp3 file - and guess what? Still mediaserver drain while playback...
Sent from my GT-I9100 using xda premium

Yeah I have the same problem too, not very fun seeing your battery drop!

News about that ? Same problem here.
Envoyé depuis mon Galaxy Nexus avec Tapatalk

Nah... now with cm10 it is even worser for me..
Sent from my GT-I9100 using xda premium

Has anyone found a fix yet?
I've been seeing this behaviour as well on my CM10 GT-I9100
Removing media files helps in shortening the wakelock
I don't see much impact from video files or pictures, I do however see it with music.
Once I start adding mp3's mediascanner service takes longer and longer.
Eventually it drains about 10% of my battery at startup with a wakelock of about 10 minutes (more or less)

At one point, I found Google+ had been installing a 'hangout_ding.mp4' file to my sdcard which was corrupt. This was only on my phone, my tablet was unaffected. A scan of my system log (watching through ddms the boot process) showed when it couldn't read the file information properly. Removing the file would get it working again, but it kept replacing it, I ended up disabling the app and almost forgetting about it. Suffice to say, I remember seeing that this was most common with mp4s, have you also isolated your ringtones and such? If a newer phone, does it have an internal storage (besides /data)? If so, have you tried looking for the culprit there as well?

daveid said:
At one point, I found Google+ had been installing a 'hangout_ding.mp4' file to my sdcard which was corrupt.
Click to expand...
Click to collapse
This is the main problem - finding the file(s) responsible for the misbehaviour.
Or is it the sheer number of files involved? (with pics + music it goes in the thousands)
I used a media checker on the sdcard offline to see which of my music files were bad, but there were many and so many different errors.
There are no easy to use apps afaik that we can use to find them.
It's hard to figure out what trips mediascanner.
You mentioned ddms.
I'll try and use that first to debug mediascannerservice.
thanks, and I'll report my findings

1ist ndayedro
I used ddms to monitor the messages of the mediastorage app while it scans.
At first it found some corrupt media files which I consequently removed.
After that no more useful warnings or erros popped up.
Removing the few corrupt media files changed nothing in the wakelock time...
MediaScannerService still uses full cpu at boot for about 5 minutes...
Any other ideas?

Related

[Q] ICS Passion v7 - "Media" process killing battery

The android.media.process is taking a large chunk of my battery. I haven't seen this process on any of the previous ICS passion roms. Can anybody tell me why this is constantly running?
Here's a couple screen shots. I would ask the dev but I'm a couple posts away from being able to do so. Hopefully he'll read this and explain why it would be different than the previous versions..
Try clearing data for all those services mentioned.
It's weird, I've seen this problem a lot in the thread, but I don't have it.
What are you syncing, by the way? Which do you have enabled?
Only thing synced is my gmail. I make sure to go through all of the settings and uncheck anything that would run in the background. I'll update after I clear out my cache.
Alright, hm.. could be a faulty app, too.
Let me know how it goes.
Cleared cache from recovery, set permissions.. etc. Its still running. It must be something different with this rom... I may just return to 6.5. I had no problems with it and I have gotten used to no GPS.
Sent from my SGH-T959 using XDA App
pillowmissile said:
Cleared cache from recovery, set permissions.. etc. Its still running. It must be something different with this rom... I may just return to 6.5. I had no problems with it and I have gotten used to no GPS.
Sent from my SGH-T959 using XDA App
Click to expand...
Click to collapse
I'm having this issue with V7 too. I read online that it could be a corrupt media file causing it. Apparently, you need to move your media off you SD card to see if it helps.
Haven't tried it yet
You can figure out what media it is scanning and then in that file open it up and put a .nomedia file in it and when your media scanner is engaged, it will skip over that particular file.
Be careful with .nomedia files b/c if you put them in say DCIM or you album art, take a wild guess what you'll see in your media player or your gallery.
.nomedias work as long as your make sure you know where they go. Wouldn't make sense to put on right in the root of your SD now would it? But find the file it keeps scanning and put one in there.
In my experience just let media process run until it eventually stops 10-15 min.. then reboot. Should stop excessive CPU usage after a couple reboots and data built.
I also .nomedia titanium backup and CWM.
Otherwise you may have a corrupt file causing this. I thought so at 1st but maybe its something with this ROM. I formatted my SDcard and media process still loose at boot. So just give time for it to settle and it usually goes away.
Sent from my SGH-T959 using XDA App

[Q] mediaserver battery drain

Hi all,
I'm having some trouble with battery drainage. Main cause is mediaserver, I have searched, and (for other devices) they suggested moving my pictures and videos off the sdcard. I have no additional media files since before this mediaserver issue began so I don't know what the problem is.
As you can see from the image, battery drains normally, then the sudden drop.
Can anyone shed any light on this? Are there any other people with the same issue?
One thing I did was flashing latest firmware from sammobile. Was fine for the first few days but suddenly this happened..
I used to have this problem. I think it might have been caused by a corrupt media file, which made the media scanner get "stuck" on that file. I deleted everything in my /sdcard/ folder which solved the issue. I'm not 100% sure, that this was the solution though, since I did a few factory resets at the same time, but the problem is gone and so is the excessive battery drain.
Sent from my GT-I9300
member68 said:
I used to have this problem. I think it might have been caused by a corrupt media file, which made the media scanner get "stuck" on that file. I deleted everything in my /sdcard/ folder which solved the issue. I'm not 100% sure, that this was the solution though, since I did a few factory resets at the same time, but the problem is gone and so is the excessive battery drain.
Sent from my GT-I9300
Click to expand...
Click to collapse
when you say deleted everything, literally the entire contents of the sd card? on my nexus there is no external one so that means deleting all the notification/gallery/system files too??
yep wanna ask the same thing. I haven't actually had any media I've added myself, which probably means it may be a file from one of the apps.
Will I have to go through all of them and delete? The mediaserver seem okay now but I'm worried about when it might go off again..
Sent from my GT-I9300 using xda premium
Had the same problem yesterday.. no new apps or anything. Looks like I solved it by emptying my photo roll. Suspecting it could be a video I recently filmed. The thumbnail was all black, so guessing that was the culprit.
Edit: And just after typing this I noticed Media was up at 20% usage again.
The problem started happening again. It's really hard to pinpoint this problem. For me, it only happens charging, but not when the phone is unplugged. I hope this is a rom issue which gets resolved in the next version.
Sent from my GT-I9300
Are u using viber or something similar? I never saw mediaserver in battery hog list unless i started using viber
I've never even heard of Viber. I might have a different issue though since I don't have a constant wake lock. Whenever my phone started acting up, I found a lot of repeating logcat messages related to the media scanner. It might be something completely different though.
Sent from my GT-I9300
maybe a fix
i had the same problem after wipe clean and fresh install of JB.
I dont know exactly what solved it but here is what i did:
1. disable media store
2. clear media store data
2.5 executed playerpro application while media store is disabled
3. deleted all .nomedia files i could find
4. deleted the Player Pro album art directory content.
5. deleted all image caches of all applications i could find
6. enabled media store
Google doesn't really care?
http://code.google.com/p/android/issues/detail?id=37298

[Q] Media Server killing battery

I was checking my battery status in settings and noticed Media Server has taken 56% of my battery, and has caused my phone to stay awake for over 18 hours and has almost 5 hours of CPU time. I have been getting over a days worth of battery with 4-5 hours of screen on time, I am currently at 22 hours with only 1.5 hours of screen on time. I don't see a way to stop it from running in Application Manager.
Is there a way to stop this process from keeping my phone awake? Is this connected with any particular application, or called something else in Application Manager?
I'm having the same issue as well.
I've seen it take a decent chunk more than once. Only like 15% at max so I'm not doing nearly as bad though. I'm curious about what it is exactly as well.
flaring afro said:
I've seen it take a decent chunk more than once. Only like 15% at max so I'm not doing nearly as bad though. I'm curious about what it is exactly as well.
Click to expand...
Click to collapse
Yeah I have always noticed it on my list, but it was never a huge drain on the battery. Like you said in the 15% range, all of the sudden though it just jumped up to over 50%. I can't think of an application I have used to make it use such a huge chunk of my battery.
So I went back into Application Manager and noticed under the Running tab that there was a "Show cached processes" option in the top right corner. Under that there was a Media application listed that uses the "android.process.media" process. Any chance that this could be related to the Media Server, or am I heading in the wrong direction?
I have recharged and restarted my phone, and Media Server is back down to 6% after discharging for 5 hours. I would just like to know what I possibly did to make my battery drain so quickly. I haven't watched any movies or videos and Pandora is the only time I listen to music on my phone.
According to my research, the media service covers scanning your internal and external sdcards for media files, including music, pictures and videos. If one file is corrupted in some way, it can cause the service to hang. That said, mine was doing the same thing. There's an app on the play store called Media Rescan Root that blocks the service at boot. The stock media player, player pro, and probably others use the media service to find new songs added to the sdcard. I switched over to PowerAmp which does its own search which doesn't hang like that. That's what I reccomend.
Sent from my GN2 using XDA Premium HD app
Do you have Drive installed?
I had the same issue with media server eating up about 60% battery. I have Google Drive installed and have around 1gb data in it. In accounts my sync settings were set to always sync Drive. I unchecked this and the media server issue seemed to have been resolved.See if this helps you.
_paradox said:
I had the same issue with media server eating up about 60% battery. I have Google Drive installed and have around 1gb data in it. In accounts my sync settings were set to always sync Drive. I unchecked this and the media server issue seemed to have been resolved.See if this helps you.
Click to expand...
Click to collapse
I unchecked media sync, and put back in my SD card, which has about 12 gb of music on it. Within 10 minutes, the media scanner jumped from .02% to 12%, so this didn't seem to make a difference for me.
TallgeeseIV said:
According to my research, the media service covers scanning your internal and external sdcards for media files, including music, pictures and videos. If one file is corrupted in some way, it can cause the service to hang. That said, mine was doing the same thing. There's an app on the play store called Media Rescan Root that blocks the service at boot. The stock media player, player pro, and probably others use the media service to find new songs added to the sdcard. I switched over to PowerAmp which does its own search which doesn't hang like that. That's what I reccomend.
Sent from my GN2 using XDA Premium HD app
Click to expand...
Click to collapse
Same thing happened to me. Mine turned out to be m4a files that were causing. I removed them and no longer see mediaserver power drain.
I read a forum a few days ago that talked about wifi causing the media service drain. They said to set a static IP address instead of dynamic and that would solve the problem. I spend most of my time on wifi so this makes a little bit of sense to me. I have set a static address and so far today my media service has remained at 3%. I don't have the link to the forum right now but I'll try to find it again and link to it later.
Sent from my SCH-I605 using xda app-developers app
Edit: Apparently that did not last long. My Media Server stayed down at 2% for several hours but then for no aparent reason it spiked up to its current usage of 31% (2hr CPU time and 7hr of Stay Awake). I would really like to know what is causing this.

[SOLVED] Media Server battery usage increased by CF-autoroot

Is it normal to have a steady 10% battery usage by Media Server?
Re: Media Server battery usage
Do you listen to a lot of music, or listen regularly, more to the point? 10% usage indicates to me you are just listening to music, if it jumps right up then you might have the media bug, but doesn't sound like it to me, from that stat
slaphead20 said:
Do you listen to a lot of music, or listen regularly, more to the point? 10% usage indicates to me you are just listening to music, if it jumps right up then you might have the media bug, but doesn't sound like it to me, from that stat
Click to expand...
Click to collapse
Actually I don't listen to music at all (with the phone), that's why I don't understand the media server running constantly.
I have the latest BTU EMB1 firmware. Installed wiping all data.
Re: Media Server battery usage
jurijvi said:
Actually I don't listen to music at all (with the phone), that's why I don't understand the media server running constantly.
I have the latest BTU EMB1 firmware. Installed wiping all data.
Click to expand...
Click to collapse
Hmm, well you can disable the media scanner with rescan media root from Play, do you have a lot of pictures or other media?
It can also run a lot if your sd card is corrupt, if you ever get messages that your card has been ejected then the media scanner will run again after each mount.
Another problem can be nandroid backups, if you use the wrong format you end up with thousands of tiny files which makes the scanner run for ages.
Re: Media Server battery usage
Just to share, yesterday I changed my stock battery for an extended Hyperion 4400, media scanner drain 5% of it in 15 min, the device was also hot, I had to force close the media scanner several times until I reboot twice and it stopped, got annoyed by it, and it's also first time it happens, nothing abnormal in my sd or internal.
Sent from my GT-I9300 using Tapatalk 2
boomboomer said:
It can also run a lot if your sd card is corrupt, if you ever get messages that your card has been ejected then the media scanner will run again after each mount.
Another problem can be nandroid backups, if you use the wrong format you end up with thousands of tiny files which makes the scanner run for ages.
Click to expand...
Click to collapse
I don't have problem with the card being ejected. However I have titanium backup running twice a week. It does create a fair amount of files.
Could that be the issue?
slaphead20 said:
Hmm, well you can disable the media scanner with rescan media root from Play, do you have a lot of pictures or other media?
Click to expand...
Click to collapse
I have a "normal" amount of pix, like less than a hundred. Few videos and that's about it.
jurijvi said:
I have a "normal" amount of pix, like less than a hundred. Few videos and that's about it.
Click to expand...
Click to collapse
I turned off Google+ while having the same issue and it fixed the problems. Turn off all the settings for it.
wga22 said:
I turned off Google+ while having the same issue and it fixed the problems. Turn off all the settings for it.
Click to expand...
Click to collapse
I have all the settings deselected for Google +. No notification, no instant upload etc..
I just re-flashed the latest BTU rom. No more media server draining the battery. However after rooting with CF-root, the media server started to show up with a steady 10% rate!

[Q] "Media" app draining my battery?

Hi all, thanks in advance for any help you can offer.
I've been going between 2 ROMs recently (Tron 2.1 and PAC-Man 23.0). For both of them, it is showing that the "Media" app is using a larger percentage of my battery (around 18%). I'm just not sure what this app is, or how to disable or remove it.
When I click on the app from the Battery details, "Force Stop" and "Report" are disabled buttons. Down below, it shows the included packages being "Downloads", "Media Storage", "Download Manager", "DRM Protected Content". I haven't been downloading anything, nor adding songs or movies, so I'm not sure what this "app" is spending its cycles doing.
Thanks!
I guess that it would be a better idea to report this incident to the ROM developer..
I have the same problem sometimes. After a google search I found that basically, your phone is searching for all the media on your internal and external storage. What causes the wake lock is that it is searching for or has found a file that is corrupt. It basically gets stuck on that file for awhile.
I had the wake lock for a couple days then it just went away.
Sent from my Infected Rezound using xda app-developers app
sanders539 said:
I have the same problem sometimes. After a google search I found that basically, your phone is searching for all the media on your internal and external storage. What causes the wake lock is that it is searching for or has found a file that is corrupt. It basically gets stuck on that file for awhile.
I had the wake lock for a couple days then it just went away.
Sent from my Infected Rezound using xda app-developers app
Click to expand...
Click to collapse
That is really interesting! Using a previous ROM, I do have a few corrupted images from a camera-app-gone-haywire. I'll have to clean those out (which I should have done anyway), and see if that helps.
Great idea!
No problem! I should go through and clean my SD card out, but I am too lazy and don't have the time to spend on it. I just deal with it because I usually have a charger nearby most of the time.
Sent from my Infected Rezound using xda app-developers app
Check to make sure the .thumbnails folder in the DCIM folder isnt overloaded with 2GB of images. Dont use the stock camera app regardless what ROM you are on. It accesses the stock Gallery app which in turns eventually creates thousands and thousands of "thumbnail" images. More like small pics at about 400x300 resolution. It JAMS up android.process.media .. hell.. it would make my phone hot because sometimes it ran straight for 24 minutes killing cpu.. deleted all the files in there and stopped using the stock app, no more problem.
THE-COPS said:
Check to make sure the .thumbnails folder in the DCIM folder isnt overloaded with 2GB of images. Dont use the stock camera app regardless what ROM you are on. It accesses the stock Gallery app which in turns eventually creates thousands and thousands of "thumbnail" images. More like small pics at about 400x300 resolution. It JAMS up android.process.media .. hell.. it would make my phone hot because sometimes it ran straight for 24 minutes killing cpu.. deleted all the files in there and stopped using the stock app, no more problem.
Click to expand...
Click to collapse
So what do we do when we have been using the stock gallery and camera app? Can I delete the .thumbnails folder? What kind of camera and gallery app do you recommend? I have both stock samsung and stock android camera that I use everyday...
I have been using my phone (unrooted stock) for quite some time now and only recently did the media act up on me and killing the battery. I have rooted and install custom rom and reformatted my sdcard.
It'll now i kinda check the battery more frequently.
Dan_L said:
So what do we do when we have been using the stock gallery and camera app? Can I delete the .thumbnails folder? What kind of camera and gallery app do you recommend? I have both stock samsung and stock android camera that I use everyday...
I have been using my phone (unrooted stock) for quite some time now and only recently did the media act up on me and killing the battery. I have rooted and install custom rom and reformatted my sdcard.
It'll now i kinda check the battery more frequently.
Click to expand...
Click to collapse
Just following up (I asked the original question). What I've found is that between various ROMs, I have two images folders on my sdcard. Mostly, I just went through and deleted a few invalid images (I think my Tron 2.0 ROM used to take corrupt images, but no longer). I cleaned out many many images I no longer needed as well.
Also, not sure if this is related: I uninstalled and reinstalled Google+ (which has an image auto-backup feature). I had been restoring it from a backup, and I think it got corrupted along the way. It was no longer automatically backing up images, for example.
Since then, I've been in much better shape, and I haven't noticed the Media process taking as much battery.

Categories

Resources