-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firefox Sound Observations 🔥 🦊 🔉 🔍 #9
Comments
Looking at the firefox performance recording it shows "WebRender display list" as the function taking up the vast majority of the frame time: Expanding that more gives us: So it looks like it might not be the game code at all, but actually the painting as done by firefox that is taking forever. Ah, here's another view that shows that the firefox "WebRender display list" is taking as long to run as the whole of the game code put together for that frame! So maybe this is just a firefox rendering problem. 🤷♂️ |
Do you think Bevy getting better at rendering would also help for web builds? Would most improvements be in |
I don't know if it's actually Bevy's fault, it might be Firefox's fault. In the screenshot above, The stack of functions on the left shows how long Bevy took to render the frame, but the stack of functions on the right shows that Firefox is taking just as long just to display the frame that is already rendered! So making Bevy render faster might not help because Firefox is still spending way too much time getting the rendered frame to the screen. That is just my interpretation and I could be wrong. I couldn't figure out where to report this to Firefox so that we might figure out if it's their problem or our problem. Also, I am using my own custom renderer, not
If you were to do any improvements it would probably be in |
Have you tried disabling privacy.resistFingerprinting in about:config ? I heard somewhere that it massively improves canvas performance. |
Isn't this simply Firefox reducing framerate on non-focused canvas, like it does for other "background" elements (other non-active tabs, notably)? Sound is choppy for me until I give focus by clicking on the canvas, and then immediately becomes normal. If so there's nothing we can do about that, it's by design. So work around by not trying to play audio until getting keyboard focus. |
In my game, I still have audio problems, even when I click on the canvas, so I'm not sure. 🤷♂️ |
It may be both at the same time, reduced framerate before first focus, and later game is more demanding so general perf issue? |
I am pretty sure it is just general performance issue, actually, so we might as well close this I think. I'm not sure why the Firefox canvas performance is so bad, but it's not actually the sound causing the problem. |
I saw the note in the readme about sound playback issues in Firefox and I just wanted to share my experiencewith my own Bevy Kira plugin on web ( I'm not using this plugin, but I am using Kira ).
I also had audio issues on Firefox, but I noticed that Firefox is also using almost 100% of one of my CPU cores. If I resize the browser window so that it is much smaller, though, the CPU usage goes down and the sound playback works nicely. That seems to indicate that the issue isn't actually with the sound playback itself, but how much CPU usage the Bevy game is using on Firefox. It seems that Bevy takes much more CPU on firefox than it does on Chrome.
I'm not sure exactly what causes the CPU usage difference, but at least I think that gives us somewhere to look. If resizing the screen changes the CPU usage, then it is probably rendering. Maybe firefox's rendering is just slower than chrome's.
I'm using a custom renderer, too, so my experience may not be the best benchmark, but that's what I know for what it's worth.
The text was updated successfully, but these errors were encountered: