fix: cancel requestAnimationFrame loops in Tuner and Oscilloscope#5160
fix: cancel requestAnimationFrame loops in Tuner and Oscilloscope#5160manvirsingh01 wants to merge 5 commits intosugarlabs:masterfrom
Conversation
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@manvirsingh01 thanks for the PR And project maintainers either walterbender sir , om santhosh sir will review your PR by completing checks soon . And I just want to mention you that their is also need of working with sampler .. which also be helpful in optimization of background process. |
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@walterbender Changes:
Verification: All 88 test suites pass (2275 tests) |
|
Working much better now. But please rebase to address the conflict in activity.js |
4d53ef7 to
ee8b87e
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
1 similar comment
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@walterbender Thanks for the feedback! I've rebased the branch and resolved the merge conflict in activity.js. Ready for another look when you have time! @walterbender |
|
✅ All Jest tests passed! This PR is ready to merge. |
65c172b to
2fbb256
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@walterbender @Chaitu7032 can you approve my work |
|
@manvirsingh01 I truly appreciate the effort you’ve put in . Your work is on track for approval soon. In the meantime, I encourage you to explore further opportunities where you can contribute meaningfully and with confidence. |
Fixes Issue sugarlabs#5145 - Tuner, Oscilloscope & Sampler continue running requestAnimationFrame loops after being stopped, causing CPU and battery drain. Changes: - synthutils.js: Added tunerAnimationId and tunerRunning flag to properly track and cancel the animation frame loop in stopTuner() - oscilloscope.js: Added isRunning flag to stop animation loop when widget is closed, preventing CPU usage from orphaned animation frames The sampler.js pitch detection already had proper cleanup implemented via stopPitchDetection() which cancels the animation frame correctly. Closes sugarlabs#5145
- Added window.TunerUtils and window.TunerDisplay in tuner.js for browser access - Added widgets/tuner to MUSICBLOCKS_EXTRAS in activity.js before widgets/sampler - Fixes 'TunerUtils is not defined' error in sampler widget
2fbb256 to
fb08fb2
Compare
|
✅ All Jest tests passed! This PR is ready to merge. |
|
I don't understand the changes you made to activity.js |
Sir, I have not seen any test error in my local system.so i make the empty commit to get fresh log . Can you help me with that? |
|
✅ All Jest tests passed! This PR is ready to merge. |
|
@walterbender I’ve updated the Prettier version to 2.8. |
|
I don't understand. What does makeNewNote have to do with the issue you are addressing? It seems unrelated. |

Fixes Issue #5145 - Tuner, Oscilloscope & Sampler continue running requestAnimationFrame loops after being stopped, causing CPU and battery drain.
Changes:
The sampler.js pitch detection already had proper cleanup implemented via stopPitchDetection() which cancels the animation frame correctly.
@Chaitu7032 @walterbender please my request
Closes #5145