<div dir="ltr">Thanks a lot, Mohammed!<div><br></div><div>There are two sliders in the app to control how often searchAndLock are called and how soon unlock is to be called after it.</div><div><br></div><div>1. Could you, please, play with it and see which values seem to give better results?</div>


<div>For now I will be fine with any more or less sane combination.</div><div><br></div><div>2. Also could you describe the result and how it behaves when you change these values? or well.. it is also external light dependent. </div>


<div><br></div><div>Let's say if you go into dark place (where flashlight is to be used anyway), does LED produce light soft and often enough to make, say, locating keys in a bag possible? Or is it more like rare annoying flashes?</div>


<div><br></div><div>3. Unlock</div><div>That is something I don't understand :/</div><div>What do you mean that gstreamer output tells I have to call unlock?</div><div>Can you then play with the unlocking timer too? Maybe there is a magic combination of values that will keep light almost constant? For example, if we start searchAndLock() as often as every 50ms and don't call unlock() ever.</div>


<div><br></div><div>Best regards,</div><div>Artem.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Nov 16, 2013 at 6:56 PM, Mohammed Hassan <span dir="ltr"><<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Great job Artem<br>
<br>
I tried it and it works (it pulses as expected).<br>
<br>
If I point camera to a lamp then the led lights up for a long time.<br>
If I direct it away from the lamp then the pulses are shorter.<br>
<br>
I personally am not sure about the Qt API but from gstreamer output, I see that<br>
you must call unlock().<br>
<br>
I will try to test it tomorrow morning and see if it will still fire or not.<br>
<br>
I guess we also need to tweak the timer for locking and unlocking but I don't<br>
really have any suggestions.<br>
<br>
Cheers,<br>
<div><br>
On Sat, Nov 16, 2013 at 06:22:32PM +0200, Artem Marchenko wrote:<br>
>  I prepared the next test app, that starts searchAndLock() every given<br>
>  number of ms and optionally does unlock() soon after it (not sure if<br>
>  you have to unlock before starting the next searchAndLock() ). Plus you<br>
>  can play with the search mode if Manual happens to be not good enough.<br>
>  Anybody willing to try on real hardware? Preferably both in dark and<br>
>  light environment (maybe flash starts in dark conditions only as<br>
>  Mohammed told).<br>
</div>>  Link to ARM RPM - [1]<a href="http://bit.ly/videofla109" target="_blank">http://bit.ly/videofla109</a><br>
<div>>  Or here's full source code<br>
</div>>  - [2]<a href="https://github.com/amarchen/video-flash-trial/tree/v0.1-9/" target="_blank">https://github.com/amarchen/video-flash-trial/tree/v0.1-9/</a><br>
<div>>  Cheers,<br>
>  Artem.<br>
><br>
>  On Sat, Nov 16, 2013 at 6:05 PM, Mohammed Hassan<br>
</div><div><div>>  <[3]<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a>> wrote:<br>
><br>
>  The point is not to be in continuous focus mode (CAF) because if you<br>
>  are in that mode<br>
>  then camera might not try to focus if it happens to have focus<br>
>  already (CAF mode = camera<br>
>  tries to focus all the time).<br>
>  In manual or fixed focus modes, camera will not try to focus all the<br>
>  time and will instead<br>
>  wait until it is instructed to focus and then it will do it.<br>
>  That is simply the reason.<br>
>  CAF focus is not guaranteed to be out of focus but manual is<br>
>  guaranteed to be out<br>
>  of focus ;-)<br>
>  Cheers,<br>
><br>
>  On Sat, Nov 16, 2013 at 05:58:30PM +0200, Artem Marchenko wrote:<br>
>  > Can you explain why Fixed (manual) focus mode? :/<br>
>  > Sorry to ask for details, it's a little difficult without the device<br>
>  at<br>
>  > hand?<br>
>  > Are you trying to tell that in a Fixed mode camera will seek for<br>
>  focus<br>
>  > forever?<br>
>  > Artem.<br>
>  > On Sat, Nov 16, 2013 at 5:55 PM, Mohammed Hassan<br>
><br>
</div></div><div>>  > <[1][4]<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a>> wrote:<br>
>  ><br>
>  > searchAndLock() should work as long as you are in a dark<br>
>  > place (that's what LED torch is for ;-))<br>
>  > and make sure the focus mode is set to fixed focus mode.<br>
>  > Good luck!<br>
>  > Cheers,<br>
>  ><br>
>  > On Sat, Nov 16, 2013 at 05:35:47PM +0200, Artem Marchenko wrote:<br>
>  > > I used to work a little with GStreamer in the past, it wasn't much<br>
>  > fun,<br>
>  > > though I was doing video processing, not just LED manipulation..<br>
>  > > Oh well, I try searchAndLock trick, if it doesn't work, I'll need<br>
>  to<br>
>  > > think if I am into diving to gstreamer or into waiting for the<br>
>  Torch<br>
>  > > API. Technically, waiting for Torch is correct probably, I am just<br>
>  > > driven by the opportunity to make the very first torch for Jolla<br>
>  :)<br>
>  > > Cheers,<br>
>  > > Artem.<br>
>  > ><br>
>  > > On Sat, Nov 16, 2013 at 5:28 PM, Mohammed Hassan<br>
>  ><br>
><br>
</div><div><div>>  > > <[1][2][5]<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a>> wrote:<br>
>  > ><br>
>  > > Hi Artem,<br>
>  > ><br>
>  > > On Sat, Nov 16, 2013 at 04:43:57PM +0200, Artem Marchenko wrote:<br>
>  > > > Thanks, Mohammed.<br>
>  > > ><br>
>  > > > I know that torch mode is not supported, but ON mode is. So my<br>
>  > > current<br>
>  > > > workaround idea is to make phone think it shoots video with<br>
>  flash<br>
>  > > mode<br>
>  > > > ON (ok, we can even shoot video for real if needed). Assumption<br>
>  is<br>
>  > > that<br>
>  > > > video + flash mode ON should make phone record video with light<br>
>  > > > constantly ON. Currently it doesn't work for me, maybe because<br>
>  > > > assumption is wrong or maybe I am just using some api the wrong<br>
>  > way.<br>
>  > ><br>
>  > > It will not work that way. There is a special mode for torch light<br>
>  > > but it's<br>
>  > > not yet been implemented.<br>
>  > ><br>
>  > > > 2nd workaround idea is to make phone seekAndLock all the time<br>
>  > > causing<br>
>  > > > flash to be ON. That is likely to result in a multitude of short<br>
>  > > > flashes though.<br>
>  > ><br>
>  > > That can work but it will be slow "light bursts".<br>
>  > > A 3rd option would be going even below GSTreamer and Qt and talk<br>
>  to<br>
>  > > the camera HW directly.<br>
>  > > This is harder -trust me- and will tie you to the hardware.<br>
>  > > I am really sorry I don't have a solution for you :(<br>
>  > > I can only promise it will be available soon in an update.<br>
>  > > Cheers,<br>
>  > ><br>
>  > > > When you record video with the flash ON in a system camera app,<br>
>  > does<br>
>  > > it<br>
>  > > > cause LED to have kith ON all the time?<br>
>  > > ><br>
>  > > > Artem.<br>
>  > > ><br>
>  > > > On Saturday, November 16, 2013, Mohammed Hassan wrote:<br>
>  > > ><br>
>  > > > Hi Artem,<br>
>  > > > On Sat, Nov 16, 2013 at 02:48:30PM +0200, Artem Marchenko wrote:<br>
>  > > > > Hi All<br>
>  > > > > *Context*<br>
>  > > > > I am trying to build a flashlight app, but the same question<br>
>  is<br>
>  > > > valid<br>
>  > > > > for any camera app that wants to shoot photos/videos in low<br>
>  > > > light.<br>
>  > > > > *The problem*<br>
>  > > > > I am trying to control LED flash by setting flash mode to ON<br>
>  > (api<br>
>  > > > > confirms that ON mode is supported) and starting camera.<br>
>  Nothing<br>
>  > > > > happens. I also tried actually capturing photo, shooting video<br>
>  > > > and<br>
>  > > > > seekAndLocking. I don't have a device myself, but kind people<br>
>  on<br>
>  > > > IRC<br>
>  > > > > told that only two short LED flashes happen (during seeking<br>
>  for<br>
>  > > > focus<br>
>  > > > > probably).<br>
>  > > > > Could somebody, please, advise how to control flash in<br>
>  Sailfish<br>
>  > > > OS? Or<br>
>  > > > > maybe you could confirm that libhybris flash control just<br>
>  isn't<br>
>  > > > wired<br>
>  > > > > to Qt level?<br>
>  > > > This is unfortunately not supported.<br>
>  > > > The only flash modes supported now are: on, off or auto.<br>
>  > > > Torch light mode is not yet supported but I assure you it will<br>
>  > come<br>
>  > > > in an update soon.<br>
>  > > > I am not that familiar with Qt but I know it's a limitation of<br>
>  the<br>
>  > > > layer underneath Qt.<br>
>  > > > The best you can do now is to wait for the phone itself and<br>
>  tinker<br>
>  > > > as you like and I am<br>
>  > > > sure you will manage to do it :-)<br>
>  > > > Cheers,<br>
>  > > > P.S. libhybris camera wrapper is not used by sailfish. It might<br>
>  or<br>
>  > > > might not work.<br>
>  > > > _______________________________________________<br>
>  > > > SailfishOS.org Devel mailing list<br>
>  > > ><br>
>  > > > --<br>
>  > > > Artem Marchenko<br>
>  > ><br>
>  ><br>
><br>
</div></div>>  > > > [1][2][3][6]<a href="http://agilesoftwaredevelopment.com" target="_blank">http://agilesoftwaredevelopment.com</a><br>
>  > > > [2][3][4][7]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  > > ><br>
>  > > > References<br>
>  > > ><br>
>  > > > 1. [4][5][8]<a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  > > > 2. [5][6][9]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  > ><br>
>  > > --<br>
>  > > Artem Marchenko<br>
>  > > [6][7][10]<a href="http://agilesoftwaredevelopment.com" target="_blank">http://agilesoftwaredevelopment.com</a><br>
>  > > [7][8][11]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  > ><br>
>  > > References<br>
>  > ><br>
>  > > 1. mailto:[9][12]<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a><br>
>  > > 2. [10][13]<a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  > > 3. [11][14]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  > > 4. [12][15]<a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  > > 5. [13][16]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  > > 6. [14][17]<a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  > > 7. [15][18]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  ><br>
>  > --<br>
>  > Artem Marchenko<br>
>  > [16][19]<a href="http://agilesoftwaredevelopment.com" target="_blank">http://agilesoftwaredevelopment.com</a><br>
>  > [17][20]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  ><br>
>  > References<br>
>  ><br>
>  > 1. mailto:[21]<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a><br>
>  > 2. mailto:[22]<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a><br>
>  > 3. [23]<a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  > 4. [24]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  > 5. [25]<a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  > 6. [26]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  > 7. [27]<a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  > 8. [28]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  > 9. mailto:[29]<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a><br>
>  > 10. [30]<a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  > 11. [31]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  > 12. [32]<a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  > 13. [33]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  > 14. [34]<a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  > 15. [35]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  > 16. [36]<a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  > 17. [37]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
><br>
>  --<br>
>  Artem Marchenko<br>
>  [38]<a href="http://agilesoftwaredevelopment.com" target="_blank">http://agilesoftwaredevelopment.com</a><br>
>  [39]<a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
><br>
> References<br>
><br>
>  1. <a href="http://bit.ly/videofla109" target="_blank">http://bit.ly/videofla109</a><br>
>  2. <a href="https://github.com/amarchen/video-flash-trial/tree/v0.1-9/" target="_blank">https://github.com/amarchen/video-flash-trial/tree/v0.1-9/</a><br>
>  3. mailto:<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a><br>
>  4. mailto:<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a><br>
>  5. mailto:<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a><br>
<div>>  6. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  7. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
</div>>  8. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  9. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
<div>>  10. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  11. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
</div>>  12. mailto:<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a><br>
>  13. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  14. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  15. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  16. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  17. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  18. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  19. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  20. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  21. mailto:<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a><br>
>  22. mailto:<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a><br>
>  23. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  24. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  25. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  26. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  27. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  28. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  29. mailto:<a href="mailto:mohammed.hassan@jollamobile.com" target="_blank">mohammed.hassan@jollamobile.com</a><br>
>  30. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  31. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  32. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  33. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  34. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  35. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  36. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  37. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
>  38. <a href="http://agilesoftwaredevelopment.com/" target="_blank">http://agilesoftwaredevelopment.com/</a><br>
>  39. <a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>Artem Marchenko<br><a href="http://agilesoftwaredevelopment.com" target="_blank">http://agilesoftwaredevelopment.com</a><br><a href="http://twitter.com/AgileArtem" target="_blank">http://twitter.com/AgileArtem</a>
</div></div>