Fenix: [Bug] Phone goes to sleep while audio is playing

Created on 5 Sep 2019  ·  4Comments  ·  Source: mozilla-mobile/fenix

Steps to reproduce

  • Go to music.youtube.com
  • Play a song without maximizing the video.
  • Wait

Expected behavior

  • Song keeps playing.

Actual behavior

  • After a bit the phone gets locked and the music stops playing. This doesn't happen if you maximize the video.

Device information

  • Android device: Galaxy A20 with Android 9
  • Fenix version:

Nightly 190904 18:02 (Build #12471814)
📦: 11.0.0, 0c63c199a
🦎: 70.0a1-20190901094958

Media P2 gv 🐞 bug 🙅 waiting

All 4 comments

Can someone please re-test? I tried with a 15sec screen sleep, for me the phone didn't get locked. Tried on: Oneplus 7T pro and Samsung Note 10

Hi, I've just checked this matter on the latest Nightly #20490606 from 2/18 having the following devices set to sleep after 15 seconds of inactivity :
• Google Pixel 3a XL (Android 10)
• Google Pixel 3a (Android 9)
• Huawei Mate 20 Lite (Android 8.1.0)
• Samsung Galaxy S7 (Android 7.0.0)
• One Plus A3 (Android 6.0.1)

If you play any song that has an actual video

✔️ The screen will not go to sleep.

►Video
20200218-172146

If you play the audio (doesn't have an actual video)

❌The screen goes to sleep and the playback is paused.
Managed to reproduce this on:
• Google Pixel 3a XL (Android 10)
• Google Pixel 3a (Android 9)
• Huawei Mate 20 Lite (Android 8.1.0)

►Video
20200218-172301

❌ The screen goes to sleep and the playback is not paused.
Managed to reproduce this on:
• Samsung Galaxy S7 (Android 7.0.0)
• One Plus A3 (Android 6.0.1)

As a daily user of the music.youtube app, the screen should not go to sleep on any circumstance while audio/video playback is performed.

This issue reproduces also on Fennec (and GeckoView Sample), therefore it's most likely a GV issue. I'm assuming it's either the video encoding for the image+audio combo that gets treated as simple audio and doesn't acquire a wakelock.

Last place I was looking into was HTMLMediaElement.h in gecko, which has MediaInfo class, with hasVideo() and hasAudio() methods. The difference between the working ones and non-working ones could be hasVideo() = false.

Added a bugzilla bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1617591

I came to report the same issue playing BBC audio streams, like https://www.bbc.co.uk/sounds/play/live:bbc_world_service. Chromium-based browsers keep the audio playing so I can listen to the radio when reading another tab or with the screen off.

Was this page helpful?
0 / 5 - 0 ratings