Reply
Thread Tools
Temporal's Avatar
Posts: 323 | Thanked: 189 times | Joined on Oct 2010 @ Brazil
#1
Hi, since yesterday my optical sensor doesn't work anymore. All I know is that it shut itself off and then I restarted it and I didn't pay attention(not unusual for this to happen) to it and the it shut itself off again.

<skip>
I noticed lots of camera-ui instances working in the background some hours before it happened, because I like to put all the hildon things to priority level -20 (I could try to do it via script upon start but whatevs), but I thought it was somewhat normal.

As it was the third time, I payed attention and then took a look at everything. Well, the flashlight_gtk didn't show up after opening lens cover.
</skip>

After some digging, noticed that nobody anymore is detecting the lens cover open. It stays shut forever. The "dmesg | grep cam" shows
cam_shutter (gpio 100) is now closed
cam_launch (gpio 69) is now inactive
cam_focus (gpio 68) is now inactive

Yes I tried the search, but it is overcrowded with fcam related problems, I couldn't find anything of value for this problem.

So, I believe I could live without the detector If I could manage to change the gpio value manually. Is it possible?

Thanks.
__________________
Love and Goodness are not a property. Are not a franchising. They are present in each one of us, and must be cultivated with KNOWLEDGE.

Last edited by Temporal; 2012-02-11 at 21:52.
 
Temporal's Avatar
Posts: 323 | Thanked: 189 times | Joined on Oct 2010 @ Brazil
#2
I just tried:

$root
#
#cat /sys/devices/platform/gpio-switch/cam_shutter/state
#closed
#
#echo open > /sys/devices/platform/gpio-switch/cam_shutter/state
#sh: Write error: Operation not permitted
#

What now?
__________________
Love and Goodness are not a property. Are not a franchising. They are present in each one of us, and must be cultivated with KNOWLEDGE.
 
Temporal's Avatar
Posts: 323 | Thanked: 189 times | Joined on Oct 2010 @ Brazil
#3
Now I tried:

#chmod a+rwx /sys/devices/platform/gpio-switch/cam_shutter/state
#ls -l /sys/devices/platform/gpio-switch/cam_shutter/state
# -rwxrwxrwx 1 root root /sys/devices/platform/gpio-switch/cam_shutter/state
#
#echo open > /sys/devices/platform/gpio-switch/cam_shutter/state
#sh: Write error: Operation not permitted
#

What now?
__________________
Love and Goodness are not a property. Are not a franchising. They are present in each one of us, and must be cultivated with KNOWLEDGE.
 
Posts: 1,101 | Thanked: 1,184 times | Joined on Aug 2008 @ Spain
#4
That interface is read only, by reading it you are calling rx51_show_shutter() which reads the gpio.
Look at the file arch/arm/mach-omap2/rx51_camera_btn.c
You'll need to modify rx51_show_shutter() and if you want a writable interface you need to add a function to write it.
 

The Following 2 Users Say Thank You to maacruz For This Useful Post:
Posts: 121 | Thanked: 53 times | Joined on Aug 2006 @ Alexandria, VA, USA
#5
I'm not sure I understand your problem. Is it that the camera app won't start? That happened to me once after I colored black the little white stripe on the inside of the back cover of the phone. A piece of white tape fixed the problem.
 
Temporal's Avatar
Posts: 323 | Thanked: 189 times | Joined on Oct 2010 @ Brazil
#6
Originally Posted by talmage View Post
I'm not sure I understand your problem. Is it that the camera app won't start? That happened to me once after I colored black the little white stripe on the inside of the back cover of the phone. A piece of white tape fixed the problem.
No, the problem is that the optical sensor (hardware) looks like is broke. The back cover is fine, I even tried with other back cover that I have spare here and nothing happened.

Originally Posted by maacruz View Post
That interface is read only, by reading it you are calling rx51_show_shutter() which reads the gpio.
Look at the file arch/arm/mach-omap2/rx51_camera_btn.c
You'll need to modify rx51_show_shutter() and if you want a writable interface you need to add a function to write it.
Oh no, that was my main fear... so I should rewrite some of the code, and then I need to recompile and learn how to synchronize with the kernel... oh my... I'll loose all the rest of my leisure time on this... OR I could try to replace the optical sensor for an equivalent one. Thank you for the answer, sorry if I'm not happy for it
__________________
Love and Goodness are not a property. Are not a franchising. They are present in each one of us, and must be cultivated with KNOWLEDGE.
 
Posts: 85 | Thanked: 5 times | Joined on Nov 2009
#7
do you think this has anything to do with this topic? http://talk.maemo.org/showthread.php?t=67968
 
Posts: 1,101 | Thanked: 1,184 times | Joined on Aug 2008 @ Spain
#8
Originally Posted by Temporal View Post
No, the problem is that the optical sensor (hardware) looks like is broke. The back cover is fine, I even tried with other back cover that I have spare here and nothing happened.


Oh no, that was my main fear... so I should rewrite some of the code, and then I need to recompile and learn how to synchronize with the kernel... oh my... I'll loose all the rest of my leisure time on this... OR I could try to replace the optical sensor for an equivalent one. Thank you for the answer, sorry if I'm not happy for it
Actually it is kernel code what I'm talking about. Don't worry, if you are able to do some basic C coding it is not hard at all. You can just make it return always 1 and use the camera button to open the camera application, or if you want something configurable you can modify the read function to use a static variable and add a write function to change its value.
 

The Following User Says Thank You to maacruz For This Useful Post:
Temporal's Avatar
Posts: 323 | Thanked: 189 times | Joined on Oct 2010 @ Brazil
#9
Sorry maacruz, but after repetitive failures on installing scratchbox and make it start, I decided to try another route, that is, to fake the dbus-signal if anything.

This is the progress I have made so far:

Up to this moment, by reading a lot, I got this, that at least lets me use the camera and flashlight app:
Code:
sudo hal-set-property --udi /org/freedesktop/hal/devices/platform_cam_shutter --key button_state_value --bool false
I'm still looking for the real dbus signal for the state change in order to fake one. Again, at least this will let me use the camera. If I had that I'd use shortcutd in order to launch a script that would read the fake state:
Code:
sudo hal-get-property --udi /org/freedesktop/hal/devices/platform_cam_shutter --key button_state_value
and then if true change to false and send a fake signal (was opened);
Then, after using flashlight or camera app, I'd have to manually hit a shortcut on my desktop to undo all I did, by:

Code:
sudo hal-set-property --udi /org/freedesktop/hal/devices/platform_cam_shutter --key button_state_value --bool true
and sending a fake dbus call that the shutter has closed for all the apps that see it (like Lens Cover Reminder).

SO: Does anyone know what would look like a dbus signal for both shutter opened and closed?

Thanks.
__________________
Love and Goodness are not a property. Are not a franchising. They are present in each one of us, and must be cultivated with KNOWLEDGE.
 

The Following User Says Thank You to Temporal For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 07:14.