PDA

View Full Version : [sandbox] Add caller specific ring tones & alarm specific tones (N900)


ViciousXUSMC
01-18-2010, 03:14 AM
Brainstorm - http://maemo.org/community/brainstorm/view/add_caller_specific_ring_tones_and_alarm_specific_ tones-n900/

Some pretty basic stuff that I hope is not hard to implement is having caller id specific ring tones instead of just one ring tone for everything, and the same for the alarm clock, being able to have a different ringer for each alarm should be a basic feature.

The first being the most important, I dont bother to answer the phone unless I know its important so I like to give my wife and parents exclusive ring tones so I know its them calling me.

puiradu
01-20-2010, 03:53 PM
Personally consider this a bug and I reported to Bugzilla. It very god to have personalized ring-tones for family and friends.
I'm a little bit confused... Why nobody react to your post? Because this missing feature is standard implemented in every NSeries device. I'm pretty sure that this it not the thing who makes N900 so special.
Is anyone with us?

Brank
01-20-2010, 03:58 PM
They are basic functionality, and I bet they will be implemented sooner or later.

Hannu
01-20-2010, 04:45 PM
To me more important would be that the phone could say the name of caller like in n95 8g example.
Well, personalized ringtones would be good to have too.

chemist
01-20-2010, 05:14 PM
please have a look for contact groups and so on; this is a realy obvious dependency! without groups no group ringtones... (whats the point in having groups without group ringtones?) and there is a brainstorm on that afaik

fatalsaint
01-20-2010, 05:26 PM
please have a look for contact groups and so on; this is a realy obvious dependency! without groups no group ringtones... (whats the point in having groups without group ringtones?) and there is a brainstorm on that afaik

Because being able to categorize your contacts makes things easier to read, and find? Thats the real purpose to groups.. ringtones is a byproduct that was built atop that. I dont use grouped ringtones but I do use groups.

I think Brainstorm is definitely where these requests belong.. and hopefully the community or Nokia implement them.

A bug report I'm not sure is necessary.. as I consider a bug to be an "unexpected feature" of something that is there.. (IE: Something is actually broken).. not that a particular feature is completely missing. That would be a feature request - which *I think* is handled by brainstorms?

So thumbs up to the OP for the brainstorm.

Sudisk
01-20-2010, 05:34 PM
I totally subscribe to this proposal.

I personally used groups both for classifying contacts and group ringtones on my S60 E65, so I can hardly wait for this feature to appear in the N900.

ViciousXUSMC
01-20-2010, 06:58 PM
I copy pasted the title from the brainstorm, not sure why/how the title got all messed up and why it has not been fixed yet :D

But yeah I consider this a "brainstorm" as its an idea I have for something that should be added to the N900 functionality. A bug to me is when something is not working as intended but currently contact specific ring tones were not intended thus there is no bug.

chemist
01-20-2010, 07:17 PM
Because being able to categorize your contacts makes things easier to read, and find? Thats the real purpose to groups.. ringtones is a byproduct that was built atop that. I dont use grouped ringtones but I do use groups.


well you use it that way... I am able to use it for about 8 years, set it up once and never used it as there was no function on any phone I used apart of locked call lists and ringtones...

I think Brainstorm is definitely where these requests belong.. and hopefully the community or Nokia implement them.


thats not what I asked...
we have several topics allready talking about groups, ring tones and so on...

http://talk.maemo.org/showthread.php?t=38010
http://talk.maemo.org/showthread.php?t=33830

maybe you find related posts and solutions and want them to be moved or merged

A bug report I'm not sure is necessary.. as I consider a bug to be an "unexpected feature" of something that is there.. (IE: Something is actually broken).. not that a particular feature is completely missing. That would be a feature request - which *I think* is handled by brainstorms?



there is a feature called "enhancement bugs" for things software is really missing out on. for example a phone app without dial pad would get an enhancement request filed as bug as it is missing the obvious direct call option with a missing dialpad. Nowadays grouping, caller picture and caller specific ringtones are "normal" features a phone should have, video-ringtones aren't...

fatalsaint
01-20-2010, 08:19 PM
All I did was answer your question... "What's the point to having groups without group ringtones?" Groups were not implemented for ringtones.

The rest of my post was generic commenting in this thread. The OP made a brainstorm that I agree with.. someone else mentioned filing a bug report that I disagree with. The reason these things are called "normal" features a "phone" should have.. is the reason I personally don't call the N900 a phone. Yet. But.. that's an entirely separate argument... and a dead horse by now.

chemist
01-20-2010, 08:39 PM
Back to topic please. It doesnt help it to explain yourself like that.

Just read somewhere else that you have 2 different setups for calendar and general alarm. what alarm do you mean? different per clock alarm? Thats what I read from the starting post. Per calendar notification setup would be another idea but that should be filed with the alarm system. Is alarmd handling phone calls? If not this topic should be split into two, one for alarmd and one for the call handler.

Please request a solution move from the collecting brainstorm.

kwotski
01-20-2010, 08:57 PM
I suggested a really impractical brain-dead approach to creating this functionality in: http://talk.maemo.org/showthread.php?p=456340#post456340

Just for fun, I actually tried to do this in an even *less* sensible manner than using python methods to talk to dbus - by executing dbus-monitor from within perl and parsing it's output (after setting the silent profile on the phone.)


#!/usr/bin/perl

# listen for incoming calls
$dbus_mon_cmd = "/usr/bin/dbus-monitor "
. "--system \"type='signal',path="
. "'/com/nokia/csd/call',interface='com.nokia.csd.Call'\"";
# map incoming numbers to ringtones
%tones = (
# gf number
'077XXXXXX' => '/home/user/MyDocs/.sounds/harp.wav',
# boss's number
'01XXXXXXX' => '/home/user/MyDocs/.sounds/parp.wav',
'default' => '/home/user/MyDocs/.sounds/mystery.wav',
);

# play a file in media player via dbus.
sub pf($) {
($f) = @_;
$pf_cmd = "dbus-send --print-reply "
. "--dest=com.nokia.mediaplayer "
. "/com/nokia/mediaplayer com.nokia.mediaplayer"
. ".mime_open string:\"file:///$f\"";
system("$pf_cmd &");
}

# start listening on dbus
open(DBUS, "$dbus_mon_cmd|") or die "couldn't read output from dbus-monitor: $!";

$debug=0;

while(<DBUS>) {
print if($debug);

# find the incoming number.
if(/string\s"(\d*)"/) {
$num = $1;
print "$num is calling..\n";
if($num =~ /^\d+$/ and ($tones{$num})) {
# play corresponding tone
pf($tones{$num});
} else {
pf($tones{'default'});
}

}
}


This doesn't work, I'm sorry to say, because the phone app seems to block media player, even in silent profile. So the configured tone plays, but only after I answered the phone or hung up (haha).

If there's some way of getting around this (a more direct way of playing the ringtone, or removing the phone app's block, ...) and a way of stopping the file playing when you answer, hang up, or lose the call, then it might work.

N.B. I'm not suggesting this as a viable actual solution! It's just for fun..


My preferred non-braindead, non-hacky solution would be for Nokia to open up the phone UI(!) (maybe the contacts infrastructure - I don't know about their status) and/or provide a simple, clean, and extensively documented framework to use the underlying API.

If this were done, I don't think it would take very long for this functionality to arrive.

twigleaf1976
02-10-2010, 09:15 AM
I just got the N900 and can't believe this function is missing. For me it is work related. I can set various ringtones for mates etc. And ignore them when at work, but if the missus rings me I know it is slightly more serious or important and can answer just by ring tone. Vice versa, at weekends if the boss calls I can ignore it (unless 'on call') A glowing error not to have it.

I come from HTC phones that have had this for years as standard and It should be added.

Venemo
03-03-2010, 05:23 PM
Here is my idea:

We should write a daemon which intercepts the phone calls, and BEFORE the ringtone starts, it would rewrite the config file which stores which audio file should be played.
Then after the call is received, it would rewrite the config to its original value.

I would really like to make it work, but I don't have a clue about Linux development (yet).
(I come from the .NET camp, so I'm pretty new to all this. However, if anyone could give me some pointers on the subject in PM, I would be grateful.)

jacktanner
03-05-2010, 04:02 PM
Related bug:

https://bugs.maemo.org/show_bug.cgi?id=7468

etuoyo
03-05-2010, 04:08 PM
I just got the N900 and can't believe this function is missing. For me it is work related. I can set various ringtones for mates etc. And ignore them when at work, but if the missus rings me I know it is slightly more serious or important and can answer just by ring tone. Vice versa, at weekends if the boss calls I can ignore it (unless 'on call') A glowing error not to have it.

I come from HTC phones that have had this for years as standard and It should be added.

Lol Nokia phones have had it for 10 years now. What Nokia were thinking when they left this out only goodness knows.

raghavmurali
03-05-2010, 04:49 PM
groups and group specific ringtones, caller specific ringtones are present in nokia phones for years now. i am not sure why nokia missed this key feature. also creating different profiles is also not present which is another miss. is there any way we can request nokia to provide them in pr1.2

qw3rty
03-05-2010, 05:55 PM
Here is my idea:

We should write a daemon which intercepts the phone calls, and BEFORE the ringtone starts, it would rewrite the config file which stores which audio file should be played.
Then after the call is received, it would rewrite the config to its original value.

I agree that sounds like the best way to do it. Would be nice to then have a plugin for Contacts which configured the daemon and told it the path to the new ringtone.

Venemo
03-05-2010, 08:53 PM
I agree that sounds like the best way to do it. Would be nice to then have a plugin for Contacts which configured the daemon and told it the path to the new ringtone.
Yeah. It was a nice idea.
I've done some research, and found out the location of the .ini file in question. It is "/home/user/.profiled/custom.ini". (My ringtone is "Stargate Atlantis Outro.mp3", and there was no other file containing the text "Stargate". Without the quotation marks, of course.)
I re-wrote the value in the config file but the ringtone didn't change. Then, I rebooted the device and it finally changed.
Obviously, the device only reads the setting when it starts. (And also, I think the Settings application restarts the process responsible for it, however, I didn't try to find out which process it is. I think it would probably mess up with the phone functionality if the daemon restated that process while receiving a call.)

Later I found out that actually the device converts the selected ringtone to a mono .wav file. (And it also does that quite buggyly. (https://bugs.maemo.org/show_bug.cgi?id=6784) :p)
Look at "/home/user/.local/share/sounds".

So, a work-around would be the followig:
The same daemon described in my above post, but instead of manipulating the config, it should also convert the personal ringtones to .wav, and then simply rename the files before the phone application plays them. :D

vietn900
03-28-2010, 08:35 PM
is there any update on this devel?

srodin
04-11-2010, 06:41 AM
long time no responses on this thread. actually Venemo's idea sounds great, has anyone checked this option?

johnym
04-24-2010, 03:47 AM
This doesn't work, I'm sorry to say, because the phone app seems to block media player, even in silent profile. So the configured tone plays, but only after I answered the phone or hung up (haha).

If there's some way of getting around this (a more direct way of playing the ringtone, or removing the phone app's block, ...) and a way of stopping the file playing when you answer, hang up, or lose the call, then it might work.

I'm still waiting for the N900 to become available here in Australia, so I can't try it for myself, but here are a couple of ideas that might be worth experimenting with:

1) Select an mp3 as the default ring tone that is actually a symlink (or replace the already chosen ring tone with a symlink). Use the dbus approach to rewrite said symlink for each incoming call. This will only work if dbus sends the notification before the phone app starts playing the ring tone, doesn't cache the ring tone data, and doesn't do fancy stuff like resolving the symlink early when you configure the ring tone. If there's a race condition between the dbus event and the phone opening the ring tone file, renice(1)'ing the script to a better priority might work.

2) Instead of a symlink, try to make it a named pipe or unix domain socket, and have a daemon listening to the dbus messages and provide the appropriate audio data for the current caller. This requires more work, but would have the advantage of being able to provide silence up until the point where the caller info becomes available, so even if the dbus notification comes late, the right ring tone would be chosen (but you'd be perceived as being a tiny bit slower in answering your phone).

If anyone is able to test any of the two approaches, I'd love to hear the result. I only recently discovered that the N900 lacked this feature, and I'm thinking it might be a deal-breaker for me as I'm quite married to it on my old Palm...

EDIT: Argh, only now saw the later responses. Replace "mp3" above with the location of the converted wav file.

cipper
04-24-2010, 09:03 AM
Later I found out that actually the device converts the selected ringtone to a mono .wav file. (And it also does that quite buggyly. (https://bugs.maemo.org/show_bug.cgi?id=6784) :p)
Look at "/home/user/.local/share/sounds".

So, a work-around would be the followig:
The same daemon described in my above post, but instead of manipulating the config, it should also convert the personal ringtones to .wav, and then simply rename the files before the phone application plays them. :D

I think that your solution would be too expensive in terms of cpu/battery and disk operations (solid state disks are capable of a limited number of writing operations).
We need a linux way for this, for example substituting the .local/share/sounds/Terrestial.aac.wav file with a FIFO file that is feeded by a fast mp3player (like mplayer) controlled by a daemon.

cipper
04-24-2010, 09:05 AM
just checked that mkfifo is provided by maemo default.

cipper
04-24-2010, 09:27 AM
just to laydown some steps:

1) preliminar operations (to do only once)
mv /home/user/.local/share/sounds/Terrestial.aac.wav /home/user/.local/share/sounds/Terrestial.aac.wav.bak
mkfifo /home/user/.local/share/sounds/fiforingtone.wav

2) when someone is calling
mplayer -ao pcm:file=/home/user/.local/share/sounds/fiforingtone.wav ringtone.mp3 &
PIDMPLAYER=$!

3) after answering or closing the call
kill $PIDMPLAYER

johnym
04-26-2010, 01:59 AM
2) when someone is calling
mplayer -ao pcm:file=/home/user/.local/share/sounds/fiforingtone.wav ringtone.mp3 &


It's been a long time since I worked with named pipes, but if memory serves me a reader of a pipe will get an EOF (end-of-file) for any read if there is no writer attached, which would prevent the phone application from getting any data if it tries to read before the dbus notification has propagated to us. If that's the case, we'll need to have the perl script open the pipe for writing (and keep it open all the time), and simply funnel pcm data into it from mplayer when needed.

benny1967
05-23-2010, 11:34 AM
See
http://talk.maemo.org/showthread.php?t=52646

Seems to work at least for some ;)

Maybe if some bright guy could make sure that the phone app never starts playing a ringtone before the script changed the symlink....

Oh, and of course a GUI would be nice ;)

I added it as a solution (http://maemo.org/community/brainstorm/view/add_caller_specific_ring_tones_and_alarm_specific_ tones-n900/#build_application_based_on_script_by_tmo-user-9000) to the original brainstorm proposal to get the whole thing into "under consideration" status.