Closed Bug 848006 Opened 12 years ago Closed 12 years ago

Alarm does not sound if phone is plugged in

Categories

(Firefox OS Graveyard :: Gaia::Clock, defect)

x86
macOS
defect
Not set
normal

Tracking

(blocking-b2g:tef+, b2g18+ fixed, b2g18-v1.0.1 verified)

VERIFIED FIXED
blocking-b2g tef+
Tracking Status
b2g18 + fixed
b2g18-v1.0.1 --- verified

People

(Reporter: djf, Assigned: alive)

References

Details

Attachments

(1 file)

Steps to reproduce: 1) Plug phone into computer via USB cable. (I have remote debugging on, but don't have the sdcard mounted, I don't know if that is relevant). 2) Set an alarm for a couple of minutes in the future, and set it to recur on all weekdays 3) Wait for alarm 4) At the specified time, the screen displays the alarm, but there is no sound or vibration 5) Hit snooze and wait 5 minutes 6) Same as step 4: alarm screen shows but not sound is played. 7) Hit snooze, unplug phone and wait 5 minutes 8) Alarm plays.
This might be related to bug 845347. Cc'ing some people from that bug and nominating.
tracking-b2g18: --- → ?
djf, I'm not sure. I was able to replicate bug 845347 without having the device plugged in. I'll see if I can find the regression window for this at the same time.
I've tried the STR above twice and experienced the bug both times. With some further testing, I think I've found that the phone has to go to sleep (or you have to push the sleep button) after setting the alarm. If you just set it for 1 minute in the future and the phone does not sleep, then you get the sound. This occurs for me even without setting any recurrances for the alarm in step 2. I've now turned off remote debugging and the console in the settings app, and I still see the bug when plugged in, so it isn't just affecting developers. If reproducable, this would affect anyone charging their phone overnight. After unplugging the phone I got one silent alarm and one noisy alarm. I've got no idea what is going on. But having the phone plugged in does seem to be a factor.
I'm continuing to see this with further testing. If the phone is plugged in and asleep, then I don't get sound. If it is unplugged or if it is awake the I do get sound.
Does it matter if you sleep it with an app being in the foreground? I'm currently trying to play with the notion that maybe it might also have to do with an app in the foreground or the homescreen being in the foreground as well...
Naoki, I think when I was testing this, I would normally set the alarm, then hit the home button to return to the homescreen and then sleep the phone. I'm not sure if I always did that though. Can you reproduce it? I started seeing this on a nightly build from late last week. Today I made a custom build of b2g18 and gaia master and am still seeing it.
QA Contact: jshih → fyen
I could repro this one! Investigating.
QA Contact: fyen → jshih
According Description step 4) "At the specified time, the screen displays the alarm, but there is no sound or vibration", I guess that the mozHidden value is not reliable as before in the same checking time. Keep to investigate.
E/GeckoConsole( 1761): Content JS LOG at app://clock.gaiamobile.org/js/onring.js:43 in rv_init: [ Wed Mar 6 15:52:00 2013 ][clock] First checkin is HIDDEN. E/GeckoConsole( 1761): Content JS LOG at app://clock.gaiamobile.org/js/onring.js:57 in rv_checkMozHidden: [ Wed Mar 6 15:52:01 2013 ][clock] Second checkin is HIDDEN. E/GeckoConsole( 1761): Content JS LOG at app://clock.gaiamobile.org/js/visibility.js:3 in visibilityChange: [ Wed Mar 6 15:52:01 2013 ] [clock] I am shown. E/GeckoConsole( 1761): Content JS LOG at app://clock.gaiamobile.org/js/visibility.js:5 in visibilityChange: [ Wed Mar 6 15:52:10 2013 ] [clock] I am hidden. Seems alarm is up before visibilitychange event..
I add a 300ms*10 count timer this time: :42 in anonymous: Upgrading db :47 in anonymous: Upgrading db done 43 in rv_init: [ Wed Mar 6 17:21:01 2013 ][clock] First checkin is HIDDEN. 57 in rv_checkMozHidden: [ Wed Mar 6 17:21:01 2013 ][clock] Second checkin is HIDDEN. 222 in timer: [ Wed Mar 6 17:21:01 2013 ][clock] 1 cont checkin is . HIDDEN Content JS LOG at app://clock.gaiamobile.org/js/visibility.js:3 in visibilityChange: [ Wed Mar 6 17:21:01 2013 ] [clock] I am shown. 222 in timer: [ Wed Mar 6 17:21:01 2013 ][clock] 2 cont checkin is . SHOWN 222 in timer: [ Wed Mar 6 17:21:01 2013 ][clock] 3 cont checkin is . SHOWN 222 in timer: [ Wed Mar 6 17:21:01 2013 ][clock] 4 cont checkin is . SHOWN 222 in timer: [ Wed Mar 6 17:21:02 2013 ][clock] 5 cont checkin is . SHOWN 222 in timer: [ Wed Mar 6 17:21:02 2013 ][clock] 6 cont checkin is . SHOWN 222 in timer: [ Wed Mar 6 17:21:02 2013 ][clock] 7 cont checkin is . SHOWN 222 in timer: [ Wed Mar 6 17:21:03 2013 ][clock] 8 cont checkin is . SHOWN 222 in timer: [ Wed Mar 6 17:21:03 2013 ][clock] 9 cont checkin is . SHOWN 222 in timer: [ Wed Mar 6 17:21:03 2013 ][clock] 10 cont checkin is . SHOWN
Tested with https://github.com/alivedise/gaia/tree/muted-alarm_v1-train app://system.gaiamobile.org/js/screen_manager.js:368 in scm_turnScreenOn: [ Wed Mar 6 18:58:00 2013 ][non clock] screen is actually on. =====> power.screenEnabled = true app://system.gaiamobile.org/js/attention_screen.js:132 in anonymous: Wed Mar 6 18:58:00 2013 [non clock] set true! =====> onring iframe setVisible to true app://system.gaiamobile.org/js/visibility.js:3 in visibilityChange: [ Wed Mar 6 18:58:01 2013 ] [non clock:system] I am shown. ======> system app(content) get visibilitychange event app://clock.gaiamobile.org/js/onring.js:43 in rv_init: [ Wed Mar 6 18:58:01 2013 ][clock] First checkin is HIDDEN. ======> onring.js check document.mozHidden app://clock.gaiamobile.org/js/onring.js:57 in rv_checkMozHidden: [ Wed Mar 6 18:58:01 2013 ][clock] Second checkin is HIDDEN. ======> onring.js check document.mozHidden w/ setTimeout(0) app://clock.gaiamobile.org/js/onring.js:223 in timer: [ Wed Mar 6 18:58:01 2013 ][clock] 1 cont checkin is . HIDDEN ======> onring.js check document.mozHidden w/ setTimeout(300ms) app://clock.gaiamobile.org/js/visibility.js:3 in visibilityChange: [ Wed Mar 6 18:58:01 2013 ] [clock] I am shown. ======> onring.js get visibilitychange event
So there's latency between setVisible to onring.html and when it's up to check mozHidden, the state is still invisible.
(In reply to Alive Kuo [:alive] (Life is a struggle.) from comment #12) > So there's latency between setVisible to onring.html and when it's up to > check mozHidden, the state is still invisible. So can you just listen to the mozvisibilitychange event, and if the visibility changes away from hidden, start the alarm? We need to fix this bug.
blocking-b2g: --- → tef?
(In reply to Justin Lebar [:jlebar] from comment #13) > (In reply to Alive Kuo [:alive] (Life is a struggle.) from comment #12) > > So there's latency between setVisible to onring.html and when it's up to > > check mozHidden, the state is still invisible. > > So can you just listen to the mozvisibilitychange event, and if the > visibility changes away from hidden, start the alarm? > > We need to fix this bug. Yes. The only thing I wonder this breaks the fix that alarm needs to be dismissed when it goes off during a call. But that's not a big feature, more like an edge case.
Assignee: nobody → alive
Patch v1: Add the last guard to ensure alarm really sounds/vibrates if the timer to check visibility doesn't come in time.
Attachment #722139 - Flags: review?(timdream)
Comment on attachment 722139 [details] https://github.com/mozilla-b2g/gaia/pull/8514 It's very sad that those OOP timing/racing issue in Gecko force us to do all these checks, but I guess it's necessary.
Attachment #722139 - Flags: review?(timdream) → review+
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
It's a bit late, but I could not reproduce the bug on 2/27 build and I could repro it on the 2/28 build... Odd. I guess it very much has to do with the timing/racing.
blocking-b2g: tef? → tef+
Uplifted commit 0bee8fb8d6f7c321e5cc3d79b26e539ac9c4f04e as: v1-train: 87cc896b7a2016df090169dd1ba21bba1e879722 v1.0.1: 24718e0f3fac9ea98b35a772531431adc7553f67
QA Contact: jshih → cbarker
Flags: in-moztrap?(cbarker)
QA Contact: cbarker → jshih
The alarm sounds when the phone is plugged in to usb now. Issue is verified as fixed. Unagi, Build ID: 20130322070203 Gecko: http://hg.mozilla.org/releases/mozilla-b2g18_v1_0_1/rev/4931ec89ebbe Gaia: 85fd164691bb852f1cfaf82405df4380629ced6e
Status: RESOLVED → VERIFIED
Created 2 test cases in Moztrap, one for the Alarm Triggering whilst charging, and one for the Alarm Triggering whilst connected via USB. See cases here: https://moztrap.mozilla.org/manage/cases/?pagenumber=1&pagesize=20&sortfield=created_on&sortdirection=desc&filter-id=6834&filter-id=6835
Flags: in-moztrap?(cbarker) → in-moztrap+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: