Closed Bug 959603 Opened 10 years ago Closed 6 years ago

poppit could tune ig.Sound.channels to improve memory usage

Categories

(Tech Evangelism Graveyard :: Preinstalled B2G Apps, defect, P4)

ARM
Gonk (Firefox OS)
defect

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: bkelly, Assigned: jmunck, NeedInfo)

References

Details

(Keywords: perf, Whiteboard: [c=memory p= s= u=][MemShrink:P2])

While investigating bug 957346 I discovered that a little more than half the 70MB memory in use by poppit was due to loading the game sounds.  In particular, impactjs loads each sound multiple times in order to allow them to be played simultaneously.  With the HTML5 audio element this results in duplicated decoded audio data and decoder library resources.

Currently impactjs loads each sound resource 4 times by default.  This can be tuned using the |ig.Sound.channels| property before calling |ig.main()|.  See the documentation here:

  http://impactjs.com/documentation/class-reference/sound#ig-sound-channels

From playing poppit, it seems unlikely that the game needs to a full 4 channels for each sound effect.  It would be nice if we could talk to the game developer about possibly tuning |ig.Sound.channels| to 2 or 3.  This would reduce the memory footprint of the game by around 10MB to 20MB which is quite significant.
Elisa, do you know who we could talk to about possibly tuning this value in poppit on fxos?  Thanks!
Flags: needinfo?(ehelton)
Elisa no longer works for Mozilla, so I'm redirecting this to Karen.
Flags: needinfo?(ehelton) → needinfo?(kward)
Blocks: b2g-poppit
Or even better, we should encourage the software vendor to try the git version of impactjs which has been re-written to use Web Audio for sounds.  I dropped in this version of the code into poppit and saw memory usage drop from ~70MB to ~40MB.
Whiteboard: [c= p= s= u=][memshrink] → [c=memory p= s= u=][memshrink]
adding Harald and Louis to cc.  Will one of you reach out to Poppit with this suggestion?
Flags: needinfo?(kward)
I'll get in touch with them. If the game worked just fine with the latest stable release that would be a swell upgrade path.
Assignee: nobody → hkirschner
(In reply to Harald Kirschner :digitarald from comment #5)
> I'll get in touch with them. If the game worked just fine with the latest
> stable release that would be a swell upgrade path.

The Web Audio implementation of impactjs is not quite released yet.  I've been told "in the next few weeks".  I believe it will be in impactjs 1.24 when it is available.  The game developer should also have access to the git repo which contains the implementation as well.
Whiteboard: [c=memory p= s= u=][memshrink] → [c=memory p= s= u=][MemShrink:P2]
Are there any updates regarding this bug?
Status: NEW → ASSIGNED
Julia, please review and provide a fix date.  Thank you
Assignee: hkirschner → jmunck
Flags: needinfo?(jmunck)
Julia - are there any updates regarding this bug?
Priority: -- → P4
Are there any updates regarding this bug?
Mass closing on Tech Evangelism::Preinstalled B2G App as Firefox OS is no longer a thing.
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
Mass closing on Tech Evangelism::Preinstalled B2G App as Firefox OS is no longer a thing.
Mass closing on Tech Evangelism::Preinstalled B2G App as Firefox OS is no longer a thing.
Product: Tech Evangelism → Tech Evangelism Graveyard
You need to log in before you can comment on or make changes to this bug.