Mojo Service has a delay under certain circumstances

354 views
Skip to first unread message

Bo-Rong Chen

unread,
Feb 27, 2025, 1:20:41 PMFeb 27
to chromi...@chromium.org, Xiaoming Shi, Miguel Casas, Kaido Kert, John Xu, Melissa Buena
Hi Chromium folks,

We are working on Cobalt (YouTube Living Room Browser) based on Chromium m114 on Android TV, and it operates in a single process mode.

I found that there was ~47ms delay for a Mojo Service sent from VizCompositorThread to Chrome_InProcessRenderer, where we bind the Mojo service similar to VideoGeometrySetterService, which is used in ChromeCast, as shown in the figure below.

The ~47ms delay only happened when we use the CSS transitions to zoom out the video player, which causes a perceivable delay, see below:
test.gif

Does anyone have an idea about what the cause was? Thanks!

Best Regards,
Bo-Rong Chen


Dave Tapuska

unread,
Feb 27, 2025, 1:25:40 PMFeb 27
to Bo-Rong Chen, chromi...@chromium.org, Xiaoming Shi, Miguel Casas, Kaido Kert, John Xu, Melissa Buena
What does a trace show? Are you binding the interface everytime?

dave.

--
You received this message because you are subscribed to the Google Groups "chromium-mojo" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-moj...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/chromium-mojo/CADFb%2B4O6WTH8fNRhtcqZWLc_1Z5FZ6vymk_Hi8rs4%3DwanqZhYw%40mail.gmail.com.

Bo-Rong Chen

unread,
Feb 27, 2025, 1:30:45 PMFeb 27
to Dave Tapuska, chromi...@chromium.org, Xiaoming Shi, Miguel Casas, Kaido Kert, John Xu, Melissa Buena
Hi Dave,

Do you have any document to enable/add traces for this Mojo service? Thanks!

I only bind the interface when ContentRendererClient is started, so it should be only once.

Best Regards,
Bo-Rong Chen

Dave Tapuska

unread,
Feb 27, 2025, 1:35:45 PMFeb 27
to Bo-Rong Chen, chromi...@chromium.org, Xiaoming Shi, Miguel Casas, Kaido Kert, John Xu, Melissa Buena
A system wide trace is needed to investigate. Since this is Android I'd start with the standard system trace (https://developer.android.com/topic/performance/tracing). I'd hope that your chromium port would hook into that, but I'm not super familiar with perfetto integration on Android.

Gathering a trace and then looking at why it is delayed. Likely it is due to something already running on the target thread and the trace will reveal that.

dave.

Bo-Rong Chen

unread,
Feb 27, 2025, 5:31:54 PMFeb 27
to Dave Tapuska, chromi...@chromium.org, Xiaoming Shi, Miguel Casas, Kaido Kert, John Xu, Melissa Buena
Hi Dave,

I got the traces via chrome://tracing, and I only saw the thread received a mojo message, but it didn't show where it was sent from.

For example, a Mojo message (cobalt.media.mojom.VideoGeometrySetter) was received by Chrome_InProcRenderer, and a following Mojo message (cobalt.media.mojom.VideoGeometryChangeClient) was received by Media thread. The Mojo message should be sent from VizCompositorThread, but I cannot find it.
5JUvBYjgXVswWCS.png
Do you have any suggestions on how to debug this trace? I also included the trace as an attachment. Thanks!

Best Regards,
Bo-Rong Chen


trace_Thu_Feb_27_2025_2.24.31_PM.json.gz

Dave Tapuska

unread,
Mar 7, 2025, 10:13:12 AMMar 7
to Bo-Rong Chen, chromi...@chromium.org, Xiaoming Shi, Miguel Casas, Kaido Kert, John Xu, Melissa Buena
Sorry I didn't respond. See the big RunTask on the media thread before the message is received. That means your thread is blocked doing something else (and can't receive the message). You should figure out what that is. You might need to add some tracing categories in your sampling.

dave.

Dave Tapuska

unread,
Mar 7, 2025, 10:16:52 AMMar 7
to Bo-Rong Chen, chromi...@chromium.org, Xiaoming Shi, Miguel Casas, Kaido Kert, John Xu, Melissa Buena
Oh sorry, I looked at the picture but didn't fully process the text. I suggest you enable all filters if you haven't. I thought mojo traced each send so those should appear. Likely you didn't have the right filters set.
Reply all
Reply to author
Forward
0 new messages