maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   How is ringtone caching handled on the N900? (https://talk.maemo.org/showthread.php?t=56678)

Manul 2010-06-20 12:58

How is ringtone caching handled on the N900?
 
Hi,

I'm currently trying to come up with a solution for individual ringtones by caller following the ideas from this thread. I am, however, a bit stumped at the moment trying to find out how ringtone caching is handled on the N900. Since I haven't found any documentation on this, I had to experiment. This is what I have so far:
  • (MP3-)Ringtones are cached as .wav files in /home/user/.local/share/sounds
  • This seems to happen the first time a ringtone is played. The information about the cached ringtone is stored somewhere and the ringtone is only cached again when a new ringtone is set, not when the original one changes (e.g. by changing a symlink)

This leads to the following behaviour: If I set the ringtone to '/home/user/link', which in turn is a symlink to '/home/user/MyDocs/.sounds/sound.mp3', at first nothing happens. The first time the sound is played, a cached version '/home/user/.local/share/sounds/sound.mp3.wav' is created. This is the played on all subsequent calls, even if I change the symlink to point to another sound file, e.g. '/home/user/MyDocs/.sounds/other.mp3'.

I have the following questions:
  • Can anybody confirm this behaviour?
  • Is this documented anywhere?
  • Where is the information about the existence of the cached ringtone and which ringtone to play stored?

An additional question would be what happens to ringtones that are originally in .wav format. I can probably fnd that out myself by experimenting, but haven't had the time yet, so if anybody already knows I'd be grateful for any hints.

Any help on this would be highly appreciated. Thanks a lot in advance!

P.S. I posted this in 'Development' rather than in 'N900' since the latter is for hardware-specific discussion and since I thought developers would be most likely to be able to shed some light on this. If anybody feels this belongs somewhere else, feel free to move this thread.

fcrochik 2010-06-20 19:19

Re: How is ringtone caching handled on the N900?
 
I believe you are mostly right after my tests. The only thing I would like to point out is that the wav file is actually created imediately after you change the ringtone (it seems that changing the ringtone either on the settings or using dbus will trigger a background process that will convert the file into a wav file)
The big chalenge is that you dont have how to know about the wav file converted and stored on the "cache" folder. The dbus get_value call will return the original file location but the phone will use the cached file.
It seems that you just have to assume there will be a file on the cache folder and guess the name based on the "official" file returned by dbus.
Like you I haven't tested yet what happens if you assign a wav file. I hope it will copy the file to the cache folder as well....

Dotblank 2010-06-20 21:09

Re: How is ringtone caching handled on the N900?
 
I spent quite some time on this for my post http://talk.maemo.org/showthread.php?t=49522

I found when you set the ringtone it creates a cache only if the cache doesn't already exist. Also it seems to recreate the cache on boot-up


All times are GMT. The time now is 23:49.

vBulletin® Version 3.8.8