[Clock][FFOS7715 v2.1] During a call,pressdown power to off screen,when alarm clock arrive,The alarm bell ringing and vibration

UNCONFIRMED
Unassigned

Status

Firefox OS
AudioChannel
UNCONFIRMED
3 years ago
2 years ago

People

(Reporter: ffos_st, Unassigned)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: sprd387715)

(Reporter)

Description

3 years ago
Description: 
During a phone call,pressdown power to off screen,when alarm clock arrive,The alarm bell ringing and vibration

Devices:
SPRD7715 ea

Build Identifier:
20141230113450


Steps to reproduce:
1)Set an alarm which is expire soon
2)It arrives a telephone call,during the call,pressdown power to off screen
3)Wait the alarm arrive

Actual Result: 
The phone is vibrating and ringing to prompt the alarm expire.

Expected Result: 
The phone is vibrating to prompt the alarm expire.

Repro frequency:10/10,100%

best
(Reporter)

Updated

3 years ago
Whiteboard: sprd387715
(Reporter)

Updated

3 years ago
Summary: [FFOX7715 v2.1] During a call,pressdown power to off screen,when alarm clock arrive,The alarm bell ringing and vibration → [FFOS7715 v2.1] [Clock] During a call,pressdown power to off screen,when alarm clock arrive,The alarm bell ringing and vibration
(Reporter)

Updated

3 years ago
Summary: [FFOS7715 v2.1] [Clock] During a call,pressdown power to off screen,when alarm clock arrive,The alarm bell ringing and vibration → [Clock][FFOS7715 v2.1]During a call,pressdown power to off screen,when alarm clock arrive,The alarm bell ringing and vibration
(Reporter)

Updated

3 years ago
Summary: [Clock][FFOS7715 v2.1]During a call,pressdown power to off screen,when alarm clock arrive,The alarm bell ringing and vibration → [Clock][FFOS7715 v2.1] During a call,pressdown power to off screen,when alarm clock arrive,The alarm bell ringing and vibration
Hi Marcus -

In the current design, the Alarm will still ring even if the phone is now in-call. I am thinking it makes sense to mute the alarm ringtone when the device is in-call, does that makes sense to you too?

Thanks

Vance
Flags: needinfo?(m)
Needinfoing Juwei, as this seems like a UX call.
Flags: needinfo?(jhuang)

Comment 3

3 years ago
Hi Vance,
We have a clear spreadsheet about what will happen when phone ring/ alarm goes off.
Please refer to the following pdf on bug 1068219:
During the call, the alarm expire: Alarm vibrates. If vibration is turned off, mute
Flags: needinfo?(jhuang)
(In reply to Juwei Huang from comment #3)
> Hi Vance,
> We have a clear spreadsheet about what will happen when phone ring/ alarm
> goes off.
> Please refer to the following pdf on bug 1068219:
> During the call, the alarm expire: Alarm vibrates. If vibration is turned
> off, mute

Thanks Juwei, so this spreadsheet is about what we are going to do in 2.2, right? Since the 2.1 behavior is different from this spreadsheet, I assume it should be OK if we modify the 2.1 behavior to follow this sheet?

Thanks

Vance
Flags: needinfo?(jhuang)

Comment 5

3 years ago
Hi Vance,
Sorry I don't know much details about timeline...but I'm sure it's the ideal behaviour we want in the future.
So yes, we'd prefer to modify the behaviour same as the spreadsheet.
Thanks!
Flags: needinfo?(jhuang)
Flags: needinfo?(m)
Hi Marcus -

Per Juwei's feedback in Comment#3, could you help to modify the current Alarm behavior such that it will only vibrate when the phone is in-call?

Thanks
Flags: needinfo?(m)
As I understand it, that big "Audio Channel Competing" table mentioned in Comment 3 dictates how the platform priorities audio in the face of different channels (phone calls, music playing, etc). Individual apps don't get special notifications when calls come in, so it's left to the system to decide how to adjust volumes in response to different events.

In other words, I don't think the Clock app has enough information to decide on its own when to mute or sound the alarm (even if we wanted to). I think that's a platform-level adjustment. Ehsan, is that right?
Flags: needinfo?(m) → needinfo?(ehsan)

Comment 8

3 years ago
301 Andrea.
Flags: needinfo?(ehsan) → needinfo?(amarchesini)
Comment 7 is correct. We have an audio-channel policy currently implemented in gecko (and in the future it will be partially moved to gaia).

We still need to investigate this issue because for what I know the alarm app should use the 'alarm' audio channel that has a lower priority than the telephony audio-channel. It means that it should be muted when used during a phone call.
Flags: needinfo?(amarchesini)
The Clock app does use the 'alarm' channel, as seen here:

https://github.com/mozilla-b2g/gaia/blob/master/apps/clock/js/audio_manager.js#L167

Flipping to the "Firefox OS :: AudioChannel" component.
Component: Gaia::Clock → AudioChannel

Comment 11

3 years ago
This might be a design defect in AudioChannel:

when clock starts to alarm:

child process:
I/* JINGMEI * ==>(  812): mAudioChannelAgent->SetVisibilityState
I/* JINGMEI * ==>(  812): AudioChannelAgent::SetVisibilityState oldVisibility 1 mVisible 1
I/* JINGMEI * ==>(  812): AudioChannelAgent::StartPlaying mAudioChannelType 3 --->3 means alarm
main process:
I/* JINGMEI * ==>(  671): AudioChannelService::GetStateInternal aElementHidden 0
> in the current codes,we will play any visible audio channel,in >AudioChannelService::CheckTelephonyPolicy,for the alarm that is to ring,we return >AUDIO_CHANNEL_STATE_NORMAL:
> if (aChannel != AudioChannel::Telephony) {
>    return AUDIO_CHANNEL_STATE_NORMAL;
>  }
I/* JINGMEI * ==>(  671): AudioChannelService::CheckTelephonyPolicy aChannel 3
child process:
I/* JINGMEI * ==>(  812): AudioChannelServiceChild::GetState mChannel 3 state 0
I/* JINGMEI * ==>(  812): HTMLMediaElement::CanPlayChanged canPlay 0

Then alarm is begin to alert.

Comment 12

3 years ago
Hi Alastor,

For the "Audio Channel Competing",if we play alarm first then call is in,alarm is stopped.
But if the call comes first,then it comes alarm,as any visible audio channel will be played in codes,alarm will not mute,is that right?
Flags: needinfo?(alwu)

Comment 13

3 years ago
Hi Alastor,

Could we get a such workaround patch in gecko AudioChannel?

@@ -422,6 +436,11 @@ AudioChannelService::CheckTelephonyPolicy(AudioChannel aChannel,
 {
   // Only the latest childID is allowed to play with telephony channel.
   if (aChannel != AudioChannel::Telephony) {
+    if (!mTelephonyChildren.IsEmpty() && aChannel == AudioChannel::Alarm)
+    {
+      return AUDIO_CHANNEL_STATE_MUTED;
+    }
     return AUDIO_CHANNEL_STATE_NORMAL;
   }
Yes, I think you're right.
And I test your patch in the flame, it could works successful.
Flags: needinfo?(alwu)

Comment 15

3 years ago
(In reply to Alastor Wu [:alwu] from comment #14)
> Yes, I think you're right.
> And I test your patch in the flame, it could works successful.

Thank you~
If it is all right,I will land it in our locale and then remove it if your mozilla resolve it in master.

Updated

3 years ago
Blocks: 1123554
Comment hidden (spam)
blocking-b2g: 2.2? → ---
tracking-b2g: backlog → ---
ux-b2g: - → ---
You need to log in before you can comment on or make changes to this bug.