Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@seadowg
Copy link
Member

@seadowg seadowg commented Jul 23, 2025

Closes #6085

Why is this the best possible solution? Were any other approaches considered?

Our only theory for why the crash happens is that MediaPlayer is able to get into weird states because we set it up on a background thread. The fix here is just to wrap MediaPlayer in a simplified interfaced that only allows one thread at a time to call methods that mutate the internal state.

How does this change affect users? Describe intentional changes to behavior and behavior that could have accidentally been affected by code changes. In other words, what are the regression risks?

We don't have reproduction steps for the crash, so the main focus here is just to check that audio playback in the app still works as expected.

Before submitting this PR, please make sure you have:

  • added or modified tests for any new or changed behavior
  • run ./gradlew connectedAndroidTest (or ./gradlew testLab) and confirmed all checks still pass
  • added a comment above any new strings describing it for translators
  • added any new strings with date formatting to DateFormatsTest
  • verified that any code or assets from external sources are properly credited in comments and/or in the about file.
  • verified that any new UI elements use theme colors. UI Components Style guidelines

@seadowg seadowg changed the base branch from master to v2025.2.x July 23, 2025 11:13
@seadowg seadowg marked this pull request as ready for review July 23, 2025 12:25
@seadowg seadowg requested a review from grzesiek2010 July 23, 2025 12:25
@dbemke
Copy link

dbemke commented Jul 24, 2025

I think I managed to reproduce it. There's a crash without any information in the launch screen. If I find more info I'll edit the post.
Steps to reproduce:

  1. Open the form.
    audioAutoplayrepeat.xlsx.txt
    audio: https://drive.google.com/drive/u/1/folders/1IeuxQZU8Sw90PAOnTRlMToB3Wp_LuCoN
  2. Swipe to following question and add repeats.

@seadowg
Copy link
Member Author

seadowg commented Jul 24, 2025

@dbemke is with or without the PR changes?

@dbemke
Copy link

dbemke commented Jul 24, 2025

is with or without the PR changes?

I reproduced it on the master and the store version. I just checked this form on the PR and the issue hasn't occurred.

@seadowg seadowg requested a review from grzesiek2010 July 28, 2025 08:44
@grzesiek2010 grzesiek2010 merged commit a1698a5 into getodk:v2025.2.x Jul 28, 2025
6 checks passed
@seadowg seadowg deleted the audio-clip branch July 28, 2025 09:25
@dbemke
Copy link

dbemke commented Jul 28, 2025

I'm not sure if it's exactly the same case but it seems similar - if it's the same is it expected that there's an error instead of the crash?
errorAudio

@seadowg
Copy link
Member Author

seadowg commented Jul 28, 2025

@dbemke that looks like a different bug. Could you file it separately?

@dbemke
Copy link

dbemke commented Jul 28, 2025

Could you file it separately?

Ok. I'll file an issue when I figure out a way to reproduce it.

@dbemke
Copy link

dbemke commented Jul 29, 2025

Tested with Success!

Verified on a device with Android 10

Verified cases:

@WKobus
Copy link

WKobus commented Jul 29, 2025

Tested with success

Verified on device with Android 15

seadowg pushed a commit to seadowg/collect that referenced this pull request Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants