A simple torch app, originally written for the LG Nexus 5 (codename "hammerhead") port of Sailfish OS. Uses GStreamer by default, with hardware specific workarounds for some other ported devices.
Now supports:
Hardware specific workarounds for devices where gstreamer is not fully supported can be added easily for any other phone with a simple control file that turns the LED on depending on its content (i.e. 1 for on, 0 for off) - get in touch if you would like me to add support for your device!
License: GPLv2+
Source: https://github.com/sam-hobbs/harbour-hammerhead-torch
Attachment | Size | Date |
---|---|---|
harbour-hammerhead-torch-0.1-1.armv7hl.rpm | 90.37 KB | 04/01/2016 - 00:31 |
harbour-hammerhead-torch-0.2-1.armv7hl.rpm | 91.38 KB | 04/01/2016 - 23:33 |
harbour-hammerhead-torch-0.4-1.armv7hl.rpm | 95.68 KB | 07/01/2016 - 01:43 |
harbour-hammerhead-torch-0.5-1.armv7hl.rpm | 94.78 KB | 07/01/2016 - 23:16 |
harbour-hammerhead-torch-0.6-1.armv7hl.rpm | 95.54 KB | 09/01/2016 - 02:44 |
harbour-hammerhead-torch-0.7-1.armv7hl.rpm | 138.22 KB | 08/06/2016 - 01:23 |
harbour-hammerhead-torch-0.8-1.armv7hl.rpm | 138.53 KB | 11/06/2016 - 17:33 |
harbour-hammerhead-torch-0.9-1.armv7hl.rpm | 137.93 KB | 14/06/2016 - 21:55 |
harbour-hammerhead-torch-0.10-1.armv7hl.rpm | 138.96 KB | 25/06/2016 - 15:05 |
harbour-hammerhead-torch-0.11-1.armv7hl.rpm | 140.16 KB | 28/06/2016 - 00:02 |
harbour-hammerhead-torch-0.12-1.armv7hl.rpm | 144.09 KB | 05/07/2016 - 02:28 |
harbour-hammerhead-torch-0.13-1.armv7hl.rpm | 144.18 KB | 21/01/2017 - 20:31 |
- Added support for Motorola Moto-G (2013)
Comments
KyleB
Fri, 2017/02/17 - 19:26
Permalink
Great simple torch app, can confirm it works on the moto g 2014 no modifications needed
moofang
Sat, 2016/08/20 - 13:56
Permalink
Chiming in that this works (with gstreamer) on aqua fish :)
May or may not mean it works for Jollac i guess.
Feathers_McGraw
Tue, 2016/07/05 - 02:28
Permalink
GStreamer, baby! :D
Feathers_McGraw
Tue, 2016/06/28 - 00:21
Permalink
I'd like to hear from people using Jolla C, since I don't have one and haven't been able to test the experimental support. Let me know!
Feathers_McGraw
Wed, 2016/06/08 - 01:29
Permalink
Now supports Motorola Photon Q, thanks to elros34
https://github.com/sam-hobbs/harbour-hammerhead-torch/pull/1
If anyone else is using a SFOS port, please get in touch and we can add support for your device.
mika77
Fri, 2016/01/08 - 02:38
Permalink
With the latest release works like a charm, thank you ^^
Feathers_McGraw
Fri, 2016/01/08 - 22:52
Permalink
You're welcome :)
Shervrar
Thu, 2016/01/07 - 06:38
Permalink
Sorry if this is stupid, but why not create a link from /sys/class/leds/led:flash_torch/brightness to /sys/kernel/debug/flash_adp1650/mode? Wouldn't that make the hammerhead univertally compatible with Jolla Phone applications that use flash?
Feathers_McGraw
Thu, 2016/01/07 - 11:43
Permalink
Hi, good question :)
Some of the other apps seem to work by creating a camera stream and controlling the flashlight that way, so I don't think creating that symlink would work for the other apps. Although the camera stream method seems convoluted it is probably more portable in theory if libhybris can abstract the locations of all the control files etc (that's just a guess, I don't know how libhybris works).
That's not the way this app works because it was originally written specifically for Hammerhead, and I only added support for jPhone because someone asked. When I started the app I didn't even know that jPhone has a file that controls the flashlight!
You're right that in theory I could make the app jPhone only, and then ask all Hammerhead users to manually create the jPhone folder structure and symlink as root, but that would be a lot less convenient.
Rikudou_Sennin
Wed, 2016/01/06 - 22:37
Permalink
not working on Jolla :)
Feathers_McGraw
Thu, 2016/01/07 - 01:58
Permalink
Should be fixed now, can you confirm?
There were two bugs - firstly the function to detect the control file wasn't working properly because it detected the correct path and then overrode it (so the app was writing to the wrong file).
Secondly, even if the correct path was manually specified, the method I was using to write to the control file (QFile & QTextStream) that works on Hammerhead doesn't work on the Jolla control file for some reason, even though nemo has permissions to read and write it :S. QFile would say it was successful in opening the file read+write in truncate (overwrite) mode, but then qtextstream couldn't get position 0, which i think means it couldn't navigate to the start of the file to overwrite it.
I think this is the same reason you can't cat the contents of the control file in a terminal even though you have read permission. Maybe it has some additional constraints?
Anyway, I completely rewrote that bit so it just calls echo with QProcess. It's now working on my Jolla, hopefully that re-write didn't break it on Hammerhead!
Rikudou_Sennin
Thu, 2016/01/07 - 02:20
Permalink
Works now. But you should definitely hide the settings - letting user write into any file is a bad idea.
Feathers_McGraw
Thu, 2016/01/07 - 02:29
Permalink
Thanks for testing :)
Not sure if I agree about the file path. The user shouldn't have to use that setting unless they have a Sailfish port on a device other than Hammerhead, since jPhone and Hammerhead are auto-detected. If they have a different device, they need to be able to set the path somehow - the whole point of the app was to be a torch for phones that can't use the apps that assume every phone is a jPhone. The app runs as nemo so it can only write to files that the user can already modify anyway, so I don't see the problem.
I agree about turning the torch on when the app starts though, I almost implemented that tonight but I wanted to get a version that works on both phones out first. I'll do it tomorrow.
Rikudou_Sennin
Fri, 2016/01/08 - 12:38
Permalink
User should never use that setting. Don't allow people do bad things if you don't have to.
They don't have to be able to set the path somehow - they will not know, where the path should point. You should make a bulletproof class that checks the phone files and if it does not find any of the files, show something like feedback form for them to contact you.
The problem about nemo writing only to files that the user already can - the file on Jolla, that controls torch is owned by root, yet you can still write to it. There may be other files like that and not doing something that innocent.
You should really never give basic user such option.
Feathers_McGraw
Sat, 2016/01/09 - 02:52
Permalink
I think you're being quite patronising and underestimating people, particularly users who are capable of installing SFOS on Hammerhead and other devices that don't come preloaded with SFOS.
The chance of someone accidentally typing the wrong path that just happens to be a real path to a file that nemo can write to, that will break the whole system if overwritten with a 1 or 0 is vanishingly small.
Nevertheless, I've removed the option to set the path to the control file in the GUI. The settings page now just displays the path to the control file and the device name, and describes how to change the settings in the config file.
Feathers_McGraw
Wed, 2016/01/06 - 22:38
Permalink
I know :( , looking into it.
Rikudou_Sennin
Thu, 2016/01/07 - 02:23
Permalink
And one more advice: you should start the torch as soon as the app opens - when people use torch, they want light. Or you should make a setting for it at least.
mika77
Mon, 2016/01/04 - 06:07
Permalink
Hi ^^ nice to see an open source torch app. I suggest you to make it work also with Jolla phone. The one on the store doesn't work on Jolla phones with the last updates, and it's closed source. Hope to see this app for both Nexus 5 and Jolla phone on Harbour ^^
coderus
Wed, 2016/01/06 - 23:02
Permalink
This works forever: https://openrepos.net/content/drgogeta86/lumino
Also Flashlight from Store works great on latest and very latest sailfish version.
mika77
Fri, 2016/01/08 - 02:36
Permalink
No, flashlight from store doesn't work always. If you updated your phone from 1.9 releases to 2xxxx release it works, but if your phone comes with 2xxxx preinstalled doesn't work.
coderus
Fri, 2016/01/08 - 18:42
Permalink
sounds like problem on your phone. i just installed flashlight from store and it just works.
Feathers_McGraw
Wed, 2016/01/06 - 02:32
Permalink
Tonight I got Hammerhead Torch working with the Jolla phone, the app now autodetects Jolla/hammerhead by checking to see if the control files exist on first run, and stores the result in a config file. I also added a way to support any other phone with a similar control file by specifying its location, just need to polish that bit and then I'll release the new version tomorrow :)
Feathers_McGraw
Mon, 2016/01/04 - 23:37
Permalink
Hi,
If I can work out how to control the torch on in the Jolla phone, I'll add support for it. At the moment, this app just writes 1 or 0 to a text file at /sys/class/leds/led:flash_torch/brightness, which turns the torch on/off on Hammerhead. The file doesn't exist on the Jolla, but there's probably a more elegant way to do it anyway. I'll have a rummage!
Sam
Rikudou_Sennin
Tue, 2016/01/05 - 00:41
Permalink
On Jolla, there is no elegant way.
echo 1 > /sys/kernel/debug/flash_adp1650/mode
echo 0 > /sys/kernel/debug/flash_adp1650/mode
Feathers_McGraw
Tue, 2016/01/05 - 01:09
Permalink
Hmm... that file is owned by root on Jolla so there must be another way, because the other apps don't have permissions to write to that file!
On hammerhead the control file is writable by nemo.
Rikudou_Sennin
Tue, 2016/01/05 - 02:20
Permalink
I had no problem writing to it as nemo.
Feathers_McGraw
Tue, 2016/01/05 - 10:40
Permalink
Looking again, although it's owned by root:root everyone has write permissions. Thanks for pointing this out, should be pretty trivial to add support for the Jolla phone :)
Rikudou_Sennin
Tue, 2016/01/05 - 00:44
Permalink
Also, for hammerhead and Jolla you should also check for camera app open and stop light if it does
Rikudou_Sennin
Mon, 2016/01/04 - 00:39
Permalink
Correct me if I'm wrong, wouldn't the app in store work for hammerhead, while it's arm?
Feathers_McGraw
Mon, 2016/01/04 - 00:55
Permalink
Nope, apparently not, read this:
http://talk.maemo.org/showthread.php?t=94620&page=32
Pages