Now I've finally found a way to make custom ringtones works... at least until now it never miss.
1) For every single call
2) Even in low memory situations, like while playing HD games like Asphalt HD
3) Without a millisecond of delay
This afternoon I spent 3 hours searching the web for informations about how Android store informations, and soon I found that Android store contacts informations (every single detail, including contact photo and call registry, in a SQL database file, located in data/data/com.android.providers.contacts/database. I've studied SQL at university, so I know how it works.
There are 2 tables with the column "custom_ringtones", in every table the fields were of this form:
content://media/internal/audio/media/XXX
where XXX is a number associated to a ringtone, this association is stored in another SQL database located in data/data/com.android.providers.contacts/database (there are 2 databases, one for internal ringtones and one for sd ones)
I immediately realized that the solution was simple: pointing directly to the ringtone file.
So in a developers website I found that the correct form to point directly was:
file:///sdcard/XXX.ogg
file:///system/media/audio/ringtones/XXX.ogg
I manually edited the contacts database for only 1 contact, rebooted, and it works!
But this is an hard and slow procedure, so I managed to find an easier way, and the solution I found is really easy and fast:
1) Download from Android market a ringtone picker app, I've used Tone Picker. If you use HandCent SMS, you already have a ringtone picker.
2) Only if your ringtones are not in sdcard, download a filemanager with root permissions, I used Root Explorer because all my ringtones are in in system/media/audio/ringtones
3) Now you have to assign custom ringtones with Tone Picker: in the contact options, select the option to assign a custom ringtone, select Tone Picker instead of Android System, and it will show a list of applications, select the file explorer and point to the desired file.
4) The same procedure should be used to define the default ringtone in settings/audio
By doing this way for every contact, in the contacts database all the custom_ringtones fields will be filled correctly, directly pointing to the ringtone file, and phone will ring with the correct ringtone every time, and without looking in the media database, so the ring will start immediately.
Please post comments if you try my method