PDA

View Full Version : [ANNOUNCE] Daemon for Vibration after call is connected


rnb89
2010-06-11, 10:16
Update 2 : The daemon has been updated. Look for Outcoming Call Vibro' created by Victor Yagofarow<xnasx@ya.ru>. Version 0.6



Update.. Nostradamus has created a deb package for the function and uploaded to extras devel.. look for out-call-vibro

Thanks to everyone who contributed to this thread.


So this one is from android.. Here is what daemon must do..

Dial number and intiate call
The phone rings for other person.
When person pickes up call, ie just when the timer for ur call starts.. send vibration signal to user..

Why this is useful?
U dont have to be holding the phone to your ear while waiting for the call to be connected.. You can call and hold the phone down.. when it vibrates, bring it up to your ear and talk..

Seems like a simple script but my lack of Linux coding abilities restricts me..

Would be grateful if someone can make the daemon..

rnb89
2010-06-21, 10:45
Bump. Anyone.. help.. pls..

jaeezzy
2010-06-21, 10:53
So this one is from android.. Here is what daemon must do..

Dial number and intiate call
The phone rings for other person.
When person pickes up call, ie just when the timer for ur call starts.. send vibration signal to user..

Why this is useful?
U dont have to be holding the phone to your ear while waiting for the call to be connected.. You can call and hold the phone down.. when it vibrates, bring it up to your ear and talk..

Seems like a simple script but my lack of Linux coding abilities restricts me..

Would be grateful if someone can make the daemon..

Not exactly what you are looking for but with "Phone Speakers Switcher" you can make a call and with the help of proximity it will automatically turns speakers on so you know phone is ringing and when the receiver answers and you take your phone to your ears and it switches back to handset. :)

dana.s
2010-06-21, 10:58
I had same feature (vibration when connected) on my Motorola c200.
I confirm it's very useful feature.

MPW
2010-06-21, 11:52
All WindowsMobile-Devices do so too, would be great :-)

bachagabriel
2010-06-21, 12:29
+1 it's a very good idea

hawaii
2010-06-21, 14:13
It would actually work better using slight vibration (maybe, TS pattern) during ringing, and when the call is connected, it stops. Both options are good. S60 devices also have software that does this (VibrateCall). Very useful.

ny-hardcore
2010-06-21, 14:57
So this one is from android.. Here is what daemon must do..

Dial number and intiate call
The phone rings for other person.
When person pickes up call, ie just when the timer for ur call starts.. send vibration signal to user..

Why this is useful?
U dont have to be holding the phone to your ear while waiting for the call to be connected.. You can call and hold the phone down.. when it vibrates, bring it up to your ear and talk..

Seems like a simple script but my lack of Linux coding abilities restricts me..

Would be grateful if someone can make the daemon..


From the wiki

import gobject, dbus
from dbus.mainloop.glib import DBusGMainLoop

def handle_call(obj_path, callernumber):
print '%s is calling' % callernumber

DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
bus.add_signal_receiver(handle_call, path='/com/nokia/csd/call', dbus_interface='com.nokia.csd.Call', signal_name='Coming')
gobject.MainLoop().run()


This python scripts listens for incoming calls and prints the fact that the phone is called.

maybe this script can be adapted to listen to 'call starts/ended' signal (is there one) and then instead of printing, just call the vibrate via dbus..

i will try to look into it tonight if i find the time..
fyi i don't have any experience programming what so ever.. so don't get your hopes up ;)

LordJuanlo
2010-06-21, 15:14
I miss this feature from my old HTC Diamond, it would love to see it on the N900

pelago
2010-06-21, 15:41
Should the vibration only happen when the device is left on a table? I can imagine the vibration being a bit annoying if I'm making a call with the handset next to my ear.

stlpaul
2010-06-21, 16:39
you could check accelerometer to see if phone is horizontal or vertical

LordJuanlo
2010-06-21, 16:56
Should the vibration only happen when the device is left on a table? I can imagine the vibration being a bit annoying if I'm making a call with the handset next to my ear.

There is no need to complicate this feature with accelerometer. The vibration on my HTC Diamond wasn't annoying at all, even when I had the device next to my ear. It was just one single vibration when the call started, it was not a continuous vibration.

But I rarely put the device next to my ear when using this feature, I just made the call and had my hand down, with the phone. Whenever I felt the vibration I took the phone to my ear and started talking. It was a great feature.

ny-hardcore
2010-06-21, 19:33
hmm... i'm stuck..

i took the wiki python code, and came up with this:

import gobject, dbus, os
from dbus.mainloop.glib import DBusGMainLoop

def handle_call(message, actor, memberids):
print 'Turning on vibrator'
os.system('dbus-send --print-reply --system --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_vibrator_enable')
print 'Sending pattern'
os.system('dbus-send --print-reply --system --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_vibrator_pattern_activat e string:"PatternTouchscreen"')
print 'Pattern send'

DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
bus.add_signal_receiver(handle_call, signal_name='AudioConnect')
gobject.MainLoop().run()


when the call is anwered, it's prints 'Call answered' but the dbus signal is send, but there is no vibration?
Is this somehow disabled when phone is active?
I to activate the vibrator when phone is active with:
dbus-send --print-reply --system --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_vibrator_enable
and then sending the touchscreen pattern, but no vibration when phone is active. It does vibrate when call is disconnected :D


and i'm not sure if i am detecting the call answered signal correctly.. someone with more experience have any ideas?

pelago
2010-06-21, 21:31
you could check accelerometer to see if phone is horizontal or vertical

Actually, proximity sensor would be better I guess, i.e. if proximity sensor is activated then the phone is probably against someone's ear, so don't vibrate when the call is answered.

Of course, maybe LordJuanlo is right and the short vibration when holding the device against your ear isn't a problem. I just think that, until I get used to it, I might think the vibration is an SMS or other alert that arrived!

canabal
2010-06-21, 21:42
It would actually work better using slight vibration (maybe, TS pattern) during ringing, and when the call is connected, it stops. Both options are good. S60 devices also have software that does this (VibrateCall). Very useful.

I agree, this is the best option from my experience.

LordJuanlo
2010-06-22, 10:41
It would actually work better using slight vibration (maybe, TS pattern) during ringing, and when the call is connected, it stops.

I prefer the opposite, Windows Mobile style (and it saves battery). But it could be configurable to suit everyone's preferences

rnb89
2010-06-22, 11:22
There is no need to complicate this feature with accelerometer. The vibration on my HTC Diamond wasn't annoying at all, even when I had the device next to my ear. It was just one single vibration when the call started, it was not a continuous vibration.

But I rarely put the device next to my ear when using this feature, I just made the call and had my hand down, with the phone. Whenever I felt the vibration I took the phone to my ear and started talking. It was a great feature.

Agreed.. A single short vibration as soon as its connected is sufficient.. I had used the feature on HTC dream/G1..

@ny-hardcore .. Keep up the good work..hopefully someone else form the community can chip in to complete the code..

qwerty12
2010-06-22, 11:31
For me, the usefulness of this on the N900 isn't a lot due to the N900 considering a call to be "answered" when the dial tones are being emitted. My W810i (which was patched to provide this functionality) would differentiate between when dial tones were being emitted and when the call was actually picked up. When it was picked up, that's when it would vibrate.

ATM, on the N900, the timer starts with the dial tones (which makes sense) but there is no signal emitted on either Bus when the call has been picked up by the recipient. Maybe the Eventlogger database is modified, I don't know...

ny-hardcore
2010-06-22, 12:20
For me, the usefulness of this on the N900 isn't a lot due to the N900 considering a call to be "answered" when the dial tones are being emitted. My W810i (which was patched to provide this functionality) would differentiate between when dial tones were being emitted and when the call was actually picked up. When it was picked up, that's when it would vibrate.

ATM, on the N900, the timer starts with the dial tones (which makes sense) but there is no signal emitted on either Bus when the call has been picked up by the recipient. Maybe the Eventlogger database is modified, I don't know...

I think there is actually a signal that is fired when a call is answered or stopped..
I my script I use
path=/com/nokia/csd/call/1
interface=com.nokia.csd.Call.Instance
member=AudioConnect
and it is found in the dbus monitor just after the call is answered or ended....

LordJuanlo
2010-06-30, 09:41
Cmon guys, anybody can make a program of this?

ny-hardcore
2010-06-30, 10:26
Cmon guys, anybody can make a program of this?

I think we are all stuck on the fact that when the 'phone' is active (i.e ongoing phonecall)
the vibrator won't function, it seems as if it is disabled, and enabling it with dbus during call does not work...

the code i posted can be run with python on the phone, but will only vibrate the phone when the call is ended, not when the call is started...

rnb89
2010-06-30, 10:51
ATM, on the N900, the timer starts with the dial tones (which makes sense)

Nope.. Timer starts when call is connected.. ie the other person picks up the call..

slipkornsaad
2010-06-30, 20:03
Then like on Vibrate Call application (http://thinkchange.cn/products/index/vibratecall.html) on symbian : The application invokes the vibration alert during outgoing calls and continues the vibration until the call is answered. This means that users can just dial and wait for the vibration alert to seize to put ears to their phones, with adjustable vibration intensity...

Matan
2010-06-30, 21:10
I think we are all stuck on the fact that when the 'phone' is active (i.e ongoing phonecall)
the vibrator won't function, it seems as if it is disabled, and enabling it with dbus during call does not work...

the code i posted can be run with python on the phone, but will only vibrate the phone when the call is ended, not when the call is started...

Did you try to vibrate by directly writing to the hardware:

/sys/class/leds/twl4030:vibrator/brightness

If you use titan's kernel using dbrightness instead of brightness might be better, as it prevents mce from interfering.

ny-hardcore
2010-07-07, 18:11
ok i came up with following

using dbus-scripts
http://maemo.org/packages/view/dbus-scripts/

install dbus-scripts

copy attached settings file (vibra.txt) to
/etc/dbus-scripts.d/

and copy the *.sh.txt file to
/home/user/
and rename it to vibra_on.sh
and run
chmod +x vibra_on.sh
(damn attachement extensions...)

run killall dbus-scripts
place a call, feel it vibrate :D

F2thaK
2010-07-08, 15:57
the above does not work

ny-hardcore
2010-07-08, 16:42
the above does not work

forgot to include
chmod +x vibra_on.sh

F2thaK
2010-07-09, 02:53
still dfoesnt work dude

colakang
2010-07-09, 03:53
PYTHON SCRIPT:



#! /usr/bin/env python2.5
# -*- coding: utf-8 -*-

import pygtk
import gtk
from gtk import Window, Button, Widget
import hildon
import time
import os
import gobject, dbus
from dbus.mainloop.glib import DBusGMainLoop


vibrator=0

def connect_call(message, actor, memberids):
#print 'message = %s' % message
#print '\n actor = %s' % actor
#print '\n memberids = %s' % memberids
global vibrator
if actor==1 and message==0:
vibrator=1
return
if actor==1 and message==1 and vibrator==1:
os.system('echo 100 > /sys/class/leds/twl4030\:vibrator/brightness')
time.sleep(1)
os.system('echo 0 > /sys/class/leds/twl4030\:vibrator/brightness')
vibrator=0
return

DBusGMainLoop(set_as_default=True)
bus = dbus.SystemBus()
bus.add_signal_receiver(connect_call, path='/com/nokia/csd/call/1', dbus_interface='com.nokia.csd.Call.Instance', signal_name='AudioConnect')
gobject.MainLoop().run()

if __name__ == '__main__':
gtk.main()



before run this script,you need to do these steps



sudo gainroot
cd /sys/class/leds/twl4030\:vibrator
chmod 666 brightness

F2thaK
2010-07-09, 04:22
as root i did "python2.5 vibe.py"

line 17 in <module>
got error "name: 'bus' not defined

F2thaK
2010-07-09, 04:57
*bump*
.............

colakang
2010-07-09, 09:18
the code is update.
you can run it again.

BTW, just run the script in normal identity.
open X terminal
python2.5 vibe.py &

F2thaK
2010-07-09, 09:55
it works sorta,

it vibes when call is started and when call is answered.

any way to have this autorun on boot in background/?

rnb89
2010-07-09, 10:01
Can anyone package it into a deb file? Pretty Please.. :)

F2thaK
2010-07-09, 10:17
yes, someone (that is able - not me) needs to:

- stop it from vibrating when call is initiated
- make it into an app that runs on boot in the background

cheers

nastradamus
2010-07-16, 08:00
Hi! (forgive my english)

I've found this topic by search..

I've wrote a simple script in a Shell and created a .deb . It works after restarting N900 too.

Here it:
https://garage.maemo.org/projects/out-call-vibro/

F2thaK
2010-07-16, 10:36
Hi! (forgive my english)

I've found this topic by search..

I've wrote a simple script in a Shell and created a .deb . It works after restarting N900 too.

Here it:
https://garage.maemo.org/projects/out-call-vibro/


BIG THANKS MATE

this not in repos yet??

nastradamus
2010-07-16, 10:50
I will load in a repository after I will learn to build correctly a package with a scratchbox. (I need a correct .changes file to upload my .deb into a extras)

Forgive my english. :)

nastradamus
2010-07-19, 10:19
Now this avaible in the Extras-devel repo. :)

http://repository.maemo.org/extras-devel/pool/fremantle/free/o/out-call-vibro/out-call-vibro_0.1_armel.deb

F2thaK
2010-07-19, 10:58
thanks, cool "app" but I uninstalled it atm...

I answered call and phone vibrates really loud, I swear person on other end heard it!

maybe add settings to next release??

:D

edit: Ive got it: ONLY vibe if proximity is open
(not up against your ear..)
?????????????????????????
=)

nastradamus
2010-07-19, 11:17
f2thak, in a last release in the Extras-devel I changed frequency and duration to a lower values. Now vibration does not break off a brain :)

F2thaK
2010-07-19, 12:34
okay, cool =)

any chance of implementing the proximity setting I suggested? only vibe if phone not to ear when call answered???

cheers

nastradamus
2010-07-19, 12:48
I will try to make it. But I do not promise that soon.

MohammadAG
2010-07-19, 13:39
vibro() {
if grep -q "Call answered"; then
if [ `cat /sys/devices/platform/gpio-switch/proximity/state` = "closed" ] then; echo 0 > /sys/class/leds/twl4030:vibrator/brightness
else
echo 200 > /sys/class/leds/twl4030:vibrator/brightness
sleep 0.9
echo 0 > /sys/class/leds/twl4030:vibrator/brightness
fi
fi
}

Haven't tested it, you might find syntax errors since I'm half asleep atm

nastradamus
2010-07-19, 13:53
MohammadAG,

Oh, thanks for hint. I'll add this in the next release. )

nastradamus
2010-07-19, 17:51
I've added Proximity sensor support.
Enjoy )

A new version is on the Extras-devel.

mthmob
2010-07-19, 18:05
Many thx for this, works perfect for me :)

Tomaszd
2010-07-19, 18:58
nastradamus, you can add a nice name for this in debian/control, so that "out-call-vibro" is not the name in Application Manager, something like this:

XB-Maemo-Display-Name: Vibrate When Call Estabilished

Here (http://wiki.maemo.org/Maemo_packaging#Displaying_an_icon_in_the_Applicat ion_Manager_next_to_your_package) are some other pointers, for example to have an icon.

dana.s
2010-07-19, 19:28
It'll be better if someone change thread title to [Announce] or open a new thread because it still says [Request] and i really didn't know that it has been done. Thanks.

dana.s
2010-07-19, 19:30
so what is the name of the app?

mangal_sk8erboy
2010-07-19, 19:38
well we do have something of the sort already..
the PHONE icon on the top left corner of the contact will be solid. once its RINGING the phone icon BLINKS.
and once he/she picks up, the TIMER starts.
thats how you know..
no vibration really required, but hey if you really want it..WHY NOT!

jakiman
2010-07-20, 00:21
This is awesome. Just tried it and works flawlessly. Would be cool to have "Settings" for it in the Settings Extras section. To be able to tweak options such as strength and duration of the vibration and enable/disable it altogether.

BTW, I had an app on N95 8GB which actually did the opposite. It will vibrate constantly while dialling and then stop when someone picks up. It was actually pretty handy as it gave me a constant feedback telling me that it's still dialling and stops if call gets picked up or if it dials out.

rnb89
2010-07-20, 03:56
Just changed the thread to [Announce] ..

Thanks again to everyone who contributed to this thread.. I hope more tweaks are added and this made more customizable based on users needs..

Perfect to what i requested and am so happy!!! N900 rules..

Salatheel
2010-07-20, 04:38
so what is the name of the app?

out-call-vibro

If you are using "Faster Application Manager" remember to update catalogs.

saxen
2010-07-20, 07:02
It would actually work better using slight vibration (maybe, TS pattern) during ringing, and when the call is connected, it stops. Both options are good. S60 devices also have software that does this (VibrateCall). Very useful.

that's would be great!! more usefull imho!

dana.s
2010-07-20, 09:30
that's would be great!! more usefull imho!

could be bad for battery usage

nastradamus
2010-07-20, 10:00
Tomaszd, thanks for help. I have done it.
Now program is called "Outcoming Call Vibro" in the Application Manager and this have an ico.

By the way, I changed a "sleep" for "gsleep" for better vibration duration control.

PS: forgive my english.

nastradamus
2010-07-20, 10:05
well we do have something of the sort already..
the PHONE icon on the top left corner of the contact will be solid. once its RINGING the phone icon BLINKS.
and once he/she picks up, the TIMER starts.
thats how you know..
no vibration really required, but hey if you really want it..WHY NOT!

Vibration helps at car driving.

cantruchd
2010-07-21, 02:22
Hello,
I installed the program, I restarted the phone, but it doesn't vibrate when I make a call and connected,
I use firmware v10.2010.19-1
I wonder if anybody using the same firmware with me has the same problem?
By the way, i install using faster application manager, could that be the problem?

ryanl33x1511
2010-07-21, 03:46
same how do i activate it ?

nastradamus
2010-07-21, 07:17
Hello,
I installed the program, I restarted the phone, but it doesn't vibrate when I make a call and connected,
I use firmware v10.2010.19-1
I wonder if anybody using the same firmware with me has the same problem?
By the way, i install using faster application manager, could that be the problem?

Please, try to install this from the standart Application Manager. Repository must be "Extras-devel". Check for updates before installing.

By the way, firmware v10.2010.19-1 (aka PR 1.2) is the latest firmware. I have the same.

(forgive my english)

cantruchd
2010-07-21, 08:27
Is the exact name 'Outcoming Call Vibro' created by Victor Yagofarow<xnasx@ya.ru> ?

Sorry because your name here are nastradamus so it is a little confusing

nastradamus
2010-07-21, 08:31
yes, Victor Yagofarov

cantruchd
2010-07-21, 08:44
Oops, I uninstall it by App manager, then reinstall using App manager, restarted the phone, but it still does not vibrate :(

I install the dual boot to Android as instructed on the NITDroid.com http://wiki.nitdroid.com/index.php?title=N900-install, could this be the reason?

Is there any information I can provide for help you in trouble shoot this problem?

nastradamus
2010-07-21, 08:50
cantruchd,
please, run out-call-vibro.sh in a terminal (not by root), make a call. If in a terminal there were errors, write about them.

cantruchd
2010-07-21, 08:57
@nastradamus
It just says "Process is already running..."

After I made a call, nothing more appear in terminal,
I call the normal way (phone icon), should I call using the terminal?

nastradamus
2010-07-21, 09:08
@cantruchd
Run stop-out-call-vibro.sh

and then run out-call-vibro.sh . It should run with output into terminal.

and make call again

cantruchd
2010-07-21, 09:26
it says "/usr/bin/out-call-vibro.sh: line 27: cannot create /sys/class/leds/tw14030:vibrator/brightness: Permission denied"
then "gsleep not found"
then "...permission denied" again.

I'll try to run with root to see what happens :-)

cantruchd
2010-07-21, 09:31
Hi nastradamus,
When I run with root, it does vibrate, but so short around 1 microsecond so it is hardly noticable.

cantruchd
2010-07-21, 09:33
and it still say 'gsleep not found'

cantruchd
2010-07-21, 09:36
is the current version 0.5?

nastradamus
2010-07-21, 09:49
Oh. My bad.
At building of a package I have forgotten to specify dependence 'coreutils-gnu'.
I'll fix it in next release.

But why you have no permissions write to the vibration device... I don't know.

Please:

1) show me a file:
cat /etc/event.d/out-call-vibro
2) Try to reinstall a package:
(on root)
apt-get remove out-call-vibro
apt-get purge out-call-vibro
apt-get install out-call-vibro

And when do not restart a phone! Try to call.

PS: yes, current version is 0.5

nastradamus
2010-07-21, 11:18
Try a new version (0.6):

apt-get update
apt-get purge out-call-vibro
apt-get install out-call-vibro

cantruchd
2010-07-21, 16:59
Try a new version (0.6):

apt-get update
apt-get purge out-call-vibro
apt-get install out-call-vibro

the content of the file:
hor "Victor Yagofarov"

description "Start the Outcoming Call Vibro script"
# generated by postinst

start on started hildon-desktop

script
/bin/chmod -R 777 /sys/class/leds
/bin/mkdir /var/run/out-call-vibro
/bin/chmod -R 777 /var/run/out-call-vibro
if [ -f /var/run/out-call-vibro/out-call-vibro.pid ] ; then /bin/rm /var/run/out-call-vibro/out-call-vibro.pid ; fi

/bin/su - user /usr/bin/run-out-call-vibro.sh
end script

cantruchd
2010-07-21, 17:00
and for mine it's not working yet

nastradamus
2010-07-21, 17:43
Now I created a new version. Try (on root):

apt-get update
apt-get purge out-call-vibro
apt-get install out-call-vibro

F2thaK
2010-07-25, 06:28
version 0.7 works pefectly for me! thank you!

just tested, both with phone not to ear and with phone to ear...

THANK YOU SO MUCH nastradamus/Victor

cantruchd
2010-07-26, 14:58
version 0.7 works pefectly for me! thank you!

just tested, both with phone not to ear and with phone to ear...

THANK YOU SO MUCH nastradamus/Victor
It seems that the program does not run automatically when the phone starts.
I see no pid 1982 in the running process lists

nastradamus
2010-07-26, 15:04
It seems that the program does not run automatically when the phone starts.
I see no pid 1982 in the running process lists

Try this:

ps aux | grep out-call

junionwoon
2010-07-26, 15:36
hi nastradamus,

many thanks for the fantastic app :)

works pretty well ... is it also possible to make it work for skype call outs?

cheers

cantruchd
2010-07-29, 10:17
Hi nastradamus,
After reflash mine works finally but with around 2 seconds latency after the other side answers.

Is this normal or not?

nastradamus
2010-07-29, 10:32
Hi nastradamus,
After reflash mine works finally but with around 2 seconds latency after the other side answers.

Is this normal or not?

This is normal. It occurs because of the slow response dbus. Features Maemo. Sometimes vibration occurs at once, sometimes after several seconds.

But maybe problem can be will solve after rewriting on C ++/Qt.


(forgive my english)

nastradamus
2010-08-26, 06:31
Please, vote for my application (http://maemo.org/packages/package_instance/view/fremantle_extras-testing_free_armel/out-call-vibro/0.7/) if you like it.
It is necessary for hit to the Extras.

Thanks!

F2thaK
2010-08-26, 06:34
voted! great little daemon .. love how it doesnt vibe if phone is to ear :D