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

iOS 13 sound starts once you reset all #78

Closed
KatieWoe opened this issue Aug 22, 2019 · 10 comments
Closed

iOS 13 sound starts once you reset all #78

KatieWoe opened this issue Aug 22, 2019 · 10 comments
Assignees

Comments

@KatieWoe
Copy link

Found when looking at phetsims/phet-core#64. Found on John Travoltage but not on Area Builder, so I think it is likely a Tambo issue. Not found on iOS 12.
When you start up the John Travoltage sim, no sound plays. Moving pieces doesn't cause a sound, and neither does muting and unmuting. However, if you hit the orange reset all button, that sound will play, and so will normal sounds after that.

@jbphet
Copy link
Contributor

jbphet commented Sep 10, 2019

One of the roots of this problem is that the user agent has changed in iOS 13, and the code in platform.js no longer recognizes that it's running on Mobile Safari (see phetsims/phet-core#64). I have done some experiments and found that with the current autoplay behaviors implemented in Chrome, Firefox, Edge, Safari, and Mobile Safari, the code that detects and resumes a suspended audio context can be generalized to work in all cases so that detection of Mobile Safari is no longer necessary. However, this will require a QA cycle and a maintenance release.

@jbphet
Copy link
Contributor

jbphet commented Sep 10, 2019

The code for resuming the audio context has been rewritten so that it is no longer necessary to have any platform-specific portions. This fixes the issue with sound not playing initially on iOS 13. This will require a maintenance release for all sims that use sound.

@jbphet
Copy link
Contributor

jbphet commented Sep 10, 2019

This should be fixed on master. I'm going to assign it back to QA to verify that the fix works and to regression test the behavior on our other supported platforms. Assuming it all checks out, this should then be assigned to @jonathanolson to deploy in a maintenance release.

@jbphet jbphet assigned jonathanolson and unassigned jbphet Sep 10, 2019
@KatieWoe
Copy link
Author

KatieWoe commented Sep 10, 2019

  • Win 10 chrome
  • Win 10 firefox
  • Win 10 edge

  • Win 7 chrome
  • Win 7 firefox
  • Win 7 internet explorer

  • Mac 10.14 chrome
  • Mac 10.14 safari

  • Mac 10.13 chrome
  • Mac 10.13 safari

  • Mac 10.12 chrome
  • Mac 10.12 safari

  • Mac 10.11 chrome
  • Mac 10.11 safari

  • Mac 10.10 safari

  • Chrome OS

  • iOS 13
  • iOS 12
  • iOS 11

@jbphet
Copy link
Contributor

jbphet commented Sep 10, 2019

@KatieWoe - I believe the issues that was causing the alert message is now fixed, please resume testing.

@KatieWoe
Copy link
Author

Done. Things look ok. Everything tested with touch when possible. Win 7 IE skipped since it doesn't support the sound in question.

@jbphet
Copy link
Contributor

jbphet commented Oct 17, 2019

I tested this issue on my iPhone 8 running version 13.1.2, and the sound issues didn't occur. I was wondering if maybe Apple fixed it, so @KatieWoe and I just tested on PhET's 6th generation iPad (which hasn't been assigned a name yet) running 13.1.2, and the problem does still occur there. Here was the test sequence:

  • Load the currently live version of John Travoltage (v1.5.11)
  • Drag the leg back and forth before doing anything else (no sound is produced)
  • Keep doing this until a discharge occurs (still no sound is produced)
  • Press the reset button - we heard the reset sound, followed by the discharge sound and the verbal exclamation at this point

Depending, I think, on what version tambo a sim has, some of them recover after a reset, some don't. This was based on testing the live versions of Friction (v1.5.9), Resistance in a Wire (v1.6.8), and Ohm's Law (v1.4.6).

@jbphet
Copy link
Contributor

jbphet commented Oct 18, 2019

@jonathanolson and I are working through a maintenance release to address this. It is turning out to require a number of unique patches, so we are thinking that would should only patch the sims that need it. Sims that don't need it either have no sound functionality at all or don't manifest the problem where sound doesn't work. The acid test for whether sound functions is to load the sim, drag (but don't tap) your finger on the screen without selecting a screen or doing anything else on the sim, then go do something in the sim that should produce sound. The currently live version of the "Build a Fraction" sim (v1.0.9) exhibits this problem. The current version of "Balancing Chemical Equations" (v1.2.8) does not.

It would be possible, albeit time consuming, to figure out exactly why the sound gets locked up in some sims and not others. I don't think that this is worth the time and effort. The likely explanation is that there is a previous version of the tambo code that tries to resume the audio context on a touchdrag event and disconnects the listener, but doesn't check whether the operation worked, and it doesn't. In other words, it's disconnecting itself before the job is done. We should just go ahead and patch such instances of the tambo code.

@jbphet
Copy link
Contributor

jbphet commented Oct 18, 2019

For future reference, here are the published sims for which tambo was not patched, either because they don't use sound or because they didn't manifest the audio problems on iOS 13:

  • balancing-chemical-equations 1.2 phet
  • blackbody-spectrum 1.0 phet
  • fraction-matcher 1.2 phet
  • fractions-equality** 1.1 phet
  • molarity 1.4 phet,phet-io
  • ph-scale 1.3 phet
  • ph-scale-basics 1.3 phet
  • reactants-products-and-leftovers 1.2 phet
  • rutherford-scattering 1.1 phet
  • states-of-matter 1.1 phet
  • states-of-matter-basics 1.1 phet

jbphet added a commit that referenced this issue Oct 18, 2019
jbphet added a commit to phetsims/area-model-algebra that referenced this issue Oct 18, 2019
jbphet added a commit that referenced this issue Oct 18, 2019
jbphet added a commit to phetsims/area-model-decimals that referenced this issue Oct 18, 2019
jbphet added a commit that referenced this issue Oct 18, 2019
jbphet added a commit to phetsims/area-model-introduction that referenced this issue Oct 18, 2019
jbphet added a commit to phetsims/area-model-multiplication that referenced this issue Oct 18, 2019
jonathanolson added a commit to phetsims/molecule-shapes that referenced this issue Oct 24, 2019
jonathanolson added a commit to phetsims/molecule-shapes-basics that referenced this issue Oct 24, 2019
jonathanolson added a commit to phetsims/wave-interference that referenced this issue Oct 24, 2019
jonathanolson added a commit to phetsims/coulombs-law that referenced this issue Oct 25, 2019
jonathanolson added a commit to phetsims/energy-forms-and-changes that referenced this issue Oct 25, 2019
jonathanolson added a commit to phetsims/john-travoltage that referenced this issue Oct 25, 2019
jonathanolson added a commit to phetsims/ohms-law that referenced this issue Oct 25, 2019
jonathanolson added a commit to phetsims/resistance-in-a-wire that referenced this issue Oct 25, 2019
jonathanolson added a commit to phetsims/build-a-fraction that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/circuit-construction-kit-dc that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/circuit-construction-kit-dc-virtual-lab that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/diffusion that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/fractions-equality that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/fractions-intro that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/fractions-mixed-numbers that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/gas-properties that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/gases-intro that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/graphing-lines that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/graphing-quadratics that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/graphing-slope-intercept that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/isotopes-and-atomic-mass that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/masses-and-springs-basics that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/molecule-shapes that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/molecule-shapes-basics that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/wave-interference that referenced this issue Oct 28, 2019
jonathanolson added a commit to phetsims/waves-intro that referenced this issue Oct 28, 2019
@jbphet
Copy link
Contributor

jbphet commented Nov 5, 2019

A fix has been implemented and deployed as part of a maintenance release. Closing.

@jbphet jbphet closed this as completed Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants