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

Vector<> have different types XI AOMI MI_10 MIUI_12 Android 10 (SDK 29) #6

Open
varundtsfi opened this issue Aug 20, 2020 · 69 comments
Labels
bug Something isn't working

Comments

@varundtsfi
Copy link
Collaborator

varundtsfi commented Aug 20, 2020

Hi,
We are facing this issue in Xiaomi MIUI 11 and MIUI 12 too. As per my understanding It's not related with Android Version but related with Xiaomi MIUI Version. Previously it was coming in MIUI 11 but not it's there in 12 too.
I tried to downgrade my xiaomi device from MIUI 11 to MIUI 10 then its started working.
Below is the old reference
(openstf#169)
(#2)
Previously It was coming in LG Got Resolved by @pcrepieux but Same binaries which is working fine for LG devices those are not working in Xiaomi.
In Xiaomi It coming as a black screen.

Device Details:-
[ro.product.model]: [Mi 10]
[ro.build.version.incremental]: [V12.0.2.0.QJBINXM]
[ro.build.version.release]: [10]
[ro.build.version.sdk]: [29]
[ro.build.version.security_patch]: [2020-07-01]
[ro.com.google.gmsversion]: [10_202005]
[ro.miui.ui.version.code]: [10]
[ro.miui.ui.version.name]: [V12]

INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:240) Creating SurfaceComposerClient
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:243) Performing SurfaceComposerClient init check
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:254) Creating virtual display
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:260) Creating buffer queue
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:263) Setting buffer options
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:267) Creating CPU consumer
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:271) Creating frame waiter
INFO: (external/MY_minicap/minicap/src/minicap_29.cpp:275) Publishing virtual display
Vector<> have different types (this=0x7fd1f95480, rhs=0x73e7b4e030)
aborted

@issue-label-bot
Copy link

Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.

@koral-- koral-- added the bug Something isn't working label Aug 20, 2020
@dkw72n
Copy link

dkw72n commented Oct 13, 2020

I managed to make it work on my device(MI CC9 Pro, MIUI 11 20.3.9, Android 10) with one line added to the AOSP code

diff --git a/libs/gui/include/gui/LayerState.h b/libs/gui/include/gui/LayerState.h
index f438eb3d0..98490849b 100644
--- a/libs/gui/include/gui/LayerState.h
+++ b/libs/gui/include/gui/LayerState.h
@@ -254,6 +254,7 @@ struct DisplayState {

     uint32_t width, height;

+    uint8_t _dummy[16];
     status_t write(Parcel& output) const;
     status_t read(const Parcel& input);
 };

It doesn't matter if the internal layout of this struct is exactly the same with MIUI's, as long as they shared the same size, it should work (of course for MIUI ONLY).

@pcrepieux
Copy link

Well done @dkw72n
Thanks for sharing.
FYI, there is an ongoing work to get rid of the AOSP compilation dependency but up until this is completed your tip might be helpful to some users. From the project perspective, I am not sure how to handle this properly. I might as well try to speed up the new implementation which hopefully is expected to be future proof (current minicap breaks at every new release).

@man4567890
Copy link

Hi @dkw72n ,
Do you have the compiled binaries please, I do not have the ability to build and I do not know which file to change, I guess you have to change the source and build? Please correct me if I'm wrong

@varundtsfi
Copy link
Collaborator Author

varundtsfi commented Oct 30, 2020

@pcrepieux
I have MI 10 device android 10 with MIUI 12.
I will try with android 10 aosp using the suggested changes.

In the libs/gui/include/gui/LayerState.h file and by added this line

  • uint8_t _dummy[16];
    I am right? @dkw72n

@varundtsfi
Copy link
Collaborator Author

varundtsfi commented Nov 1, 2020

@pcrepieux I have build the AOSP by adding the changes suggested by @dkw72n and It's working fine with MIUI 11 and 12.

There is an issue it's not generic as suggested by @dkw72n these binaries will be supported only for Xiaomi device having MIUI 11 and 12.
WhatsApp Image 2020-11-01 at 11 09 02

Again @dkw72n thanks for your suggestion man.
😄

@varundtsfi
Copy link
Collaborator Author

@man4567890 I will share the binaries very soon on my git branch.

@man4567890
Copy link

@varundtsfi much appreciated!

@chaooe
Copy link

chaooe commented Nov 3, 2020

Does the aosp for the android system? I don't know where the file is /libs/gui/include/gui/LayerState.h

@varundtsfi
Copy link
Collaborator Author

varundtsfi commented Nov 3, 2020

Hi @chaooe It's in frameworks/native/include/gui/LayerState.h. and Yes AOSP is android system.

@chaooe
Copy link

chaooe commented Nov 3, 2020

@varundtsfi sorry, it's not easy to download the AOSP and compline it for me. Could you help to build the minicap.so to me?
my device version is android29, and abi is arm64-v8a

@pcrepieux
Copy link

@chaooe I believe you'll find it here https://github.com/varundtsfi/Xiaomi_Vector_issue/tree/main/android-29/arm64-v8a thanks to @varundtsfi
Hope this helps until we decide how to properly update the project.

@chaooe
Copy link

chaooe commented Nov 3, 2020

Thanks, it works. Mi 10 with Android 10. And the MIUI version is 12.08. Will try more Mi device which blocked me before.

@man4567890
Copy link

Thanks @varundtsfi , I tried it on a LGE phone, but it still breaks, I guess it only works on Xiaomi

2020-11-03T08:38:03.776Z INF/device:plugins:touch 7166 [LMK920TM1f70231a] Reading minitouch banner
2020-11-03T08:38:03.818Z INF/device:plugins:touch 7166 [LMK920TM1f70231a] minitouch says: "Connection established"
2020-11-03T08:38:03.828Z INF/device:plugins:vnc 7166 [LMK920TM1f70231a] Starting VNC server on port 7470
2020-11-03T08:38:03.830Z INF/device:plugins:browser 7166 [LMK920TM1f70231a] Loading browser list
2020-11-03T08:38:03.868Z INF/device:plugins:browser 7166 [LMK920TM1f70231a] Updating browser list
2020-11-03T08:38:03.870Z INF/device:plugins:mute 7166 [LMK920TM1f70231a] Will not mute master volume
2020-11-03T08:38:04.143Z INF/device:resources:minirev 7166 [LMK920TM1f70231a] Installing "/usr/lib/node_modules/stf/vendor/minirev/arm64-v8a/minirev" as "/data/local/tmp/minirev"
2020-11-03T08:38:04.306Z INF/device:plugins:forward 7166 [LMK920TM1f70231a] Launching reverse port forwarding service
2020-11-03T08:38:04.333Z INF/device:plugins:forward 7166 [LMK920TM1f70231a] Connecting to reverse port forwarding service
2020-11-03T08:38:04.516Z INF/device 7166 [LMK920TM1f70231a] Fully operational
2020-11-03T08:41:30.959Z IMP/device:plugins:group 7166 [LMK920TM1f70231a] Now owned by ******
2020-11-03T08:41:30.960Z INF/device:plugins:group 7166 [LMK920TM1f70231a] Subscribing to group channel "27wYow6vQ7KHx53MvmzFQw=="
2020-11-03T08:41:33.145Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Setting frame producer projection to 865x865
2020-11-03T08:41:33.146Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Requesting frame producer to start
2020-11-03T08:41:33.147Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Launching screen service
2020-11-03T08:41:33.244Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "PID: 31995"
2020-11-03T08:41:33.245Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: Using projection 1080x2400@389x865/0"
2020-11-03T08:41:33.245Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:241) Creating SurfaceComposerClient"
2020-11-03T08:41:33.247Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Connecting to minicap service
2020-11-03T08:41:33.248Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:244) Performing SurfaceComposerClient init check"
2020-11-03T08:41:33.249Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:255) Creating virtual display"
2020-11-03T08:41:33.249Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:261) Creating buffer queue"
2020-11-03T08:41:33.249Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:264) Setting buffer options"
2020-11-03T08:41:33.250Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:268) Creating CPU consumer"
2020-11-03T08:41:33.250Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:272) Creating frame waiter"
2020-11-03T08:41:33.251Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:276) Publishing virtual display"
2020-11-03T08:41:33.252Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "Vector<> have different types (this=0x7ff5b517d0, rhs=0x7ff5b51920)"
2020-11-03T08:41:33.364Z WRN/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Shell keeping minicap running ended unexpectedly
2020-11-03T08:41:35.060Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Disconnecting from minicap service
2020-11-03T08:41:35.063Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Stopping minicap service
2020-11-03T08:41:35.064Z FTL/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Frame producer had an error FailError: Failure: 'closed'
    at /usr/lib/node_modules/stf/node_modules/adbkit/lib/adb/parser.js:183:29
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
2020-11-03T08:41:35.064Z FTL/util:lifecycle 7166 [LMK920TM1f70231a] Shutting down due to fatal error
2020-11-03T08:41:35.073Z INF/provider 12558 [*] Cleaning up device worker "LMK920TM1f70231a"
2020-11-03T08:41:35.073Z ERR/provider 12558 [*] Device worker "LMK920TM1f70231a" died with code 1
2020-11-03T08:41:35.074Z INF/provider 12558 [*] Restarting device worker "LMK920TM1f70231a"
2020-11-03T08:41:36.028Z INF/device:support:push 26999 [LMK920TM1f70231a] Sending output to "tcp://127.0.0.1:7116"
2020-11-03T08:41:36.033Z INF/device 26999 [LMK920TM1f70231a] Preparing device
2020-11-03T08:41:36.619Z INF/device:support:sub 26999 [LMK920TM1f70231a] Receiving input from "tcp://127.0.0.1:7114"
2020-11-03T08:41:36.621Z INF/device:support:sub 26999 [LMK920TM1f70231a] Subscribing to permanent channel "*ALL"
2020-11-03T08:41:36.715Z INF/device:support:properties 26999 [LMK920TM1f70231a] Loading properties
2020-11-03T08:41:36.798Z INF/device:support:sdk 26999 [LMK920TM1f70231a] Supports SDK 29
2020-11-03T08:41:36.799Z INF/device:support:abi 26999 [LMK920TM1f70231a] Supports ABIs arm64-v8a, armeabi-v7a, armeabi

@pcrepieux
Copy link

Indeed, that likely is devices specific. I wouldn't be surprised that applying the fix suggested by @dkw72n with another array size could make it work but I don't find it would be an appropriate solution.
That's great for Xiaomi users but for other devices that are impacted, the only viable solution I can think of will come with the reimplementation of minicap.

@varundtsfi
Copy link
Collaborator Author

varundtsfi commented Nov 4, 2020

properly

@chaooe I believe you'll find it here https://github.com/varundtsfi/Xiaomi_Vector_issue thanks to @varundtsfi
Hope this helps until we decide how to properly update the project.

@pcrepieux Thank you so much Actually I am building for Android 9 too and soon those will be available on my git.

@varundtsfi
Copy link
Collaborator Author

varundtsfi commented Nov 4, 2020

Indeed, that likely is devices specific. I wouldn't be surprised that applying the fix suggested by @dkw72n with another array size could make it work but I don't find it would be an appropriate solution.
That's great for Xiaomi users but for other devices that are impacted, the only viable solution I can think of will come with the reimplementation of minicap.

I Agreed with you sir but by the time People can resume their work. I think Video streaming would be a good option as I am using scrcpy which is working fine on each and every device.

@varundtsfi
Copy link
Collaborator Author

varundtsfi commented Nov 4, 2020

Thanks, it works. Mi 10 with Android 10. And the MIUI version is 12.08. Will try more Mi device which blocked me before.

Here are the Prebuilt binaries for Android 9 with MIUI 11 and 12 too.
@chaooe , @man4567890 and @pcrepieux

https://github.com/varundtsfi/Xiaomi_Vector_issue

@varundtsfi
Copy link
Collaborator Author

varundtsfi commented Nov 4, 2020

Thanks @varundtsfi , I tried it on a LGE phone, but it still breaks, I guess it only works on Xiaomi

2020-11-03T08:38:03.776Z INF/device:plugins:touch 7166 [LMK920TM1f70231a] Reading minitouch banner
2020-11-03T08:38:03.818Z INF/device:plugins:touch 7166 [LMK920TM1f70231a] minitouch says: "Connection established"
2020-11-03T08:38:03.828Z INF/device:plugins:vnc 7166 [LMK920TM1f70231a] Starting VNC server on port 7470
2020-11-03T08:38:03.830Z INF/device:plugins:browser 7166 [LMK920TM1f70231a] Loading browser list
2020-11-03T08:38:03.868Z INF/device:plugins:browser 7166 [LMK920TM1f70231a] Updating browser list
2020-11-03T08:38:03.870Z INF/device:plugins:mute 7166 [LMK920TM1f70231a] Will not mute master volume
2020-11-03T08:38:04.143Z INF/device:resources:minirev 7166 [LMK920TM1f70231a] Installing "/usr/lib/node_modules/stf/vendor/minirev/arm64-v8a/minirev" as "/data/local/tmp/minirev"
2020-11-03T08:38:04.306Z INF/device:plugins:forward 7166 [LMK920TM1f70231a] Launching reverse port forwarding service
2020-11-03T08:38:04.333Z INF/device:plugins:forward 7166 [LMK920TM1f70231a] Connecting to reverse port forwarding service
2020-11-03T08:38:04.516Z INF/device 7166 [LMK920TM1f70231a] Fully operational
2020-11-03T08:41:30.959Z IMP/device:plugins:group 7166 [LMK920TM1f70231a] Now owned by ******
2020-11-03T08:41:30.960Z INF/device:plugins:group 7166 [LMK920TM1f70231a] Subscribing to group channel "27wYow6vQ7KHx53MvmzFQw=="
2020-11-03T08:41:33.145Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Setting frame producer projection to 865x865
2020-11-03T08:41:33.146Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Requesting frame producer to start
2020-11-03T08:41:33.147Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Launching screen service
2020-11-03T08:41:33.244Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "PID: 31995"
2020-11-03T08:41:33.245Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: Using projection 1080x2400@389x865/0"
2020-11-03T08:41:33.245Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:241) Creating SurfaceComposerClient"
2020-11-03T08:41:33.247Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Connecting to minicap service
2020-11-03T08:41:33.248Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:244) Performing SurfaceComposerClient init check"
2020-11-03T08:41:33.249Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:255) Creating virtual display"
2020-11-03T08:41:33.249Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:261) Creating buffer queue"
2020-11-03T08:41:33.249Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:264) Setting buffer options"
2020-11-03T08:41:33.250Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:268) Creating CPU consumer"
2020-11-03T08:41:33.250Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:272) Creating frame waiter"
2020-11-03T08:41:33.251Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "INFO: (external/MY_minicap/src/minicap_29.cpp:276) Publishing virtual display"
2020-11-03T08:41:33.252Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] minicap says: "Vector<> have different types (this=0x7ff5b517d0, rhs=0x7ff5b51920)"
2020-11-03T08:41:33.364Z WRN/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Shell keeping minicap running ended unexpectedly
2020-11-03T08:41:35.060Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Disconnecting from minicap service
2020-11-03T08:41:35.063Z INF/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Stopping minicap service
2020-11-03T08:41:35.064Z FTL/device:plugins:screen:stream 7166 [LMK920TM1f70231a] Frame producer had an error FailError: Failure: 'closed'
    at /usr/lib/node_modules/stf/node_modules/adbkit/lib/adb/parser.js:183:29
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
2020-11-03T08:41:35.064Z FTL/util:lifecycle 7166 [LMK920TM1f70231a] Shutting down due to fatal error
2020-11-03T08:41:35.073Z INF/provider 12558 [*] Cleaning up device worker "LMK920TM1f70231a"
2020-11-03T08:41:35.073Z ERR/provider 12558 [*] Device worker "LMK920TM1f70231a" died with code 1
2020-11-03T08:41:35.074Z INF/provider 12558 [*] Restarting device worker "LMK920TM1f70231a"
2020-11-03T08:41:36.028Z INF/device:support:push 26999 [LMK920TM1f70231a] Sending output to "tcp://127.0.0.1:7116"
2020-11-03T08:41:36.033Z INF/device 26999 [LMK920TM1f70231a] Preparing device
2020-11-03T08:41:36.619Z INF/device:support:sub 26999 [LMK920TM1f70231a] Receiving input from "tcp://127.0.0.1:7114"
2020-11-03T08:41:36.621Z INF/device:support:sub 26999 [LMK920TM1f70231a] Subscribing to permanent channel "*ALL"
2020-11-03T08:41:36.715Z INF/device:support:properties 26999 [LMK920TM1f70231a] Loading properties
2020-11-03T08:41:36.798Z INF/device:support:sdk 26999 [LMK920TM1f70231a] Supports **SDK 29**
2020-11-03T08:41:36.799Z INF/device:support:abi 26999 [LMK920TM1f70231a] Supports ABIs arm64-v8a, armeabi-v7a, armeabi

I have the binaries for LGE SDK 28 (https://github.com/varundtsfi/Xiaomi_Vector_issue) but your device having SDK Level 29 so I need to build for 29 then only it will work and Yes those binaries only for Xiamoi device having Android 9 and 10 or MIUI having 11 or 12.

@man4567890
Copy link

Thanks so much @varundtsfi

@pcrepieux
Copy link

Thanks @varundtsfi for your efforts to help users having this issue.
The plan definitely is to upgrade minicap and I absolutely agree that scrcpy is a very nice tool.
My current goal is to make minicap operate at a higher level (like they do) to decrease CPU arch, ABI, fragmentations issues because I am afraid that duplicating the minicap.so will be hard to maintain.
Will try to publish some code shortly.

@pcrepieux
Copy link

pcrepieux commented Nov 5, 2020

I just started an experimental branch with the WIP code (mostly a proof of concept for now). Looks OK on pixel 4 running Android11 and a Mi 9 running Android 9 (that one used to have the "Vector<> have different types" error)
Note: there is a directory named experimental in this branch which contains a kotlin implementation of minicap (at least partially).

$ cd experimental
$ ./gradlew assembleDebug
$ adb push ./app/build/outputs/apk/debug/minicap-0.1-debug.apk /data/local/tmp/
$ adb shell CLASSPATH=/data/local/tmp/minicap-0.1-debug.apk app_process /system/bin io.devicefarmer.minicap.Main

Will document this and continue the dev & integration with stf shortly

@ii958
Copy link

ii958 commented Nov 10, 2020

it works

@varundtsfi
Copy link
Collaborator Author

varundtsfi commented Nov 10, 2020

I just started an experimental branch with the WIP code (mostly a proof of concept for now). Looks OK on pixel 4 running Android11 and a Mi 9 running Android 9 (that one used to have the "Vector<> have different types" error)
Note: there is a directory named experimental in this branch which contains a kotlin implementation of minicap (at least partially).

$ cd experimental
$ ./gradlew assembleDebug
$ adb push ./app/build/outputs/apk/debug/minicap-0.1-debug.apk /data/local/tmp/
$ adb shell CLASSPATH=/data/local/tmp/minicap-0.1-debug.apk app_process /system/bin io.devicefarmer.minicap.Main

Will document this and continue the dev & integration with stf shortly

Hi @pcrepieux
Your solution is working fine on Xiaomi Devices too.

wokring

@pcrepieux
Copy link

Thanks for the feedbacks @varundtsfi, @ii958
@man4567890 could you give it a try on your LG device ?

@man4567890
Copy link

@pcrepieux ,could you provide me with the .so files please, I tried to build this, but got a bit confused, so I'm not sure if I have the correct binaries

@pcrepieux
Copy link

@man4567890, there is no more .so files.

The following instructions assumes MINICAP_SRC_PATH is the path where you cloned the experimental branch (those are pretty much the same as the original ones here).

  1. Run minicap on the device
$ cd MINICAP_SRC_PATH/experimental
$ ./gradlew assembleDebug
$ adb push ./app/build/outputs/apk/debug/minicap-0.1-debug.apk /data/local/tmp/
$ adb shell CLASSPATH=/data/local/tmp/minicap-0.1-debug.apk app_process /system/bin io.devicefarmer.minicap.Main
  1. Run the sample web application
$ cd MINICAP_SRC_PATH/example
$ adb forward tcp:1717 localabstract:minicap
$ node app.js
  1. Open your web browser on http://localhost:9002

You should see your device screen in your browser.

@EdwardCheck
Copy link

EdwardCheck commented Dec 9, 2020

@varundtsfi
you shared minicap.so just work on Xiaomi,sdk=29, miui12。
can you share the detailed steps of how you compile minicap.so (minicap-shared)? tks

@yusunan
Copy link

yusunan commented Dec 9, 2020

@pcrepieux @varundtsfi
Share some informations ,We got a new MIUI device as follow IMAGE
下载 (4)
And it's not has this aborted issue,So we tested more MIUI devices and We came to a conclusion:
XIAOMI has fixed this issue since the device's [Android security patch level] is [2020-09-01 ]
So this kind of devices should use the original minicap.so file.

@pcrepieux By the way I had try the 2.60 minicap.apk ,it works fine in other devices but will failed in this device.
And its work fine with original minicap and minicap.so file.
截屏2020-12-09 上午10 37 08

@PengJunchen
Copy link

@pcrepieux I also try 2.60, but still got failure for MIUI 11.0.23, has that version fixed the issue which mentioned by @varundtsfi ?

@varundtsfi
Copy link
Collaborator Author

@EdwardCheck Yes sure I will share the steps very soon just allow me some time. My Laptop got crashed 3 days back because of that I am not able to do anything.

@Lua12138
Copy link

Lua12138 commented Feb 5, 2021

@EdwardCheck Yes sure I will share the steps very soon just allow me some time. My Laptop got crashed 3 days back because of that I am not able to do anything.

Is there anything new ?

@ZGrauer
Copy link

ZGrauer commented Feb 9, 2021

I'm having some issues with setting the projection virtual width and height to reduced values from the real width and height using the minicap-0.1-debug.apk.

The normal minicap.so files are not working for this LG V60 ThinQ 5G device with SDK 29. Every version of minicap.so provided doesn't work and results in vector<> errors. This experimental apk successfully streams the screen but not at the requested size.

Is this a known issue, or am I missing params or not using the APK correctly?

Starting minicap:

[ro.product.build.version.incremental]: [2013217264e42]
[ro.product.build.version.release]: [10]
[ro.product.build.version.sdk]: [29]
[ro.product.cpu.abi]: [arm64-v8a]
adb.exe -s LMV600TMbc31ad40 shell CLASSPATH=/data/local/tmp/minicap-0.1-debug.apk app_process /system/bin io.devicefarmer.minicap.Main -P 1080x2460@360x820/0 
PID: 4120
Listening on minicap
chunk(length=24)
banner {
  version: 1,
  length: 24,
  pid: 26916,
  realWidth: 1080,
  realHeight: 2460,
  virtualWidth: 1080,
  virtualHeight: 2460,
  orientation: 0,
  quirks: 2
}
chunk(length=36544)
headerbyte1(val=1)
headerbyte2(val=10497)
headerbyte3(val=338177)
headerbyte4(val=338177)
body(len=36540)
chunk(length=65495)
body(len=65495)
chunk(length=65536)

image

@pcrepieux
Copy link

Thanks for giving it a try. This early development might still be buggy. I confirm something's wrong with the projection parameter. Will give it a look.

@suzhenyu006
Copy link

Thanks for giving it a try. This early development might still be buggy. I confirm something's wrong with the projection parameter. Will give it a look.

is there any method to solve this problem??

@varundtsfi varundtsfi reopened this Mar 4, 2021
@yusunan
Copy link

yusunan commented Mar 15, 2021

@pcrepieux
Does minicap.apk able to take a screenshot like minicap -s.
Could you share the command?

@pcrepieux
Copy link

@yusunan,

No, the currently available apk doesn't support "-s" command line parameter. I am coding this feature at the moment so that the apk can replace the binary (hopefully)

@varundtsfi
Copy link
Collaborator Author

I'm having some issues with setting the projection virtual width and height to reduced values from the real width and height using the minicap-0.1-debug.apk.

The normal minicap.so files are not working for this LG V60 ThinQ 5G device with SDK 29. Every version of minicap.so provided doesn't work and results in vector<> errors. This experimental apk successfully streams the screen but not at the requested size.

Is this a known issue, or am I missing params or not using the APK correctly?

Starting minicap:

[ro.product.build.version.incremental]: [2013217264e42]
[ro.product.build.version.release]: [10]
[ro.product.build.version.sdk]: [29]
[ro.product.cpu.abi]: [arm64-v8a]
adb.exe -s LMV600TMbc31ad40 shell CLASSPATH=/data/local/tmp/minicap-0.1-debug.apk app_process /system/bin io.devicefarmer.minicap.Main -P 1080x2460@360x820/0 
PID: 4120
Listening on minicap
chunk(length=24)
banner {
  version: 1,
  length: 24,
  pid: 26916,
  realWidth: 1080,
  realHeight: 2460,
  virtualWidth: 1080,
  virtualHeight: 2460,
  orientation: 0,
  quirks: 2
}
chunk(length=36544)
headerbyte1(val=1)
headerbyte2(val=10497)
headerbyte3(val=338177)
headerbyte4(val=338177)
body(len=36540)
chunk(length=65495)
body(len=65495)
chunk(length=65536)

image

Hi @ZGrauer ,

If you want to use minicap.so, you can take the vector issue fix binaries from following link. Sorry for the delay

https://github.com/varundtsfi/Xiaomi_Vector_issue/tree/main/LG

@varundtsfi
Copy link
Collaborator Author

@yusunan,

No, the currently available apk doesn't support "-s" command line parameter. I am coding this feature at the moment so that the apk can replace the binary (hopefully)

Hi @pcrepieux ,

These day's People are getting more and more vector issue in devices. Previously it was in Xiaomi devices, then later came to know about LG and Now VIVO devices also we are getting the same issue.

But Xiaomi Solution will not work in LG and VIVO devices. We have to build required AOSP with proper changes.

I have one doubt. How its possible that Xiaomi issue came to other manufacture's . Are they(Xiaomi) sharing their code bese with LG and VIVO.

LG and VIVO using Xiaomi graphic library functionalities? I have built the solution for all these manufactures. But Video Streaming(Using MediaProjection) is working fine.

@ZGrauer
Copy link

ZGrauer commented May 20, 2021

Hi @ZGrauer ,

If you want to use minicap.so, you can take the vector issue fix binaries from following link. Sorry for the delay

https://github.com/varundtsfi/Xiaomi_Vector_issue/tree/main/LG

Hi @varundtsfi

I tried this file and I am getting this error,

CANNOT LINK EXECUTABLE "/data/local/tmp/minicap-devel/minicap": "/data/local/tmp/minicap-devel/minicap.so" is 32-bit instead of 64-bit

I am trying to use this file, https://github.com/varundtsfi/Xiaomi_Vector_issue/blob/main/LG/android-29/arm64-v8a/minicap.so

@pcrepieux
Copy link

@varundtsfi that's basically to get rid of all those kind of issues that minicap has been rewritten (see #12) 😉
@yusunan BTW screenshot is now possible with kotlin minicap
@ZGrauer @suzhenyu006 The projection should be OK now 🤞 (but when it's used with STF, the resulting stream doesn't look OK, I am not completely sure why for now)

Now the idea is to have stf using it as a fallback when "legacy" minicap doesn't work (at least for a transition stage, to ensure the new minicap is good enough). But if you using it as a standalone tool, it's supposed to work (I believe so). If not, let me know by creating new issue so that it can be improved.

@varundtsfi
Copy link
Collaborator Author

varundtsfi commented May 22, 2021

@ZGrauer
Let me verify it again. I think, I copied the armeabi_v7 binary into arm64 directory. I have
Tested armeabi_v7 and by mistake copied the same.
I will verify and confirm you very soon.
And thabks for informing me 👃

@varundtsfi
Copy link
Collaborator Author

@pcrepieux sure I will try this and share the experience.

@varundtsfi
Copy link
Collaborator Author

@ZGrauer

I have sent you an email please look into that and share the results.
I have tested the same binary on LG G7 Thinq devices arm64-v8a skd 29. 
If you face any issue please let me know.

@ZGrauer
Copy link

ZGrauer commented May 24, 2021

@varundtsfi

The new binary is working perfectly on my LG V60 ThinQ 5G device with SDK 29. Thank you

@varundtsfi
Copy link
Collaborator Author

@varundtsfi

The new binary is working perfectly on my LG V60 ThinQ 5G device with SDK 29. Thank you

wow great.

@varundtsfi
Copy link
Collaborator Author

I'm having some issues with setting the projection virtual width and height to reduced values from the real width and height using the minicap-0.1-debug.apk.
The normal minicap.so files are not working for this LG V60 ThinQ 5G device with SDK 29. Every version of minicap.so provided doesn't work and results in vector<> errors. This experimental apk successfully streams the screen but not at the requested size.
Is this a known issue, or am I missing params or not using the APK correctly?
Starting minicap:

[ro.product.build.version.incremental]: [2013217264e42]
[ro.product.build.version.release]: [10]
[ro.product.build.version.sdk]: [29]
[ro.product.cpu.abi]: [arm64-v8a]
adb.exe -s LMV600TMbc31ad40 shell CLASSPATH=/data/local/tmp/minicap-0.1-debug.apk app_process /system/bin io.devicefarmer.minicap.Main -P 1080x2460@360x820/0 
PID: 4120
Listening on minicap
chunk(length=24)
banner {
  version: 1,
  length: 24,
  pid: 26916,
  realWidth: 1080,
  realHeight: 2460,
  virtualWidth: 1080,
  virtualHeight: 2460,
  orientation: 0,
  quirks: 2
}
chunk(length=36544)
headerbyte1(val=1)
headerbyte2(val=10497)
headerbyte3(val=338177)
headerbyte4(val=338177)
body(len=36540)
chunk(length=65495)
body(len=65495)
chunk(length=65536)

image

Hi @ZGrauer ,

If you want to use minicap.so, you can take the vector issue fix binaries from following link. Sorry for the delay

https://github.com/varundtsfi/Xiaomi_Vector_issue/tree/main/LG

Hi @pcrepieux
One Question in thi

@varundtsfi
Copy link
Collaborator Author

I'm having some issues with setting the projection virtual width and height to reduced values from the real width and height using the minicap-0.1-debug.apk.
The normal minicap.so files are not working for this LG V60 ThinQ 5G device with SDK 29. Every version of minicap.so provided doesn't work and results in vector<> errors. This experimental apk successfully streams the screen but not at the requested size.
Is this a known issue, or am I missing params or not using the APK correctly?
Starting minicap:

[ro.product.build.version.incremental]: [2013217264e42]
[ro.product.build.version.release]: [10]
[ro.product.build.version.sdk]: [29]
[ro.product.cpu.abi]: [arm64-v8a]
adb.exe -s LMV600TMbc31ad40 shell CLASSPATH=/data/local/tmp/minicap-0.1-debug.apk app_process /system/bin io.devicefarmer.minicap.Main -P 1080x2460@360x820/0 
PID: 4120
Listening on minicap
chunk(length=24)
banner {
  version: 1,
  length: 24,
  pid: 26916,
  realWidth: 1080,
  realHeight: 2460,
  virtualWidth: 1080,
  virtualHeight: 2460,
  orientation: 0,
  quirks: 2
}
chunk(length=36544)
headerbyte1(val=1)
headerbyte2(val=10497)
headerbyte3(val=338177)
headerbyte4(val=338177)
body(len=36540)
chunk(length=65495)
body(len=65495)
chunk(length=65536)

image

Hi @ZGrauer ,
If you want to use minicap.so, you can take the vector issue fix binaries from following link. Sorry for the delay
https://github.com/varundtsfi/Xiaomi_Vector_issue/tree/main/LG

Here is the branch minicap-vm which at least looks OK when using SCREEN_GRABBER=minicap-apk bin/stf local on my laptop.
The SCREEN_GRABBER environment variable here is to force the use of the new experimental minicap. An alpha release of the minicap package with the new apk included is available here
Let me know the results

Hi @pcrepieux
One question. Here we are getting jpeg data if i want mjpeg data from your new approach experimental then What I have to do it.

https://github.com/DeviceFarmer/minicap/blob/master/experimental/app/src/main/java/io/devicefarmer/minicap/provider/BaseProvider.kt

line no 118 :- compress(Bitmap.CompressFormat.JPEG, q, out)

@yusunan
Copy link

yusunan commented Sep 14, 2021

Hi @pcrepieux
We are trying to replace minicap.so with minicap APK, but we find that when we open an application that does not allow screenshots, using minicap APK cannot display the correct device image。It will show a black image with status bar.
截屏2021-09-14 上午11 29 44

Got a way to resolve this problem from SCRCPY, here is a pull request
#26

@pcrepieux
Copy link

Thanks @yusunan for the fix 👍

@pcrepieux
Copy link

Sorry @varundtsfi I completely missed your previous message. If it's not too late...About MJPEG.
This is kind of blurry "standard". Something could be certainly done, but it depends which MJPEG. Do you have a reference document in mind.

@varundtsfi
Copy link
Collaborator Author

Sorry @varundtsfi I completely missed your previous message. If it's not too late...About MJPEG.

This is kind of blurry "standard". Something could be certainly done, but it depends which MJPEG. Do you have a reference document in mind.

Hi @pcrepieux
I am working on a project in which i will trying to take mjpeg or binary data of video like scrcpy is doing then by using transcoder and nimble streamer i will display that video on web page using SLDP player. Once i completed the initial R&D then i will share that branch with you very soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests