True that camera has to be running?General


Last Updated:

  1. DsyMnapTic

    DsyMnapTic Well-Known Member This Topic's Starter

    Joined:
    Apr 29, 2011
    Messages:
    1,119
    Likes Received:
    204
    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

    Joined:
    Jul 20, 2012
    Messages:
    1,304
    Likes Received:
    585
    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

    Joined:
    Jan 15, 2012
    Messages:
    786
    Likes Received:
    188
    What LED?
     
  4. DsyMnapTic

    DsyMnapTic Well-Known Member This Topic's Starter

    Joined:
    Apr 29, 2011
    Messages:
    1,119
    Likes Received:
    204
  5. DsyMnapTic

    DsyMnapTic Well-Known Member This Topic's Starter

    Joined:
    Apr 29, 2011
    Messages:
    1,119
    Likes Received:
    204
    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

    Joined:
    Jan 15, 2012
    Messages:
    786
    Likes Received:
    188
    You could try freezing your camera and then see if your flashlight works.
     
  7. giantpune

    giantpune Well-Known Member

    Joined:
    Jun 13, 2012
    Messages:
    452
    Likes Received:
    475
    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 (Text):
    1.  
    2. #include <fcntl.h>
    3. #include <sys/ioctl.h>
    4.  
    5.  
    6. int main(int argc, char** argv)
    7. {
    8.     // open camera device
    9.     int led_status;
    10.     int dev = open( "/dev/msm_camera/config0", O_RDONLY );
    11.     if( dev < 0 )
    12.     {
    13.         perror( "open" );
    14.         return 1;
    15.     }
    16.     puts( "opened device" );
    17.  
    18.     led_status = 1;
    19.     if( ioctl( dev, _IOW( 'm', 22, unsigned *), &led_status ) )
    20.     {
    21.         perror( "ioctl on" );
    22.         close( dev );
    23.         return 1;
    24.     }
    25.  
    26.     puts( "flashlight on" );
    27.     sleep( 1 );
    28.  
    29.     led_status = 0;
    30.     if( ioctl( dev, _IOW( 'm', 22, unsigned *), &led_status ) )
    31.     {
    32.         perror( "ioctl off" );
    33.         close( dev );
    34.         return 1;
    35.     }
    36.  
    37.     puts( "flashlight off" );
    38.  
    39.     close( dev );
    40.     return 0;
    41. }
    42.  
     
    DsyMnapTic and Artine like this.
  8. Artine

    Artine Well-Known Member Contributor

    Joined:
    Jul 20, 2012
    Messages:
    1,304
    Likes Received:
    585
    Exactly what I thought.
     
  9. DsyMnapTic

    DsyMnapTic Well-Known Member This Topic's Starter

    Joined:
    Apr 29, 2011
    Messages:
    1,119
    Likes Received:
    204
    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

    Joined:
    Mar 28, 2011
    Messages:
    3,236
    Likes Received:
    740
    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

    Joined:
    Jul 20, 2012
    Messages:
    1,304
    Likes Received:
    585
    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 This Topic's Starter

    Joined:
    Apr 29, 2011
    Messages:
    1,119
    Likes Received:
    204
    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 This Topic's Starter

    Joined:
    Apr 29, 2011
    Messages:
    1,119
    Likes Received:
    204
    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

    Joined:
    Nov 24, 2012
    Messages:
    68
    Likes Received:
    3
    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

    Joined:
    Jul 20, 2012
    Messages:
    1,304
    Likes Received:
    585
    Which is more testament to what I and giantpune said; they need to update their coding.
     

Share This Page

Loading...