[FIX] Cant add no custom ringtone locale and online playing possible


katerpanne

Members
19 Apr 2014
3,557
332
Hello together,

I have a MI11 Ultra (weekly 21.5.20 - clean install) and I am not able to setup AND play a custom ringtone (*.mp3 and *.ogg)
I can choose a custom ringtone (locale & online) but the phone is not playing it when I get a call. Its playing an old default tone.
Same for alarms & notifications. If I choose / add the ringtone, I can play & hear the ringtone
  • First it was not possible to choose a custom ringtone with filemanager, so I have downloaded "mi file manager" from playstore (now I have two of them)
    • and now I can choose filemanager while setup a custom ringtone
  • I have selected in settings ringtones and activated them (music, filemanger, audio files, recorder, tones) I have tried all of them
  • I have copied the ringtones in the folder "ringtones"
  • I have cleared the cache / data in themes / phone
  • I have selected other themes
  • I have configured in themes the custom ringtone
  • I have checked the permissions of the folders (rwx) / apps (storage)
  • I have deletet the data / cache of the Permission app
Perhaps it is a permission issue:
The default ringtones from MIUi are stored in "\system\media\audio\...\" -> folder: rwxr-xr-x and file: rw-r--r--
The online or custom ringtones are stored in "\sdcard\MIUI\...\" -> folder: rwx------ and file: rw-------
[Edit] - with the help from @Poney70 I have corrected the permissions -> the problem exists already.

The system table looks quiet good, the entries are there but they are not playing:

<k>ringtone</k><v>file:///storage/emulated/0/MIUI/.ringtone/mark.mp3</v>
<k>ringtone_sound_slot_1</k><v>file:///storage/emulated/0/MIUI/.ringtone/mark.mp3</v>
<k>ringtone_sound_slot_2</k><v>file:///storage/emulated/0/MIUI/.ringtone/2011techno.1.mp3</v>
Nothing is working for a custom ringtone. If I choose one of the internal default ringtones from miui, it is working

But after some logcat investigations, here we go ...
The permissions of "/data/system/theme_magic" is the issue.
So I have manually deleted the folder "theme_magic".
While setup a custom ringtone the folder will be recreated with correct permissions.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Fix]: TWRP Module
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Run this TWRP Module and you should be able to choose your own ringtones.
Credits for the cool ScriptBody goes to @Poney70 -> Thank you very much ! Mount data in twrp if it is not mounted already!

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Workaround]: MagiskModule
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Copy ringtomes to "\system\media\audio\ringtones"
Now I can choose the ringtones from the miui default ringtones AND the phone is playing them if I get a call / alarm / notification

Here is the link for the MagiskModule
To use yours and not my ringtones copy your tones into the zip-file and install with magisk
  • copy your ring tones into the zip-folder -> system\media\audio\ringtones
  • copy your alarm tones into the zip-folder -> system\media\audio\alarms
  • copy your notification tones into the zip-folder -> system\media\audio\notifications
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Use the Tool "Zedge" from Playstore to set a custom ringtone:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  • with this tool you can setup your ringtones directly from the tool
  • using the MIUI sound settings, click custom and choose Zedge instead of filemanager, music ...
In the first screen there is an advertising (german version), click in the left upper corner the "x" to close it
choose your ringtone and set it

Happy weekend, regards Kater
 
Last edited:
Just tried, also on 2020/05/20 weekly. I can simply assign custom ringtones from the Settings menu (not sure about the English menu entries) : Settings/Sound, then select Ring Tone and on one of the fields there is a small button "All Ringtones" where you can also select your individual one...

Gesendet von meinem M2102K1C mit Tapatalk
 
Just tried, also on 2020/05/20 weekly. I can simply assign custom ringtones from the Settings menu (not sure about the English menu entries) : Settings/Sound, then select Ring Tone and on one of the fields there is a small button "All Ringtones" where you can also select your individual one...

Gesendet von meinem M2102K1C mit Tapatalk

yes this should work, but it does not. do you have a MI11 Ultra as well ?
 
yes this should work, but it does not. do you have a MI11 Ultra as well ?
Yes ;) and on the latest weekly Xiaomi.EU ROM...

I am talking about the button circled in the screenshot, can you see this in the settings? Or can you see it but cannot access ringtones when selecting it?
IMG_20210525_085608.jpg


Gesendet von meinem M2102K1C mit Tapatalk
 
  • Like
Reactions: katerpanne
Yes ;) and on the latest weekly Xiaomi.EU ROM...

I am talking about the button circled in the screenshot, can you see this in the settings? Or can you see it but cannot access ringtones when selecting it? View attachment 36910

Gesendet von meinem M2102K1C mit Tapatalk

ich weiss was du meinst :) I can choose the ringtone but the phone is playing the default ringtone ....
 
  • Like
Reactions: Atanas Chebishev
Strange, here it works just fine (just tried changing my custom ringtone to another one without issues).... Sadly then I'm out of ideas for now :(
 
I am talking about the button circled in the screenshot, can you see this in the settings?

I got the same problem on POCO F3. I use the same button, can actually select my custom ringtone. It even plays back ok when pressing the blue area. But when a call comes in, the default tone is played.
I have created a MagiskModule
Thanks, will try this out.
 
Hmm, what I do is the following step-by-step (English menu entries may vary slighty as I German language selected):
  1. in Settings select "Sound&Touch
  2. select "Ringtone"
  3. select blue button "All ringtones"
  4. select "choose local ringtone"
  5. I selected "Sounds" (or Tones?) as apps to choose
  6. select "My sounds"
  7. select Sound you wish as ringtone
  8. select "Save" in top right corner
Could it be you are missing Step 8 ?
Oh, and I have my custom ringtones stored in the folder /storage/emulated/0/Ringtones (or /Ringtones in the Sdcard root)
 
  • Like
Reactions: katerpanne
Hmm, what I do is the following step-by-step (English menu entries may vary slighty as I German language selected):
  1. in Settings select "Sound&Touch
  2. select "Ringtone"
  3. select blue button "All ringtones"
  4. select "choose local ringtone"
  5. I selected "Sounds" (or Tones?) as apps to choose
  6. select "My sounds"
  7. select Sound you wish as ringtone
  8. select "Save" in top right corner
Could it be you are missing Step 8 ?
Oh, and I have my custom ringtones stored in the folder /storage/emulated/0/Ringtones (or /Ringtones in the Sdcard root)

Hi... thanx for the answer -> it is not working :-(

I have tested all variants (filemanager, sounds, music, audio files, recorder) and also I clicked save.

You can choose the custom ringtone and its marked and displayed in the right blue corner box.

But its only playing the old default ringtone ...

I am wondering coz its a new phone, yesterday unlocked, installed the new firmware, checked all permissions.

And one thing with the alarm. If I now choose the new custom default alarm from the new internal entry it is not playing the custom ringtone only the old default.

I have to customize the individual alarm with a custom ringtone from internal copied by my magisk module :)

Its magic ....
 
Last edited:
  • Like
Reactions: s3axel
Could it be you are missing Step 8 ?
I have tested all variants (filemanager, sounds, music, audio files, recorder, filemanager) and also I clicked save.
Nothing helps, too.
Also I noticed, that if I select custom tone for SIM2, the same tone is automatically applied for SIM1, and plays ok when pressing the blue area. If a call comes in on any sim, only the MI theme is played.
If I select a built-in tone for SIM2, the custom tone is reset for SIM1 and replaced by that from SIM2. On incoming call to any SIM, this selected built-in tone is played back.
If I set a built-in tone for SIM2, then set my custom tone for SIM1, then the selected standert tone sound on incoming call to SIM2, but only MI theme sounds on incoming call to SIM1

I go crazy...
 
  • Like
Reactions: hibbo
In the meantime I have tested a lot of things, nothing helped ...

one thing I have found -> default alarm issue in the system table, the URI seems not correct.
Perhaps as default it will use "file://" as prefix but I dont know.

<k>default_alarm_alert</k><v>/system/media/audio/alarms/1_nokia_in_rock.mp3</v>

instead of

<k>ringtone</k><v>file:///storage/emulated/0/MIUI/.ringtone/mark.mp3</v>
 
  • Like
Reactions: hibbo
Hello. I have the same problem on mi 11 pro. I am confused that there is an additional icon on sim 2 that does not react to anything. Do you have something similar?
 

Attachments

  • 111.jpg
    111.jpg
    80.1 KB · Views: 795
  • 222.jpg
    222.jpg
    93.8 KB · Views: 2,209
Hello. I have the same problem on mi 11 pro. I am confused that there is an additional icon on sim 2 that does not react to anything. Do you have something similar?

Hi... yes I have the same on MI11 Ultra and two SIM-Cards

Notes to the second picture the right one
  • The blue Button means that SIM2 should use the same ringtone as SIM1
  • The green Button is for choosing an individual custom ringtone for SIM2
 
  • Like
Reactions: L EV
  • with this tool you can setup your ringtones directly from the tool
  • using the MIUI sound settings, click custom and choose Zedge instead of filemanager, music ...
In the first screen there is an advertising, click in the leftupper corner the "x" and you can choose your ringtone

After setup the custom ringtone it will play this ringtone. Alarm and notification I have not testet
I can't follow this instruction. I do not have ads and there is no X icon so that later you can select custom melodies
 
I can't follow this instruction. I do not have ads and there is no X icon so that later you can select custom melodies

Choose x to close advertising if you dont have advertising you dont have x to close it. choose your tone and set it as ringtone voilla
 
  • Like
  • Haha
Reactions: L EV and Poney70
Choose x to close advertising if you dont have advertising you dont have x to close it. choose your tone and set it as ringtone voilla
Thank you. I am grateful for your help, but I understand what to do, but I have empty folders in the zedge and there is no way to select the files that are in the memory of my phone
 
Thank you. I am grateful for your help, but I understand what to do, but I have empty folders in the zedge and there is no way to select the files that are in the memory of my phone

I dont know if you can choose your own local ringtones, you can download actual songs / notifications / alarms and set them as custom tone.

At the moment I have created logcat-files. There are so many errors, i wonder that the telephone works at all :)

Anybody who wants to search for the root cause by its own:

# connect phone with PC and USB
# create a textfile -> eg logfile.txt in adb folder
# adb logcat > logfile.txt
# ctrl+c (to stop logfile recording)

  • Choose the custom ringtone -> one logfile
  • Call yourself -> second logfile
The logfiles will be big, so it is better to split them into two logfiles

I will be back in some month ...
 
  • Like
  • Haha
Reactions: geoorg and L EV
вы можете загружать настоящие песни / уведомления / будильники и устанавливать их как собственный тон.
It works for me, but there are no tunes I need :D

PS. I will have to do a factory reset and observe what conflicts with what
 
It works for me, but there are no tunes I need :D

PS. I will have to do a factory reset and observe what conflicts with what

Good idea please dont play back settings from cloud. I have a brand new china phone I did all from scratch. Perhaps something went wrong. I will analyze the logcats perhaps I will find the root cause.

If you have time can you test this before reset…

Safe Mode (This is not the "Recovery mode" or the "Fastboot mode" )
In case your phone shows a lot of errors and you cant handle them because there are a lot of pop up windows or you want to deinstall something from magisk as example ... try the "safe mode" only some important standard apps will be loaded:
  1. Power off your Android device and then power it on. You can also use the Reboot or Restart option.
  2. You will see the Powered by Android logo and MI logo on the boot screen, If they disappear and the Screen ist black, press and hold the Volume Down key down so long till system ist loaded
  3. The System will load and you will see a watermark... Safe mode
  4. Deinstall the app with the error / analyze the root cause of the issue and so on ...
  5. Reboot the phone to get off the "safe mode"
  6. Perhaps after loading you have to disable AirPlane Mode
 
Interim Result Part1:
After analyzing the logcats it could be this issue after selecting a custom ringtone:
Code:
MediaProvider: Database update failed while renaming /storage/emulated/0/MIUI/.ringtone/mark_neu.mp3.tmpXres
05-29 07:15:18.422  5798 14138 W MediaProvider: android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: files._data (code 2067 SQLITE_CONSTRAINT_UNIQUE)
05-29 07:15:18.444 13497 13497 E ThemeFileUtils: Failed to copy( /storage/emulated/0/MIUI/.ringtone/mark_neu.mp3 to + /data/system/theme_magic/ringtones/ringtone_slot_1.mp3 ): java.nio.file.AccessDeniedException: /data/system/theme_magic/ringtones/ringtone_slot_1.mp3
05-29 07:15:18.449 13497 14465 I ResourceDataManager: refreshing local resources
05-29 07:15:18.456 13484 13484 E ThemeFileUtils: Failed to copy( /storage/emulated/0/MIUI/.ringtone/mark_neu.mp3 to + /data/system/theme_magic/ringtones/ringtone.mp3 ): java.nio.file.AccessDeniedException: /data/system/theme_magic/ringtones/ringtone.mp3
05-29 07:15:18.459  1165  1165 E SurfaceFlinger: frame rate abnormal: timeElapsed = 1.9
05-29 07:15:18.460 13484 13484 E ThemeFileUtils: Failed to copy( /storage/emulated/0/MIUI/.ringtone/mark_neu.mp3 to + /data/system/theme_magic/ringtones/ringtone_slot_2.mp3 ): java.nio.file.AccessDeniedException: /data/system/theme_magic/ringtones/ringtone_slot_2.mp3

Permissions:
/storage/emulated/0/MIUI/.ringtone -> rwxrwxr-x (directory)
/storage/emulated/0/MIUI/.ringtone/mark_neu.mp3 rw------- (file)

/data/system/theme_magic/ringtones -> rwxrwxr-x (directory)
 
Last edited:
After analyzing the logcat I have found the root cause.
The permissions of "/data/system/theme_magic/ringtones" is the issue.
So I have manually deleted the folder. While setup a custom ringtone the folder will be recreated with correct permissions.
Everything is working like a chame. I will create a TWRP Script.
 
Last edited:
Hello ,
If I set my Ringtone with the MiMix-Explorer it`ll work!
No need for Root or s.e.
Open MIMIX , mark your Ringtone , 3 Dots at upper right , set as Ringtone.