Media Scanner Fix? - Galaxy S III Q&A, Help & Troubleshooting

Hi guys,
I know there is an issue with the media scanner killing battery, until now I have been disabling the scanner with the rescan media root app.
My Q: Has it been fixed? Or is there a fix where it does not kill battery soo quick?
Thanks in advance
--r1sh12

Bump

Be on a newest possible samsung rom and everything should be fine.. Atleast i dont have any prob.. And siyah kernel included also..
Sent from my GT-I9300 using xda premium

Is pretty easily fixed.
First if you do nandroid backups in the blob format change to .tar and delete any current backups.
If that does not fix it format your sd card.
If still not fixed clear your thumbnail caches.
And as a last resort full wipe and start from scratch.
Sent from my SGS3 using Tapatalk
ROM Sotmax Ultimate V13
Kernel Yank555.lu-V3a

corrsea said:
Is pretty easily fixed.
First if you do nandroid backups in the blob format change to .tar and delete any current backups.
If that does not fix it format your sd card.
If still not fixed clear your thumbnail caches.
And as a last resort full wipe and start from scratch.
Sent from my SGS3 using Tapatalk
ROM Sotmax Ultimate V13
Kernel Yank555.lu-V3a
Click to expand...
Click to collapse
Thanks for the advise
I can't remember what format my backups were.. It was set to the default one. I have a few on my external SD though so I'll move them to PC.
I also have CoPilot on my internal SD so I'm thinking maybe the map cache is causing a problem? I refuse to delete it though just because Google/Samsung have this annoying bug in their software.

Add .nomedia files in all your backup and cache directories, the scanner should then ignore them.
Try stopping Media Storage, clearing data and rebooting before formatting or wiping, run the scanner once after boot then disable with Rescan Media Root app.

Offered ntsDaa
It's my understanding (See Issue 37199 on codeDOTgoogleDOTcom, comment 45) that
MediaScanner: reimplement the ".nomedia" feature for hiding files from the media provider
Previously we ignored any files and directories that had name started with '.'
and ignored any directories that contained a ".nomedia" file.
Now to support transferring any file via MTP, we now add these previously ignored files
to the media database, but will not mark them as audio, video, image or playlist files.
That way they will be included in the files table but will be hidden from the
audio, video, images and playlist views that are used by apps like Music and Gallery.
Click to expand...
Click to collapse
To wit, MediaScanner indexes ALL files irrespective of the presence or absence of a .nomedia file in that directory.
From that same issue it appears that it is because filenames with characters that are also SQL wildcards ( "_" and similar) cause the scan to run slower.
From android googlesource change id I1cd4efbd56a37886cb44a86acb73eb9a3c9f303d
Improve scan time for some cases
When the path being matched has a sqlite wildcard character in it, a "like"
match will be quite slow. Unfortunately this is fairly common, since "_"
is a wildcard character. However, because in most cases the case of the path
in the database will match the case on disk, an "=" match will work, so it
is worthwhile to try an "=" match first, before trying a "like".
If there are no wildcard characters, the "like" will be as fast as the "=",
because of the case-insensitive index on the _data column, so there is no
need to try "=" first in that case.
Click to expand...
Click to collapse
Apparently this is substantially improved in 4.2, but there my knowledge ends; I ran across this while trying to fix an unrelated issue.
EDIT @ 1639UTC: Koushik Dutta said the same thing in his G+ post of 27th December: plusDOTgoogleDOTcom/103583939320326217147/posts/Ntgmq2oniA5

Thanks for the info guys
I disabled media scanning the past few days but none of my stored photos would show in gallery apart from recent ones!
If I can keep my library intact but stop the annoying scanning, then I'll be very happy

I've had it twice for different reasons and it is annoying. Don't bother with freezing and using rescan media as that's just as annoying.
It's easy enough to live with while you're trying to track down the cause. Simply stop media scanner after you boot the phone. In my experience the wakelock will not return until you reboot. Then you can just stop it again. That way everything works
Sent from my SGS3 using Tapatalk
ROM Sotmax Ultimate V13
Kernel Yank555.lu-V3a

fade2black101 said:
Thanks for the info guys
I disabled media scanning the past few days but none of my stored photos would show in gallery apart from recent ones!
If I can keep my library intact but stop the annoying scanning, then I'll be very happy
Click to expand...
Click to collapse
Just enable media scanner occasionally to update your libs
---------- Post added at 10:42 AM ---------- Previous post was at 10:41 AM ----------
corrsea said:
I've had it twice for different reasons and it is annoying. Don't bother with freezing and using rescan media as that's just as annoying.
It's easy enough to live with while you're trying to track down the cause. Simply stop media scanner after you boot the phone. In my experience the wakelock will not return until you reboot. Then you can just stop it again. That way everything works
Sent from my SGS3 using Tapatalk
ROM Sotmax Ultimate V13
Kernel Yank555.lu-V3a
Click to expand...
Click to collapse
^^^^ exactly this....so simple :thumbup:

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

CM10 media scan problem.

Hey.
I'm on CM10 and when i open gallery,or Apollo,or something else,there's no music or pictures showing...
Has anyone have this problem,how to fix it?
Yarman2000 said:
Hey.
I'm on CM10 and when i open gallery,or Apollo,or something else,there's no music or pictures showing...
Has anyone have this problem,how to fix it?
Click to expand...
Click to collapse
This maybe isn't useful to you, but I'm having exactly the same problem. I'm running CM10 FXP133 on my Xperia Ray. Wrote a post a bout it here.
So I guess we're both equally desperate. Anybody please help!
/Daniel
Not sure if this is any good (I don't have time to try it out right now), but I found this.
/Daniel
edit: Nope. Sorry. Didn't work. Crap.
Looks like its a problem with the latest nightly.. it was working fine last release...
Sent from my SCH-I535 using Tapatalk 2
I partially solved my problem. Something had put a .nomedia file in /sdcard, which quite naturally led to problems. I removed the file and did a new scan and now I got photos in the gallery again. Apollo is still empty though, so I'm kinda pulling my hair here. Done the obvious stuff (reboots, clearing cache, purging app data).
/Daniel
Ha! Found the rest of the solution. Seems the media scanner doesn't scan all folders anymore but just some (found out about it in this post). I moved some of my music to /sdcard/downloads, run a scan and suddenly it's there in Apollo.
Oh, and the .nomedia in sdcard root appeared again. No idea where it comes from, but it seems like a good idea to check for it and delete it once in a while. Strange things happen...
Oh. And sorry to the OP for hijacking this thread. I hope some of my mumbling is useful to you
/Daniel
I reflashed rom again,and now in gallery and apollo,media is showing.
Maybe it's a problem with Rom Manager,because that pushed .nomedia files in wrong folders.
DanielMalmgren said:
Ha! Found the rest of the solution. Seems the media scanner doesn't scan all folders anymore but just some (found out about it in this post). I moved some of my music to /sdcard/downloads, run a scan and suddenly it's there in Apollo.
Oh, and the .nomedia in sdcard root appeared again. No idea where it comes from, but it seems like a good idea to check for it and delete it once in a while. Strange things happen...
Oh. And sorry to the OP for hijacking this thread. I hope some of my mumbling is useful to you
/Daniel
Click to expand...
Click to collapse
on galaxy nexus, paranoid android 1.99:
after using Rescan Media Root https://play.google.com/store/apps/details?id=com.addz.mediascannerroot
there's a folder in DCIM called 100ANDRO.
put the music files in there and stock player detects them
put pictures in DCIM>Camera and gallery finds them.
check out Mountain Laurel Handrails http://awoodrailing.com
Similar thing happened to me on CM9, Xperia mini. I deleted the .nomedia file and cleared the app data on music players and things are fine now.
My status on this one right now is that scanning mostly works. It refuses to scan some directories though. If I move all my music to /sdcard/music it's scanned, but in /sdcard/subsonic/music where it's always been before it's not. The only big problem with this is that for example /sdcard/ringtones is not scanned. So according to the system I no longer have any custom ringtones. This gotta be a bug, right?
/Daniel
Maybe you could try another music app like winamp. Because there you can do a manually media scan and as far as I know you can choose the folder where it should scan manually, too. Maybe give it a shot
DanielMalmgren said:
My status on this one right now is that scanning mostly works. It refuses to scan some directories though. If I move all my music to /sdcard/music it's scanned, but in /sdcard/subsonic/music where it's always been before it's not. The only big problem with this is that for example /sdcard/ringtones is not scanned. So according to the system I no longer have any custom ringtones. This gotta be a bug, right?
/Daniel
Click to expand...
Click to collapse
at first i couldn't find my ringtones, put one in sd/ringtones and in the system/media/audio//ringtones
in doing all this i ran SDrescan and rescan media root multiple times.
now i've got two of the same showing up.
one thing the messed me up is that the ringtone filename is not used on the menu.
instead, the ringtone menu is pulling the metadata to tile it.
so I've got my filename 'ringtone.mp3' but it show up in the menu as 'song'
jimmypader said:
at first i couldn't find my ringtones, put one in sd/ringtones and in the system/media/audio//ringtones
in doing all this i ran SDrescan and rescan media root multiple times.
now i've got two of the same showing up.
one thing the messed me up is that the ringtone filename is not used on the menu.
instead, the ringtone menu is pulling the metadata to tile it.
so I've got my filename 'ringtone.mp3' but it show up in the menu as 'song'
Click to expand...
Click to collapse
Ok. I also ended up putting my ringtones in /system/media/audio//ringtones which solves my problems. The media scanner still doesn't want to have anything with the ones in /sdcard/ringtones to do. Guess the media service will need some polishing before CM10 is released
/Daniel
jimmypader said:
on galaxy nexus, paranoid android 1.99:
after using Rescan Media Root https://play.google.com/store/apps/details?id=com.addz.mediascannerroot
there's a folder in DCIM called 100ANDRO.
put the music files in there and stock player detects them
put pictures in DCIM>Camera and gallery finds them.
check out Mountain Laurel Handrails http://awoodrailing.com
Click to expand...
Click to collapse
the method helped me resolved the music files issue but still Im having problem with the gallery pictures...tried to reboot coz that made the music problem solved but it doest worked on the pics...got any other idea?
but all in all THANKS really :laugh:
info: after restarting my phone music is not again detected by the phone. THis is a head exploding problem.

[Q/solved] External SD treated as multiple separate storages

Dear fellow XDA members,
I have run into a problem that I am not really sure of what to do with.
Basically, the problem is this: on my sgs2 gt-i9100 running slimbean (happened on PA 2.10, too, though), My external SD card is being read 3 times by apps such as winamp. It would encounter a song 3 times and list it 3 times because of this.
This is because my card has been mounted to 3 points.Or rather, mounted to /storage/sdcard1 and symlinked twice. I think. The biggest issue is that 2 of 3 cannot be read by any app. They'll list the songs but refuse to play them. Only /storage/sdcard1 works as it should.
Now for me my most obvious option is to remove the symlinks since all apps seem to be fine with the /storage/sdcard1 itself. I did a rm -rf /mnt/extSdCard and also for /extSdCard, but they keep coming back. I looked at vold.fstab but apart from that, I have no idea where to look.
Another thing I should note is that (/mnt)/extSdCard have lrwxrwxrwx rights, but the actually working /storage/sdcard1 has d---rwxr-x.
If anyone could even point me in the right direction, that'd be great. Thank you for your time.
Edit: the symlinks came back every reboot.
Vold.fstab mounts the SD to /storage/sdcard1
Edit 2: I added the rm commands to init.rc, but it doesn't seem to be working.
Edit 3: Winamp is now listing all the songs 4 times. I'm figuiring out where the new link is.
As much as I hate bumping, I feel like I have to in order to maximize my chance of anyone finding this thread.
joeyvanhummel said:
As much as I hate bumping, I feel like I have to in order to maximize my chance of anyone finding this thread.
Click to expand...
Click to collapse
Clear data for winamp, download Rescan media root and run it.
Sent from my GT-I9100 using xda premium
kilometers4 said:
Clear data for winamp, download Rescan media root and run it.
Sent from my GT-I9100 using xda premium
Click to expand...
Click to collapse
Thank you for your quick answer.
I have cleaned cache/data and uninstalled winamp to be sure, and installed and ran media scanner root. I then installed winamp. Sadly, to no avail. It still lists all the songs 4 times, of which only 1 plays. The same goes for other apps that list media, such as Sleep As Android.
I also just now found where the symlinks are being made: /init.smdk4210.rc, but deleting the symlink operations does not help; the file is somehow restored and the symlinks re-made after the reboot. I also haven't been able to find out where the new, 4th symlink is, yet.
joeyvanhummel said:
Thank you for your quick answer.
I have cleaned cache/data and uninstalled winamp to be sure, and installed and ran media scanner root. I then installed winamp. Sadly, to no avail. It still lists all the songs 4 times, of which only 1 plays. The same goes for other apps that list media, such as Sleep As Android.
I also just now found where the symlinks are being made: /init.smdk4210.rc, but deleting the symlink operations does not help; the file is somehow restored and the symlinks re-made after the reboot. I also haven't been able to find out where the new, 4th symlink is, yet.
Click to expand...
Click to collapse
Deleting sym links will not work since they will be recreated by the kernel on boot.
To resolve this clear data for Media Storage and reboot. Run the Media scanner and wait for Media Storage to reindex all the media files. Time for scan will depend on how many media files and recursive directories you have on your SD card so please be patient during the first scan.
Sent from my GT-I9100 using Tapatalk 2
acekay said:
Deleting sym links will not work since they will be recreated by the kernel on boot.
To resolve this clear data for Media Storage and reboot. Run the Media scanner and wait for Media Storage to reindex all the media files. Time for scan will depend on how many media files and recursive directories you have on your SD card so please be patient during the first scan.
Sent from my GT-I9100 using Tapatalk 2
Click to expand...
Click to collapse
Thank you, I did this just after rm -rf'ing the symlinks, and it worked! Not sure if after the reboot it'll scan for media on the symlinks, but atleast I have a workaround.

♚ Media storage issue ♚

I'm running AOKP JB Build 5, and Dagr8's Kernel.
The rom is awesome, but something is wrong with my Media Storage, ever since I ran this rom.
I am suddenly experiencing duplicates of music files, and pictures, all stored on my SD card.
I clear data on Media Storage and reboot. I then have to wait an extremely long time before my SD card finally reads, then back to normal...
But then this re-occurs!
I can't figure out why or how to permanently fix it..
Help?
Sent from my Fish Tank ₪
I have seen users with this issue, when I had double [or ghost/double files] for my pic's [no music I use pandy] it was from restore quickpic from tibu, so I just reinstalled from the Market fresh quickpic app, it fixed that, but I have to from time to time backup my storage and just do a complete format, then put my files back on, I did upgrade to a better quality ext SD and did a fresh format of that and copied my files back on, no issues since then...
A side note, I had these issues going from ICS to Jbean, but since I did the above no issues on this, just my experience.
While I can't confirm this, I do suspect that the issue is caused by duplicate media storage events occurring within the rom.
This can be accomplished a number of ways, but I also suspect that it's an APK compatibility issue.
And depending on the roms used, will manifest itself when more than 1 app stores data, while the second APK will duplicate the data save function.
Check the rom carefully for more than 1 app performing the same function, such as a camera app or music app.
These APK's often have an auto save/restore feature, but save the files under a different file name and basically duplicate the save in 2 places.
Also, apps that auto backup will often save duplicate copies in different locations, by mistake, as they are not always compatible with every build.
Again, it's really a trial and error situation, as so many variables exist, and many apps share duplicated function without registration of a force close event.
I hope in some small way this may help you find the rogue apps.....g

[Q] How to get music app to recognize external SD?

Ok I have a bunch of music on my external SD card. Searching through the forums, I came across the Directory Bind app which seems to be extremely useful. My problem is that I am not quite sure where to point source and target so that Google's Music App recognizes the mp3s on my external drive.
I have the Samsung Galaxy S2 Skyrocket, using Jelly Bean (SlimBean Rom)
My sd card directory is at: /sdcard, or /storage/sdcard.
My external music is at: /storage/sdcard1/music
The potential source (or target?) directories I see are:
/data/data/com.google.android.music
/data/data/com.android.music
Tried both to no luck. Any tips?
Shouldn't Media Scanner be picking up those files on boot? I don't think you should have to manually point the Google Music app to the directory. Is there a ".nomedia" file in the directory where your music is located?
I don't see that file. If should media scanner pick it up even if it's the external card?
It does on mine.
Hmm. I tried a couple things:
- Reformatted SD card (slow format to FAT32)
- Place just one album on the clean SD card
This seemed to work ok.
But when I dumped 3 GB of music on the 32GB-size SD card, it seems that BetterBatteryStats indicates that since boot, MediaScannerService has been running non-stop.
How long should it really take to scan 3GB of media on a 32GB SD card to get it in the Media Library?
Note: The SD card also has a clockworkmod directory. Not sure if that was causing a slow down, but I added a .nomedia file to the clockworkmod directory in hopes that it will speed it up.
Any ideas?
Why is this here, he has a skyrocket.
Sent from my Zanpakuto using Getsuga Tensho!
Nick281051 said:
Why is this here, he has a skyrocket.
Sent from my Zanpakuto using Getsuga Tensho!
Click to expand...
Click to collapse
Just helping people out
Mods feel free to relocate this thread to the appropriate forum. My mistake.
So I tried a few more things.
I added .nomedia to the clockworkmod (multiple subdirectories) as well as other non-music directories and added just three albums (40 songs) to the music directory.
It took about 3 minutes for Media Scanner to finish adding the albums based on BetterBatteryStats, ~1 album a minute. After that, I saw them in the Music app. I'm now going to load ~30-40 albums and hope for the best.
Update:
Success! It only took 3 minutes to scan after loading 30-40 albums. So I'll chalk this thread as solved with the following solutions:
1) Reformat to make sure SD card is clean and ready
2) Put .nomedia files in anything but music. I have a feeling the 6000+ clockworkmod blob files slowed the scan to a halt earlier. .nomedia fixed it.
Thanks all.
plarser48 said:
Mods feel free to relocate this thread to the appropriate forum. My mistake.
So I tried a few more things.
I added .nomedia to the clockworkmod (multiple subdirectories) as well as other non-music directories and added just three albums (40 songs) to the music directory.
It took about 3 minutes for Media Scanner to finish adding the albums based on BetterBatteryStats, ~1 album a minute. After that, I saw them in the Music app. I'm now going to load ~30-40 albums and hope for the best.
Click to expand...
Click to collapse
If I'm not mistaken, media scanner scans all files on your disks regardless of what they contain. The purpose of the .nomedia files is to "hide" any media files present from the media scanner so they don't show up in the gallery, music player, etc. So your 3 minute runtime is for all the files on your system, not just the 3 albums you added.
Sent from my SGH-I777 using xda app-developers app
---------- Post added at 12:35 AM ---------- Previous post was at 12:29 AM ----------
plarser48 said:
Update:
Success! It only took 3 minutes to scan after loading 30-40 albums. So I'll chalk this thread as solved with the following solutions:
1) Reformat to make sure SD card is clean and ready
2) Put .nomedia files in anything but music. I have a feeling the 6000+ clockworkmod blob files slowed the scan to a halt earlier. .nomedia fixed it.
Thanks all.
Click to expand...
Click to collapse
If you have that many blob files in your clockworkmod directory you might want to try the "delete unused backup data" option in CWM under "backup and restore". I managed tho accumulate lots of empty files there by deleting old backups via my file explorer instead of through CWM. It was causing some pretty long (20 minute plus) scan times for my system. Now under 2 to 3 with 12 gigs of music.
Sent from my SGH-I777 using xda app-developers app

Categories

Resources