Reduces the number of onTimeUpdate timers in MediaFoundation playback [chromium/src : main]

0 views
Skip to first unread message

Frank Liberato (Gerrit)

unread,
Sep 5, 2025, 12:04:01 PMSep 5
to Tochukwu Ibe-Ekeocha, Dale Curtis, Mark Foltz, Jordan Bayles, Kent Tamura, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz...@chromium.org
Attention needed from Dale Curtis, Jordan Bayles, Kent Tamura, Mark Foltz and Tochukwu Ibe-Ekeocha

Frank Liberato added 1 comment

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Frank Liberato . resolved

(-me) there's plenty of review coverage on this already.

thanks
-fl

Open in Gerrit

Related details

Attention is currently required from:
  • Dale Curtis
  • Jordan Bayles
  • Kent Tamura
  • Mark Foltz
  • Tochukwu Ibe-Ekeocha
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I882f2d8ca1d55788bc7939421d6ec08974d1ac9d
Gerrit-Change-Number: 6912477
Gerrit-PatchSet: 3
Gerrit-Owner: Tochukwu Ibe-Ekeocha <tibee...@microsoft.com>
Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
Gerrit-Reviewer: Jordan Bayles <jop...@chromium.org>
Gerrit-Reviewer: Kent Tamura <tk...@chromium.org>
Gerrit-Reviewer: Mark Foltz <mfo...@chromium.org>
Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
Gerrit-Attention: Dale Curtis <dalec...@chromium.org>
Gerrit-Attention: Kent Tamura <tk...@chromium.org>
Gerrit-Attention: Jordan Bayles <jop...@chromium.org>
Gerrit-Attention: Tochukwu Ibe-Ekeocha <tibee...@microsoft.com>
Gerrit-Attention: Mark Foltz <mfo...@chromium.org>
Gerrit-Comment-Date: Fri, 05 Sep 2025 16:03:50 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Dale Curtis (Gerrit)

unread,
Sep 5, 2025, 12:38:22 PMSep 5
to Tochukwu Ibe-Ekeocha, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz...@chromium.org
Attention needed from Tochukwu Ibe-Ekeocha and Xiaohan Wang

Dale Curtis added 1 comment

Patchset-level comments
Dale Curtis . unresolved

Removing reviewers until Xiaohan and I finish review to avoid noise.

Open in Gerrit

Related details

Attention is currently required from:
  • Tochukwu Ibe-Ekeocha
  • Xiaohan Wang
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I882f2d8ca1d55788bc7939421d6ec08974d1ac9d
    Gerrit-Change-Number: 6912477
    Gerrit-PatchSet: 3
    Gerrit-Owner: Tochukwu Ibe-Ekeocha <tibee...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
    Gerrit-Attention: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-Attention: Tochukwu Ibe-Ekeocha <tibee...@microsoft.com>
    Gerrit-Comment-Date: Fri, 05 Sep 2025 16:38:13 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dale Curtis (Gerrit)

    unread,
    Sep 5, 2025, 12:50:55 PMSep 5
    to Tochukwu Ibe-Ekeocha, Sangbaek Park, Nic Williamson, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz...@chromium.org
    Attention needed from Tochukwu Ibe-Ekeocha

    Dale Curtis added 1 comment

    Patchset-level comments
    File-level comment, Patchset 4 (Latest):
    Dale Curtis . unresolved

    This unfortunately pollutes too many layers with build flags and knowledge of MediaFoundation. You'll need to find a more generic non-buildflag mechanism to activate this behavior.

    E.g., one such mechanism might be to extract the current timer based mechanism from HTMLMediaElement into a helper utility that each WMP instance could either own a copy of or delegate to some underlying subsystem. We can then enable that on all platforms and avoid guarded code.

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Tochukwu Ibe-Ekeocha
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I882f2d8ca1d55788bc7939421d6ec08974d1ac9d
    Gerrit-Change-Number: 6912477
    Gerrit-PatchSet: 4
    Gerrit-Owner: Tochukwu Ibe-Ekeocha <tibee...@microsoft.com>
    Gerrit-Reviewer: Dale Curtis <dalec...@chromium.org>
    Gerrit-Reviewer: Xiaohan Wang <xhw...@chromium.org>
    Gerrit-CC: Nic Williamson <cham...@microsoft.com>
    Gerrit-CC: Sangbaek Park <sangba...@chromium.org>
    Gerrit-CC: srirama chandra sekhar <srir...@samsung.com>
    Gerrit-Attention: Tochukwu Ibe-Ekeocha <tibee...@microsoft.com>
    Gerrit-Comment-Date: Fri, 05 Sep 2025 16:50:46 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Dale Curtis (Gerrit)

    unread,
    Sep 5, 2025, 12:51:34 PMSep 5
    to Tochukwu Ibe-Ekeocha, Sangbaek Park, Nic Williamson, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz...@chromium.org
    Attention needed from Tochukwu Ibe-Ekeocha

    Dale Curtis added 1 comment

    Commit Message
    Line 20, Patchset 4 (Latest):an overall wake reduction per second of 8.
    Dale Curtis . unresolved

    This seems like a pretty minor reduction in timers. What does this mean in terms of power usage saved?

    Gerrit-Comment-Date: Fri, 05 Sep 2025 16:51:25 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Xiaohan Wang (Gerrit)

    unread,
    Sep 5, 2025, 1:34:40 PMSep 5
    to Tochukwu Ibe-Ekeocha, Sangbaek Park, Nic Williamson, Dale Curtis, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz...@chromium.org
    Attention needed from Tochukwu Ibe-Ekeocha

    Xiaohan Wang added 2 comments

    Commit Message
    Line 22, Patchset 4 (Latest):In addition to the theoretical analysis, we also performed a WPA trace which collects data on CPU Wakes. The traces were performed using Edge, as well as a vanilla chromium build with HWDRM support through PlayReady enabled. On average the traces showed less timer invocations when the feature flag was enabled.
    Xiaohan Wang . unresolved

    Thanks for the CL, and the detailed explanation in CL description!

    I'll put all my comments here for easier discussion.

    #### Real World Impact

    What's the real world impact in terms of power savings? For example, for normal user scenarios (play, pause, etc).

    #### Timer Frequency

    According the the HTML5 video element spec:

    If the time was reached through the usual monotonic increase of the current playback position during normal playback, and if the user agent has not fired a timeupdate event at the element in the past 15 to 250ms and is not still running event handlers for such an event, then the user agent must queue a task to fire a simple event named timeupdate at the element...

    So during playback, how often will MediaFoundation MediaEngine file OnTimeUpdate()? For example, if it fires every 125ms, then we won't have much savings?

    One thing I noticed is that we don't stop the timer in MojoRendererService when the playback rate is 0 (pause). Maybe that's something we can improve.

    #### Code Consistency

    I agree with Dale that we should not expose too much Windows / MediaFoundation-specifics in the media pipeline. A lot of files touched in this CL are generic, that they support playback on all platforms.

    So if we do feel a push (event-driven) model is necessary, we should have a generic way to support it, and each Renderer can choose which model it wants to use.

    File media/base/media_switches.cc
    Line 1177, Patchset 4 (Latest): base::FEATURE_DISABLED_BY_DEFAULT);
    Xiaohan Wang . unresolved
    If you rebase this CL, you can use the new 2-param BASE_FEATURE macro 😊
    ```
    BASE_FEATURE(kMediaFoundationEventDrivenTimeUpdates,
    base::FEATURE_DISABLED_BY_DEFAULT);
    ```
    Gerrit-Comment-Date: Fri, 05 Sep 2025 17:34:29 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Tochukwu Ibe-Ekeocha (Gerrit)

    unread,
    Oct 17, 2025, 1:55:08 PM (2 days ago) Oct 17
    to Sangbaek Park, Nic Williamson, Dale Curtis, chromium...@chromium.org, srirama chandra sekhar, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, eric.c...@apple.com, erickun...@chromium.org, feature-me...@chromium.org, jophba...@chromium.org, kinuko...@chromium.org, mfoltz...@chromium.org

    Tochukwu Ibe-Ekeocha abandoned this change

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: abandon
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages