sailfishos-sony-tama / main

Documentation, releases, and issues
MIT License
36 stars 7 forks source link

VP9 video playback does not always resume #134

Closed rinigus closed 2 years ago

rinigus commented 3 years ago

When stopping video, changing app, returning to the one with video, video does not always continue playing. This holds for youtube videos via browser or videos on device and played by Gallery.

Browser refusing to continue playing with HW sound volume. Similar observed for Gallery with HW volume control disabled:

Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [dres_store_tx_new] created new transaction
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [eval_rule] invoking rule #5 (get_active_audio_manager_id/1)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [eval_rule] invoking rule #0 (update_resource_entries/1)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [eval_rule] invoking rule #1 (update_resource_owner_entries/1)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [eval_rule] invoking rule #5 (get_active_audio_manager_id/1)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [eval_rule] invoking rule #15 (set_corks/1)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [eval_rule] invoking rule #18 (update_contexts/1)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [eval_rule] invoking rule #13 (set_audio_privacy/2)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [eval_rule] invoking rule #12 (set_audio_routes/1)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [eval_rule] invoking rule #13 (set_audio_privacy/2)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [eval_rule] invoking rule #14 (set_volume_limits/1)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [signal_handler] signal='audio_actions', cb='' txid=0
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [dump_signal_changed_args] calling signal_changed(audio_actions, 0,  5, 0x7fda460c00, (nil), 5000)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [dump_signal_changed_args]    fact[0]: 'com.nokia.policy.context'
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [dump_signal_changed_args]    fact[1]: 'com.nokia.policy.volume_limit'
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [dump_signal_changed_args]    fact[2]: 'com.nokia.policy.audio_route'
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [dump_signal_changed_args]    fact[3]: 'com.nokia.policy.audio_cork'
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [dump_signal_changed_args]    fact[4]: 'com.nokia.policy.audio_mute'
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [signal_handler] signal_changed() succeeded
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [dres_store_tx_commit] committed transaction
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [dres_store_tx_new] created new transaction
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [eval_rule] invoking rule #15 (set_corks/1)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [eval_rule] invoking rule #14 (set_volume_limits/1)
Apr 04 20:28:42 XperiaXZ2Compact ohmd[3016]: [dres_store_tx_commit] committed transaction
Apr 04 20:28:46 XperiaXZ2Compact kernel: dsi-ctrl:[dsi_ctrl_handle_error_status] tx timeout error: 0x40
Apr 04 20:28:49 XperiaXZ2Compact systemd[1]: Starting Cleanup of Temporary Directories...
Apr 04 20:28:49 XperiaXZ2Compact systemd[1]: Started Cleanup of Temporary Directories.

with timeout error.

rinigus commented 3 years ago

Way to trigger:

Original approach:

Simplified approach:

rinigus commented 3 years ago

With the software audio, I get the same inability to play. Would have to close the browser and restart it to make it work with video. Log after resuming video which fails to play

May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_update_goal] resource_request has no prereqs => updating
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_run_actions] executing actions for resource_request
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_builtin_dres] recursively resolving goal all
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_check_target] checking target audio_cork
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_check_factvar] $com.nokia.policy.resource_owner: outdated (332 > 317)
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_check_factvar] $com.nokia.policy.audio_cork: up-to-date (316 > 317)
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_check_target] => audio_cork needs to be updated
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_run_actions] executing actions for audio_cork
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_check_target] checking target update_feature_enabled
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_check_factvar] $com.nokia.policy.feature: up-to-date (247 > 252)
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_check_target] => update_feature_enabled already up-to-date
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_check_target] checking target update_feature_allowed
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_check_factvar] $com.nokia.policy.context: up-to-date (316 > 317)
May 04 22:54:14 XperiaXZ2Compact ohmd[3019]: [dres_check_factvar] $com.nokia.policy.audio_device_selectable: up-to-date (256 > 317)

it is insufficient to browse away and return, application has to be closed.

Interestingly, Angelfish running from Flatpak doesn't seem to have this issue. I can pause video, go to other programs to type, return and resume.

Could it be native browser bug?

rinigus commented 3 years ago

Bumping droidmedia to 0.20210326.0 made no difference.

Re Angelfish: it is probably not using accelerated playback.

rinigus commented 3 years ago

Latest logs

journal.txt

logcat.txt

rinigus commented 3 years ago

I just managed to trigger this issue with AOSP9 arm 32bit based port as well. While rare for this case, it looks to be more general issue than I expected on the basis of hybris 10 port

lal883 commented 3 years ago

Noticed this on 4.0.1.48, XZ2C too. Also, seeking videos in browser is tough that, sometimes the video freezes but audio keeps playing and during some other times it stops altogether. Will have to restart browser to get playback working again then.

rinigus commented 3 years ago

Thanks for confirming! Then it is not a blocker for aarch64/AOSP10 transition. I have no idea how to fix it, though.

rinigus commented 3 years ago

Looks like I cannot reproduce it on a website of national TV. Could be limited to youtube

rinigus commented 3 years ago

Looks to be limited to YouTube videos in the browser. Other web sites with videos (ERR, BBC) allow to pause/resume. Using local videos and LL Player, it is possible to pause/resume as well.

Renaming the issue

rinigus commented 3 years ago

Looks like it is mainly related to VP9. On AOSP9 based port, all works as it should with VP9. Although, there are some issues with pause/play sequence in Gallery.

In AOSP10, I have seen the issues that are correlating with VP9 use. In Gallery and LL Player it could be worse than in browser - those apps tend to hang after pause/resume cycle fails.

rinigus commented 2 years ago

Seems to be fixed in SFOS 4.3 - couldn't trigger it anymore in the latest release.