maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Applications (https://talk.maemo.org/forumdisplay.php?f=41)
-   -   Disable autostart of Camera App? (https://talk.maemo.org/showthread.php?t=39845)

DaTraS 2010-01-09 12:04

Disable autostart of Camera App?
 
Hey Guys.

After playing a few days with my new N900 (i somehow love this little machine :D), i have a question about the camera application.

When I open the lens cover, the camera app automatically starts.
Since I am using the Flashlight-App quite often, is there a way to disable this autostarting?

This would be very useful, so that I don't have to close the camera app first everytime i want to use the Flashlight-App.

Every suggestion is welcome.

Bye,

DaTraS

qwerty12 2010-01-09 12:25

Re: Disable autostart of Camera App?
 
http://www.mail-archive.com/maemo-de.../msg22741.html

tangs 2010-01-09 13:19

Re: Disable autostart of Camera App?
 
does it really work ?

DaTraS 2010-01-09 13:57

Re: Disable autostart of Camera App?
 
It works.
But after I run the first command, Flashlight won't work.

"Unable to turn on flashlight"

Don't know if it is caused by this command or because of an app I installed previously, but even after I typed in the second command, and thus turning on the autostarting again, flashlight is not able to turn on the flashlight.

I will try a reboot to see if it works.

/EDIT:

Okay, even a reboot wont work. Seems like my Flashlight is ****ed up. I've read through the thread and there seems to be a problem with the current version of flashlight.

So we can except this solution to be working.
Now, an app which would simply send these 2 commands by clicking "autostart on/off" would be great.

But I've been to long out of developing, so if someone could make an app out of this, this surely would be great!

zerocool2k 2010-10-22 05:53

Re: Disable autostart of Camera App?
 
How about disable Camera button long press from launching the camera software IF the lens is covered? I remembered reading that the authors of shortcutd said it was plausible but involved an ugly hack. I don't care how ugly that is, if someone knows how to do it that would be great, cause it would work perfectly with shortcutd.

Wikiwide 2010-10-22 06:40

Re: Disable autostart of Camera App?
 
Quick reply...
http://maemo.org/packages/view/cl-launcher/
and live focus
http://maemo.org/packages/view/lfocus/

Copernicus 2015-01-14 04:15

Re: Disable autostart of Camera App?
 
Let me drag up this thread to bring up this question once again -- is killing the camera app by using "dsmetool" still the best way to stop it from coming up every time you open the lens cover?

I tried to avoid this question back when I was working on the Lanterne app, but I've got an app now that just can't ignore the problem -- if both it and the camera app run at the same time, they'll fight each other for control over the camera's focus. So, I've gotta do something about it.

I know that mbarcode uses the "dsmetool" mechanism, and that seems to work on my N900s. But I'd like to know if it still works in all variations of the CSSU, and with the camera-ui2 project. Any hints as to a general-purpose mechanism to stop the camera app from coming up would be greatly appreciated. Thanks!

reinob 2015-01-14 08:45

Re: Disable autostart of Camera App?
 
@Copernicus,

The camera-ui is started (by Xsession) using "dsmetool -t /usr/bin/camera-ui".
"t" means "start-restart", i.e. on process exit it will be restarted up to N times.

So in principle killing it (after testing if it's actually running) with "dsmetool -k" should work fine (as long as you then restart it using dsmetool if required).

As an idea, perhaps SIGSTOP (and then SIGCONT) might do the trick nicely. But it's just an untested idea.

[EDIT] forgot to add, this is using CSSU-thumb, but was the same with stock firmware.

sixwheeledbeast 2015-01-14 14:20

Re: Disable autostart of Camera App?
 
It's seems most are using the dsmetool -k. I don't believe another method has been found.
camera-ui2 should not need to use any killing method as it replaces the camera-ui, in that instance.
Question what happens if two camera applications are running at the moment? Does the camera-ui not switch to standby mode? Does it definitely fight over the controls?

Copernicus 2015-01-14 14:46

Re: Disable autostart of Camera App?
 
Quote:

Originally Posted by sixwheeledbeast (Post 1456554)
Question what happens if two camera applications are running at the moment? Does the camera-ui not switch to standby mode? Does it definitely fight over the controls?

From what I'm seeing, I can say that Bad Things Happen(tm). When I run my app, I try to initialize the focus to a particular distance; if I then open the camera app, I can often hear the focus snap back to a different level. Moreover, the camera app will die with an "Operation Failed" message. (Possibly this is because my own app is not going into "standby mode" when the camera app starts; I'll have to see if I can find a way to do this.)

In general, though, I'm not seeing a way to tell when someone else is using the camera, or any method of negotiating ownership over the camera hardware. :(

freemangordon 2015-01-14 15:22

Re: Disable autostart of Camera App?
 
cssu camera-ui has options "show/hide on lenscover open/close", I am too lazy to dig on gitorious, but those should be gconf settings. Unfortunately afaik stock camera-ui does not support these.

Copernicus 2015-01-14 15:28

Re: Disable autostart of Camera App?
 
Quote:

Originally Posted by freemangordon (Post 1456564)
cssu camera-ui has options "show/hide on lenscover open/close", I am too lazy to dig on gitorious, but those should be gconf settings. Unfortunately afaik stock camera-ui does not support these.

Yes! I saw this last year; camera-lens-launcher is using this setting to keep the camera app from automatically launching (and yeah, it only works with CSSU, not stock).

I was kinda wondering about that, though; is it really a good idea for one app to be digging around inside and modifying another app's gconf settings?

reinob 2015-01-14 15:47

Re: Disable autostart of Camera App?
 
Quote:

Originally Posted by Copernicus (Post 1456565)
I was kinda wondering about that, though; is it really a good idea for one app to be digging around inside and modifying another app's gconf settings?

As long as it does it on behalf of its users.. why not? :)

freemangordon 2015-01-14 16:54

Re: Disable autostart of Camera App?
 
Copernicus: you can restore the value when your application quits

peterleinchen 2015-01-14 17:12

Re: Disable autostart of Camera App?
 
Quote:

Originally Posted by Copernicus (Post 1456565)
... camera-lens-launcher is using this setting to keep the camera app from automatically launching (and yeah, it only works with CSSU, not stock).

Either I did not get it right, or I am confused?
On stock Pr1.3 with stock camera cl-launcher does work fine and hinders camera to automatically start.

Estel 2015-01-14 17:51

Re: Disable autostart of Camera App?
 
If one is not using R&D mode and watchdogs disabled, repeated killing of camera-ui with the "dsmetool -k" method results in device reboot (funf act - I've used it few times, when got locked out of screen/keyboard focus while using buggy full-screen program, and ssh'ing to kill the offender wasn't available). So, better method would be nice to have.

/Estel

Copernicus 2015-01-14 18:17

Re: Disable autostart of Camera App?
 
Quote:

Originally Posted by freemangordon (Post 1456570)
Copernicus: you can restore the value when your application quits

Yes, that's what the cl-launcher does. I'm just not really comfortable with the idea of mucking around in the guts of someone else's app in order to make it play nice with others. ;) There really should be a better way!

But yeah, I'm probably going to copy that method in my app.

Copernicus 2015-01-14 18:19

Re: Disable autostart of Camera App?
 
Quote:

Originally Posted by peterleinchen (Post 1456577)
Either I did not get it right, or I am confused?
On stock Pr1.3 with stock camera cl-launcher does work fine and hinders camera to automatically start.

On CSSU, cl-launcher changes the flag in the camera app's gconf parameters to stop it from launching when the lens cover is opened. On stock PR1.3 and below, it simply kills the camera app outright. So, it works in either case, but is a bit more vicious on non-CSSU devices. :)


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

vBulletin® Version 3.8.8