ubports / ubuntu-touch

Ubuntu Touch's issue inbox is now migrated to GitLab.
https://gitlab.com/ubports/ubuntu-touch
1.28k stars 110 forks source link

Bug: Media being played in Morph browser starts stuttering if phone goes to sleep #2043

Open likeadragonmaid opened 2 years ago

likeadragonmaid commented 2 years ago

Steps to reproduce

  1. Launch Morph and open the site you want to play media from.
  2. Play media and let the device sleep or press power button to make it sleep.

Expected behavior

The playing media should not stutter while phone's screen is off or when phone is suspended.

Actual behavior

The playing media starts to stutter while phone's screen is off or when phone is suspended.

Flohack74 commented 2 years ago

Morph browser cannot play back sound when its in the background or the device screen is turned off, this is kinda intended. Canonical built Ubuntu Touch in a way that Apps cannot do anything in the background. Its a wonder that its choppy, not just stopping. Changing this has a lot of considerations and is a complex matter. Its not easily put on the roadmap as it will otherwise significantly drain the battery of your device. Unfortunately Android has much better power-saving features, we are light years away from that. So the only way to save battery is to let almost nothing run when device is asleep. Music can be played back though via media hub, but thats currently only accepting files on disk from your music collection. Thats why music app (and a few others) work. But browser, as it needs to stream stuff, cannot do that. You can try to prevent suspension with the UT Tweak Tool. But then Morph browser gains full access to everything your user has to as it needs to run unconfined then. It might be not desired.

likeadragonmaid commented 2 years ago

Preventing suspension for Morph via UT Tweak Tool does not work unlike other apps.