Closed Bug 1183870 Opened 9 years ago Closed 9 years ago

[B2G] Set current audio channel to "none" when there is no any audio playing

Categories

(Firefox OS Graveyard :: Gaia::System::Audio Mgmt, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:2.5+, b2g-v2.2 unaffected, b2g-master verified)

VERIFIED FIXED
FxOS-S5 (21Aug)
blocking-b2g 2.5+
Tracking Status
b2g-v2.2 --- unaffected
b2g-master --- verified

People

(Reporter: onelson, Assigned: evanxd)

References

()

Details

(Keywords: regression, Whiteboard: [2.5-Daily-Testing], [Spark])

Attachments

(4 files)

Description:
When the user navigates to the browser to search 'www.youtube.com', they may experience the phone demonstrating unintended effects when attempting to adjust volume buttons via the phone's hardware buttons. On tapping the volume button on a website (such as youtube), the user may observe observe that the buttons will adjust the 'ringtone' volume/audiochanel as opposed to the 'media' volume which is either actively being used, or has the potential to be seen shortly.
Could be involved with adjusting ringtone volume prior to entering browser.

Repro Steps:
1) Update the device to []
2) Open the browser app
3) Navigate to 'www.youtube.com'
4) Select the video 'Shake it Off by Taylor Swift' on the front page [or anything]
5) Adjust the volume via hardware buttons; observe volume drop down adjusting
6) Tap video play to start
7) Repeat step 5

Actual:
Adjusting volume via hardware buttons in browser adjusts the ringtone volume

Expected:
Adjusting volume via hardware buttons in browser adjusts the media volume


Environment Variables:
---------------------------

Device: Aries 2.5
BuildID: 20150714110444
Gaia: 66638d0e65bf58b7f640bcc7bed4a0b23d1356c6
Gecko: e786406bc683
Gonk: 2916e2368074b5383c80bf5a0fba3fc83ba310bd
Version: 42.0a1 (2.5) 
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:42.0) Gecko/42.0 Firefox/42.0

Device: Flame 2.5
BuildID: 20150714010206
Gaia: 7676b68b4d32ed13243eeb719188847121bd5611
Gecko: 0931671a14ef
Gonk: a4f6f31d1fe213ac935ca8ede7d05e47324101a4
Version: 42.0a1 (2.5) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:42.0) Gecko/42.0 Firefox/42.0
****************************

Issue DOES NOT REPRODUCE on 2.2 for flame devices
Results: Adjusting volume via hardware buttons in browser adjusts the media volume
Device: Flame 2.2
BuildID: 20150714002501
Gaia: 84d0c76370dcd3d25813b00de55194730884355b
Gecko: a5db6d9850f6
Gonk: bd9cb3af2a0354577a6903917bc826489050b40d
Version: 37.0 (2.2) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:37.0) Gecko/37.0 Firefox/37.0
--------------------------

Repro Rate: 5/10

Attachments:
video- https://youtu.be/mJDIYKTehmQ
logcat
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(pbylenga)
Assignee: nobody → alwu
[Blocking Requested - why for this release]:
Functional regression of a core feature.

Requesting a window.
blocking-b2g: --- → 2.5?
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(pbylenga)
I was unable to reproduce this issue on the latest or the reporters build.  Leaving the tags for someone else to attempt.

Environmental Variables:
Device: Flame 2.5
BuildID: 20150715195729
Gaia: 981c61cdeb527fac8f8383c110df0e749eff67ea
Gecko: 72835344333f
Version: 42.0a1 (2.5) 
Firmware Version: v18D-1
User Agent: Mozilla/5.0 (Mobile; rv:42.0) Gecko/42.0 Firefox/42.0
Flags: needinfo?(ktucker)
Flags: needinfo?(ktucker)
Adding more consistent steps to reproduce.

Repro Steps:
1) Update an Aries to 20150716033647
2) Go to Settings > Sound
3) Adjust either the Ringtones & Notifications slider, or the Alarm volume slider.
4) Open the Browser, go to youtube, and play a video.
5) Adjust volume with the hardware buttons.


Actual:
Volume is adjusted for the audio channel from step 3.


Expected:
Volume is adjusted for the Media channel.


Environmental Variables:
Device: Aries 2.5
BuildID: 20150716033647
Gaia: 981c61cdeb527fac8f8383c110df0e749eff67ea
Gecko: 72835344333f
Gonk: 2916e2368074b5383c80bf5a0fba3fc83ba310bd
Version: 42.0a1 (2.5) 
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:42.0) Gecko/42.0 Firefox/42.0
Assignee: alwu → evanxd
It seems that we forgot to change the current audio channel when the audio playback end, so the sound manager would send the wrong sound type event.

Evan would take this bug.
Component: AudioChannel → Gaia::System::Audio Mgmt
The attachment 8635177 [details] [review] is a WIP patch.
Blocks: 1179689
Blocks: 1183366
No longer blocks: 1183366
Blocks: 1183710
Comment on attachment 8635177 [details] [review]
[gaia] evanxd:bug-1183870 > mozilla-b2g:master

Hi Dominic,

Could you help to review the patch?

Thanks.
Attachment #8635177 - Flags: review?(dominic.kuo)
Removing regression window wanted since there is already a patch. Adding qa wanted to test this again once it lands.
Comment on attachment 8635177 [details] [review]
[gaia] evanxd:bug-1183870 > mozilla-b2g:master

Assuming I understand correctly, the audio channel service did not fire events when some audio channel ends, then caused this issue. This patch fires `audiochannelchanged` on both some audio channel starts or ends, so the patch looks good to me.
Attachment #8635177 - Flags: review?(dominic.kuo) → review+
Dominic, thanks for the review.
master: https://github.com/mozilla-b2g/gaia/commit/b79d2a4c233d1e92790062219ebb7772965e1d56
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Sorry had to revert this change since this caused Gij4 Test failures like https://treeherder.mozilla.org/logviewer.html#?job_id=2346707&repo=b2g-inbound
Status: RESOLVED → REOPENED
Flags: needinfo?(evanxd)
Resolution: FIXED → ---
Hi Carsten,

The Gij4 was good when I landed the code. See it[1].

But let me try again.

[1]: https://treeherder.mozilla.org/#/jobs?repo=gaia&revision=be3ce1d608274d79ad51998dbfc758c43549cbd3
Flags: needinfo?(evanxd)
If the treeherder[1] is without any failure, let's land the code.

[1]: https://treeherder.mozilla.org/#/jobs?repo=gaia&revision=bbce8a360b2391686c3244e19d29025e4ffbedaa
Summary: [Browser][AudioChannel] While on 'www.youtube.com', adjusting volume buttons may manipulate 'Ringtone' volume levels instead of 'Media' → [B2G] Send the "none" event when there is no any audio playing
Summary: [B2G] Send the "none" event when there is no any audio playing → [B2G] Set current audio channel to "none" when there is no any audio playing
Cannot run the failed test in local. It's very hard to debug. Will try run it in local again later.
Sad, the test is passed in local. Need to debug this on CI server.
Very weird, the play button on status bar is just disappeared.
Finally, I found the root cause. Looks like it is about gecko.

There are two issues here:
1. The music for `Check the play icon is in the status bar. moztrap:9742` test cannot be played in the runtime.
2. When the test does going homescreen, the state of the music just becomes `inactive`. And audio channel service will do `this.publish('audiochannelchanged', { channel: 'none' });`. So the play button in status bar is hidden.

The above second issue is why the test cannot be passed. Let's file a bug for the gecko issues. And the bug blocks this bug.
The test will be passed after bug 1191207 is fixed. The we can land the code to fix this bug.
Depends on: 1191207
Blocks: 1130350
Triage: +'ing for regression.
blocking-b2g: 2.5? → 2.5+
Hi, Evan,
Because the bug1195191 was fixed, you can try the test again.
Flags: needinfo?(evan)
Nice, all treeherder tasks are passed[1]. Let's land the code.

[1]: https://treeherder.mozilla.org/#/jobs?repo=gaia&revision=b4ee2788a2bd04826626fe022c9a949c7fcf4c2d
master: https://github.com/mozilla-b2g/gaia/commit/7103dcfbdbbb2514b735e301f9deb7daf56af23e
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Resolution: --- → FIXED
Strangely if I run the following integration test: 

TEST_FILES=apps/music/test/marionette/Player_test.js make test-integration

It fails on the "Status bar" test which involve the playing indicator in the system tray / status bar.
And git bisect pointed to that patch.
Nevermind. It seems that removing the b2g runtime and letting the test suite redownload it eliminated the problem. Also gaia-try is clear with it too. False alarm.
Hubert, no problem.
Target Milestone: --- → FxOS-S5 (21Aug)
The original bug (using STR at comment 3) has been verified fixed on Flame and Aries.

I've also verified the duplicates: bug 1183366, bug 1186338, bug 1186533, bug 1187261, and bug 1195191 are all verified as fixed.

Unable to verify the depends on bug 1191207 because I'm not sure how to run the test at bug 1191207 comment 1. I tried and it wanted me to "Get rid of references to gaia-node-modules stuff" and also install something which I'm unsure about.

Still setting bug as verified because I think this bug and all the duplicated bugs covered most of the bases for this regression.

Verified on:
Device: Aries 2.5
BuildID: 20150826051728
Gaia: c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c
Gecko: f61c3cc0eb8b7533818e7379ccc063b611015d9d
Gonk: 2916e2368074b5383c80bf5a0fba3fc83ba310bd
Version: 43.0a1 (2.5) 
Firmware Version: D5803_23.1.A.1.28_NCB.ftf
User Agent: Mozilla/5.0 (Mobile; rv:43.0) Gecko/43.0 Firefox/43.0

Device: Flame 2.5
BuildID: 20150826030209
Gaia: c1ae9f02f2a9cfb89bf67aeea97e467c41c3362c
Gecko: f61c3cc0eb8b7533818e7379ccc063b611015d9d
Gonk: c4779d6da0f85894b1f78f0351b43f2949e8decd
Version: 43.0a1 (2.5) 
Firmware Version: v18Dv4
User Agent: Mozilla/5.0 (Mobile; rv:43.0) Gecko/43.0 Firefox/43.0
Status: RESOLVED → VERIFIED
QA Whiteboard: [QAnalyst-Triage?]
Flags: needinfo?(jmercado)
Keywords: qawanted
Flags: needinfo?(jmercado)
There is one case we forgot to handle. The issue still can be reproduced.
If the we turn off the iframe which have playing audio, we would not send the "audiochannelchanged".

STR.
1. Play music from music app
2. Long press home button
3. Swipe off the music app (Turn off)

Expected.
4. No playing icon & the volume control type should be "notification"

Actual.
4. Have playing icon & the volume control type is "media"
Status: VERIFIED → REOPENED
Flags: needinfo?(evan)
Resolution: FIXED → ---
Alastor,

Let's fix the issue(Comment 42) in a new Bug(Bug 1199605).

Thanks.
Status: REOPENED → RESOLVED
Closed: 9 years ago9 years ago
Flags: needinfo?(evan)
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: