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

[Android] MaybeWaitOnFence doesn't signal with videos/Impeller. #143720

Closed
jonahwilliams opened this issue Feb 19, 2024 · 3 comments · Fixed by flutter/engine#50792
Closed

[Android] MaybeWaitOnFence doesn't signal with videos/Impeller. #143720

jonahwilliams opened this issue Feb 19, 2024 · 3 comments · Fixed by flutter/engine#50792
Assignees
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version team-engine Owned by Engine team triaged-engine Triaged by Engine team

Comments

@jonahwilliams
Copy link
Member

Running the Flutter Gallery app with Impeller/Vulkan and the YUV sampler patch from @chinmaygarde

flutter_01

Logs are full of

E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.
E/ImageReaderSurfaceProducer( 3117): acquireLatestImage image's fence was never signalled.

CPU profile looks like:

Despite never signalling, we spend 50 ms out of 180ms CPU time checking it. Is this working in other cases, because it seems like its extraordinarily expensive for something that isn't working at all.

image

See also: #142153

@darshankawar darshankawar added in triage Presently being triaged by the triage team platform-android Android applications specifically engine flutter/engine repository. See also e: labels. c: performance Relates to speed or footprint issues (see "perf:" labels) e: impeller Impeller rendering backend issues and features requests team-engine Owned by Engine team and removed in triage Presently being triaged by the triage team labels Feb 20, 2024
@johnmccutchan johnmccutchan self-assigned this Feb 20, 2024
@johnmccutchan
Copy link
Contributor

I've asked Android folks what is expected here.

@jonahwilliams jonahwilliams added the P1 High-priority issues at the top of the work list label Feb 20, 2024
@jonahwilliams
Copy link
Member Author

Marking this as P1 as I understand you are working on it? Or at least asking about it, and we can figure out what to do afterwards.

@jonahwilliams jonahwilliams added the triaged-engine Triaged by Engine team label Feb 20, 2024
johnmccutchan added a commit to flutter/engine that referenced this issue Feb 21, 2024
#50792)

- Close all ImageReaders and Images when we get an onTrimMemory
callback.
- Remove the first frame fix based around caching the last image
displayed because it isn't safe to do on some platforms. Leave a TODO to
revisit this.

We have seen some reports of platform views not working after an
application is backgrounded and then resumed. According to Android GPU
folks ImageReader/Image/HardwareBuffers should be valid after an
application has been resumed. However on Samsung we know that isn't the
case and there are (unconfirmed) reports of it also impacting Pixel
devices.

Should fix flutter/flutter#142978 and
flutter/flutter#139039

Also fixes flutter/flutter#143720
@danagbemava-nc danagbemava-nc added the r: fixed Issue is closed as already fixed in a newer version label Feb 22, 2024
Copy link

github-actions bot commented Mar 7, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: performance Relates to speed or footprint issues (see "perf:" labels) e: impeller Impeller rendering backend issues and features requests engine flutter/engine repository. See also e: labels. P1 High-priority issues at the top of the work list platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version team-engine Owned by Engine team triaged-engine Triaged by Engine team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants