Bug 6689 - (int-151237) Prevent magnet from waking up device
(int-151237)
: Prevent magnet from waking up device
Status: RESOLVED WONTFIX
Product: System software
Device lock
: 5.0/(3.2010.02-8)
: N900 Maemo
: Low enhancement with 20 votes (vote)
: ---
Assigned To: unassigned
: device-lock-bugs
:
:
:
:
  Show dependency tree
 
Reported: 2009-12-07 22:13 UTC by leek
Modified: 2011-01-21 00:12 UTC (History)
12 users (show)

See Also:


Attachments
Simple script to fix the issue at hand. (1.43 KB, application/octet-stream)
2010-03-10 01:39 UTC, Bernard B
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description leek (reporter) 2009-12-07 22:13:58 UTC
SOFTWARE VERSION:

Version: 1.2009.42-11.002

EXACT STEPS LEADING TO PROBLEM: 

1. Put the device in sleep mode (in landscape mode, press the top button and
select Lock Screen and Keys, or slide the right button).

2. Put a small (but not extra-strong) magnet, such as the magnetic clip of a
carrying case, near the center of the screen, around (70% right, 60% down) from
the top left, as viewed in landscape mode.

EXPECTED OUTCOME:

The device stays asleep.

ACTUAL OUTCOME:

If the keyboard tray is closed, the device wakes up when a magnet is present,
but goes back to sleep when the magnet is removed.

If the keyboard tray is open, the device wakes up when a magnet is present, but
stays awake when the magnet is removed.

REPRODUCIBILITY:

Always

EXTRA SOFTWARE INSTALLED:

n/a

OTHER COMMENTS:

My guess is that there is a reed or Hall-Effect switch in the N900 which
detects the keyboard tray being opened/closed by the proximity of an internal
magnet.

If the reed or Hall-Effect switch is closed by an external magnetic field, such
as the magnetic clip of a carrying case, then the device wakes up.

An option to prevent waking up the device when the keyboard tray is being
opened, might be enough to prevent a magnetic clip from waking it up. This will
prevent inadvertent wake-ups when inserting the N900 into carrying cases with
magnetic clips, or when coming near magnetic fields.

However, this should remain an option, because for people who do not suffer
this magnetic problem, it may be convenient for them to be able to wake up
their N900 immediately, by sliding the keyboard open.
Comment 1 hareesh 2009-12-07 23:15:21 UTC
*** This bug has been confirmed by popular vote. ***
Comment 2 Andre Klapper maemo.org 2009-12-08 19:34:09 UTC
Thanks for reporting this.
Comment 3 Lucas Maneos 2009-12-08 21:44:25 UTC
I saw this a while ago when placing the N900 next to an N800 (wearing the SU-31
magnetic case) and thought I was going mad :-)  It happens even when the magnet
is placed near the back of the N900.
Comment 4 Quim Gil nokia 2009-12-15 07:12:22 UTC
If there is something that can be done at software level, then this looks more
like a bug.
Comment 5 leek (reporter) 2009-12-15 10:21:00 UTC
Quim: You're very generous.

Certainly no fault of the software design or implementation is implied by this
report :)

I am not privy to all of the details (specs, etc.).

However, it is a sincere request for enhancement :)

I hope it can be worked around in software.

Thanks for everyone's efforts.

(Sorry Andre... :)
Comment 6 Lucas Maneos 2009-12-15 11:50:52 UTC
Hm, exactly the same thing also happens with the N810.  Funny how I never
noticed in over 2 years...
Comment 7 badac.hoi 2009-12-27 04:07:49 UTC
Just bought a new belt case with magnetic latch not knowing about this bug. I
hope this option can be implemented with software. Else my battery life will be
even lower than it is.
Comment 8 t3st3r 2009-12-27 09:15:56 UTC
*** Bug 7366 has been marked as a duplicate of this bug. ***
Comment 9 t3st3r 2009-12-27 09:30:41 UTC
Me got this issue, and after some investigation tracked it down to slider
opening sensor (GPIO 71) which is toggled by magnets of my horizontal case so
screen may become unlocked when putting device into case. I also filed bug 7366
and it seems to be duplicate to this one. I'm sorry (fixing: marked it as
duplicate of this bug).

People on forum are also affected by this issue: see
http://talk.maemo.org/showthread.php?t=36194

I have idea: add option (and according settings in UI) to disregard slider
sensor when screen is locked. This would not allow to unlock device by sliding
it's keyboard, but as for me I would prefer to unlock device by other means
rather than get random screen clicks and other unwanted activity. I believe
this option should be configurable: some people are fine right now but some are
affected by this issue and it can be convenient for people to use slide to
unlock device BUT some people would need to disable this due to mentioned
issue.

P.S. please boost priority and/or severity of this bug! It haves potential to
affect many users, may cause weird issues (unwanted desktop clicks, battery
drain due to backlight) and hence it probably needs some attention from Nokia
people in a timely manner. It probably can be worked around through software,
even while being hardware issue in it's nature.
Comment 10 John Montagna 2010-02-06 02:33:04 UTC
One simple solution is if the lock switch (right side) was used to lock the
device as opposed to timing out, only unlock with the switch or the power
button and slider but not the keyboard.

If the device timed out, then opening the keyboard will wake it up.

Most horizontal cases use a magnet.  This is adding to the battery issues, not
to mention unwanted desktop changes.
Comment 11 Andre Klapper maemo.org 2010-03-04 23:29:43 UTC
According to Nokia this is a WONTFIX:

"in real world this might as well happen if you have a case with magnetic clip.
Constant waking up and quick discharging is the least of the problems -
magnetic sensor is used to detect back cover presence. when back cover is
opened all I/O to the external mmc card is cut in a rude way and it is
unmounted; WONTFIX."
Comment 12 Thomas Tanner 2010-03-05 00:14:26 UTC
I don't understand how this is related to our problem.
We are not suggesting to completely disable the magnetic sensor
but to change the reaction to the sensor events.
If I remove the back cover, my device does not become unlocked,
i.e. the sensor can discriminate between sliding out the keyboard and removing
the back cover.
+1 for solution #10!
please mark this bug as a very important feature enhancement.

(In reply to comment #11)
> magnetic sensor is used to detect back cover presence. when back cover is
> opened all I/O to the external mmc card is cut in a rude way and it is
> unmounted; WONTFIX."
Comment 13 egoshin 2010-03-05 01:48:21 UTC
Andre,

I strongly suspect that a person who investigated a case doesn't look seriously
into issue - I doubt that the SAME magnetic sensor monitors BOTH - KBD unlock
and back cover presence. The bug describes a problem with KBD opening but
resolution states about back cover and mSD (not mmc!).

Nobody here whining about mSD disconnection but about KBD unlock.

Is it possible to re-open a bug with strong consideration on KBD unlock only?
Comment 14 t3st3r 2010-03-05 17:54:38 UTC
I do not care about external card as I do not use it. But unlock of device
drains battery power.

Btw you can toggle locking switch when device in case. Then device remains
locked but that's very inconvenient sequence. 

IMHO, Nokia could do better than just blindly ignoring customers problems.
Comment 15 John Montagna 2010-03-05 19:15:12 UTC
The keyboard open event handler should simply ignore
the event if the phone was locked with the lock switch as opposed to timing
out.
Other then the cpu responding to the event, there is no other battery drain.

Keyboard_Open()
{
    If (locked_by_lock_switch)
       ignore
    else
       wake_up
}

The other issue is the random desktop modifications caused by touches from the
case on the screen.

While there are only 17 votes for this bug, it is most likely because most
people haven't figured that this is contributing to their battery issues.
Comment 16 egoshin 2010-03-08 23:11:31 UTC
From t3st3r@mail.ru:

"Btw you can toggle locking switch when device in case. Then device remains
locked"

Just tried - lock a phone via side-slider and open KBD. Phone unlocks, any
widget starts updating via Internet.

The same happens if I just move N900 near my case magnetic cover.
Comment 17 Bernard B 2010-03-09 11:52:21 UTC
I understand why Nokia mark this as a WONTFIX - the issue is that any magnet
may trigger the back cover sensor, effectively ejecting the SD card and
potentially corrupting the contents. Thus N900 cases with magnetic latches are
dangerous if used with an SD card. The slide sensor being activated is just one
of the issues.

Notwithstanding that, for those who need a workaround and don't have an SD card
or are willing to take the risks, the following works for me:
As root, run
# echo 1 > /sys/devices/platform/gpio-switch/slide/disable

Or, stash this little snippet into a file /etc/event.d/disable-slider to do
this on boot:

start on started mce
console none
script
    echo 1 > /sys/devices/platform/gpio-switch/slide/disable
end script
Comment 18 Bernard B 2010-03-09 12:21:20 UTC
Oh, bear in mind that the workaround in Comment #17 also stops the keyboard
backlight from coming on. It should be possible to do a cleaner workaround by
hooking into mce via dbus.
Comment 19 egoshin 2010-03-09 20:56:25 UTC
(In reply to comment #17)

> Notwithstanding that, for those who need a workaround and don't have an SD card
> or are willing to take the risks, the following works for me:
> As root, run
> # echo 1 > /sys/devices/platform/gpio-switch/slide/disable

Excelent!

I looked into kb_lock but name misled me - that is a locking side slider.

But I need to correct you - this way has nothing with SD card - I just tested -
the back cover removal still unmount /dev/mmc1 and mount it back after cover
re-installation. And it should not - I see a small hole near camera lens and
that cover actually acts as light sensor - if I cover it by my finger the
/dev/mmc1 SD card is mounted again.

So, your way is perfect solution (KBD light... yes we could connect script to
it which can light KBD in case of slider unlocking).
Comment 20 egoshin 2010-03-09 21:21:55 UTC
(In reply to comment #11)
> magnetic sensor is used to detect back cover presence. when back cover is
> opened all I/O to the external mmc card is cut in a rude way and it is
> unmounted; WONTFIX."
> 

I am puzzled - I see the light sensor for back cover presence detection. And
putting finger over it's hole un-mounts mmc SD card, removal - mounts it back.

Who did that kind of conclusion - does he familiar with N900 hardware design,
BTW?

Or, do we have different hardware in different countries?
Comment 21 leek (reporter) 2010-03-09 22:10:38 UTC
Everyone's comments here in the last week have been helpful.

Yes, the back cover is detected by a light sensor just below the camera. I can
put my finger over it and the device wakes up. I let go, and it goes to sleep.

I had to reboot my N900 after I "corrupted" my memory card by mounting it and
unmounting it too many times with my finger over the sensor. Perhaps there's a
race condition in the code which can be triggered by too frequently changing
the sensor's input. Rebooting the N900 made the memory card usable again.

As everyone has said, the keyboard tray opening is a software event which
should be able be to be suppressed in order to prevent accidental wakeup due to
magnetic fields.

I respectfully request that this bug be reopened.
Comment 22 Bernard B 2010-03-10 01:34:49 UTC
(In reply to comment #20)
> I am puzzled - I see the light sensor for back cover presence detection. And
> putting finger over it's hole un-mounts mmc SD card, removal - mounts it back.
> 
> Who did that kind of conclusion - does he familiar with N900 hardware design,
> BTW?
> 
> Or, do we have different hardware in different countries?

Curious. We might have different hardware then. With the back cover off, I can
wave a magnet somewhere over the SD card and get these to appear in dmesg:
 mmc0: cover is closed, card is now accessible
 mmc0: cover is open, card is now inaccessible

No matter how hard I try with a non-magnet, I can't trigger it.
Comment 23 Bernard B 2010-03-10 01:39:04 UTC
Created an attachment (id=2461) [details]
Simple script to fix the issue at hand.

Attached is a tgz containing a simple python script that disables the slide
switch when the device is put into standby. It works for me. If somebody wants
to package this up and make it more useful, feel free.
Comment 24 Andre Klapper maemo.org 2010-03-10 20:57:16 UTC
(In reply to comment #21)
> I respectfully request that this bug be reopened.

Erm, why? Because you think that it is a software bug?
Comment 25 leek (reporter) 2010-03-11 01:57:32 UTC
(In reply to comment #24)
> (In reply to comment #21)
> > I respectfully request that this bug be reopened.
> 
> Erm, why? Because you think that it is a software bug?

Because:
1. The problem impacts users significantly, leading to decreased battery life
and accidental screen presses.
2. It can apparently be worked around in software without bad side effects
(thanks Bernard).
3. There are clearly the votes for this to be considered important.
4. The rear cover sensor is a different matter, whether or not it is magnetic
on certain N900 models, and it doesn't lessen the desire to fix this problem.

Remember, I originally submitted this as an enhancement request, and I never
claimed there was a software bug or deviation from software specifications.
(Expected vs. Actual behavior was from a user experience standpoint rather than
a software specification standpoint.)

See comment #4 for why it's considered a "bug" now.

Lowering severity back to ER, for what it's worth.
Comment 26 Neil MacLeod maemo.org 2010-03-17 21:05:12 UTC
Also if a device is secured ("Secure device" from the power button menu -
default code is 12345) or allowed to auto-lock, and the keyboard and screen
then locked with the side switch before placing into a pocket/belt-clip, the
touch screen can be unintentionally unlocked by a magnet meaning it is then
possible to accidentally power off the device when a random touch screen event
answers "Yes" to the "Switch off device?" prompt.

That would p me off...
Comment 27 Andre Klapper maemo.org 2011-01-18 16:33:12 UTC
Internal Nokia WONTFIX comment for Maemo5:
"in real world this might as well happen if you have a case with magnetic clip. 
constant waking up and quick discharging is the least of the problems -
magnetic sensor is used to detect back cover presence. when back cover is
opened all i/op to the external mmc card is cut in a rude way and it is
unmounted; WONTFIX."

reflecting status here.
Comment 28 egoshin 2011-01-19 23:09:31 UTC
(In reply to comment #27)
> Internal Nokia WONTFIX comment for Maemo5:
> "in real world this might as well happen if you have a case with magnetic clip. 
> constant waking up and quick discharging is the least of the problems -
> magnetic sensor is used to detect back cover presence. when back cover is
> opened all i/op to the external mmc card is cut in a rude way and it is
> unmounted; WONTFIX."
> 
> reflecting status here.

I only can point to part of Comment #19:

"this way has nothing with SD card - I just tested -
the back cover removal still unmount /dev/mmc1 and mount it back after cover
re-installation."

And I can't understand why back cover OPEN/CLOSED detector is bind in Internal
Nokia comment to OPEN/CLOSE detector of KBD. The simple experiment shows that
both are different channels in software - KBD opening has nothing with back
cover opening (different actions).

It seems again as a come-off.
Comment 29 Bernard B 2011-01-20 06:44:53 UTC
egoshin: See comment #22.

My N900 uses magnetic sensors for both the keyboard slide sensor and the back
cover sensor (which abruptly ejects the SD card when opened). Magnets can
disturb either sensor. Magnetic cases for the N900 just aren't safe.

If Nokia fix this in software, someone will then be complaining that their SD
card keeps getting corrupted (it happened once to me). So I can see why they
label it WONTFIX.

I'd suggest buying a new case.
Comment 30 egoshin 2011-01-21 00:12:38 UTC
(In reply to comment #29)
> egoshin: See comment #22.
> 
> My N900 uses magnetic sensors for both the keyboard slide sensor and the back
> cover sensor (which abruptly ejects the SD card when opened). Magnets can
> disturb either sensor. Magnetic cases for the N900 just aren't safe.

Magnet disturbs only one side because N900 is thick. I never seen the cover
switch action on magnet but I put N900 into case in one-way only - just because
I like to pick-up a phone by one hand.