Notices


Reply
Thread Tools
Posts: 1,417 | Thanked: 2,619 times | Joined on Jan 2011 @ Touring
#1
There is a new app named Saera being developed to provide a voice controlled experience similar to Siri for the Iphone.
For this app to be fully useful to people who need hands free voice interaction with their device the answer button needs to work outside of answering/ending phone calls with both the wired headset and more importantly the Bluetooth headsets much as it does on phones with voice dialing. Most of the work appears to have been done for wired headsets with these packages:
*Headset Button Enabler - enables wired headset to be used outside calls
*Headset Control - uses wired headset to control Media Player

These apps are designed for pausing and starting the media player but need to be accessable to Python which Saera is written in, and more importantly also need to include the more common bluetooth headsets which does not appaer to be the case.

Saera is one of the killer apps car drivers, cyclists, and motorcycle drivers have waited for on Maemo/Meego.

the Saera thread is here http://talk.maemo.org/showthread.php?t=84753
 

The Following 2 Users Say Thank You to biketool For This Useful Post:
Posts: 1,417 | Thanked: 2,619 times | Joined on Jan 2011 @ Touring
#2
Checked http://wiki.maemo.org/Phone_control
doesnt seem to currently be any way to get information related to headsets beyond pairing and other standard bluez stuff.
 
Posts: 804 | Thanked: 1,598 times | Joined on Feb 2010 @ Gdynia, Poland
#3
According to headset-button-enabler description, when it is installed and a headset button is pressed, "ButtonPressed" signal is emitted by HAL... it should be possible to catch that signal in Python somehow... I cannot help with Python, as my Python skills are weak, but have a look at headset-control package sources, especially at two files: headset-controld.c and headset-control-obj.c. If you understand C language, you will notice this isn't rocket science, and it requires only Python glib, dbus and hal bindings (maybe even one of these is not needed, I skimmed through the code now very quickly while I'm on the train), which, afaik, are all available for Python on Maemo. So, in my oppinion, package headset-control could be used as a reference implementation, if someone has more time, (s)he can write a wiki page basing on this code.
 

The Following User Says Thank You to misiak For This Useful Post:
wook_sf's Avatar
Posts: 640 | Thanked: 435 times | Joined on Oct 2011 @ rajvoSa BA
#4
not quite sure, but maybe os.popen can help?
 

The Following User Says Thank You to wook_sf For This Useful Post:
Posts: 1,417 | Thanked: 2,619 times | Joined on Jan 2011 @ Touring
#5
Originally Posted by misiak View Post
According to headset-button-enabler description, when it is installed and a headset button is pressed, "ButtonPressed" signal is emitted by HAL... it should be possible to catch that signal in Python somehow... .
Thanks I think the scripts control will do it for the wired headset. I dont have my N900 right now as a replacement is in the mail but I am also trying to figure out how the HAL or d-bus handles an answer button from a BT headset when there is not an incoming call. I think if there was a way to mod headset-button-enabler to look for the bluetooth answer instead of from the wired headset it would do the job, my sub-script kiddie skills are really failing me now though.
 
Posts: 1,417 | Thanked: 2,619 times | Joined on Jan 2011 @ Touring
#6
Originally Posted by wook_sf View Post
not quite sure, but maybe os.popen can help?
Thanks, I am looking at that now, a great lead. The problem is I am waiting for my replacement N900 to arrive and cant experiment. Can you see a answer button press on you BT headset with os.popen without mucking with dbus?
 
wook_sf's Avatar
Posts: 640 | Thanked: 435 times | Joined on Oct 2011 @ rajvoSa BA
#7
Originally Posted by biketool View Post
Thanks, I am looking at that now, a great lead. The problem is I am waiting for my replacement N900 to arrive and cant experiment. Can you see a answer button press on you BT headset with os.popen without mucking with dbus?
unfortunately i don't have BT headset :S nor n900 but it should work since i tested some functions like this on n9 and it works.
last night i found struct of input events and library written in python, well...there's not much of ported py libs for harmattan but i am sure python-dev and this scripts can be ported to python easily.
however, you can take needed classes from event.py and input.py and put them into your script.
 

The Following User Says Thank You to wook_sf For This Useful Post:
Posts: 435 | Thanked: 769 times | Joined on Apr 2010
#8
When wired or bluetooth button is pressed a system dbus signal is emitted. On n900 if I don't remember wrong the wired button is disabled but you may enable it just with an amixer command. You don't need anything else, just to enable the wired button and listen to dbus events.
__________________
My Fremantle projects: InternetRadioPlayer, QRadio, InternetRadioWidget, AutoRemoveSms, PSAutoLock, TodoListWidget, MediaPlayerWidget
My Harmattan projects: InternetRadioPlayer, QMLRadio, SigmaPlayer, WidgetCanvas, NotesExporter, 3DTris, NoStopPlayer, NotesImporter
 

The Following User Says Thank You to gionni88 For This Useful Post:
Posts: 804 | Thanked: 1,598 times | Joined on Feb 2010 @ Gdynia, Poland
#9
Originally Posted by gionni88 View Post
When wired or bluetooth button is pressed a system dbus signal is emitted. On n900 if I don't remember wrong the wired button is disabled but you may enable it just with an amixer command. You don't need anything else, just to enable the wired button and listen to dbus events.
So it doesn't matter whether the headset is wired or wireless (bluetooth), the dbus signal will be the same? If yes, I can come up with minimalistic C and Python example for you taxizo, as I have wired headset (but I don't have any wireless, so I'm only able to test with wired one).

edit: This would get more responses if it was posted in "Development" section, not "Design"... Anyway, I'm up for writing a simple example, give me few hours

Last edited by misiak; 2012-06-13 at 16:12.
 

The Following 3 Users Say Thank You to misiak For This Useful Post:
Posts: 1,417 | Thanked: 2,619 times | Joined on Jan 2011 @ Touring
#10
Originally Posted by misiak View Post
So it doesn't matter whether the headset is wired or wireless (bluetooth), the dbus signal will be the same? If yes, I can come up with minimalistic C and Python example for you taxizo, as I have wired headset (but I don't have any wireless, so I'm only able to test with wired one).

edit:I'm up for writing a simple example, give me few hours
Great, plenty of us really appreciate the work!
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 20:01.