avm1: Remove playback queue from Sound - #24176
Draft
ChrisCPI wants to merge 1 commit into
Draft
Conversation
ChrisCPI
force-pushed
the
avm1-remove-sound-queue
branch
2 times, most recently
from
July 10, 2026 19:41
29b7167 to
2ba7dad
Compare
The inclusion of this feature was a misinterpretation of how loaded sounds behave on the desktop Flash Player projector. It actually loads sounds synchronously, meaning that anything immediately after `loadSound()` (such as `start()`) would work, giving the illusion that a queue exists.
ChrisCPI
force-pushed
the
avm1-remove-sound-queue
branch
from
July 10, 2026 19:50
2ba7dad to
22216e0
Compare
kjarosh
reviewed
Jul 11, 2026
| num_ticks = 100 | ||
| # The FP projector loads local MP3s synchronously, which means | ||
| # that any start() calls immediately following loadSound() | ||
| # do succeed. This does not happen in a Flash browser. |
Member
There was a problem hiding this comment.
If that does happen in flashplayer when loading remote resources, we should implement this behavior as well. Running SWFs in standalone FP was also the thing in the past.
Collaborator
Author
There was a problem hiding this comment.
when loading remote resources
Do you mean when loading local files? AFAIK with these changes, Ruffle should be matching FP when it comes to loading remote files.
Also, I'm open to ideas on how the synchronous behavior could be replicated, since that would seem tricky to do.
kjarosh
reviewed
Jul 11, 2026
| import os | ||
| from http.server import HTTPServer, BaseHTTPRequestHandler | ||
|
|
||
| class MyHandler(BaseHTTPRequestHandler): |
Member
There was a problem hiding this comment.
Is there anything special in this server that prevents us from just using python -m http.server?
ChrisCPI
marked this pull request as draft
July 16, 2026 16:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Undoes most of #21163. The inclusion of this feature was a misinterpretation of how loaded sounds behave on the desktop Flash Player projector. It actually loads sounds synchronously, meaning that anything immediately after
loadSound()(such asstart()) would work, giving the illusion that a queue exists.However, remote files (a test for which has been added) do not load synchronously, and plays do not appear to be queued in that case. In addition, local files do not load synchronously when running the SWF in a Flash browser.
Note that this was manually undone since changes were made to
Soundsince that PR, so it's possible there's a mistake, though I'm pretty sure there isn't.Testing
avm1/sound_load_start_remotefile to test loading remote MP3s.avm1/sound_load_starttest has been marked as a known failure, and has also been modified to include traces for whenonLoadis fired, to demonstrate how it is fired right after callingloadSound().avm1/sound_multiple_loadtest has been marked as a known failure.I'm still a bit confused as to what is expected of the tests in this scenario, so let me know if anything else needs done.
Checklist
server.pyin the added test)