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


I couldn't find the appropriate module, so I copied my mp3 files into: /system/media/audio/....
That seems to be working. I hope that the system sound files do not get deleted / replaced with new ROMs.

Edit: Except now, after a reboot, they seem to have gone from the folder!
I've converted them into .ogg files, and still they have disappeared from the folders.
I note that when I include one of my own sound files as a ringtone, it get copied to a very remote .ringtone folder.
( /storage/emulated/0/Android/data/com.android.thememanager/files/MIUI/.ringtone )
Maybe it is this folder that is broken.
Can this folder be mended?
Is there a way to stop the files being deleted in the /system/media/audio/... folders?

Edit: Just trying the [Workaround]: MagiskModule

Edit2: The module copies to the same remote .ringtone folder as above. And also as above, this folder is broken.
 
Last edited:
I've converted them into .ogg files, and still they have disappeared from the folders.
I note that when I include one of my own sound files as a ringtone, it get copied to a very remote .ringtone folder.
( /storage/emulated/0/Android/data/com.android.thememanager/files/MIUI/.ringtone )
Maybe it is this folder that is broken.
Can this folder be mended?
Is there a way to stop the files being deleted in the /system/media/audio/... folders?

Edit: Just trying the [Workaround]: MagiskModule

Edit2: The module copies to the same remote .ringtone folder as above. And also as above, this folder is broken.
ian… this module copy the ringtones on every reboot. what is your issue?

what about the logcat file?
 
ian… this module copy the ringtones on every reboot. what is your issue?

what about the logcat file?
All of my customised ringtones have gone now (including the phone). :(
1. How does it know which sound files to copy?
2. Where does it copy them from? Or is that the same as 1 above?
3. And where does it copy them to?

Which part of the logfile do you want - boot? trying to play the sound?

Why would Xiaomi mess such an important part of android up?
 
All of my customised ringtones have gone now (including the phone). :(
1. How does it know which sound files to copy?
2. Where does it copy them from? Or is that the same as 1 above?
3. And where does it copy them to?

Which part of the logfile do you want - boot? trying to play the sound?

Why would Xiaomi mess such an important part of android up?
iain…. read my post and answer my questions. i dont have a glass sphere and i am not so stupid to install first a12 beta…
 
  • Haha
Reactions: LOLO9393
iain…. read my post and answer my questions. i dont have a glass sphere and i am not so stupid to install first a12 beta…
I have tried installing both the Magisk module and the TWRP file.
The files are in the .ringtone folder, but do not play after a reboot - they do not play with any of my players either.
 
I have tried installing both the Magisk module and the TWRP file.
The files are in the .ringtone folder, but do not play after a reboot - they do not play with any of my players either.
then you have made a mistake…

where is the logcat???
 
which section of the logcat do you want - trying to play the media file, reboot process, or receiving a text or phone call?
there where the issues are not boot process. I am wondering that you cant play your sound files with a media player. what does it mean… the folder is broken?
 
Last edited:
there where the issues are not boot process. I am wondering that you cant play your sound files with a media player. what does it mean… the folder is broken?
I've uninstalled and re-installed the Magisk module, and also got the logcat. I've re-copied the files into the /system/media/audio/... folders, and re-assigned the sounds. After a re-boot, my sound files have again disappeared from the folders. However, my SMS sound file plays, but under a different filename and from a different location -
MediaPlayer: setDataSource() actualUri=file:///data/system/theme_magic/ringtones/sms_received_sound.mp3

This appears to be the only file in that folder - none of other allocations that I have made appear. My original filename appears as the sound allocated under the Messages Sound notifications, but neither my original filename, nor this new filename appear in the list of available sounds for selection - yet it plays!

Note: I do not play with any of the coding - I just follow instructions or solutions.

Code:
10-31 04:01:02.442  3738  3738 D ScreenView_HotSeats: dispatchDraw:0
10-31 04:01:02.443  3279  4125 D Avrcp_ext: AudioManager Player: AudioPlaybackConfiguration piid:23 type:android.media.SoundPool u/pid:1000/3394 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null
10-31 04:01:02.442   989   989 W perf@2.2-servic: type=1400 audit(0.0:1439): avc: denied { search } for name="1545" dev="proc" ino=421759 scontext=u:r:vendor_hal_perf_default:s0 tcontext=u:r:miuibooster:s0 tclass=dir permissive=0
10-31 04:01:02.443  3279  4125 D Avrcp_ext: AudioManager Player: AudioPlaybackConfiguration piid:15 type:android.media.SoundPool u/pid:1000/1918 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null
10-31 04:01:02.443  3279  4125 D Avrcp_ext: AudioManager Player: AudioPlaybackConfiguration piid:31 type:android.media.SoundPool u/pid:10083/3738 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null
10-31 04:01:02.443  3279  4125 D Avrcp_ext: AudioManager Player: AudioPlaybackConfiguration piid:47 type:android.media.SoundPool u/pid:1027/5677 state:idle attr:AudioAttributes: usage=USAGE_ASSISTANCE_SONIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null
10-31 04:01:02.443  3279  4125 D Avrcp_ext: AudioManager Player: AudioPlaybackConfiguration piid:143 type:android.media.MediaPlayer u/pid:1000/3394 state:idle attr:AudioAttributes: usage=USAGE_NOTIFICATION content=CONTENT_TYPE_SONIFICATION flags=0x800 tags= bundle=null
10-31 04:01:02.444  3279  4125 D Avrcp_ext: AudioManager isPlaying: false, mA2dpState: 11, isMusiActive: false
10-31 04:01:02.447  1918  7093 I AudioService: setDefaultTimeZoneStatus: mInternationalLocation=true
10-31 04:01:02.447  1918  7093 D AudioService: getIndexForType() type=content://settings/system/sms_received_sound
10-31 04:01:02.447  3394 17168 D MediaPlayer: setDataSource() actualUri=file:///data/system/theme_magic/ringtones/sms_received_sound.mp3
10-31 04:01:02.449  3394  4442 D MiBridge: requestCpuHighFreq---- uid: 1000 level: 1 timeoutms:2000
10-31 04:01:02.449  1545  1568 W MiuiBooster: "MiuiBoosterService requestCpuHighFreq: 1000, 1, 2000"
10-31 04:01:02.449  1545  1568 W MiuiBooster: "requestCpuHighFreq,final level:1,final timeoutms:2000"
10-31 04:01:02.449  1545  1568 W MiuiBooster: "perf_hint_hc start"
10-31 04:01:02.449  1545  1568 W MiuiBooster: "big_core_value[level-1]:4095"
10-31 04:01:02.449  1545  1568 W MiuiBooster: "little_core_value[level-1]:4095"
10-31 04:01:02.449  1545  1568 W MiuiBooster: "prime_core_value[level - 1]:4095"
10-31 04:01:02.450  1545  1568 W MiuiBooster: "perf_handle:664"
10-31 04:01:02.450  3394  4442 D MiBridge: requestCpuHighFreq handle: 1
10-31 04:01:02.451  3394  4442 I MiBridge: reportMiSpeedRecord Success
 
I've uninstalled and re-installed the Magisk module, and also got the logcat. I've re-copied the files into the /system/media/audio/... folders, and re-assigned the sounds. After a re-boot, my sound files have again disappeared from the folders. However, my SMS sound file plays, but under a different filename and from a different location -
MediaPlayer: setDataSource() actualUri=file:///data/system/theme_magic/ringtones/sms_received_sound.mp3

This appears to be the only file in that folder - none of other allocations that I have made appear. My original filename appears as the sound allocated under the Messages Sound notifications, but neither my original filename, nor this new filename appear in the list of available sounds for selection - yet it plays!

Note: I do not play with any of the coding - I just follow instructions or solutions.
hi it could be that the folders have changed. not a problem. look for the ringtones folder and change them in the magisk modul. I cant test it, sorry.
 
hi it could be that the folders have changed. not a problem. look for the ringtones folder and change them in the magisk modul. I cant test it, sorry.
I'll wait and hope that Xiaomi will mend this soon. I'll go with the system sounds until then ;)
 
  • Love
Reactions: KGVER
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
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
[Workaround]: MagiskModule
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Use the Tool "Zedge" from Playstore to set a custom ringtone:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Hello. I have Android 12 (xiaomi.eu 21.10.27) on POCO F3.
TWRP method dont working because TWRP on android 12 can't read "system/data".
MagiskModule method dont working because i don't have root and magisk.
Zedge method dont working because zedge app dont see internal storage.

What i can do?
 
Hello. I have Android 12 (xiaomi.eu 21.10.27) on POCO F3.
TWRP method dont working because TWRP on android 12 can't read "system/data".
MagiskModule method dont working because i don't have root and magisk.
Zedge method dont working because zedge app dont see internal storage.

What i can do?
@Onotoley I converted the .mp3 files with a free software to .ogg and put the new .ogg files in MIUI\.ringtone (and in ringtones, music and alarm folders too. But the MIUI\.ringtone was the last one and it started working. Though I can't say they worked because there was a copy in other folders, too).
 
Same problem on my Mi10T with 12.5.1 Stable ROM.

Thanks for sharing this fix, manually deleting "theme_magic" folder via TWRP Recovery solved issue.
Now i can upload my custom ringtones in to sdcard and they visible in file explorer.

For those who not familiar with TWRP Recovery but already install it like me:
In main menu choose Advanced > File Manager, navigate to /data/system/theme_magic, ensure that you're right inside theme_magic folder, then click little blue check mark button in right bottom corner, choose Delete. After that return to main menu and select Reboot > System. Don't worry, folder will recreate itself after reboot with right permissions.

P.S. Wondering that latest Stable ROM had such a bug.
Hi and have a HNY! Would you please advise (in detail if possible) how to access /data/system/ as when using the file manager (even with the activated option for seeing hidden files) no such the files are visible. Tnx in advance
 
Hi and have a HNY! Would you please advise (in detail if possible) how to access /data/system/ as when using the file manager (even with the activated option for seeing hidden files) no such the files are visible. Tnx in advance
try this… its an example

-=-=-=-=-=-=-=-=-=-=-=-=-=-
# adb shell
# su system
# rm -r /data/system/FOLDERNAME
# reboot
-=-=-=-=-=-=-=-=-=-=-=-=-=-
# install magisk & mix explorer
# grant root in magisk to mix explorer
# grant root access in mix explorer -> settings - more settings - allow root
# change to /data/system/FOLDERNAME and delete the files / directories
# reboot
 
unfortunately it didnt work for me. tried with the magisk module. the module couldnt be installed. i tried with twrp, module installed but ringtones still cant be set.
i also delted the folder mentiopned. still no luck
xiaomi mi note 10 pro running latest miui in android 11...
this is really sad
ps. i tried also deleting the theme folder via twrp but i couldnt since when i enter the system folder, all folder names look like gibberish. random numbers and letters....
 
unfortunately it didnt work for me. tried with the magisk module. the module couldnt be installed. i tried with twrp, module installed but ringtones still cant be set.
i also delted the folder mentiopned. still no luck
xiaomi mi note 10 pro running latest miui in android 11...
this is really sad
ps. i tried also deleting the theme folder via twrp but i couldnt since when i enter the system folder, all folder names look like gibberish. random numbers and letters....
you have to enter the pin pw pattern in twrp to decrypt your folders

why is the module not installed?
 
Last edited:
you have to enter the pin pw pattern in twrp to decrypt your folders

why is the module not installed?
sorry but i am not sucha tech savvy guy. i feel awesome just by managing to root my phone lol.
so my files are decrypted. i never remember doing that? any help in making the names properly appear again?
the magisk module probably wasnt installed because i added lots of ringtones. around 300. can i isntall magisk module and then manually adding in a root folder the ringtones needed? (and which would that folder be?
thanks so much
 
sorry but i am not sucha tech savvy guy. i feel awesome just by managing to root my phone lol.
so my files are decrypted. i never remember doing that? any help in making the names properly appear again?
the magisk module probably wasnt installed because i added lots of ringtones. around 300. can i isntall magisk module and then manually adding in a root folder the ringtones needed? (and which would that folder be?
thanks so much
hi use this magisk module as described in topic Workaround]: MagiskModule
 
hi use this magisk module as described in topic Workaround]: MagiskModule
is there a separate topic? i cant find itthrough search. i can see it in the first post though.
problem is i have many ringtones and when i add them to the zip, it cant be installed. is there a size limit? can i use the module and add the ringtones later? but in which path should i add them? i have a rooted phone, thank you for the help
 
i just managed to install the original; zip but if i try to add my ringtones in the zip, it doesnt install because then the zip is 360 mbyte. is there a way to add these ringtones afterwards?
 
  • Haha
Reactions: katerpanne
managed to install magisk module. i then added my ringtones in the correct root folder that the ringtones from the zip were installed. used mixplorer to add ringtones to contacts. failed miserably. obviously this method doesnt work for me. i am sad
 
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.
Hi,
I have notification sound problem.
Does this solution works in same way with notification folder?
I mean to connect phone via usb to pc and just delete notification folder, hope I will not mess something :)
What would be Your advice? Thanks