don't use Moz Audio API in the Gaia TonePlayer (dialer and system/emergency-call)

RESOLVED FIXED in 1.3 Sprint 4 - 11/8

Status

Firefox OS
Gaia::Dialer
RESOLVED FIXED
4 years ago
3 years ago

People

(Reporter: gal, Assigned: kinetik)

Tracking

unspecified
1.3 Sprint 4 - 11/8
x86
Mac OS X
Dependency tree / graph

Firefox Tracking Flags

(blocking-b2g:1.3+)

Details

Attachments

(1 attachment, 2 obsolete attachments)

fix
46 bytes, text/x-github-pull-request
kinetik
: review+
Details | Review | Splinter Review
(Reporter)

Description

4 years ago
The Moz Audio API is deprecated and we should use Web Audio instead. We are about to drop Moz Audio API so we should replace this for 1.3.

apps/communications/dialer/js/keypad.js:    this._audio.mozSetup(1, this._sampleRate);
apps/system/emergency-call/js/keypad.js:   this._audio.mozSetup(2, this._sampleRate);
(Reporter)

Updated

4 years ago
blocking-b2g: --- → 1.3+
Blocks: 927245
Summary: don't use Moz Audio API → don't use Moz Audio API in the Gaia TonePlayer (dialer and system/emergency-call)
An old WIP patch can be found here: https://github.com/etiennesegonzac/gaia/compare/web-audio-tone-player
(Assignee)

Comment 2

4 years ago
Created attachment 821455 [details] [diff] [review]
bug927852_v0.patch

Something like this?  Tested locally on desktop, not on actual phone hardware.
Attachment #821455 - Flags: feedback?(etienne)
Assignee: nobody → etienne
Target Milestone: --- → 1.3 Sprint 4 - 11/8
(In reply to Matthew Gregan [:kinetik] from comment #2)
> Created attachment 821455 [details] [diff] [review]
> bug927852_v0.patch
> 
> Something like this?

Well yes, something *exactly* like this :)
Taking the liberty to assign this to you since it's pretty much done here.
Assignee: etienne → kinetik
Comment on attachment 821455 [details] [diff] [review]
bug927852_v0.patch

* bug 922569 should introduce some unit-test coverage for the TonePlayer, which would help with adding some here
* it's probably a good time to put the TonePlayer in shared/ and have a little bit less duplication between the dialer and the system app

But those 2 things could be filed as follow up bug, depends on how much time you have :)
Attachment #821455 - Flags: feedback?(etienne) → feedback+
(Assignee)

Comment 5

4 years ago
Thanks Etienne, I've put a pull request up: https://github.com/mozilla-b2g/gaia/pull/13245

I don't have much time to spend on this (just want to kill the old audio API as soon as possible), so I'll leave your excellent suggestions for a followup bug.
(Assignee)

Comment 6

4 years ago
Created attachment 824973 [details] [review]
fix
Attachment #821455 - Attachment is obsolete: true
Attachment #824973 - Flags: review?(etienne)
Follow up bug 933278 is open for the unit-tests.
Comment on attachment 824973 [details] [review]
fix

r=me with a small nit:

the kShortPressDuration is 0.25 in the emergency call keypad, and 0.3 in the dialer.

We should probably use the same value in both places (I like the result better with 0.25 fwiw).
Attachment #824973 - Flags: review?(etienne) → review+
(Assignee)

Comment 9

4 years ago
(In reply to Etienne Segonzac (:etienne) from comment #8)
> the kShortPressDuration is 0.25 in the emergency call keypad, and 0.3 in the
> dialer.
> 
> We should probably use the same value in both places (I like the result
> better with 0.25 fwiw).

That's what the original code had, so I kept it, but it makes sense to standardize on something.  I pushed a small followup that uses 0.25 everywhere.

I think this is ready to be merged now.  Since the pull request is already active, is there anything else I need to do?
(Assignee)

Updated

4 years ago
Attachment #824973 - Attachment is patch: false
Attachment #824973 - Attachment mime type: text/plain → text/x-github-pull-request
(In reply to Matthew Gregan [:kinetik] from comment #9)
> I think this is ready to be merged now.  Since the pull request is already
> active, is there anything else I need to do?

Can you squash the commits into one? Thanks, then it's ready to merge.
(Assignee)

Comment 11

4 years ago
(In reply to Etienne Segonzac (:etienne) from comment #10)
> Can you squash the commits into one? Thanks, then it's ready to merge.

Thanks, done!
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
Is there an updated pull request? I don't see a merge option on that one.
(Assignee)

Comment 13

4 years ago
Comment on attachment 824973 [details] [review]
fix

Weird, maybe it's because I did a fixup + rebase and pushed?  Or because Travis-CI is horked?  It updated the pull request with the correct commits...

Anyway, I closed that and opened a new one: https://github.com/mozilla-b2g/gaia/pull/13450
Attachment #824973 - Attachment is obsolete: true
(Assignee)

Comment 14

4 years ago
Created attachment 828362 [details] [review]
fix
Attachment #828362 - Flags: review+
(Assignee)

Comment 15

4 years ago
FYI, I landed the patch to disable the Audio Data API (bug 927245) on mozilla-inbound just now, so you'll need to merge this to have a working dialer.
https://github.com/mozilla-b2g/gaia/commit/add12c96c3e9281baa7f483f7ba751ce63df5749
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
(Assignee)

Comment 17

4 years ago
Thanks!
Keywords: checkin-needed
Depends on: 942751
Depends on: 943138

Updated

3 years ago
Depends on: 961986

Updated

3 years ago
Depends on: 963220
You need to log in before you can comment on or make changes to this bug.