Compare commits

...

10 Commits
v8.3 ... v8.4.1

Author SHA1 Message Date
Cameron Gutman
db5b7ab867 Version 8.4.1 2019-10-16 19:10:56 -07:00
Cameron Gutman
3bcc1c84bb Fix crash on controllers with RX and RY but no Z and RZ axes 2019-10-16 19:02:51 -07:00
Cameron Gutman
d46053f8d6 Preserve old DS4 detection behavior on Android 4.3 and below 2019-10-15 21:15:03 -07:00
Cameron Gutman
00a5fed9e9 Update AGP to 3.5.1 2019-10-15 20:58:03 -07:00
Cameron Gutman
b6315a715a Improve support for DualShock 4 and Xbox One controllers on 4.14+ kernels 2019-10-15 20:57:33 -07:00
Cameron Gutman
0da8303468 Don't use the USB driver for Xbox One gamepads on 4.14+ kernels 2019-10-15 20:05:01 -07:00
Cameron Gutman
c821c4684f Allow FFmpeg decoders on Android x86. Closes #630 2019-10-15 00:11:43 -07:00
Cameron Gutman
6bae33f822 Merge pull request #739 from vanitasvitae/patch-1
Fix German short_description
2019-10-15 00:06:12 -07:00
Cameron Gutman
08d4ab67a6 Update moonlight-common-c submodule 2019-10-12 19:50:30 -07:00
Paul Schaub
62203d2f21 Fix German short_description
fixed a typo
2019-10-06 12:44:40 +02:00
8 changed files with 98 additions and 30 deletions

View File

@@ -7,8 +7,8 @@ android {
minSdkVersion 16
targetSdkVersion 29
versionName "8.3"
versionCode = 200
versionName "8.4.1"
versionCode = 203
}
flavorDimensions "root"

View File

@@ -425,6 +425,10 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
String devName = dev.getName();
LimeLog.info("Creating controller context for device: "+devName);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
LimeLog.info("Vendor ID: "+dev.getVendorId());
LimeLog.info("Product ID: "+dev.getProductId());
}
LimeLog.info(dev.toString());
context.name = devName;
@@ -471,25 +475,45 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
InputDevice.MotionRange rxRange = getMotionRangeForJoystickAxis(dev, MotionEvent.AXIS_RX);
InputDevice.MotionRange ryRange = getMotionRangeForJoystickAxis(dev, MotionEvent.AXIS_RY);
if (rxRange != null && ryRange != null && devName != null) {
if (devName.contains("Xbox") || devName.contains("XBox") || devName.contains("X-Box")) {
// Xbox controllers use RX and RY for right stick
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
if (dev.getVendorId() == 0x054c) { // Sony
if (dev.hasKeys(KeyEvent.KEYCODE_BUTTON_C)[0]) {
LimeLog.info("Detected non-standard DualShock 4 mapping");
context.isNonStandardDualShock4 = true;
}
else {
LimeLog.info("Detected DualShock 4 (Linux standard mapping)");
context.usesLinuxGamepadStandardFaceButtons = true;
}
}
}
else if (!devName.contains("Xbox") && !devName.contains("XBox") && !devName.contains("X-Box")) {
LimeLog.info("Assuming non-standard DualShock 4 mapping on < 4.4");
context.isNonStandardDualShock4 = true;
}
if (context.isNonStandardDualShock4) {
// The old DS4 driver uses RX and RY for triggers
context.leftTriggerAxis = MotionEvent.AXIS_RX;
context.rightTriggerAxis = MotionEvent.AXIS_RY;
}
else {
// If it's not a non-standard DS4 controller, it's probably an Xbox controller or
// other sane controller that uses RX and RY for right stick and Z and RZ for triggers.
context.rightStickXAxis = MotionEvent.AXIS_RX;
context.rightStickYAxis = MotionEvent.AXIS_RY;
// Xbox controllers use Z and RZ for triggers
context.leftTriggerAxis = MotionEvent.AXIS_Z;
context.rightTriggerAxis = MotionEvent.AXIS_RZ;
context.triggersIdleNegative = true;
context.isXboxController = true;
// While it's likely that Z and RZ are triggers, we may have digital trigger buttons
// instead. We must check that we actually have Z and RZ axes before assigning them.
if (getMotionRangeForJoystickAxis(dev, MotionEvent.AXIS_Z) != null &&
getMotionRangeForJoystickAxis(dev, MotionEvent.AXIS_RZ) != null) {
context.leftTriggerAxis = MotionEvent.AXIS_Z;
context.rightTriggerAxis = MotionEvent.AXIS_RZ;
}
}
else {
// DS4 controller uses RX and RY for triggers
context.leftTriggerAxis = MotionEvent.AXIS_RX;
context.rightTriggerAxis = MotionEvent.AXIS_RY;
context.triggersIdleNegative = true;
context.isDualShock4 = true;
}
// Triggers always idle negative on axes that are centered at zero
context.triggersIdleNegative = true;
}
}
@@ -595,7 +619,7 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
// required fixup is ignoring the select button.
else if (devName.equals("Xbox Wireless Controller")) {
if (gasRange == null) {
context.isXboxBtController = true;
context.isNonStandardXboxBtController = true;
}
}
}
@@ -774,7 +798,21 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
}
}
if (context.isDualShock4) {
if (context.usesLinuxGamepadStandardFaceButtons) {
// Android's Generic.kl swaps BTN_NORTH and BTN_WEST
switch (event.getScanCode()) {
case 304:
return KeyEvent.KEYCODE_BUTTON_A;
case 305:
return KeyEvent.KEYCODE_BUTTON_B;
case 307:
return KeyEvent.KEYCODE_BUTTON_Y;
case 308:
return KeyEvent.KEYCODE_BUTTON_X;
}
}
if (context.isNonStandardDualShock4) {
switch (event.getScanCode()) {
case 304:
return KeyEvent.KEYCODE_BUTTON_X;
@@ -819,7 +857,7 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
return KeyEvent.KEYCODE_BUTTON_START;
}
}
else if (context.isXboxBtController) {
else if (context.isNonStandardXboxBtController) {
switch (event.getScanCode()) {
case 306:
return KeyEvent.KEYCODE_BUTTON_X;
@@ -1538,9 +1576,9 @@ public class ControllerHandler implements InputManager.InputDeviceListener, UsbD
public int hatXAxis = -1;
public int hatYAxis = -1;
public boolean isDualShock4;
public boolean isXboxController;
public boolean isXboxBtController;
public boolean isNonStandardDualShock4;
public boolean usesLinuxGamepadStandardFaceButtons;
public boolean isNonStandardXboxBtController;
public boolean isServal;
public boolean backIsStart;
public boolean modeIsSelect;

View File

@@ -191,10 +191,32 @@ public class UsbDriverService extends Service implements UsbDriverListener {
}
}
public static boolean kernelSupportsXboxOne() {
String kernelVersion = System.getProperty("os.version");
LimeLog.info("Kernel Version: "+kernelVersion);
if (kernelVersion == null) {
// We'll assume this is some newer version of Android
// that doesn't let you read the kernel version this way.
return true;
}
else if (kernelVersion.startsWith("2.") || kernelVersion.startsWith("3.")) {
// These are old kernels that definitely don't support Xbox One controllers properly
return false;
}
else if (kernelVersion.startsWith("4.4.") || kernelVersion.startsWith("4.9.")) {
// These aren't guaranteed to have backported kernel patches for proper Xbox One
// support (though some devices will).
return false;
}
else {
// The next AOSP common kernel is 4.14 which has working Xbox One controller support
return true;
}
}
public static boolean shouldClaimDevice(UsbDevice device, boolean claimAllAvailable) {
// We always bind to XB1 controllers but only bind to XB360 controllers
// if we know the kernel isn't already driving this device.
return XboxOneController.canClaimDevice(device) ||
return ((!kernelSupportsXboxOne() || !isRecognizedInputDevice(device) || claimAllAvailable) && XboxOneController.canClaimDevice(device)) ||
((!isRecognizedInputDevice(device) || claimAllAvailable) && Xbox360Controller.canClaimDevice(device));
}

View File

@@ -77,8 +77,12 @@ public class MediaCodecHelper {
blacklistedDecoderPrefixes.add("AVCDecoder");
}
// Never use ffmpeg decoders since they're software decoders
blacklistedDecoderPrefixes.add("OMX.ffmpeg");
// We want to avoid ffmpeg decoders since they're software decoders,
// but on Android-x86 they might be all we have (and also relatively
// performant on a modern x86 processor).
if (!Build.BRAND.equals("Android-x86")) {
blacklistedDecoderPrefixes.add("OMX.ffmpeg");
}
// Force these decoders disabled because:
// 1) They are software decoders, so the performance is terrible

View File

@@ -5,7 +5,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.android.tools.build:gradle:3.5.1'
}
}

View File

@@ -1 +1 @@
Spiele vom deinem PC auf Android spielen (nur NVIDIA)
Spiele von deinem PC auf Android spielen (nur NVIDIA)

View File

@@ -0,0 +1,4 @@
- Fixed DualShock 4 mapping on devices running 4.14+ kernels
- Improved support for wired Xbox 360/One controllers
- Fixed crash using certain controllers without analog triggers
- Enabled streaming on Android-x86