maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   [ANNOUNCE] Phone Speakers Switcher - turns speakers on/off during call (https://talk.maemo.org/showthread.php?t=46914)

jaeezzy 2010-03-09 10:48

[ANNOUNCE] Phone Speakers Switcher - turns speakers on/off during call
 
1 Attachment(s)
Hi,
This simple application turns the speakers on or off by sliding the keyboard out or closing it respectively while the call is active - making and answering the call (not while receiving/ringing).
It is just in early development phase and hence not yet uploaded to extras-devel but will soon. However, for those who want to give it a try and leave some feedback, I have attached the .deb file. I've used it, installed/uninstalled, restarted device, without any problem hence you shouldn't have any either. If any, just uninstall and let me know.

TO DO:
* Use proximity as well [DONE]
* Create a control panel applet for settings (options to also open dashboard while speakers are active if any other files are open and of course to choose between proximity or keyboard action) [DONE]

TO INSTALL:
*open x-terminal
*sudo gainroot (assuming you have rootsh installed from repo)
*dpkg -i psswitcher_0.1-1_armel.deb (assuming you are in the same directory as this .deb file)

OR

Open the file from File Manager to install. (EASY)

TO UNINSTALL:
*sudo gainroot (assumption as above)
*dpkg -r psswitcher

OR

Simply uninstall from Application Manager.

UPDATES:

0.2-3 is in Extras-testing now.

NOTE: Answering and ending calls using camera button is yet not supported in Skype and GTalk calls.

*Version 0.2-3 (Current)
*Changelog:(since 0.1-9)

- Issues with bluetooth headset is resolved
- Options to enable camera button to toggle proximity while proximity is in use
- Disabling proximity by half-pressing camera button while making or answering a call will last for that whole conversation. It can't be later enabled within the same conversation.
- Other minor fixes

*Version 0.1-9
*Changelog:

- Information banner to show proximity state everytime its toggled
- Delay timer upto 10 seconds
- Other minor fixes

Again usage instructions file /usr/share/doc/psswitcher/README.Debian.

This package is just uploaded to extras-devel and as soon as its there I'll promote it to testing. Thanks

update: package is now in extras-testing


*Version 0.1-8
*Changelog:

- Supports Bluetooth headsets now
- Pressing camkey while answering/calling deactivates proximity
- Pressing camkey for around half a second toggles proximity
- Ability to use keyboard and proximity concurrently
- While opening keyboard proximity is temporarily disabled
- Option to set delay when turning speakers on via proximity
- Usage instructions file /usr/share/doc/psswitcher/README.Debian
IMPORTANT: Due to dependency problem for now it can only be installed giving sudo dpkg -i --force-depends psswitcher_0.1-8_armel.deb

*Version 0.1-7
*Changelog:

- cam key presses more accurate (meaning- long press ends phone call and quick short press toggles speakers and presses falling in between isn't effective)

*Version 0.1-5
*Changelog:
- Proximity Fixed
- Option to select distance before turning the speakers on has been removed coz it was for different purpose actually :D
- Minor fixes in control panel plugin UI
*Bug-tracker has also been added but as of now its not active yet. When it gets, I'll be pushing it to testing.

*Version 0.1-4
*Changelog:
- GUI interface in control panel for configuration
- Option to automatically open dashboard added
- Option to easily end call added
*Now available to download from extras-devel(BEWARE OF THE RISK OF ENABLING EXTRAS-DEVEL IN APPLICATION MANAGER)
*However, you can use the attached .deb file instead until I push it to extras-testing for testing purposes.

-----------------------------------------------------------------------------------------------
PLEASE NOTE THE FOLLOWING BEFORE INSTALLING:
[config file is in /home/user/.psswitcher/config]
[using proximity and other shortcuts at the same time will interfere and may cause random issues so please avoid doing so]
[just changing from true to false or vice versa will either disable/enable the shortcut]
[for "Distance", higher the value, further you can hold before the speaker gets activated ]
[please do killall PSSwitcher for changes to take effect] -- EDITED
[In config "Use Switcher", "Double Tap", "Open Dashboard" have no effect. I'm planning to implement them with control panel plugin for disabling the application, double tapping to end call and opening the dashboard while turning the speakers on respectively]


*Version 0.1-3
*Changelog:
- Proximity sensor shortcut is added
- Config file to switch shortcuts
- Phone UI's button is updated when toggeling speakers
- Some minor fixes

*Version 0.1-2
*Changelog:
- Sometimes only works when redoing is fixed.
- Camera focus button shortcut is added.
- Ineffective when headphone is plugged is added.

PS: Big thanks to qwerty12 or else I would have been still banging my head :D.

F2thaK 2010-03-09 11:12

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
sounds cool, but i totally dont get the part about how it works

"making and answering the call (not while receiving/ringing)"

dof250 2010-03-09 11:27

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
i'd love to see that when my phone is next to my face (proximity sensor) it goes to internal and when i put it away it goes on external speaker. That would be great

Matan 2010-03-09 11:32

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Does this program have a source?

rash.m2k 2010-03-09 11:34

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Dude what does this application actually do?

Need a little more explanation.

Rob1n 2010-03-09 11:41

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
From my reading, it only operates while you're actually having a conversation on the phone (i.e. after you've picked up the call). It then switches to the main speakers (rather than just the earpiece speaker) when you open the keyboard, and back again when the keyboard is closed. This allows you to easily look things up on the phone in the middle of a conversation. As dof250 says, having it triggered by the proximity sensor might make more sense, but it sounds like that option will be coming in a future release.

jaeezzy 2010-03-09 11:49

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by Rob1n (Post 561061)
From my reading, it only operates while you're actually having a conversation on the phone (i.e. after you've picked up the call). It then switches to the main speakers (rather than just the earpiece speaker) when you open the keyboard, and back again when the keyboard is closed. This allows you to easily look things up on the phone in the middle of a conversation. As dof250 says, having it triggered by the proximity sensor might make more sense, but it sounds like that option will be coming in a future release.

Ya exactly. It only works when the phone is active meaning you are talking on the phone or you are making call to someone and not when the phone is ringing which happens when someone else is calling you and other times it has no effect. The good of this is you can slideout the keyboard and do other stuff on the mobile while talking in loudspeaker and if you want to talk normally you don't have to go to the phone ui and disable speaker, just slide in the keyboard and there you go. Ya, I'll be bringing proximity sooon.

F2thaK 2010-03-09 11:52

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
oh, okay thats cool, might give it a test

badboyuk 2010-03-09 11:53

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
why not just tap on the loud speaker an slide the keyboard out an use it?! simple.

dof250 2010-03-09 11:58

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by badboyuk (Post 561078)
why not just tap on the loud speaker an slide the keyboard out an use it?! simple.

Well... if you're in an app you first need to switch back to phone and then tap the loudspeaker button. Opening the keyboard is faster

jaeezzy 2010-03-09 12:00

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by badboyuk (Post 561078)
why not just tap on the loud speaker an slide the keyboard out an use it?! simple.

Ya you are right but it comes handy after that - now you want to disable speaker : Just slide the keyboard in. Now if you say "Then just open dashboard, open Phone UI and tap speaker off button" then it's up to you. Moreover, in my case I always open most windows in fullscreen which adds up one more step of exiting the fullscreen mode.

damnshock 2010-03-09 12:10

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Great and usefull idea/program. I will wait until it gets to a better state to install it.

Thanks!

Pigro 2010-03-09 12:13

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
The proximity bit will be very useful - except when having one of those 'one way conversations' with wife/mother/GF etc. where you tend to get a bit exhausted 5 mins into your half duplex ear-bashing and start holding the phone at arms length for a bit of respite. Suggest disabling based on inbound CLI for nominated 'significant others' to spare the wider public being exposed to the rant/lecture/stream of consciousness ;-)

@badBoyUK - why? because automation is good. It's much more convenient not to have to say to the caller "hold on a minute while I put you on speaker .." (+ 2 second delay while you then actually do it). I seem to have to do this very regularly these days, now that I have such a capable "phone" that I can use it productively whilst on a call :-)

atz6975 2010-03-09 12:14

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
wonderful! so cool for voice mail...
Some feedback:
1) I don't know how you do it but it seems you don't "trigger" the speaker and therefore the speaker button is not highlighted. Could you do it and notify the telephone app to switch the button "on".
2) I could only get it working once...

But great anyway!!!

jaeezzy 2010-03-09 12:23

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by atz6975 (Post 561104)
wonderful! so cool for voice mail...
Some feedback:
1) I don't know how you do it but it seems you don't "trigger" the speaker and therefore the speaker button is not highlighted. Could you do it and notify the telephone app to switch the button "on".
2) I could only get it working once...

But great anyway!!!

Thanks for the feedback. So what after that. Is it not working? About, updating the Phone UI, I'm not sure but if anyone have any idea on this please let me know coz only from the help of this community I'm this far (ya though I'm not that far yet :D)

humble 2010-03-09 12:27

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
This is awesome! Great app thanks for putting this together..
will come in hand indeed.

Side note: one can install directly from File Manger just click on the .deb

late666 2010-03-09 13:47

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
What would be cool is to have the speakers on by default, and having them turn off when the proximity sensor goes on, so when you're holding the phone to your ear they're off, and when you're holding it in front of you the speakers go on...

efekt 2010-03-09 14:16

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by late666 (Post 561187)
What would be cool is to have the speakers on by default, and having them turn off when the proximity sensor goes on, so when you're holding the phone to your ear they're off, and when you're holding it in front of you the speakers go on...

Bad idea IMO - I can think of many occasions I have to put away the phone and still not wanting the speaker to be turned automatically on.

As for a general idea, I think this application is a very good idea, and maybe the speaker on/off can be mapped to a physical key - say, pressing and holding the camera key for 2 or 3 seconds will turn the speaker on or off, according to its current condition...?
Or even a quick screen gesture?

atz6975 2010-03-09 16:31

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
actually if I insist the 2 time it works again.

jaeezzy 2010-03-11 00:20

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by atz6975 (Post 561392)
actually if I insist the 2 time it works again.

Thanks. I have just uploaded the 0.1-2 version which will fix this and others. See my first post under UPDATES for more details and it is more usable.

hawaii 2010-03-11 02:06

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
New release works great. Camera focus key works even when it's assigned to shortcutd too.

Thanks for your work!

jaeezzy 2010-03-13 03:25

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Hi,
I've just uploaded the latest one 0.1-3. Please find the details in my first post under "UPDATES" and please make sure you read the "PLEASE READ THIS BEFORE INSTALLING" to avoid any kind of problem and feedbacks would be greatly appreciated. thanks

jaeezzy 2010-03-18 01:11

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
I've just uploaded the 0.1-4 version to extras-devel and in my #1 post here so you can download/use and I will be glad to have some feedbacks. Changes are also mentioned in my #1 post under "UPDATES". Thanks and enjoy ;)

atz6975 2010-03-18 12:44

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
I'll love your app!
Let me test and write back here.
Really,thanks.

oskkos 2010-03-18 19:37

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Hi,
Installed the latest version and I'm really loving your app.

One bug found however:
Tried it when plugged into charger and it didn't work.
In fact I couldn't get speaker on even manually by pressing the speker button in phone UI. Can anyone else confirm this?

jaeezzy 2010-03-19 03:06

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by oskkos (Post 572330)
Hi,
Installed the latest version and I'm really loving your app.

One bug found however:
Tried it when plugged into charger and it didn't work.
In fact I couldn't get speaker on even manually by pressing the speker button in phone UI. Can anyone else confirm this?

Is is repeatable? did you try again? coz I just checked and didn't have any problem. When the proximity sensor is on and you try to manually turn speakers off via phone ui its gonna turn back on again coz you are holding it far.

hawaii 2010-03-19 04:02

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
I have no issues at all with it. Newest release works A LOT faster when switching.

Shini 2010-03-19 05:15

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
I like it I was going to install when the first one came but I didnt I was waitting for Proximity Sensor~
and I just test it out now and it work just like charm~
and very fast switching~ what a wonderful job!! thank you so much for this useful app~

oskkos 2010-03-19 08:53

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by jaeezzy (Post 572785)
Is is repeatable? did you try again? coz I just checked and didn't have any problem. When the proximity sensor is on and you try to manually turn speakers off via phone ui its gonna turn back on again coz you are holding it far.

Restarted my phone and tried again. Now it seems to be working nicely. So no problemos anymore.

hawaii 2010-03-19 13:35

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Interested in implementing tapping the power button, to disconnect the call instead of the camera button (which works brilliantly, by the way).

If not, I can localize and make a personal patch.

jaeezzy 2010-03-20 03:09

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by hawaii (Post 573322)
Interested in implementing tapping the power button, to disconnect the call instead of the camera button (which works brilliantly, by the way).

If not, I can localize and make a personal patch.

Ya, that would be fine but the thing is when pressing power button it pops up a menu and I don't know how I can cancel that and only do what I want. If you can tell me how, I can implement that and also I'm working on proximity sensor coz the one I'm using at the moment isn't giving stable result - meaning in the day time, night and night time with the room lights on. Maybe because I chose the shorthand (easy way) :D Can anyone plz check this one and report me back?. Coz all I'm doing now is reading the files from /sys/class/hwmon/hwmon1/device/ namely adc0 and adc1 every 1 second and as they return numeric values, I'm just using that to turn speakers on/off. Can someone plz tell what they are actually, coz they are giving random results in different scenarios like I mentioned above and from what I found in the web, it is suppose to give proximity value.

qwerty12 2010-03-20 08:11

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by jaeezzy (Post 574280)
Coz all I'm doing now is reading the files from /sys/class/hwmon/hwmon1/device/ namely adc0 and adc1 every 1 second and as they return numeric values, I'm just using that to turn speakers on/off. Can someone plz tell what they are actually, coz they are giving random results in different scenarios like I mentioned above and from what I found in the web, it is suppose to give proximity value.

That would be due to those being the values for the light sensor... You want the file "/sys/bus/platform/devices/proximity/state" which can have a state of "open" or "closed".

P.S. GIOChannels provide a nicer alternative to watching files.

pillar 2010-03-20 09:05

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Shortcutd uses proximityd which I think could be used for easy proximity reading. Maybe it could be useful here as well?

jaeezzy 2010-03-21 02:01

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by qwerty12 (Post 574430)
That would be due to those being the values for the light sensor... You want the file "/sys/bus/platform/devices/proximity/state" which can have a state of "open" or "closed".

P.S. GIOChannels provide a nicer alternative to watching files.

Thanks for the info but I just couldn't make use of GIOChannel. Here's how I did:

Code:

int fd = open("/sys/bus/platform/devices/proximity/state", O_RDONLY, O_NONBLOCK, O_NOCTTY);
GIOChannel *channel = g_io_channel_unix_new(fd);
g_io_add_watch(channel, G_IO_IN | G_IO_PRI, (GIOFunc)readState, NULL);
..........

gboolean readState(GIOChannel *channel, GIOCondition cond, gpointer data){
 gchar *state;
 gsize size;
 GIOStatus ret = g_io_channel_read_line(channel, &state, &size, NULL, NULL);
 if (ret != G_IO_STATUS_ERROR){
  printf("STATE: %s", state);
  if (strcmp(state, "open") == 0){
        ...........
    }
  else if (strcmp(state, "closed") == 0){
        ...........
  }
  g_free(state);
 }else
  return FALSE;

 return TRUE;
}

Any help would be great. Thanks

qwerty12 2010-03-21 07:19

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by jaeezzy (Post 575383)
Thanks for the info but I just couldn't make use of GIOChannel. Here's how I did:

Code:

int fd = open("/sys/bus/platform/devices/proximity/state", O_RDONLY, O_NONBLOCK, O_NOCTTY);
GIOChannel *channel = g_io_channel_unix_new(fd);
g_io_add_watch(channel, G_IO_IN | G_IO_PRI, (GIOFunc)readState, NULL);
..........

gboolean readState(GIOChannel *channel, GIOCondition cond, gpointer data){
 gchar *state;
 gsize size;
 GIOStatus ret = g_io_channel_read_line(channel, &state, &size, NULL, NULL);
 if (ret != G_IO_STATUS_ERROR){
  printf("STATE: %s", state);
  if (strcmp(state, "open") == 0){
        ...........
    }
  else if (strcmp(state, "closed") == 0){
        ...........
  }
  g_free(state);
 }else
  return FALSE;

 return TRUE;
}

Any help would be great. Thanks

I'd be lying if I said I knew, so all I can do is point you to headphoned: http://repo.or.cz/w/headphoned.git/b...dphoned.c#l280

jaeezzy 2010-03-22 01:21

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
I've just uploaded the current version 0.1-5 to both devel and my #1 post. Its more matured now :D As, always all info are in that same post.

jaeezzy 2010-03-22 06:30

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
ok I think I've messed up couple of things in extras-devel repo as it's says dependency missing and I've no idea why and it can't be downloaded (I'm just noticing it). I checked some other packages and in every of them its "libosso1 (>=2.23)" but how come mine has "libosso1 (>=2.26)" and its in this where the problem lies. I'm using scratchbox only nothing else and in control file in Depends its ${shlibs:Depends}. Any help would be great however installing the provided deb file in the #1 post goes well. Thanks

qwerty12 2010-03-22 10:32

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by jaeezzy (Post 576679)
ok I think I've messed up couple of things in extras-devel repo as it's says dependency missing and I've no idea why and it can't be downloaded (I'm just noticing it). I checked some other packages and in every of them its "libosso1 (>=2.23)" but how come mine has "libosso1 (>=2.26)" and its in this where the problem lies. I'm using scratchbox only nothing else and in control file in Depends its ${shlibs:Depends}. Any help would be great however installing the provided deb file in the #1 post goes well. Thanks

https://bugs.maemo.org/show_bug.cgi?id=9070#c3 - the first paragraph there should sum it up.

jaeezzy 2010-03-22 11:18

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by qwerty12 (Post 576876)
https://bugs.maemo.org/show_bug.cgi?id=9070#c3 - the first paragraph there should sum it up.

Thanks for the info and does that mean I've to wait until the release of PR1.2 to be able to upload downloadable package in extras-* repo?

qwerty12 2010-03-22 11:21

Re: [ANNOUNCE] Phone Speaker Switcher - turns speakers on/off during call
 
Quote:

Originally Posted by jaeezzy (Post 576916)
Thanks for the info and does that mean I've to wait until the release of PR1.2 to be able to upload downloadable package in extras-* repo?

Nah, you should be OK -- you don't appear to depend on any components that are new to PR 1.1.


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

vBulletin® Version 3.8.8