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

Behold 2 flashlight interest..

jvrobert

Member
Dec 29, 2009
51
31
Hi - I'm the author of the MomentFlash app (allows Samsung Moment users to use the LED flash on the camera as a flashlight). Someone on the android market mentioned there was interest in a version that worked on the Behold 2.

A few questions:

Is there already an app to do this for the Behold 2? If not, is there interest in one?

If there's interest, I'll need some help testing as I don't own a Behold 2 so would be flying blind based on the kernel source, assuming I can do the same thing on the behold 2 I do on the moment.
 
  • Like
Reactions: Exaqtion
OK, I will take a look. I'll probably need to tweak the low level code a bit, and to do that I'll need a little help. Can someone who has the Android SDK installed and is familiar with ADB please run the following command and post the output?

adb shell "ls -l /dev"

Code:
>adb shell "ls -l /dev"
crw------- root     root       7, 135 2010-01-05 12:59 vcsa7
crw------- root     root       7,   7 2010-01-05 12:59 vcs7
crw------- root     root      10,  27 2010-01-05 12:59 vtmdrv
crw------- root     root     245,   1 2010-01-05 12:59 ttyEFS0
crw------- root     root     245,   0 2010-01-05 12:59 ttyCSD0
prw-rw-rw- root     root              2010-01-05 17:04 vtrsp
prw-rw-rw- root     root              2010-01-05 17:04 vtreq
crw------- root     root     116,  33 2010-01-05 12:59 timer
crwxrwxrwx system   system   100,   0 2010-01-05 12:59 bma150
crw------- root     root      81,  20 2010-01-05 12:59 video20
crw-rw-rw- system   camera   247,   0 2010-01-05 12:59 msm_camera0
drwxr-xr-x root     root              2010-01-05 12:59 block
crw------- root     root     249,   0 2010-01-05 12:59 diag
crw------- root     root       7, 128 2010-01-05 12:59 vcsa
crw------- root     root       7,   0 2010-01-05 12:59 vcs
drwxr-xr-x root     root              2010-01-05 12:59 graphics
drwxr-xr-x root     root              2010-01-05 12:59 input
drwxr-xr-x root     root              2010-01-05 12:59 oncrpc
crw------- root     root     252,   2 2010-01-05 12:59 smdcntl2
crw------- root     root     252,   1 2010-01-05 12:59 smdcntl1
crw------- root     root     252,   0 2010-01-05 12:59 smdcntl0
crw------- root     root      10,  28 2010-01-05 12:59 network_throughput
crw------- root     root      10,  29 2010-01-05 12:59 network_latency
crw------- root     root      10,  30 2010-01-05 12:59 cpu_dma_latency
crwxrwxrwx system   system    10,  31 2010-01-05 12:59 proximity
crwxrwxrwx system   system    10,  32 2010-01-05 12:59 akm8973_aot
crwxrwxrwx system   system    10,  33 2010-01-05 12:59 akm8973_daemon
crw-rw-rw- system   system    10,  34 2010-01-05 12:59 max9877
crw------- root     root      10,  35 2010-01-05 12:59 max17040_driver
crwxrwxrwx system   system    10,  36 2010-01-05 12:59 melfas_fw_download
crw------- root     root      10,  37 2010-01-05 12:59 fsa9480
crw-rw-r-- system   radio     10,  38 2010-01-05 12:59 alarm
crw-rw-rw- bluetooth bluetooth  10, 223 2010-01-05 12:59 uinput
crw-rw---- adb      adb       10,  39 2010-01-05 12:59 android_adb_enable
crw-rw---- adb      adb       10,  40 2010-01-05 12:59 android_adb
drwxr-xr-x root     root              2010-01-05 12:59 log
crw-rw-rw- root     root      10,  44 2010-01-05 12:59 binder
crw-rw---- system   graphics  10,   5 2010-01-05 12:59 pmem_gpu1
crw-rw---- system   graphics  10,   4 2010-01-05 12:59 pmem_gpu0
crw-rw---- system   audio     10,   3 2010-01-05 12:59 pmem_adsp
crw-rw---- system   graphics  10,   2 2010-01-05 12:59 pmem
crw-rw---- system   camera    10,   1 2010-01-05 12:59 pmem_camera
crw-rw-rw- root     root      10,  45 2010-01-05 12:59 ashmem
crw-rw---- system   graphics  10,   0 2010-01-05 12:59 hw3d
crw-rw-rw- system   audio     10,  46 2010-01-05 12:59 msm_snd
crw------- root     root      10,  47 2010-01-05 12:59 msm_wma
crw------- root     root      10,  48 2010-01-05 12:59 msm_amrnb_in
crw------- root     root      10,  49 2010-01-05 12:59 msm_aac
crw------- root     root      10,  50 2010-01-05 12:59 msm_amrnb
crw------- root     root      10,  51 2010-01-05 12:59 msm_qcelp
crw------- root     root      10,  52 2010-01-05 12:59 msm_evrc
crw-rw---- system   audio     10,  53 2010-01-05 12:59 msm_mp3
crw-rw---- system   audio     10,  54 2010-01-05 12:59 msm_preproc_ctl
crw-rw---- system   audio     10,  55 2010-01-05 12:59 msm_pcm_in
crw-rw---- system   audio     10,  56 2010-01-05 12:59 msm_pcm_ctl
crw-rw---- system   audio     10,  57 2010-01-05 12:59 msm_pcm_out
crw------- root     root      10,  58 2010-01-05 12:59 nmea
crw------- root     root      10,  59 2010-01-05 12:59 loopback
crw------- root     root      10,  60 2010-01-05 12:59 smem_log
crw-r----- radio    radio     10,  61 2010-01-05 12:59 qmi2
crw-r----- radio    radio     10,  62 2010-01-05 12:59 qmi1
crw-r----- radio    radio     10,  63 2010-01-05 12:59 qmi0
crw------- root     root       4,  63 2010-01-05 12:59 tty63
crw------- root     root       4,  62 2010-01-05 12:59 tty62
crw------- root     root       4,  61 2010-01-05 12:59 tty61
crw------- root     root       4,  60 2010-01-05 12:59 tty60
crw------- root     root       4,  59 2010-01-05 12:59 tty59
crw------- root     root       4,  58 2010-01-05 12:59 tty58
crw------- root     root       4,  57 2010-01-05 12:59 tty57
crw------- root     root       4,  56 2010-01-05 12:59 tty56
crw------- root     root       4,  55 2010-01-05 12:59 tty55
crw------- root     root       4,  54 2010-01-05 12:59 tty54
crw------- root     root       4,  53 2010-01-05 12:59 tty53
crw------- root     root       4,  52 2010-01-05 12:59 tty52
crw------- root     root       4,  51 2010-01-05 12:59 tty51
crw------- root     root       4,  50 2010-01-05 12:59 tty50
crw------- root     root       4,  49 2010-01-05 12:59 tty49
crw------- root     root       4,  48 2010-01-05 12:59 tty48
crw------- root     root       4,  47 2010-01-05 12:59 tty47
crw------- root     root       4,  46 2010-01-05 12:59 tty46
crw------- root     root       4,  45 2010-01-05 12:59 tty45
crw------- root     root       4,  44 2010-01-05 12:59 tty44
crw------- root     root       4,  43 2010-01-05 12:59 tty43
crw------- root     root       4,  42 2010-01-05 12:59 tty42
crw------- root     root       4,  41 2010-01-05 12:59 tty41
crw------- root     root       4,  40 2010-01-05 12:59 tty40
crw------- root     root       4,  39 2010-01-05 12:59 tty39
crw------- root     root       4,  38 2010-01-05 12:59 tty38
crw------- root     root       4,  37 2010-01-05 12:59 tty37
crw------- root     root       4,  36 2010-01-05 12:59 tty36
crw------- root     root       4,  35 2010-01-05 12:59 tty35
crw------- root     root       4,  34 2010-01-05 12:59 tty34
crw------- root     root       4,  33 2010-01-05 12:59 tty33
crw------- root     root       4,  32 2010-01-05 12:59 tty32
crw------- root     root       4,  31 2010-01-05 12:59 tty31
crw------- root     root       4,  30 2010-01-05 12:59 tty30
crw------- root     root       4,  29 2010-01-05 12:59 tty29
crw------- root     root       4,  28 2010-01-05 12:59 tty28
crw------- root     root       4,  27 2010-01-05 12:59 tty27
crw------- root     root       4,  26 2010-01-05 12:59 tty26
crw------- root     root       4,  25 2010-01-05 12:59 tty25
crw------- root     root       4,  24 2010-01-05 12:59 tty24
crw------- root     root       4,  23 2010-01-05 12:59 tty23
crw------- root     root       4,  22 2010-01-05 12:59 tty22
crw------- root     root       4,  21 2010-01-05 12:59 tty21
crw------- root     root       4,  20 2010-01-05 12:59 tty20
crw------- root     root       4,  19 2010-01-05 12:59 tty19
crw------- root     root       4,  18 2010-01-05 12:59 tty18
crw------- root     root       4,  17 2010-01-05 12:59 tty17
crw------- root     root       4,  16 2010-01-05 12:59 tty16
crw------- root     root       4,  15 2010-01-05 12:59 tty15
crw------- root     root       4,  14 2010-01-05 12:59 tty14
crw------- root     root       4,  13 2010-01-05 12:59 tty13
crw------- root     root       4,  12 2010-01-05 12:59 tty12
crw------- root     root       4,  11 2010-01-05 12:59 tty11
crw------- root     root       4,  10 2010-01-05 12:59 tty10
crw------- root     root       4,   9 2010-01-05 12:59 tty9
crw------- root     root       4,   8 2010-01-05 12:59 tty8
crw------- root     root       4,   7 2010-01-05 12:59 tty7
crw------- root     root       4,   6 2010-01-05 12:59 tty6
crw------- root     root       4,   5 2010-01-05 12:59 tty5
crw------- root     root       4,   4 2010-01-05 12:59 tty4
crw------- root     root       4,   3 2010-01-05 12:59 tty3
crw------- root     root       4,   2 2010-01-05 12:59 tty2
crw------- root     root       4,   1 2010-01-05 12:59 tty1
crw-rw-rw- root     system     4,   0 2010-01-05 12:59 tty0
crw-rw-rw- root     root       5,   2 2010-01-05 12:59 ptmx
crw------- root     root       5,   1 2010-01-05 12:59 console
crw-rw-rw- root     root       5,   0 2010-01-05 12:59 tty
crw------- root     root     253,  36 2010-01-05 12:59 smd36
crw------- root     root     253,  27 2010-01-05 12:59 smd27
crw------- root     root     253,  17 2010-01-05 12:59 smd17
crw------- root     root     253,   7 2010-01-05 12:59 smd7
crw-r----- radio    radio    253,   0 2010-01-05 12:59 smd0
crw------- root     root       1,  13 2010-01-05 12:59 mem_notify
crw------- root     root       1,  11 2010-01-05 12:59 kmsg
crw-rw-rw- root     root       1,   9 2010-01-05 12:59 urandom
crw-rw-rw- root     root       1,   8 2010-01-05 12:59 random
crw-rw-rw- root     root       1,   7 2010-01-05 12:59 full
crw-rw-rw- root     root       1,   5 2010-01-05 12:59 zero
crw-rw-rw- root     root       1,   3 2010-01-05 12:59 null
crw------- root     root       1,   2 2010-01-05 12:59 kmem
crw------- root     root       1,   1 2010-01-05 12:59 mem
crw------- root     root     116,   0 2010-01-05 12:59 controlC0
crw------- root     root     116,  24 2010-01-05 12:59 pcmC0D0c
crw------- root     root     116,  16 2010-01-05 12:59 pcmC0D0p
drwxr-xr-x root     root              2010-01-05 12:59 adsp
crw------- root     root     254,   1 2010-01-05 12:59 rtc1
crw------- root     root     254,   0 2010-01-05 12:59 rtc0
crw------- root     root      89,   0 2010-01-05 12:59 i2c-0
crw------- root     root      89,   4 2010-01-05 12:59 i2c-4
crw------- root     root      89,   5 2010-01-05 12:59 i2c-5
crw------- root     root      89,   3 2010-01-05 12:59 i2c-3
crw------- root     root      89,   2 2010-01-05 12:59 i2c-2
crw------- root     root      89,   1 2010-01-05 12:59 i2c-1
crw-rw---- bluetooth bluetooth 248,   0 2010-01-05 12:59 ttyHS0
crw-rw-rw- system   system   127,   0 2010-01-05 16:02 ttyHSUSB0
brwxr-xr-x root     root     138,  15 2010-01-05 12:59 stl15
brwxr-xr-x root     root     138,  14 2010-01-05 12:59 stl14
brwxr-xr-x root     root     138,  13 2010-01-05 12:59 stl13
brwxr-xr-x root     root     138,  12 2010-01-05 12:59 stl12
brwxr-xr-x root     root     138,  11 2010-01-05 12:59 stl11
brwxr-xr-x root     root     138,  10 2010-01-05 12:59 stl10
brwxr-xr-x root     root     138,   9 2010-01-05 12:59 stl9
brwxr-xr-x root     root     137,  15 2010-01-05 12:59 bml15
brwxr-xr-x root     root     137,  14 2010-01-05 12:59 bml14
brwxr-xr-x root     root     137,  13 2010-01-05 12:59 bml13
brwxr-xr-x root     root     137,  12 2010-01-05 12:59 bml12
brwxr-xr-x root     root     137,  11 2010-01-05 12:59 bml11
brwxrwxrwx root     root     137,  10 2010-01-05 12:59 bml10
brwxr-xr-x root     root     137,   9 2010-01-05 12:59 bml9
crw-rw---- radio    radio     10, 132 2010-01-05 12:59 multipdp
crw-rw---- radio    radio    255,   0 2010-01-05 12:59 dpramerr
crw-rw---- radio    radio    255,   2 2010-01-05 17:08 dpram1
crw-rw---- radio    radio    255,   1 2010-01-05 17:08 dpram0
drwxr-xr-x root     root              2010-01-05 12:59 socket
drwxr-xr-x root     root              1969-12-31 19:00 pts
 
Upvote 0
OK, here's a stab in the dark ;) It's just a quick test to see if I'm using the right device and ioctl call. If it works, it will only turn the flash on (won't turn off) so you may need to run your camera app and take a picture to cycle flash back off, or maybe reboot phone.

Also, could you tell me what the text at the top of the app is? Should be Something/Something, like Samsung/SGH-T939 or something like that maybe.

Install app from AppManager, then run it, then tap red button.

Let me know if light turns on, or if nothing at all happens.
 

Attachments

  • momentflashTEST.zip
    132.9 KB · Views: 61
Upvote 0
screenshot-1.png


Unfortunately it did not work, the FLASH did not come on at all! :mad:
 
Upvote 0
I guess he checks the model number :( Someone recompile the source!
Recompiled the code by removing the check for the Galaxy only part of the code. It turned on the LED light, however it does not turn it off. When I touch the touch screen it will flash and it will have a more brighter flash while the screen it touched. Once I close the program (Pressing Home button) the light goes off, or when the phone autolocks.

Code:
devnode = "/dev/msm_camera0";
I think that this is what turns the FLASH on, since it was in the code.
 
Upvote 0
Hi - I'm the author of the MomentFlash app (allows Samsung Moment users to use the LED flash on the camera as a flashlight). Someone on the android market mentioned there was interest in a version that worked on the Behold 2.

A few questions:

Is there already an app to do this for the Behold 2? If not, is there interest in one?

If there's interest, I'll need some help testing as I don't own a Behold 2 so would be flying blind based on the kernel source, assuming I can do the same thing on the behold 2 I do on the moment.


My answers are: Nope, I'm interested and I'd help
 
Upvote 0
OK, Try this one, used the other ioctl I see in the sources.. I'm not sure if the ioctl has to be left open while the light is on (it doesn't on the Moment) so I added a 1 second delay after the light turns on (theoretically).

So if you could let me know if
a) Light turns on
b) Light turns off 1 second after it turns on automatically or if it stays on until you click it.

Thanks
 

Attachments

  • momentflashTEST.zip
    133 KB · Views: 76
Upvote 0
OK, Try this one, used the other ioctl I see in the sources.. I'm not sure if the ioctl has to be left open while the light is on (it doesn't on the Moment) so I added a 1 second delay after the light turns on (theoretically).

So if you could let me know if
a) Light turns on
b) Light turns off 1 second after it turns on automatically or if it stays on until you click it.

Thanks
This version seems to work fine. The option to autostart the led does not work. However once I press the button it turns on and stays on. The light only turns off when I press the button off, even after backscreen time out and pressing the HOME button. So the light only turns off when you press the button.

There is a bit of delay on the graphics though, I press the button, light comes on and a few seconds later the button (on the screen) then lights up and vice versa when shutting down.

Otherwise it seems like it is working fine!
 
Upvote 0
This version seems to work fine. The option to autostart the led does not work. However once I press the button it turns on and stays on. The light only turns off when I press the button off, even after backscreen time out and pressing the HOME button. So the light only turns off when you press the button.

There is a bit of delay on the graphics though, I press the button, light comes on and a few seconds later the button (on the screen) then lights up and vice versa when shutting down.

Otherwise it seems like it is working fine!

Cool - thanks.

The lag in graphics was because I put a 1 second delay in just in case I needed to hold open the handle, you wouldn't be able to tell it came on at all otherwise.

The attached should also fix the issue with the "auto-start" feature, though since you already have it installed, you may need to go in and reset the config option to "kick" it.

Otherwise, looks like it works and I'll update the app on the Android market to indicate support for the Behold 2 (and probably galaxy, I guess).

Can you check if the "torch" mode works? You can press in the middle of the eye, and move your finger up and out of the top to turn on "bright" mode. Then also check to make sure it turns off from bright mode if you tap eye again.

Thanks for your help!

EDIT: New attachment.. _May_ fix the torch issue with shutting down in 1 second on its own. Could you (or anyone else who wants to try) let me know?
 

Attachments

  • momentflashTEST.zip
    132.7 KB · Views: 73
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