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
User reported issue: Encoding Error: Decoding Failed #151
Comments
System report (from a working sim, Capacitor Lab):
|
@arouinfar and I noticed that the error trace looks related to audio. @jbphet can you take a look? Should we request the client try other sims with sound? We aren't sure if some sims have synthesized sound vs sound clips, so we aren't sure where to go. |
@samreid said:
This problem is definitely related to audio. The failure is occurring when the sim tries to decode the base64-encoded data that represents a pre-recorded sound clip, but unfortunately the information above gives us little insight into why this is happening. I dug into the first failure a bit based on the line number information in the screenshot above, and I'm reasonably confident that it's occurring during the loading of By design, the sound files try to create a stubbed, blank audio buffer if the decode fails, but it appears that this error-handling path is not working, which is the source of the error message in the trace that says,
So, we basically have a double failure on our hands: The audio fails to decode on the user's system, and the error recovery path causes an exception. I'm not sure whether this error recovery path was always broken (which would be rather lame on my part) or if something has changed in the Web Audio spec. I tried changing the code in the error path to create a 1-frame sound instead of a 0-frame sound, and the DOM exception stopped happening, so this is a promising improvement. Also, there is a message at the end of the user's trace that says We may be able to fix the problem and make sims run successfully when audio decoding fails by implementing one or both of the items described above, but it would help to have a bit more information before putting any more time into this. Here are some requests: @oliver-phet - Can you please thank the user who reported this for doing so, let them know that it is a problem related to decoding sound files that are used in the sim, and ask them the following questions:
@KatieWoe - Do we have a Mac with the OS version that the user lists above? Below is a patch of the changes that might resolve this issue. Note that if we do this, we'll have to maintenance release pretty much every sim released since we started doing sounds in these
|
We do have MacOS 10.15.7. |
@jbphet should this be moved to another repo? |
@jbphet reply from user:
Have checked my Macbook air sound settings and all seems normal. using internal mc & speakers & they’re working during Zoom sessions and for youtube, music & sound clip playback
resistance sim visuals & sliders work fine there is no sound (even with the sound speaker unchecked)
Yup.. i’d defo be up for trying a modified version of the sim on my machine… ON: The user also found an older version (1.1.5) that doesn't exhibit the issue. Would it be helpful for you to have the user identify the exact version this problem was introduced? |
@jbphet reviewed this problem today: CM: Will this affect RC's from, say, yesterday? |
I reproduced this on our test device in Safari, but not in Chrome. I tested it on MacOS 11 running Safari 14 and didn't see it. I'm updating it now to Safari 15 (the 10.15 device was already on Safari 15). If it is introduced then, that may help us further. |
It did not happen on MacOS 11 Safari 15 |
@oliver-phet said:
Sure, if they are willing to do that, it would be very helpful. |
Sounds like this issue was introduced in 1.2.0. |
Sound was introduced in the 1.2 version, as were several other features and model improvements. Settling for the 1.1 version is a step down in functionality, but certainly better than nothing at all. |
This problem has now appeared in RC testing for Fourier, see phetsims/fourier-making-waves#202. Raising priority to high. Note that the report in Fourier is also on macOS Catalina 10.15.7 + Safari 15.0, the same platform originally reported here. Safari 15.0 is the latest version of Safari, which as been back-ported to (some) older versions of macOS. This problem does not appear on my wife's MacBookPro11,1 (Mid 2014) with macOS 10.15.6 + Safari 13.1.2. |
I added better error handling and re-modulified the sounds in tambo, joist, vegas, and scenery-phet because those were the repos with sounds being used by the fourier-making-waves sim. I then worked with @Nancy-Salpepi to test out fourier on the machine where the problem can be duplicated. The sim loaded successfully, and printed out the expected console warnings. For reference, I've included the output below. There are essentially two error messages produced per decoding failure.
[Warning] decode of audio data failed, using stubbed sound, error: null (empty_apartment_bedroom_06_resampled_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (empty_apartment_bedroom_06_resampled_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (screen-selection-home-v3_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (screen-selection-home-v3_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (switching-screen-selector-icons-003_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (switching-screen-selector-icons-003_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (general-button-v4_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (general-button-v4_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (general-close_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (general-close_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (general-open_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (general-open_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (checkbox-checked_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (checkbox-checked_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (checkbox-unchecked_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (checkbox-unchecked_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (radio-button-v2_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (radio-button-v2_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (step-back-v2_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (step-back-v2_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (step-forward-v2_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (step-forward-v2_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (screen-selection_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (screen-selection_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (pause_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (pause_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (play-pause-003_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (play-pause-003_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (general-boundary-boop_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (general-boundary-boop_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (general-soft-click_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (general-soft-click_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (reset-all_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (reset-all_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (boing_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (boing_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (cheer_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (cheer_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (ding_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (ding_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (organ_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (organ_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (trumpet_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (trumpet_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (go-back_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (go-back_mp3.js, line 21)
[Warning] decode of audio data failed, using stubbed sound, error: null (level-selection-button_mp3.js, line 16)
[Warning] promise rejection caught for audio decode, error = EncodingError: Decoding failed (level-selection-button_mp3.js, line 21)
It should be noted that this is a partial solution to the problem. The better error handling will allow sims to load when audio decoding fails, but we still don't know why we are running into audio decode errors on this particular configuration of MacOS and Safari version, nor what, if anything, we can do about it. |
@oliver-phet - Can you ask the original reporter of this issue to try the sim again? You can let them know that we've fixed an issue that was specific to that OS and browser configuration. |
@jbphet - @zepumph and I checked the database and filesystem entries (including .htaccess files) for the failed phet-io deployments, and everything seems to have worked correctly. Here are the sims we checked: |
That's good news @mattpen! Based on this, I think our work here is done. I'll leave this open to record what we hear from the user who originally reported the issue (@oliver-phet is going to contact them) so that we can fully close the loop on this issue. @oliver-phet - If the user reports that the sim now loads for them, you can go ahead and close. |
|
I'm still awaiting a detailed system report from the user.
The text was updated successfully, but these errors were encountered: