1. 2015 is going to be a great year for Android! Why wait??
    Samsung Galaxy Note 5 | Samsung Galaxy S6 | HTC One M9
  2. New Forum Created: Samsung Gear VR!

True that camera has to be running?General


  1. DsyMnapTic

    DsyMnapTic Well-Known Member

    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.

    Advertisement
    :
  2. Artine

    Artine Well-Known Member Contributor

    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.
    DsyMnapTic likes this.
  3. Dark One

    Dark One Well-Known Member Contributor

    What LED?
  4. DsyMnapTic

    DsyMnapTic Well-Known Member

  5. DsyMnapTic

    DsyMnapTic Well-Known Member

    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
  6. Dark One

    Dark One Well-Known Member Contributor

    You could try freezing your camera and then see if your flashlight works.
  7. giantpune

    giantpune Well-Known Member

    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;
    }
    
    DsyMnapTic and Artine like this.
  8. Artine

    Artine Well-Known Member Contributor

    Exactly what I thought.
  9. DsyMnapTic

    DsyMnapTic Well-Known Member

    See that's what I figured as well. So the developer of notification toggle doesn't know what he's talking about.
  10. MacFett

    MacFett Well-Known Member

    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.
  11. Artine

    Artine Well-Known Member Contributor

    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).
  12. DsyMnapTic

    DsyMnapTic Well-Known Member

    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.
  13. DsyMnapTic

    DsyMnapTic Well-Known Member

    I'm even surprised that more of you haven't noticed a decent amount of battery drain while using the LED. Theoretically if the LED is being used by itself it should cause very minimal battery drainage.
  14. mrjello

    mrjello Well-Known Member

    I haven't been able to get the stock camera app to work when the flash is already on....
  15. Artine

    Artine Well-Known Member Contributor

    Which is more testament to what I and giantpune said; they need to update their coding.
Loading...

Share This Page