[Q] /system/media/audio/ringtones show up multiple times

apexofservice

Senior Member
Jan 22, 2011
133
4
0
I added some files to /system/media/audio/ringtones using terminal emulator and busybox mv:

Code:
#busybox mv thisfile.mp3 /system/media/audio/ringtones
After that, all my ringtones appear in my menu twice (except the one I just added, which appears once).

Then I added another few files using the same method, after reboot, all my original ringtones show up three times, the ones from the first round show up twice and the ones I had just added show up once.

It seems that everytime I touch this directory (/system/media/audio/ringtones) android is appending to the menu everything that's in the file, but it's not doing the right thing with things that are already in the list.

I doubled checked that these files do not appear more than once in the filesystem. Has anyone seen this? It may be related to the question asked in this thread (which was never solved or replied to):

http://forum.xda-developers.com/showthread.php?t=968091

Anyone else experienced this? Know how to fix? I love each one of you.
 

CuriousTech

Senior Member
Nov 16, 2010
535
64
0
Floor
Most likely there are multiple instances of the same files or you're confusing media scanner, which runs and boot or when USB is disconnected. It won't detect changes to sdcard/media until it runs again.

The system directory structure is like this:
/system/media/audio/alarms
/system/media/audio/notifications
/system/media/audio/ringtones

And different apps may list 1, 2 or all of these, plus others found by media scanner such as:
/sdcard/media/audio/alarms
/sdcard/media/audio/notifications
/sdcard/media/audio/ringtones

And possibly /sdcard/external_sd/media/*

Just try to keep it organized and don't add anything to root so it's not as much trouble keeping out the duplicates and you won't lose any when flashing new roms.
 

Red_81

Senior Member
Dec 5, 2010
1,367
672
0
St.Louis Metro
1. go into settings --> applications --> manage applications --> all --> media container. Force a stop and clear data

2. Repeat for the media storage

3. Reboot

When your phone comes back up it will do a full media scan. If you still have duplicates after this point then you have extra media directories as CuriousTech suggested.
 

apexofservice

Senior Member
Jan 22, 2011
133
4
0
Well I followed your advice and did a force stop and clear data, then rebooted.

Now, when I go into setting > sounds, the set ringtone option is totally greyed out, not available. But when I.open a term and do
su
ls /system/media/audio/ringtones
I see the whole list of files.

Maybe my permissions are wrong?
Idk, ideas?
 

apexofservice

Senior Member
Jan 22, 2011
133
4
0
Okay, permissions on each of the files in /system/media/audio/ringtones are each set to rwxrwxr-x
, which seems pretty permissive, so I guess this ism't the issue. Owner is root, grp is root.
I'm stumped.
 

apexofservice

Senior Member
Jan 22, 2011
133
4
0
whoops

Okay, I was wrong originally, I actually did have multiple versions of my files in the /system/media/audio directory.

It actually looked like this:

Code:
/system/media/audio $ ls
Audio
ringtones
ui
notifications
alarms
Anyway, I fixed that up:

Code:
/system/media/audio $ busybox diff Audio/ringtones ringtones
Only in ringtones: ATT_Tone.ogg
Only in ringtones: Chrome_Ring.ogg
Only in ringtones: Classic-Bell.mp3
Only in ringtones: Clear_Sky.ogg
Only in ringtones: Dark_Alley.ogg
Only in ringtones: Dramatic_Piano.ogg
Only in ringtones: Drum_Roll.ogg
Only in ringtones: Glam.ogg
Only in ringtones: Grass_Meadow.ogg
Only in ringtones: Magenta.ogg
Only in ringtones: Organic.ogg
Only in ringtones: Pure_Tone.ogg
Only in ringtones: Rings.ogg
Only in ringtones: Risk.ogg
Only in ringtones: Rock_Star.ogg
Only in ringtones: Standard.ogg
Only in ringtones: Urgent.ogg
/system/media/audio $ busybox diff Audio/notifications notifications
Only in notifications: 20_Cloud.ogg
Only in notifications: Bells.ogg
Only in notifications: Chrome_Alert.ogg
Only in notifications: Dark_Alley_alert.ogg
Only in notifications: Glam_alert.ogg
Only in notifications: Grass_Meadow_alert.ogg
Only in notifications: Hey_Hey.ogg
Only in notifications: Pure_Tone_alert.ogg
Only in notifications: Urget_alert.ogg
Only in notifications: Wooden_Percussion_alert.ogg

# now confident that i can remove Audio
/system/media/audio $ rm -r Audio
/system/media/audio $ ls
ringtones
ui
notifications
alarms
/system/media/audio $ reboot
Upon reboot media scanner ran, but I'm still seeing the options to set voice call ringtone and notifications grayed out in settings >> Sound.

I also looked in settings >> applications >> manage applications >> all and to my surprise Media Container Service has 0.00B of data and all options are grayed out.

This still smells like a permissions problem to me (files are demonstrably present but certain users/apps can't see them), but these look pretty permissive to me:

Code:
/system/media/audio/ringtones $ ls -l -a
-rw-r--r-- root     root        65858 2011-04-26 20:09 Standard.ogg
-rw-r--r-- root     root        28084 2011-04-26 20:09 Organic.ogg
-rw-r--r-- root     root       155860 2011-04-26 20:09 Glam.ogg
-rwxrwxr-x root     root        48968 2011-04-29 17:28 BussaMove.ogg
-rwxrwxr-x root     root        31563 2011-04-29 17:28 EtherShake.ogg
-rwxrwxr-x root     root        38875 2011-04-29 17:28 Calypso_Steel.ogg
-rwxrwxr-x root     root        15364 2011-04-29 17:28 .DS_Store
-rwxrwxr-x root     root        46673 2011-04-29 17:28 Big_Easy.ogg
-rwxrwxr-x root     root        39199 2011-04-29 17:28 Paradise_Island.ogg
-rw-r--r-- root     root       182993 2011-04-26 20:09 Urgent.ogg
-rwxrwxr-x root     root        39413 2011-04-29 17:28 Shes_All_That.ogg
-rw-r--r-- root     root       404678 2011-04-26 20:09 Drum_Roll.ogg
-rwxrwxr-x root     root        44104 2011-04-29 17:28 Nassau.ogg
-rwxrwxr-x root     root        32640 2011-04-29 17:28 OrganDub.ogg
-rwxrwxr-x root     root        37672 2011-04-29 17:28 Cairo.ogg
-rwxrwxr-x root     root        36049 2011-04-29 17:28 Backroad.ogg
-rwxrwxr-x root     root       164830 2011-04-29 17:28 Radiation.ogg
-rwxrwxr-x root     root        32933 2011-04-29 17:28 No_Limits.ogg
-rw-r--r-- root     root       151611 2011-04-26 20:09 Dark_Alley.ogg
-rw-r--r-- root     root       349687 2011-04-26 20:09 Risk.ogg
-rw-r--r-- root     root        54307 2011-04-26 20:09 Chrome_Ring.ogg
-rwxrwxr-x root     root        31136 2011-04-29 17:28 World.ogg
-rwxrwxr-x root     root        26298 2011-04-29 17:28 TwirlAway.ogg
-rwxrwxr-x root     root        68588 2011-04-29 17:28 HalfwayHome.ogg
-rwxrwxr-x root     root       113055 2011-04-29 17:28 FreeFlight.ogg
-rwxrwxr-x root     root        44186 2011-04-29 17:28 SilkyWay.ogg
-rw-r--r-- root     root       151788 2011-04-26 20:09 Grass_Meadow.ogg
-rwxrwxr-x root     root        34864 2011-04-29 17:28 MildlyAlarming.ogg
-rwxrwxr-x root     root        44422 2011-04-29 17:28 Seville.ogg
-rwxrwxr-x root     root        37179 2011-04-29 17:28 Club_Cubano.ogg
-rwxrwxr-x root     root        39921 2011-04-29 17:28 Champagne_Edition.ogg
-rwxrwxr-x system   sdcard_rw   100035 2011-04-28 22:46 Classic-Bell.mp3
-rw-r--r-- root     root       490616 2011-04-26 20:09 Rock_Star.ogg
-rwxrwxr-x root     root        52809 2011-04-29 17:28 Ring_Synth_02.ogg
-rw-r--r-- root     root       164810 2011-04-26 20:09 ATT_Tone.ogg
-rwxrwxr-x root     root        42097 2011-04-29 17:28 LosAngeles2019.ogg
-rwxrwxr-x root     root        38307 2011-04-29 17:28 LoopyLounge.ogg
-rwxrwxr-x root     root        36620 2011-04-29 17:28 Terminated.ogg
-rwxrwxr-x root     root        50545 2011-04-29 17:28 DonMessWivIt.ogg
-rw-r--r-- root     root       776419 2011-04-26 20:09 Magenta.ogg
-rwxrwxr-x root     root        36539 2011-04-29 17:28 Third_Eye.ogg
-rwxrwxr-x root     root        61434 2011-04-29 17:28 DancinFool.ogg
-rwxrwxr-x root     root        56616 2011-04-29 17:28 Playa.ogg
-rwxrwxr-x root     root        43965 2011-04-29 17:28 Ring_Synth_04.ogg
-rwxrwxr-x root     root        41355 2011-04-29 17:28 Nairobi.ogg
-rwxrwxr-x root     root        54923 2011-04-29 17:28 Glacial_Groove.ogg
-rwxrwxr-x root     root        30925 2011-04-29 17:28 CurveBall.ogg
-rwxrwxr-x root     root        49108 2011-04-29 17:28 Road_Trip.ogg
-rw-r--r-- root     root        62984 2011-04-26 20:09 Rings.ogg
-rwxrwxr-x root     root        37952 2011-04-29 17:28 CrayonRock.ogg
-rwxrwxr-x root     root        42220 2011-04-29 17:28 Safari.ogg
-rw-r--r-- root     root       176446 2011-04-26 20:09 Pure_Tone.ogg
-rwxrwxr-x root     root        28124 2011-04-29 17:28 MidEvilJaunt.ogg
-rwxrwxr-x root     root        50578 2011-04-29 17:28 Eastern_Sky.ogg
-rwxrwxr-x root     root        15476 2011-04-29 17:28 Ding.ogg
-rwxrwxr-x root     root        34627 2011-04-29 17:28 LoveFlute.ogg
-rw-r--r-- root     root        49808 2011-04-26 20:09 Dramatic_Piano.ogg
-rwxrwxr-x root     root        61699 2011-04-29 17:28 Enter_the_Nexus.ogg
-rwxrwxr-x root     root        21007 2011-04-29 17:28 Ring_Digital_02.ogg
-rwxrwxr-x root     root        39174 2011-04-29 17:28 Bollywood.ogg
-rwxrwxr-x root     root        37847 2011-04-29 17:28 Steppin_Out.ogg
-rwxrwxr-x root     root        38688 2011-04-29 17:28 Gimme_Mo_Town.ogg
-rwxrwxr-x root     root        41094 2011-04-29 17:28 Growl.ogg
-rwxrwxr-x root     root        59024 2011-04-29 17:28 Ring_Classic_02.ogg
-rwxrwxr-x root     root        39738 2011-04-29 17:28 Funk_Yall.ogg
-rw-r--r-- root     root       757920 2011-04-26 20:09 Clear_Sky.ogg
-rwxrwxr-x root     root        41828 2011-04-29 17:28 BirdLoop.ogg
Can anyone help?
 

apexofservice

Senior Member
Jan 22, 2011
133
4
0
okay, this thread has become a conversation with myself, but i'm still updating as I get new info just for the record.

so, this is quite st00pid, but it turns out that you can't set a ringtone or notification tone if the volume on the ringer is set to 0. well, i guess that makes sense in some way, but i certainly found it vexing.

finally, i have to report that i'm still seeing doubles in the list of apps. i'm going to do a find command from the root and see if I really do have doubles still around.

many thanks to all who contributed.
 

CuriousTech

Senior Member
Nov 16, 2010
535
64
0
Floor
Well, at least it's not tripples. ;)

I was trying to find an app that shows where media files are but no luck. Ringdroid will show them all but not where they are located. We need something simple like Galery which shows I have 5 ShootMe snapshots in cache. lol
 

apexofservice

Senior Member
Jan 22, 2011
133
4
0
Well, if you just want to know where media files are you can just get a shell and say
Code:
$find / -name "*ogg"
to find all ogg files (for example).
 

ehasalm

New member
Apr 4, 2011
2
0
0
Did you ever find another directory that had the same files? By the way, the name in the list of available ringtones comes from Tag data in the .ogg file.
I had the same problem with my I9000, I picked one ringtone (for example one which named Sunshine, which is doubled) and made find / -name *Sunshine*, and I found it in the system/audio/ringtones, but also in sdcard/ringtones, I deleted the folder, then made clear cache of the media storage in setting>applicaiton>all, rebooted and the problem was solved.
 

drbuck

Member
Aug 15, 2009
9
0
0
1. go into settings --> applications --> manage applications --> all --> media container. Force a stop and clear data

2. Repeat for the media storage

3. Reboot

When your phone comes back up it will do a full media scan. If you still have duplicates after this point then you have extra media directories as CuriousTech suggested.
Thanks! This works for me.
 

MnCC

Member
May 13, 2010
40
18
0
1. go into settings --> applications --> manage applications --> all --> media container. Force a stop and clear data

2. Repeat for the media storage

3. Reboot

When your phone comes back up it will do a full media scan. If you still have duplicates after this point then you have extra media directories as CuriousTech suggested.
Solved it for me too, thanks dude.
 
  • Like
Reactions: kled54

hugothebas

Senior Member
Nov 30, 2011
185
37
0
Curitiba
1. go into settings --> applications --> manage applications --> all --> media container. Force a stop and clear data

2. Repeat for the media storage

3. Reboot

When your phone comes back up it will do a full media scan. If you still have duplicates after this point then you have extra media directories as CuriousTech suggested.
Thats and old thread, but this solution worked for me. Thanks!
 

raship

Senior Member
Mar 4, 2012
56
0
0
Nadiad
Want to put *.ogg files in system media audio ringtones folder but not working

I have accidentally deleted the stock ringtones in this one. Now there is no ringtones in my mobile.

Some how my phone was not playing my custom ringtones from my SD card. I checked in the settings and it was showing only stock ringtones.
My device is rooted, so I went to system/media/audio/ringtones and deleted stock ringtones. Now there is no ringtones in the settings mebu
Even tried different ringtones in system ringtones location, with all kind of formats, tried setting permissions to rw-r-r, restarted fone everytime applying new settings. But didn't work out. Tried downloading ringtones app, but none helped.
Can anybody help me out? I hope flashing the rom or restore from back up is not the only option. After back up I had done many changes

Sent from my Micromax A300 using XDA Free mobile app
 

BWolf56

Senior Member
Mar 25, 2011
4,111
1,769
0
Outaouais
I have accidentally deleted the stock ringtones in this one. Now there is no ringtones in my mobile.

Some how my phone was not playing my custom ringtones from my SD card. I checked in the settings and it was showing only stock ringtones.
My device is rooted, so I went to system/media/audio/ringtones and deleted stock ringtones. Now there is no ringtones in the settings mebu
Even tried different ringtones in system ringtones location, with all kind of formats, tried setting permissions to rw-r-r, restarted fone everytime applying new settings. But didn't work out. Tried downloading ringtones app, but none helped.
Can anybody help me out? I hope flashing the rom or restore from back up is not the only option. After back up I had done many changes

Sent from my Micromax A300 using XDA Free mobile app
You can grab them off the ROM you're using and copy them in the ringtones folder.

Also, using an app like Zedge should work getting custom ringtones.
 
  • Like
Reactions: raship

raship

Senior Member
Mar 4, 2012
56
0
0
Nadiad
Thank you bro. It helped. Finally my mobile has 'a' ringtone.... :):p

Btw do you know, why it is not playing from the SD card? If there is any way, I can change default folder to SD card. I have placed many folders on SD cards. i.e. /ringtones
/media/ringtones
/media/audio/ringtones

So, I guess I am not missing out SD card location, but my OS is reading only from system location. :(

Sent from my Micromax A300 using XDA Free mobile app
 

BWolf56

Senior Member
Mar 25, 2011
4,111
1,769
0
Outaouais
Thank you bro. It helped. Finally my mobile has 'a' ringtone.... :):p

Btw do you know, why it is not playing from the SD card? If there is any way, I can change default folder to SD card. I have placed many folders on SD cards. i.e. /ringtones
/media/ringtones
/media/audio/ringtones

So, I guess I am not missing out SD card location, but my OS is reading only from system location. :(

Sent from my Micromax A300 using XDA Free mobile app
Anything ROM related will run from the internal unless you partition your external SD to do otherwise. That being said, .ogg files are extremely small so it shouldn't really matter.
 

raship

Senior Member
Mar 4, 2012
56
0
0
Nadiad
Yes. But I am using stock rom and I have not done any changes related to rom.
It started happening with the accidentally selecting .nomedia option in MX Player. Then after my SystemUI stopped working and I had to restore from backup. The reason why I am inclined to SD card location is, it can play any file and I can customize my ringtones. In system folder, I am limited to just stock roms(after restore). Btw your suggested app has given me nice ringtones. But I am still missing my custom made tones.

I would appreciate if a way to restore the default location is found :)
 

BWolf56

Senior Member
Mar 25, 2011
4,111
1,769
0
Outaouais
Yes. But I am using stock rom and I have not done any changes related to rom.
It started happening with the accidentally selecting .nomedia option in MX Player. Then after my SystemUI stopped working and I had to restore from backup. The reason why I am inclined to SD card location is, it can play any file and I can customize my ringtones. In system folder, I am limited to just stock roms(after restore). Btw your suggested app has given me nice ringtones. But I am still missing my custom made tones.

I would appreciate if a way to restore the default location is found :)
A .nomedia is a simple file that can be deleted using any file explorer.

You can use ringtone maker app to create custom ones and use them as your ringtone, you don't need an external SD for that.

P.S.: You should quote my post so I get a notification of your reply. That way I can reply faster.
 
  • Like
Reactions: raship