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

Support multi-window replay on Android #1912

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

qiq-2022
Copy link

Introduce JAVA layer into gfxreconstruct
to enable replay multi-window trace files on Android. The command line changes to
am start -n "com.lunarg.gfxreconstruct.replay/.ReplayActivity"

@ci-tester-lunarg
Copy link

Author qiq-2022 not on autobuild list. Waiting for curator authorization before starting CI build.

@CLAassistant
Copy link

CLAassistant commented Dec 12, 2024

CLA assistant check
All committers have signed the CLA.

@ziga-lunarg
Copy link
Contributor

In android/scripts/gfxrecon.py the app_activity should be updated

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 323055.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5549 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5549 failed.

@bradgrantham-lunarg
Copy link
Contributor

I think this probably also needs changes in android/scripts/gfxrecon.py to alter the way it invokes the replay Activity.

@ci-tester-lunarg
Copy link

Author qiq-2022 not on autobuild list. Waiting for curator authorization before starting CI build.

@qiq-2022
Copy link
Author

Hi, I have modified the activity name in android/scripts/gfxrecon.py.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 323522.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5556 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5556 failed.

@ci-tester-lunarg
Copy link

Author qiq-2022 not on autobuild list. Waiting for curator authorization before starting CI build.

@antonio-lunarg antonio-lunarg self-requested a review December 18, 2024 17:23
@antonio-lunarg
Copy link
Contributor

antonio-lunarg commented Dec 19, 2024

I've tested this on a device with a notch, and I noticed the replay does not extend over the cutout area.

To fix that, I had to add a res/values-v27/styles.xml with the following content:

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppTheme" parent="@android:style/Theme.NoTitleBar.Fullscreen">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>

        <item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:windowTranslucentNavigation">true</item>
    </style>
</resources>

@qiq-2022 qiq-2022 force-pushed the MultiWindowAndroid branch from c195705 to 7cba771 Compare January 7, 2025 10:52
@ci-tester-lunarg
Copy link

Author qiq-2022 not on autobuild list. Waiting for curator authorization before starting CI build.

@qiq-2022 qiq-2022 force-pushed the MultiWindowAndroid branch from 7cba771 to d332a5c Compare January 8, 2025 02:26
@ci-tester-lunarg
Copy link

Author qiq-2022 not on autobuild list. Waiting for curator authorization before starting CI build.

Copy link
Contributor

@antonio-lunarg antonio-lunarg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates! Once my last comment is resolved, LGTM.

Introduce JAVA layer into gfxreconstruct
to enable replay multi-window trace files on Android.
The command line changes to
am start -n "com.lunarg.gfxreconstruct.replay/.ReplayActivity"
@qiq-2022 qiq-2022 force-pushed the MultiWindowAndroid branch from d332a5c to 0d436aa Compare January 8, 2025 10:08
@ci-tester-lunarg
Copy link

Author qiq-2022 not on autobuild list. Waiting for curator authorization before starting CI build.

@MarkY-LunarG
Copy link
Contributor

MarkY-LunarG commented Jan 13, 2025

@qiq-2022 , I ran this on my Pixel 6 with Android 13 (even with Antonio's change) and I only see half of the screen. I believe @per-mathisen-arm mentioned there were issues pre Android 14, but I thought he mentioned you had fixes for that. Do you have suggestions? Thanks

Update It looks like it's because the application is launching in portrait mode on my phone. If I manually rotate it, the image looks correct.

@qiq-2022
Copy link
Author

qiq-2022 commented Jan 14, 2025

@MarkY-LunarG

It looks like it's because the application is launching in portrait mode on my phone. If I manually rotate it, the image looks correct.

Yes that's true. This problem comes from the existing way of changing orientation. Simply call "setRequestedOrientation" after the first window created will leads to this issue. If we only set the orientation at the very beginning, it will not have this problem.

My proposal is to fix the app orientation to landscape since most traces are captured in landscape mode. And provide an option that can make the app replay in portrait mode. Otherwise, it will have to fix the way of changing orientation during replay.

I actually raised an issue for awareness: #1945

@MarkY-LunarG
Copy link
Contributor

We actually have a combination of portrait and landscape mode captures. This is because we capture Android GUI as well since it uses SKIA with Vulkan. So we need to be able to dynamically switch based on the capture.

@MarkY-LunarG
Copy link
Contributor

MarkY-LunarG commented Jan 14, 2025

I'm not sure if this is the fix, but if I add the following in ReplayActivity.java, it seems to work on the few tests I've tried:

In ReplayActivity.java, addNewView, right after System.loadLibrary:

                if (width > height) {
                    setRequestedOrientation(0);
                } else {
                    setRequestedOrientation(1);
                }

I don't know if:

  1. We need to wrap this in an Android version check
  2. If this will really work with portrait tests.

I have to do more testing. But I'll let you know.

@MarkY-LunarG
Copy link
Contributor

I'm not sure if this is the fix, but if I add the following in ReplayActivity.java, it seems to work on the few tests I've tried:

In ReplayActivity.java, addNewView, right after System.loadLibrary:

                if (width > height) {
                    setRequestedOrientation(0);
                } else {
                    setRequestedOrientation(1);
                }

I don't know if:

1. We need to wrap this in an Android version check

2. If this will really work with portrait tests.

I have to do more testing. But I'll let you know.

Nope. That worked for landscape captures when the device was locked in portrait mode, but not portrait captures.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 367637.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 367637 cancelled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants