Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeks are reported multiple times a second while playing in Chromium/Electron in Linux. Too many setPositionState calls? #8098

Closed
b2ag opened this issue Feb 17, 2025 · 0 comments · Fixed by #8100
Labels
component: UI The issue involves the Shaka Player UI priority: P2 Smaller impact or easy workaround type: bug Something isn't working correctly
Milestone

Comments

@b2ag
Copy link

b2ag commented Feb 17, 2025

Have you read the FAQ and checked for duplicate open issues?
Yes

If the problem is related to FairPlay, have you read the tutorial?

Unrelated

What version of Shaka Player are you using?

Nightly

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from main?
Yes

Are you using the demo app or your own custom app?
Demo

If custom app, can you reproduce the issue using our demo app?
Yes

What browser and OS are you using?
Chromium on Linux/NixOS

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
Not applicable

What are the manifest and license server URIs?

Unrelated

What configuration are you using? What is the output of player.getNonDefaultConfiguration()?

See Demo configuration

What did you do?

  1. Open a terminal
  2. Run dbus-monitor "path=/org/mpris/MediaPlayer2"
  3. Start Chromium
  4. Navigate to https://nightly-dot-shaka-player-demo.appspot.com/
  5. Play any video
  6. Observe calls to member seeked of interface org.mpris.MediaPlayer2.Player roughly four times a second

What did you expect to happen?
The browser should not report a seek if no seek is happening.

What actually happened?

The "seeked" member of the MPRIS interface gets called over and over.
...
signal time=1739828325.256662 sender=:1.268 -> destination=(null destination) serial=1995 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 430623
signal time=1739828325.522995 sender=:1.268 -> destination=(null destination) serial=1996 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 701302
signal time=1739828325.788332 sender=:1.268 -> destination=(null destination) serial=1997 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 961053
signal time=1739828326.054405 sender=:1.268 -> destination=(null destination) serial=1998 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 1231431
signal time=1739828326.319630 sender=:1.268 -> destination=(null destination) serial=1999 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 1490923
signal time=1739828326.584859 sender=:1.268 -> destination=(null destination) serial=2000 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 1760717
signal time=1739828326.851132 sender=:1.268 -> destination=(null destination) serial=2001 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 2021227
signal time=1739828327.116854 sender=:1.268 -> destination=(null destination) serial=2002 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 2291346
signal time=1739828327.381511 sender=:1.268 -> destination=(null destination) serial=2003 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 2560557
signal time=1739828327.647223 sender=:1.268 -> destination=(null destination) serial=2004 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 2820490
signal time=1739828327.913860 sender=:1.268 -> destination=(null destination) serial=2005 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 3091515
signal time=1739828328.179497 sender=:1.268 -> destination=(null destination) serial=2006 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 3361529
signal time=1739828328.444349 sender=:1.268 -> destination=(null destination) serial=2007 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 3620846
signal time=1739828328.710947 sender=:1.268 -> destination=(null destination) serial=2008 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 3891752
signal time=1739828328.975757 sender=:1.268 -> destination=(null destination) serial=2009 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 4150874
signal time=1739828329.241590 sender=:1.268 -> destination=(null destination) serial=2010 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 4421058
signal time=1739828329.506754 sender=:1.268 -> destination=(null destination) serial=2011 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 4680560
signal time=1739828329.772963 sender=:1.268 -> destination=(null destination) serial=2012 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 4951213
signal time=1739828330.038568 sender=:1.268 -> destination=(null destination) serial=2013 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 5221249
signal time=1739828330.303507 sender=:1.268 -> destination=(null destination) serial=2014 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 5480521
signal time=1739828330.570079 sender=:1.268 -> destination=(null destination) serial=2015 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 5741344
signal time=1739828330.835906 sender=:1.268 -> destination=(null destination) serial=2016 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 6011585
signal time=1739828331.100919 sender=:1.268 -> destination=(null destination) serial=2017 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 6271161
signal time=1739828331.366189 sender=:1.268 -> destination=(null destination) serial=2018 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 6540702
signal time=1739828331.631667 sender=:1.268 -> destination=(null destination) serial=2019 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 6800615
signal time=1739828331.897258 sender=:1.268 -> destination=(null destination) serial=2020 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 7070591
signal time=1739828332.163668 sender=:1.268 -> destination=(null destination) serial=2021 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 7341305
signal time=1739828332.428378 sender=:1.268 -> destination=(null destination) serial=2022 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 7610397
signal time=1739828332.694144 sender=:1.268 -> destination=(null destination) serial=2023 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 7870496
signal time=1739828332.960137 sender=:1.268 -> destination=(null destination) serial=2024 path=/org/mpris/MediaPlayer2; interface=org.mpris.MediaPlayer2.Player; member=Seeked
   int64 8140806
...

I've stumbled upon this while trying to debug some random behavior in an Electron app using shaka. There I investigate some rare and random "stop" calls from MPRIS. I currently suspect the seeked spam could trigger a race condition in some media control program running over here.

The same behavior of lots of seek events shows in Electron but not in Firefox.

The behavior seems to be a direct result of the integration of PR #7188 .

I'm unsure if this is a bug but the question template said to use the bug template if it might be a bug.

For me it looks like the behavior of calling updatePositionState which calls navigator.mediaSession.setPositionState in a somewhat tight loop is not intended usage of this API. But yet I'm not sure.

this.eventManager_.listen(this.video_, 'timeupdate', () => {

Are you planning to send a PR to fix it?
No

EDIT: Also other players like mpv or websites like YouTube don't do this. So I guess it's abnormal.

@b2ag b2ag added the type: bug Something isn't working correctly label Feb 17, 2025
@shaka-bot shaka-bot added this to the v4.14 milestone Feb 17, 2025
@b2ag b2ag changed the title Seeks are reported multiple times a second while playing in Chromium/Electron. Too many setPositionState calls? Seeks are reported multiple times a second while playing in Chromium/Electron in Linux. Too many setPositionState calls? Feb 18, 2025
@avelad avelad added component: UI The issue involves the Shaka Player UI priority: P2 Smaller impact or easy workaround labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: UI The issue involves the Shaka Player UI priority: P2 Smaller impact or easy workaround type: bug Something isn't working correctly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants