-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
PICO 4 Ultra Compatibility? #5659
Comments
Please post your
|
Please replace this file in your scrcpy 3.1:
Does it solve the problem? diff --git server/src/main/java/com/genymobile/scrcpy/Workarounds.java server/src/main/java/com/genymobile/scrcpy/Workarounds.java
index eec00a046..cbe414f4f 100644
--- server/src/main/java/com/genymobile/scrcpy/Workarounds.java
+++ server/src/main/java/com/genymobile/scrcpy/Workarounds.java
@@ -10,6 +10,7 @@ import android.content.AttributionSource;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.pm.ApplicationInfo;
+import android.content.res.Configuration;
import android.media.AudioAttributes;
import android.media.AudioManager;
import android.media.AudioRecord;
@@ -139,6 +140,10 @@ public final class Workarounds {
Field configurationControllerField = ACTIVITY_THREAD_CLASS.getDeclaredField("mConfigurationController");
configurationControllerField.setAccessible(true);
configurationControllerField.set(ACTIVITY_THREAD, configurationController);
+
+ Field configurationField = configurationControllerClass.getDeclaredField("mConfiguration");
+ configurationField.setAccessible(true);
+ configurationField.set(configurationController, new Configuration());
} catch (Throwable throwable) {
Ln.d("Could not fill configuration: " + throwable.getMessage());
} |
It doesn't solved the problem, that's the new error
|
For reference, the problem is that the vendor modified the system in @Override // android.hardware.display.IExtDisplayManagerGlobal
public void adjustDisplayInfo(int displayId, DisplayInfo displayInfo) {
ActivityThread thread;
if (displayId != 0 || ActivityThread.isSystem() || (thread = ActivityThread.currentActivityThread()) == null) {
return;
}
Configuration configuration = thread.getConfiguration();
if (configuration == null) {
configuration = thread.getExt().getInitConfiguration();
}
Rect bound = configuration.windowConfiguration.getBounds();
int width = bound.width();
displayInfo.logicalWidth = width;
displayInfo.appWidth = width;
displayInfo.largestNominalAppWidth = width;
displayInfo.smallestNominalAppWidth = width;
int height = bound.height();
displayInfo.logicalHeight = height;
displayInfo.appHeight = height;
displayInfo.largestNominalAppHeight = height;
displayInfo.smallestNominalAppHeight = height;
int i = configuration.densityDpi;
displayInfo.logicalDensityDpi = i;
float f = i;
displayInfo.physicalYDpi = f;
displayInfo.physicalXDpi = f;
displayInfo.rotation = 0;
} Setting an empty configuration as I did does not work, because then the size is 0x0. The configuration is (a priori) initially Another workaround would be to NOT initialize Maybe we can just make diff --git server/src/main/java/com/genymobile/scrcpy/Workarounds.java server/src/main/java/com/genymobile/scrcpy/Workarounds.java
index eec00a046..a6caf59b1 100644
--- server/src/main/java/com/genymobile/scrcpy/Workarounds.java
+++ server/src/main/java/com/genymobile/scrcpy/Workarounds.java
@@ -42,6 +42,11 @@ public final class Workarounds {
Field sCurrentActivityThreadField = ACTIVITY_THREAD_CLASS.getDeclaredField("sCurrentActivityThread");
sCurrentActivityThreadField.setAccessible(true);
sCurrentActivityThreadField.set(null, ACTIVITY_THREAD);
+
+ // activityThread.mSystemThread = true;
+ Field mSystemThreadField = ACTIVITY_THREAD_CLASS.getDeclaredField("mSystemThread");
+ mSystemThreadField.setAccessible(true);
+ mSystemThreadField.setBoolean(ACTIVITY_THREAD, true);
} catch (Exception e) {
throw new AssertionError(e);
} Please test this new binary:
|
If the screen content is not the same for different devices, you must crop another rectangle by adjusting the width/height/x/y values. |
Ho ok my bad! It was cause of the display id used before to make it works (I was using --display-id=1) without it it works perfectly! |
Are there several displays on Quest or Pico 4?
|
[server] INFO: Device: [Pico] Pico A92Y0 (Android 14) |
Oh, ok, because you're currently mirroring? These displays are not present when no scrcpy is running, right? |
Yes, I'm currently mirroring! I believe they are not in use without scrcpy! |
Make ActivityThread.isSystem() return true to avoid a NullPointerException later. Refs #5659 comment <#5659 (comment)> Fixes #5659 <#5659>
Merged into |
Environment
Describe the bug
Trying to run a simple 'scrcpy' command, device is found but got errors (Using Meta Quest 3 has no problem).
Using version 2.7 works but using crop parameters do not works (What ever I set, it renders always the 2 eyes)
The text was updated successfully, but these errors were encountered: