• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

True that camera has to be running?

DsyMnapTic

Android Expert
Apr 29, 2011
1,119
204
The rocky mountains
Is it true that the camera had to be running in the background somewhere in order for the LED to be on?
I just emailed the developer of notification toggle, wondering why the camera was operating in the background of Handcent messaging when I had the LED on.


Edit: oh and he told me that there's nothing he could do about it and the camera has to be running in order to have the LED on.
 
Is it true that the camera had to be running in the background somewhere in order for the LED to be on?
I just emailed the developer of notification toggle, wondering why the camera was operating in the background of Handcent messaging when I had the LED on.


Edit: oh and he told me that there's nothing he could do about it and the camera has to be running in order to have the LED on.

Nope. I have a flashlight app that turns on the LED and the camera is not running in the background. The dev might just need to improve his code.
 
  • Like
Reactions: DsyMnapTic
Upvote 0
Nope. I have a flashlight app that turns on the LED and the camera is not running in the background. The dev might just need to improve his code.

Here's the thing though Artine, I never would've known it was running if it hadn't have glitched out Handcent. There was nothing showing that any camera app was running, so I couldn't stop it unless I shut the LED off
 
Upvote 0
The camera doesnt need to be running to turn on the flashlight. In fact, you dont need any java running it all. You can even turn on the camera led from within recovery, where the entire android operating system is not running.

Code:
#include <fcntl.h>
#include <sys/ioctl.h>


int main(int argc, char** argv)
{
    // open camera device
    int led_status;
    int dev = open( "/dev/msm_camera/config0", O_RDONLY );
    if( dev < 0 )
    {
        perror( "open" );
        return 1;
    }
    puts( "opened device" );

    led_status = 1;
    if( ioctl( dev, _IOW( 'm', 22, unsigned *), &led_status ) )
    {
        perror( "ioctl on" );
        close( dev );
        return 1;
    }

    puts( "flashlight on" );
    sleep( 1 );

    led_status = 0;
    if( ioctl( dev, _IOW( 'm', 22, unsigned *), &led_status ) )
    {
        perror( "ioctl off" );
        close( dev );
        return 1;
    }

    puts( "flashlight off" );

    close( dev );
    return 0;
}
 
Upvote 0
I've never been able to get the camera to start if I have the LED on. I've tried with several different apps. I've always figured the two are connected.

They may be connected in that the camera app of choice is calling upon the LED feature, and expecting it to be off when it calls for it. And if it's already on, they don't know what to do, and freak out and refuse to start. At least that's my guess anyway - and if it's right, then developers need to update their camera app coding to start taking into considerations exceptions like these (though I can't imagine they'd typically need to).
 
Upvote 0
From what I figured out allot of flashlight app developers say that they need access to the camera in order for the LED to work. Just look around at some on the market. I've also found out, that it doesn't run any app (atleast that I know of) when the light is on. The only way you'd know is when a glitch occurs. I.E. like the one I had in the background of handcent messaging OR now actually I get a glitch of my camera picking up images between screen animations in ADW launcher.
I'm using Tesla LED by the way.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones