Automattic / Automattic/pocket-casts-android
Audio focus not consistently gained/dropped properly
- Dominant language
- Kotlin
- Stars
- 2.8k
- Forks
- 308
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 143
Description
### Description
When the [Freeletics app](https://play.google.com/store/apps/details?id=com.freeletics.lite&hl=en_US&gl=US) does a workout countdown while Pocket Casts is playing audio, Pocket Casts is inconsistent in giving up audio focus before resuming after the countdown.
* Sometimes playback stops for the countdown and resumes after it is done
* Sometimes playback continues through the countdown
* Sometimes playback continues through the countdown but the Pocket Casts playback scrubber stops updating to reflect that playback is continuing.
### Step-by-step reproduction instructions
I tried to reproduce this in [a toy app I made](https://github.com/mchowning/audio-interruption-app) for playing different kinds of sounds with different types of focus requests and I wasn't able to find any way to recreate the issue. Even with the Freeletics app the issue does not seem to occur consistently.
Steps:
1. Download the Freeletics app
2. While Pocket Casts is playing, begin a workout in the Freeletics app so that there is an audible countdown from 5. I wasn't able to find a way to do this without a Freeletics subscription, so I signed up for a free trial.
3. Observe that Pocket Casts _sometimes_ stops playing, and _sometimes_ the visual scrubber in the app stops updating.
### Screenshots or screen recording
This video shows the different behaviors happening without any interaction with the phone. The screen is split with Pocket Casts on the top and Freeletics on the bottom.
* The 3 and 25-second marks are examples of playback stopping as expected
* The 15-second mark is an example of playback continuing (and the UI scrubber continuing to update)
* The 35-second mark is an example of playback continuing but the UI scrubber not continuing to update.
https://user-images.githubusercontent.com/4656348/218192485-06c66acc-369c-454a-9f9e-3d6da81decca.mov
### Did you search for existing bug reports?
- [X] I have searched for existing bug reports.
### Device, Operating system, and Pocket Casts app version
Samsung A13, Android 12, Pocket Casts 7.32-rc build.
Contributor guide
Research direction
Start by reproducing the behavior on the reported Samsung A13 running Android 12 with Pocket Casts 7.32-rc while another app plays audio during a countdown. Compare the cases where playback stops, continues normally, or continues with a stalled scrubber. Done means audio focus is gained and dropped consistently and playback and its scrubber remain synchronized.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- audio-video-rtc, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100