Skip to content
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

Switching between tabs makes Strudel unresponsive #108

Closed
Bubobubobubobubo opened this issue May 4, 2022 · 1 comment · Fixed by #123
Closed

Switching between tabs makes Strudel unresponsive #108

Bubobubobubobubo opened this issue May 4, 2022 · 1 comment · Fixed by #123
Labels
bug Something isn't working

Comments

@Bubobubobubobubo
Copy link
Contributor

The bug was found using Google Chrome (latest version) on a MacBook Pro 13" (latest OS). In order to reproduce it, open Strudel in one tab and two or three other random tabs (like the ToneJS API doc and a few google queries). Switch from Strudel to documentation while running a moderately complex / dense pattern. After switching back by alt-tabbing, Strudel REPL stops rendering sound and appears to be loading for an undefinite time. It can sometimes resume its course or, in other cases, crash.

Browser plugins: Vimium, Dark Reader, uBlock Origin.
Chrome version: 101.0.4951.54
MacOS version: 12.2.1 (21D62)

I don't know a lot about web browsers but I wonder if this could be linked to a browser extension altering Strudel behavior somehow. It could also be because my patterns were making extensive use of ToneJS, but nothing fancy really (monosynth with custom parameters).

Happy to help to investigate this issue by running tests or by looking at page performance :).

@felixroos felixroos added the bug Something isn't working label May 4, 2022
@felixroos
Copy link
Collaborator

This could happen due to requestAnimationFrame being halted when the tab is in the background, causing the lastFrame time to stick at that moment in time. When the Strudel tab is refocused, the animation loop will continue, causing the next frame to query from the sticky lastFrame time to the (much later) current time, resulting in a expensive query + an expensive paint for larger spans. So at some time of inactivity, it will freeze the page. I will try to confirm this hypothesis later

felixroos added a commit that referenced this issue Jun 1, 2022
@felixroos felixroos mentioned this issue Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants