Open
Bug 1427937
Opened 7 years ago
Updated 2 days ago
audio context should release its wakelock when it's non-audible
Categories
(Core :: Web Audio, enhancement, P2)
Tracking
()
NEW
Tracking | Status | |
---|---|---|
firefox68 | --- | affected |
People
(Reporter: alwu, Unassigned)
References
(Blocks 1 open bug, )
Details
(Whiteboard: [geckoview:fenix:p3])
The report from google app team shows that sometime the audio wakelock doesn't be unlocked correctly, and it would cause a power waste.
> org.mozilla.firefox : AudioMix, with partial_wakelock_time 2h47m5.954s
The partial_wakelock is created from here
https://searchfox.org/mozilla-central/rev/b24e6342d744c5a83fab5c15972e11eeb69d68e6/mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoAppShell.java#560
Updated•7 years ago
|
Summary: Sometime audio wakelock doesn't be unlocked correctly → Sometime audio wakelock is not unlocked correctly
Reporter | ||
Comment 1•7 years ago
|
||
After some investigation, I found that 'AudioMix' wakelock is not called by firefox directly, the topics we use for audio/video are 'audio-playing' or 'video-playing'. Not sure where is the 'AudioMix' from.
Ex. (using firefox to play music) $dumpsys power
Wake Locks: size=2
PARTIAL_WAKE_LOCK 'AudioMix' ACQ=-1m30s662ms LONG (uid=1041 ws=WorkSource{10128})
PARTIAL_WAKE_LOCK 'audio-playing' ACQ=-1m30s649ms LONG (uid=10128 pid=20982)
Updated•7 years ago
|
Priority: -- → P1
Reporter | ||
Comment 2•7 years ago
|
||
This issue is caused by web audio.
When you create an AudioContext, the AudioMix wakelock would exist until it's destroyed.
What I guess is that AudioStream continuely input silent data to audio hardware so that audio server would always keep its wakelock.
---
STR.
1. goto https://alastor0325.github.io/htmltests/non_mse_tests/webaudio_silent.html
2. put the tab on background
3. $ adb shell dumpsys power
4. then you would see the 'AudioMix' wakelock exists until the tab is destoryed
Reporter | ||
Updated•7 years ago
|
Summary: Sometime audio wakelock is not unlocked correctly → audio context should release its wakelock when it's non-audible
Reporter | ||
Updated•7 years ago
|
Component: Audio/Video → Web Audio
Product: Firefox for Android → Core
Reporter | ||
Comment 3•7 years ago
|
||
Hi, Paul,
Since we use an audio driver for AudioContext, the cubeb stream would cause audio backends to request wake lock even web audio's non-audible. (both OSX and Android would do so)
The rough solution might be changing back to system clock driver once we detect the web audio is continuely outputing silent data over a specific time.
Do you have any idea for this issue?
Thanks!
Flags: needinfo?(padenot)
Comment 4•7 years ago
|
||
This is a feature, not a bug.
Application authors that wish to save battery power can call `suspend` or even `close` on the `AudioContext`.
What is this google app report?
Flags: needinfo?(padenot)
Reporter | ||
Comment 5•7 years ago
|
||
(In reply to Paul Adenot (:padenot) from comment #4)
> This is a feature, not a bug.
>
> Application authors that wish to save battery power can call `suspend` or
> even `close` on the `AudioContext`.
>
> What is this google app report?
I would ask them for more details.
BTW, Is this feature defined by spec? or just our feature?
Thanks.
Comment 6•7 years ago
|
||
(In reply to Alastor Wu [:alwu][please needinfo me][GMT+8] from comment #5)
> I would ask them for more details.
> BTW, Is this feature defined by spec? or just our feature?
This is in the Web Audio API specification [0].
[0]: https://webaudio.github.io/web-audio-api/
Reporter | ||
Updated•7 years ago
|
Assignee: alastor0325 → nobody
Updated•7 years ago
|
Assignee: nobody → padenot
Updated•7 years ago
|
Rank: 15
Priority: P1 → P2
Updated•7 years ago
|
Assignee: padenot → nobody
Updated•6 years ago
|
Whiteboard: [geckoview]
Updated•6 years ago
|
status-firefox68:
--- → affected
OS: Unspecified → Android
Whiteboard: [geckoview] → [geckoview:fenix:p2]
Updated•5 years ago
|
Type: defect → enhancement
Whiteboard: [geckoview:fenix:p2] → [geckoview:fenix:p3]
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•