playcanvas / playcanvas/engine

Sound Listener ignores the autoRender property

Open
#7,406 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

I was looking at why we keep losing frame time in our app when the application is paused from rendering (hidden from view). We pause it using app.autoRender = false. However it looks like Sound Listener is ignoring the property, because its update is triggered before that, when application.update(dt) is called:

https://github.com/playcanvas/engine/blob/bf80c95bfaec10d5202f8fc5d91f772ae4c3fab8/src/framework/app-base.js#L2066-L2071

Image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/framework/app-base.js at the application.update(dt) call around lines 2066-2071, then trace where the Sound Listener update is triggered. Check how app.autoRender is expected to affect updates while rendering is paused. Done means the Sound Listener no longer consumes frame time when autoRender is false, while normal updates continue when rendering is enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
audio-video-rtc
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.