Closed
Bug 1092346
Opened 10 years ago
Closed 10 years ago
At the end of a call the proper volume control channel is not restored in the dialer app
Categories
(Firefox OS Graveyard :: AudioChannel, defect)
Tracking
(firefox38 fixed)
RESOLVED
FIXED
2.2 S5 (6feb)
Tracking | Status | |
---|---|---|
firefox38 | --- | fixed |
People
(Reporter: gsvelto, Assigned: alwu)
References
Details
Attachments
(2 files, 2 obsolete files)
3.46 KB,
patch
|
Details | Diff | Splinter Review | |
1.93 KB,
patch
|
alwu
:
review+
|
Details | Diff | Splinter Review |
While working on bug 834530 we noticed a problem that prevented us from using the `notification' channel in the dialer as our UX specs mandated: once a call ended the volume control channel used by the dialer (notification) would be set but then quickly overridden by the volume control channel used by the system app.
The STR is the following:
1. Have the changes from bug 834530 applied
2. Apply the attached patch, it will ensure that the dialer uses the `notification' channel to play sounds and sets it as its volume control channel (note that you might need to reset gaia after applying the patch as it changes the dialer's permissions)
3. Launch the dialer and adjust the volume, the `notification' channel is being used
4. Start a call, wait for the callscreen to come up then end it
5. Once you're back in the dialer adjust the volume again, the `content' channel is now being used
I've spent some time digging into why this is happening and I've found that the issue is triggered by the AudioChannelManager in response to visibility events. When closing the callscreen the dialer becomes visible again, this triggers the visibilitychange handler here:
http://hg.mozilla.org/mozilla-central/file/675913ddbb55/dom/system/gonk/AudioChannelManager.cpp#l148
This in turn will send an IPC message that is passed via the ContentParent to the main process:
http://hg.mozilla.org/mozilla-central/file/0b9dd32d1e16/dom/ipc/ContentParent.cpp#l2372
... and sets the current default volume control channel to the one used by the dialer, the `notification' channel.
Once this has happened the same visibilitychange handler is triggered once again but this time in the main process (i.e. on behalf of the system app I suppose). Since we're in the main process this adjusts the default control channel directly and sets it to the `content' channel because the system app doesn't have a default set and thus is on the `unknown' channel and triggers this path:
http://hg.mozilla.org/mozilla-central/file/675913ddbb55/dom/system/gonk/AudioChannelManager.cpp#l138
Unfortunately I'm unsure if it's the AudioChannelManager that is at fault (and should ignore the second change) or if we're sending the visibility events in the wrong order; so for now I'm filing this in the AudioChannel component but it might as well be a Gaia::System::Window Mgmt issue.
Reporter | ||
Comment 1•10 years ago
|
||
This is something I've encountered when working on bug 834530. It prevents us from properly using the telephony channel for touch tones and might have other implications so I'd like to nominate it for 2.2. It's an issue of polish but it might be hiding some other underlying problems; see comment 0 for the detailed description and STR.
blocking-b2g: --- → 2.2?
Comment 2•10 years ago
|
||
Hi Gabriele,
If you use notification channel to playback the DTMF tone with plug-in the headset in the device, do you hear the sound from speaker?
In this case, the sound should go through the headset only.
BTW, what's the main problem right now?
When the call end, user try to adjust the volume but he adjust the "content" channel? Or else?
Flags: needinfo?(gsvelto)
Reporter | ||
Comment 3•10 years ago
|
||
(In reply to Randy Lin [:rlin] from comment #2)
> If you use notification channel to playback the DTMF tone with plug-in the
> headset in the device, do you hear the sound from speaker?
> In this case, the sound should go through the headset only.
Yes, that's not the issue here.
> BTW, what's the main problem right now?
> When the call end, user try to adjust the volume but he adjust the "content"
> channel? Or else?
The main problem is that if I set the dialer app to use the `notification' channel, make a call (which brings me to the callscreen), then go back to the dialer what I get is the `content' channel instead. Basically the channel being used in the dialer is not restored correctly after a call.
Flags: needinfo?(gsvelto)
Updated•10 years ago
|
Flags: needinfo?(alwu)
Assignee | ||
Comment 4•10 years ago
|
||
Hi, Gabriele,
I can't understand very well about why the dialer would become a 'content' channel after the call.
Do you mean that the system app change the audio channel type of dialer app?
Thanks!
Flags: needinfo?(alwu)
Reporter | ||
Comment 5•10 years ago
|
||
(In reply to Alastor Wu [:alwu] from comment #4)
> I can't understand very well about why the dialer would become a 'content'
> channel after the call.
> Do you mean that the system app change the audio channel type of dialer app?
Not directly. The channel is changed by the AudioChannelManager in response to visibility events; however visibility of the apps - and specifically of the callscreen - is set by the system app. So either the problem is with the AudioChannelManager that is not correctly interpreting the visibility status or with the system app that is not setting it correctly.
Assignee | ||
Updated•10 years ago
|
Assignee: nobody → alwu
Assignee | ||
Comment 6•10 years ago
|
||
[Root cause]
After the dialer change the default audio type, the system app also change it.
But the actual active app is the dialer app, we should avoid other apps to modify the default audio type.
[Solution]
Check the default window id to make sure the modification is allowed.
Assignee | ||
Comment 7•10 years ago
|
||
After pushing this patch to the try-server, the result seems ok.
Hi, Baku,
Could you help me review this patch?
Very appreciate :)
Attachment #8558453 -
Attachment is obsolete: true
Attachment #8558560 -
Flags: review?(amarchesini)
Comment 8•10 years ago
|
||
Comment on attachment 8558560 [details] [diff] [review]
Make default audio volume type consistent
Review of attachment 8558560 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/audiochannel/AudioChannelService.cpp
@@ +525,5 @@
> // If this child is in the background and mDefChannelChildID is set to
> // others then it means other child in the foreground already set it's
> // own default channel already.
> + if ((!aHidden && mDefChannelChildID != aChildID) ||
> + (mDefChannelChildID != aChildID &&
extra space.
@@ +526,5 @@
> // others then it means other child in the foreground already set it's
> // own default channel already.
> + if ((!aHidden && mDefChannelChildID != aChildID) ||
> + (mDefChannelChildID != aChildID &&
> + mDefChannelChildID != CONTENT_PROCESS_ID_UNKNOWN)) {
indent 1 space more this line.
Attachment #8558560 -
Flags: review?(amarchesini) → review+
Reporter | ||
Comment 9•10 years ago
|
||
I'll give this a spin ASAP with both the regular and emergency dialer and report. BTW if the fix was so easy then I wholeheartedly suggest that we uplift it to 2.2. We might even go as far as uplifting to 2.1 so we'd have consistent audio channels there too.
Assignee | ||
Comment 10•10 years ago
|
||
Attachment #8558560 -
Attachment is obsolete: true
Attachment #8558872 -
Flags: review+
Assignee | ||
Comment 11•10 years ago
|
||
Hi, Gabriele,
The code of this function is the same as previous versions, so I think it could be uplifted easily.
Assignee | ||
Comment 12•10 years ago
|
||
Try-server result.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=a4eaf0055277
Keywords: checkin-needed
Comment 13•10 years ago
|
||
Keywords: checkin-needed
Reporter | ||
Updated•10 years ago
|
Status: NEW → ASSIGNED
Comment 14•10 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
status-firefox38:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 2.2 S5 (6feb)
Updated•10 years ago
|
blocking-b2g: 2.2? → ---
Reporter | ||
Comment 15•10 years ago
|
||
Alastor, I'm experiencing a regression that I hadn't noticed before. If I open the SMS app, or the e-mail app both of which set the 'notification' default volume control channel I get instead the 'content' one. Reverting your patch fixes the problem. Could you have a look?
Flags: needinfo?(alwu)
Assignee | ||
Comment 16•10 years ago
|
||
No problem, I will check it!
Keep ni for tracking.
Assignee | ||
Comment 17•10 years ago
|
||
The previous patches could fix this bug, but it's not a good solution.
I would file another bug to handle the issue. The new patch could both solve the issue of this bug and the regression errors of Comment15.
See Bug 1133449.
Status: RESOLVED → REOPENED
Flags: needinfo?(alwu)
Resolution: FIXED → ---
Assignee | ||
Comment 18•10 years ago
|
||
Sorry for error changing the bug state.
Status: REOPENED → RESOLVED
Closed: 10 years ago → 10 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•