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

How to build minicap.so for android 11 ? #208

Open
wull8 opened this issue Mar 31, 2020 · 27 comments
Open

How to build minicap.so for android 11 ? #208

wull8 opened this issue Mar 31, 2020 · 27 comments

Comments

@wull8
Copy link

wull8 commented Mar 31, 2020

Anyone started playing with android 11?

@varundtsfi
Copy link

varundtsfi commented Apr 2, 2020

Hi @wull8
I am trying to build android-r-preview-2 but initially I am getting below errors.
But once these errors fixed I can come up with some data.If you have any idea why above errors are there then your suggestions are welcome.

error: external/linux-kselftest/Android.bp:53:13: unrecognized property "arch.mips"
error: external/linux-kselftest/Android.bp:56:15: unrecognized property "arch.mips64"
error: external/seccomp-tests/Android.bp:20:13: unrecognized property "arch.mips"
error: external/seccomp-tests/Android.bp:23:15: unrecognized property "arch.mips64"

repo init -u https://android.googlesource.com/platform/manifest -b android-r-preview-1
My System details :-
Ubuntu 16.04 LTS
Python -3.5.2
Java 1.8

@varundtsfi
Copy link

I have tried by taking the latest repo

repo init -u https://android.googlesource.com/platform/manifest -b android-r-preview-2
and getting below error.
[100% 268/268] writing build rules ...
FAILED:
build/make/core/base_rules.mk:491: error: overriding commands for target `out/target/product/generic_arm64/system/bin/chattr', previously defined at build/make/core/base_rules.mk:467
18:28:48 ckati failed with: exit status 1

I have put the same logs over google community. If I found something then I will post

@entomber
Copy link

entomber commented May 6, 2020

@varundtsfi I got it to build on android-r-preview-3 by commenting out the following in external/linux-kselftest/Android.bp and external/seccomp-tests/Android.bp:

/*
    arch: {
        mips: {
            enabled: false,
        },
        mips64: {
            enabled: false,
        },
    },
*/

Doesn't work with STF though.

@varundtsfi
Copy link

@varundtsfi I got it to build on android-r-preview-3 by commenting out the following in external/linux-kselftest/Android.bp and external/seccomp-tests/Android.bp:

/*
    arch: {
        mips: {
            enabled: false,
        },
        mips64: {
            enabled: false,
        },
    },
*/

Doesn't work with STF though.

Hi @entomber
Due to some other stuffs I was busy but today only I have downloaded the android-r-preview-4. I will build the OS and share the results.

@varundtsfi
Copy link

varundtsfi commented May 26, 2020

@entomber I have build android-r-preview-4 successfully but when I push mimicap in external directory and again build then not getting generated minicap.so file. Do you have any idea...

@wull8
Copy link
Author

wull8 commented Jun 11, 2020

@varundtsfi @pcrepieux

Hello all,

Thanks for your information !

I managed to build minicap.so with "android-r-preview-4". But when I run it on mobile device, I got below error:

Check error CANNOT LINK EXECUTABLE "/data/local/tmp/minicap": cannot locate symbol "_ZN7android21SurfaceComposerClient17getDisplayConfigsERKNS_2spINS_7IBinderEEEPNS_6VectorINS_11DisplayInfoEEE"

Any idea about this issue ? (I guess android-r-preview-4 still uses "minicap_29.cpp").

Thanks :)

@varundtsfi
Copy link

Hi @entomber and @wull8

I am also getting the same error
CANNOT LINK EXECUTABLE "/data/local/tmp/minicap": cannot locate symbol "_ZN7android21SurfaceComposerClient17getDisplayConfigsERKNS_2spINS_7IBinderEEEPNS_6VectorINS_11DisplayInfoEEE" referenced by "/data/local/tmp/minicap.so"...

But I have verified SurfaceComposerClient and ISurfaceComposerClient files in android 10 and 11 both are identical.
Screenshot from 2020-06-16 10-32-52
Screenshot from 2020-06-16 10-31-51

Now I will try another approach If I got something I will post immediately over here.

@pcrepieux Any suggestion please.

@pcrepieux
Copy link
Contributor

That's a recurring issue. The AOSP source code is currently not fully sync'ed with preview/beta builds. There is only 2 options I can think of with the current codebase:

  • wait ...
  • figure out the API change by inspecting the libgui.so and dynamically load and call the new method.

I'll try to look at this issue in the coming days. If I find a way to make it work, I'll keep you posted.

@varundtsfi
Copy link

varundtsfi commented Jun 22, 2020

@pcrepieux which file we have to compare.

Dynamically load and call the new method this activity we have done in android 10 support also.

I am working on second option. Whatever would be the output I will post it here.

@kotini
Copy link

kotini commented Jul 6, 2020

Any update on android 11 support ?

@pcrepieux
Copy link
Contributor

pcrepieux commented Jul 7, 2020

Will check again shortly if the the current AOSP source code can help. The main blocker is that
android::SurfaceComposerClient::Transaction::setDisplayProjection(android::sp<android::IBinder> const&, unsigned int, android::Rect const&, android::Rect const&) changed to
android::SurfaceComposerClient::Transaction::setDisplayProjection(android::sp<android::IBinder> const&, android::ui::Rotation, android::Rect const&, android::Rect const&)
The unsigned int specifying rotation has become a ui::Rotation. Even knowing that (by comparing screenrecord binary or libgui.so), without the source code, it's a bit hard to fix :-/
I've seen someone commenting, he managed to do it (unfortunately, I don't see this comment anymore). That would be interesting to know which branch/tag from AOSP (or other repo ...??? ... ) has been used.

@WeiPeiXian
Copy link

my code is different from aosp, it can be only used to xiaomi device
maybe the code below can be helpful
#include <ui/Rotation.h>
at line 279
t.setDisplayProjection(mVirtualDisplay, android::ui::toRotation(android::DISPLAY_ORIENTATION_0), layerStackRect, visibleRect);

in my code , the code of getDisplayinfo method is different from aosp, so i delete my comment, it just can be used to xiaomi device for other device
here is my code, i think only line 279 will be helpful to build minicap.so for to build minicap.so for aosp
https://github.com/WeiPeiXian/minicap/blob/master/jni/minicap-shared/aosp/src/minicap_30.cpp,

@pcrepieux
Copy link
Contributor

@WeiPeiXian
I agree using this fonction would make it work but where did you get this header file ui/Rotation.h ?
Could you explain how you managed to build minicap-shared ? Maybe I am missing a little something but, while I understand what are the required changes, I couldn't find the required sources to compile it.
Any link, branch name/tag, ... would be appreciated :-)

@WeiPeiXian
Copy link

@pcrepieux
I also can't find Rotation.h at aosp
I use company internal code compilation to build it instead of AOSP
so nothing help can be given to build it on aosp branch
maybe we should wait ... , the beta branch may contains Rotation.h

@siva-kranthi
Copy link

@pcrepieux @wull8 @varundtsfi @entomber @WeiPeiXian
Can you please let me know the steps to build the so files for Android 11 without docker as I have access to the full R code from OEM. Didn't understand much from this https://github.com/openstf/minicap/blob/master/jni/minicap-shared/README.md

@pcrepieux
Copy link
Contributor

Here is a comment in an older discussion that will maybe provide you the step you are looking for : #168 (comment)

@varundtsfi
Copy link

@WeiPeiXian Is it possible that you can share minicap.so files for Android 11 for Xiaomi Devices. Please share if you don't have any issue.

@WeiPeiXian
Copy link

https://github.com/WeiPeiXian/minicap/tree/master/minicap.so
Here is the minicap.so files for Android 11
best wishes

@varundtsfi
Copy link

@WeiPeiXian
Thanks for sharing the binaries. I have tested it on Xiaomi Android 11 It's working.

INFO: (packages/apps/SYSOPT/minicap/so/src/minicap_30.cpp:248) Creating SurfaceComposerClient
INFO: (packages/apps/SYSOPT/minicap/so/src/minicap_30.cpp:251) Performing SurfaceComposerClient init check
INFO: (packages/apps/SYSOPT/minicap/so/src/minicap_30.cpp:262) Creating virtual display
INFO: (packages/apps/SYSOPT/minicap/so/src/minicap_30.cpp:268) Creating buffer queue
INFO: (packages/apps/SYSOPT/minicap/so/src/minicap_30.cpp:271) Setting buffer options
INFO: (packages/apps/SYSOPT/minicap/so/src/minicap_30.cpp:275) Creating CPU consumer
INFO: (packages/apps/SYSOPT/minicap/so/src/minicap_30.cpp:279) Creating frame waiter
INFO: (packages/apps/SYSOPT/minicap/so/src/minicap_30.cpp:283) Publishing virtual display BBBB:
INFO: (packages/apps/SYSOPT/minicap/so/src/minicap_30.cpp:289) Starting apply
INFO: (packages/apps/SYSOPT/minicap/so/src/minicap_30.cpp:291) Ending apply

@pcrepieux Here is a good information about these binaries. These binaries are working for Google Pixel 2(Android 11) Also.

@Maciejszuchta
Copy link

https://github.com/WeiPeiXian/minicap/tree/master/minicap.so
Here is the minicap.so files for Android 11
best wishes

Which minicap file do you use for android 11?
I used the ones I got by default from building minicap and repaced only minicap.so file that you provided but now I get
CANNOT LINK EXECUTABLE "/data/local/tmp/minicap": cannot locate symbol "_ZN7android21SurfaceComposerClient22getActiveDisplayConfigERKNS_2spINS_7IBinderEEEPNS_13DisplayConfigE" referenced by "/data/local/tmp/minicap.so"...

@PengJunchen
Copy link

@WeiPeiXian

I try to use your forked branch to build the library, but the size of the built library is only 2KB, would you please tell me what kind of things missing?
The manifest I used is android-11.0.0_r3.

@stoefln
Copy link

stoefln commented Oct 8, 2020

https://github.com/WeiPeiXian/minicap/tree/master/minicap.so
Here is the minicap.so files for Android 11
best wishes
@WeiPeiXian
I am missing the x86 binary. Would you be able to provide it?

@PengJunchen
Copy link

https://github.com/WeiPeiXian/minicap/tree/master/minicap.so
Here is the minicap.so files for Android 11
best wishes
@WeiPeiXian
I am missing the x86 binary. Would you be able to provide it?

It has been provided in official support: https://github.com/DeviceFarmer/minicap

@maykonpacheco
Copy link

maykonpacheco commented Dec 7, 2022

@pcrepieux, @varundtsfi To make the minicap work, does my cell phone use adb?

@varundtsfi
Copy link

varundtsfi commented Dec 7, 2022

@pcrepieux, @varundtsfi To make the minicap work, does my cell phone use adb?
Hi @maykonpacheco ,

Yes it does(actually your local system uses to communicate with your device ) To cast the screen from your mobile device to your local system.

It uses adb forward command and many more to get the device details.

@maykonpacheco
Copy link

maykonpacheco commented Dec 7, 2022

Hi, @varundtsfi , I'm trying to follow that instruction from @pcrepieux to add the minicap to my LG G7.
Even though I use adb, I'm having a hard time understanding it.
How do I add the minicap to my device?
#169
image

@varundtsfi
Copy link

What is the android version of LG G7 you are using So that I will try to download the aosp to build .

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

No branches or pull requests