maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N9 / N950 (https://talk.maemo.org/forumdisplay.php?f=51)
-   -   [Anounce] [N9] Volume/Power Button Monitor (https://talk.maemo.org/showthread.php?t=82538)

wolke 2013-08-20 03:03

Re: [Anounce] [N9] Volume/Power Button Monitor
 
added n9-button-monitor and n9bm-toggle to openrepos

https://openrepos.net/content/telesh...button-monitor
https://openrepos.net/content/teleshoes/n9bm-toggle

Code:

deb http://harmattan.openrepos.net/teleshoes personal main

Mikkosssss 2013-08-22 15:07

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Is there way to get snapshot working with action like up down up?

I want that because I use double press up for torch and double pressdown for cyclotron.
Another reason is that I use short double press time 250ms but I dont always manage to press so fast and snapshot needs to be more reliable.

wolke 2013-08-22 15:25

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by Mikkosssss (Post 1368709)
Is there way to get snapshot working with action like up down up?

I want that because I use double press up for torch and double pressdown for cyclotron.
Another reason is that I use short double press time 250ms but I dont always manage to press so fast and snapshot needs to be more reliable.

nope, sorry, patterns are not available in 0.5.4.

this is certainly possible to code, and i might add something like it eventually. {in fact, you used to be able to specify arbitrary patterns like hold up, double-tap down, release up, but it was too complicated, both in the code, and in the complex hand maneuvering. the way it is now, with default timeouts, i dont make mistakes. with the patterns and the rigorous timeouts needed to make sure overlapping patterns work, i fukt up more often than i actually clicked it correctly}

personally, i like triple-tap-up for snapshot, but i dont think i could do it in 1/4 of a second. {for my double/triple timeouts, i use 400ms/600ms.} so far, ive managed to use it several times to great success, but just as often im too slow to capture the Moment.
you might also want to consider double-tap lock.

Mikkosssss 2013-08-22 16:04

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Ok I come back when/if you do it someday. :p
I use short delay on double press because I have many times found that my flashlight is on in my pocket, I dont know how that's possible.
Yes, I know there's timeout for flashlight. :D
I dont like treble press because with short delay that I need I need sometimes try start flashlight few times so it would probably take pictures when I am trying. :D
I dont like double press to unlock and if that single press powerbutton was snapshot my memory would be soon full of black pictures. :p

wolke 2013-08-22 16:06

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by Mikkosssss (Post 1368719)
Ok I come back when/if you do it someday. :p
I use short delay on double press because I have many times found that my flashlight is on in my pocket, I dont know how that's possible.
Yes, I know there's timeout for flashlight. :D
I dont like treble press because with short delay that I need I need sometimes try start flashlight few times so it would probably take pictures when I am trying. :D

heh, yea. ok, i will let you know if i do it

Mikkosssss 2013-08-22 16:46

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Then I have another thing.
I disabled camera sound from camera.py (just messed filename)
(Yes, I am secred spy)

Could notification led be used to tell that picture is taken. 0.5sec light when taking and another 0.5 sec when saved.

Thanks.

wolke 2013-08-22 17:33

Re: [Anounce] [N9] Volume/Power Button Monitor
 
sounds cool. assuming that LED patterns are easy to fire, ill try to do it soon-ish.

initial proposal for next release is to add the following options:
1) quickSnapShutterSound {default is none}
2) quickSnapSaveSound {default is snd_camera_shutter.wav}
3) quickSnapShutterLEDPattern {default is blink}
4) quickSnapSaveLEDPattern {default is blink twice}
5) quickSnapShutterCmd {default is none}
6) quickSnapSaveCmd {default is none}

what you can do, temporarily, is bind another action to the same sequence, to run a command that performs the led notify. it will fire roughly 3s before the picture is snapped.

Mikkosssss 2013-08-22 18:04

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by wolke (Post 1368739)
It will fire roughly 3s before the picture is snapped.

I can just add sleep delay then.

Thanks

Edit: Here is python script that uses led: http://talk.maemo.org/showthread.php?t=91044

masen 2013-08-25 17:19

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Thanks for a great app. I installed it and it works with camera and musicplayer, but I cant get the torch to work. According to the default file it should start when holding volume+ when on stand-by screen? Am I stupid who can't make it work? (not necessary to answer :)).
That feature would be so nice to have. Anyone who can help me?

wolke 2013-08-25 18:36

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by masen (Post 1369287)
Thanks for a great app. I installed it and it works with camera and musicplayer, but I cant get the torch to work. According to the default file it should start when holding volume+ when on stand-by screen? Am I stupid who can't make it work? (not necessary to answer :)).
That feature would be so nice to have. Anyone who can help me?

try closing any camera apps and other torch apps first. only one app can control the camera at a time.

try holding it for ~10s just to make sure your phone isnt being sluggish.
the button push takes about 1s to start, to make sure you meant to hold it down, and then the torch normally takes about 3s to start, but maybe yours is taking longer.

try rebooting {note that n9bm doesnt start up as soon as the phone boots; extra applications are made to wait until all system services starts. this means that after you reboot, it takes 1-3min for n9bm to turn on}

try normal flash in camera; maybe your hardware is defective?

wolke 2013-08-29 23:58

Re: [Anounce] [N9] Volume/Power Button Monitor
 
ok, crap. LED requires root, and n9bm of course runs as user. thinking about it. ideas?

wolke 2013-08-30 00:13

Re: [Anounce] [N9] Volume/Power Button Monitor
 
ok, made a daemon that listens over dbus for led(0), led(255), etc

wolke 2013-08-30 00:32

Re: [Anounce] [N9] Volume/Power Button Monitor
 
syntax will be:
###led => set led brightness to ### [0..255]
###ms => delay ### milliseconds
on => 255led synonym
off => 0led synonym


double blink:
on, 10ms, off, 250ms, on, 10ms, off

slow increase over ~5s:
16led, 250ms, 32led, 250ms, 48led, 250ms, 64led, 250ms, 80led, 250ms, 96led, 250ms, 112led, 250ms, 128led, 250ms, 144led, 250ms, 160led, 250ms, 176led, 250ms, 192led, 250ms, 208led, 250ms, 224led, 250ms, 240led, 250ms, 255led, 250ms, 0led

wolke 2013-08-30 02:22

Re: [Anounce] [N9] Volume/Power Button Monitor
 
damnit! im done with it, except that i cant get the led-dbus to start as root. got no idea what to do about this.

EDIT: presumably because dbus qt mainloop needs an xsession. switched to gobject

wolke 2013-08-30 04:58

Re: [Anounce] [N9] Volume/Power Button Monitor
 
v0.5.5
+ added configurable led patterns for quickSnap
+ added shutter sound to quickSnap, in addition to picture-saved sound
+ added soundfile configs for quickSnap

wolke 2013-08-30 05:05

Re: [Anounce] [N9] Volume/Power Button Monitor
 
if you get a chance, please test this. i have no idea if it will work in non-openmode.

EDIT: what i mean specifically is it would be great if someone who doesnt use openmode tested quick-snap and saw that the LED blinks for them. it should blink once approximately at the same time the image is taken {and play the default camera sound at the same time}, and then blink twice quickly when the image is saved {without playing any sound by default}.

to add quickSnap to the lockscreen {vol+ trebleClick}, do this in ~/.config/n9-button-monitor.ini
action=quickSnap(auto),volumeUp,trebleClick,screen Locked

Mikkosssss 2013-08-30 06:05

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Wont work :(

wolke 2013-08-30 06:08

Re: [Anounce] [N9] Volume/Power Button Monitor
 
oh well, thanks for the test!

can you also test the sound configs?
copy two WAVs to MyDocs called a.wav and b.wav, edit prefs, and add these lines:
quickSnapShutterSound=/home/user/MyDocs/a.wav
quickSnapSaveSound=/home/user/MyDocs/b.wav

then take a quickSnap, you should hear a, then hear b about 5 seconds later

wolke 2013-08-30 06:17

Re: [Anounce] [N9] Volume/Power Button Monitor
 
note that LED works fine if you use openmode.
also note that you can start the led daemon manually by running as root:
/opt/n9-button-monitor/led-dbus.py

and that this will almost certainly work on non-openmode.

Mikkosssss 2013-08-30 06:46

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Add lines
quickSnapShutterSound=/home/user/MyDocs/a.wav
quickSnapSaveSound=/home/user/MyDocs/b.wav

To camera.py or button monitor ini?

toebaer 2013-08-30 06:49

Re: [Anounce] [N9] Volume/Power Button Monitor
 
LED worked fine (as described) for me in non-openmode. No camera sound, though. And the pictures have non-standard names (too many digits?), so they won't show up in the gallery? Otherwise, this is brilliant :), thank you very much.

Sorry, no time to test the sound files at the moment.

wolke 2013-08-30 07:26

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by toebaer (Post 1370577)
LED worked fine (as described) for me in non-openmode. No camera sound, though. And the pictures have non-standard names (too many digits?), so they won't show up in the gallery? Otherwise, this is brilliant :), thank you very much.

Sorry, no time to test the sound files at the moment.

awesome! ok, great!

actually, it wont show up in gallery because gallery only shows pictures that are in the tracker, not pictures that are in DCIM. i do not use the tracker, so i do not use gallery. the digits in the filename are the number of seconds since jan 1st 1970, to prevent any filename conflicts.

wolke 2013-08-30 07:28

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by Mikkosssss (Post 1370575)
Add lines
quickSnapShutterSound=/home/user/MyDocs/a.wav
quickSnapSaveSound=/home/user/MyDocs/b.wav

To camera.py or button monitor ini?

ini .

Mikkosssss 2013-08-30 08:23

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by wolke (Post 1370584)
ini .

My looks like this:
Code:

#autogenerated on 2013-08-22 19:28
torchAutoShutOffTimeMs=300000
longClickDelayMs=3000
doubleClickDelayMs=250
trebleClickDelayMs=251
cameraDisabled=0
dbusBufferMs=800
action=torchOn,volumeUp,doubleClick,screenLocked
action=torchOff,volumeUp,singleClick,screenLocked
action=quickSnap(off),volumeDown,longClickStart,screenLocked
quickSnapShutterSound=/home/user/MyDocs/a.wav
quickSnapSaveSound=/home/user/MyDocs/b.wav

Now torch/snapshot wont work.

I havent rebooted after installion, do I need to?

wolke 2013-08-30 13:29

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by Mikkosssss (Post 1370590)
My looks like this:
Code:

#autogenerated on 2013-08-22 19:28
torchAutoShutOffTimeMs=300000
longClickDelayMs=3000
doubleClickDelayMs=250
trebleClickDelayMs=251
cameraDisabled=0
dbusBufferMs=800
action=torchOn,volumeUp,doubleClick,screenLocked
action=torchOff,volumeUp,singleClick,screenLocked
action=quickSnap(off),volumeDown,longClickStart,screenLocked
quickSnapShutterSound=/home/user/MyDocs/a.wav
quickSnapSaveSound=/home/user/MyDocs/b.wav

Now torch/snapshot wont work.

I havent rebooted after installion, do I need to?

you should not need to, but rebooting might fix it. {try the below first.}

please try stopping the job and running n9bm from the terminal {preferably over ssh}. if there is an error parsing the config file, it will show up in the terminal. also, events will print info.
Code:

devel-su
initctl stop apps/n9-button-monitor
/opt/n9-button-monitor/bin/n9-button-monitor.py

note that this error is ok, and it just means that theres no bluetooth input device connected:
Code:

ERROR:dbus.proxies:Introspect error on :1.2:/org/freedesktop/Hal/devices/computer_logicaldev_input_0: dbus.exceptions.DBusException: org.freedesktop.Hal.NoSuchDevice: No device with id /org/freedesktop/Hal/devices/computer_logicaldev_input_0
the only other output you should see at startup is 'refreshing config' and some 'loaded plugin's

Mikkosssss 2013-08-30 14:57

Re: [Anounce] [N9] Volume/Power Button Monitor
 
initctl not found :p

But after reboot both sound and led worked. :)

I only noticed one annoying thing that when it focuses it uses flash sometimes like in stock camera.
Is that focus so important?
Could it be replaced with just wait till camera just focuses without pressing focus?

wolke 2013-08-30 18:47

Re: [Anounce] [N9] Volume/Power Button Monitor
 
quick snap takes an argument for how to flash
if you replace quickSnap(auto) with quickSnap(off), it will never flash.

now, if you mean the focus-assist-light-thing, when i asked msameer the about it in regards to cameraplus, he said:
Quote:

thst is actually the assist light trying to focus. I don't think there is a way to disable that. I remember harmattan stock camera team was getting a lot of bugs about that because people confuse it with flash. That is a platform limitation unfortunately
as for just waiting for the camera to focus without calling search(), i tried this when i was developing this feature.
i tested starting the camera for 0s, 1s, 2s, and 3s and then just snapping without focus. the pictures were all absolute rubbish without focusing first, each equally poor.

gardi 2014-02-16 00:16

Re: [Anounce] [N9] Volume/Power Button Monitor
 
What is the purpose of this application?
bad english
Can you put a screen shot?
deb installer does not set up with
gives the error
Can you show a detailed installation?

wolke 2014-02-16 18:51

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by gardi (Post 1412957)
What is the purpose of this application?

the purpose of this application is to control what the volume buttons do on your n9 {also the power button, but this is less useful}.

the central use cases are:
1) controlling the flashlight/torch without unlocking the phone
2) taking pictures without unlocking the phone or starting the camera app
3) controlling the music player without taking the phone out of your pocket
4) being configurable enough to let you do whatever weird things you might want {i use it to skip songs while im reading a book with fbreader}

Quote:

Originally Posted by gardi (Post 1412957)
Can you put a screen shot?

the reason there is no screenshot is that there is no screen. there is a configuration file, which you can edit with your favorite text editor {redak, nano, vim}.
if you dont do anything, the default sets up torch/flashlight controls and music controls from the lockscreen.

Quote:

Originally Posted by gardi (Post 1412957)
deb installer does not set up with
gives the error
Can you show a detailed installation?

you need to run 'apt-get -f install' after 'dpkg -i n9-button-monitor.deb'. this is true for any application that has dependencies that you dont already have.

however, you can also just use openrepos instead of using the terminal, which should handle dependencies properly.
https://openrepos.net/content/telesh...button-monitor

Silwer 2014-02-16 21:58

Re: [Anounce] [N9] Volume/Power Button Monitor
 
would be grate to have this app for Jolla.

wolke 2014-02-16 21:59

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by Silwer (Post 1413048)
would be grate to have this app for Jolla.

buy me one and ill see what i can do! :D

gardi 2014-02-17 01:35

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Thank you for your interest.
I did and it was great :)

Shadwblade2652 2014-02-17 04:14

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by wolke (Post 1413049)
buy me one and ill see what i can do! :D

I think that if you asked jolla they would consider it. The N9 is dead, so its required for people like this to make apps for it. Asking Jolla for features will probably get you better integration and functionality

wolke 2014-02-17 07:15

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by Shadwblade2652 (Post 1413064)
I think that if you asked jolla they would consider it. The N9 is dead, so its required for people like this to make apps for it. Asking Jolla for features will probably get you better integration and functionality

note that the primary reason that any of us want a free operating system for our phones is the ability to make whatever WE want, not to get commercial support. this is true REGARDLESS of the current state of official support. no matter how good a piece of software is, if it cant be modified to suit the individual, its not as good as it could be.

of course, more official support is better and {hopefully} jolla is in it for the long haul. however, it is missing the point if you think that making free software is something we do only because Big Softwares Inc isnt doing it for us.

i seriously doubt jolla is going to make a customizable button monitor to run arbitrary commands on arbitrary screens. this is not what the average consumer wants, and it enables folks to do stupid things that they would blame jolla for.

Yisroel491 2014-03-25 09:21

can this app be used to modify a volume button where it turns on the device instead of the power button? my power button is kappute.

wolke 2014-03-25 14:01

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by Yisroel491 (Post 1418413)
can this app be used to modify a volume button where it turns on the device instead of the power button? my power button is kappute.

nope, sorry

robthebold 2015-07-04 18:11

Re: [Anounce] [N9] Volume/Power Button Monitor
 
What a simple but simply useful application. Hadn't even thought to try it until recently -- silly me.

I really like the flashlight function. Super useful! Reminds me of my wife's ca. 2003 Nokia feature phone. Button Monitor is dragging my N9 kicking and screaming into the early 21st century!!

I also added a volume down long press action to read the most recent SMS with my klugey speaksms script. Again, why didn't I try this before?

Thanks

peterleinchen 2015-07-04 19:21

Re: [Anounce] [N9] Volume/Power Button Monitor
 
In general you are right.
Quote:

Originally Posted by robthebold (Post 1475726)
... Again, why didn't I try this before?

But read this just 2 posts before
Quote:

Originally Posted by Yisroel491
can this app be used to modify a volume button where it turns on the device instead of the power button? my power button is kappute.
I am trying to touch my power button as less as possible (also have installed "lock screen app"). As this is a known failure possibility of N9.

wolke 2015-07-07 19:29

Re: [Anounce] [N9] Volume/Power Button Monitor
 
@robthebold
glad you like it! (speaksms script? sounds interesting! link?)

@peterleinchen
yes, that would be nice. no, its not something that this app can ever do and it has nothing whatsoever to do with what this app is for.

srsly tho, dont worry about your power button. the physical failure is in the case, and new cases are cheap and easy enough to replace.

robthebold 2015-07-15 15:07

Re: [Anounce] [N9] Volume/Power Button Monitor
 
Quote:

Originally Posted by peterleinchen (Post 1475730)

I am trying to touch my power button as less as possible (also have installed "lock screen app"). As this is a known failure possibility of N9.

I keep my non-working N9 as a "parts car" -- as people with classic autos say -- for the operational one. I do worry a little, but also would hate to not be able to use all the cool functionality of the device for fear of breaking it. Just like driving that antique vehicle vs. worrying about wrecking it and keeping it garaged, I suppose . . .


All times are GMT. The time now is 11:07.

vBulletin® Version 3.8.8