From 22892bdc1257238cd981f37c0a909ac9c5653793 Mon Sep 17 00:00:00 2001 From: udbue <71850746+udbue@users.noreply.github.com> Date: Sat, 9 May 2026 19:14:21 +0300 Subject: [PATCH 1/4] Update Game.java Credits to papi-ux/nova --- app/src/main/java/com/limelight/Game.java | 110 ++++++++++++++++------ 1 file changed, 80 insertions(+), 30 deletions(-) diff --git a/app/src/main/java/com/limelight/Game.java b/app/src/main/java/com/limelight/Game.java index 992fc00a71..bb0be05a48 100755 --- a/app/src/main/java/com/limelight/Game.java +++ b/app/src/main/java/com/limelight/Game.java @@ -313,6 +313,62 @@ public interface GameMenuCallbacks { private static final int UTF8_CHUNK_SIZE = 512; private final Queue commitTextQueue = new ArrayDeque<>(); private final Handler commitTextHandler = new Handler(Looper.getMainLooper()); + + static boolean displaySupportsHdr10(Display.HdrCapabilities hdrCapabilities) { + if (hdrCapabilities == null) { + return false; + } + + for (int hdrType : hdrCapabilities.getSupportedHdrTypes()) { + if (hdrType == Display.HdrCapabilities.HDR_TYPE_HDR10) { + return true; + } + } + + return false; + } + + static boolean shouldRequestHdrStream(boolean prefEnableHdr, + boolean onExternalDisplay, + int sdkInt, + boolean displaySupportsHdr10) { + if (!prefEnableHdr) { + return false; + } + + if (onExternalDisplay) { + return true; + } + + if (sdkInt < Build.VERSION_CODES.N) { + return false; + } + + if (displaySupportsHdr10) { + return true; + } + + // Explicit HDR opt-in still requests a 10-bit stream on SDR panels. + return true; + } + + static boolean shouldShowSdr10BitOptInToast(boolean prefEnableHdr, + boolean onExternalDisplay, + int sdkInt, + boolean displaySupportsHdr10) { + return prefEnableHdr && + !onExternalDisplay && + sdkInt >= Build.VERSION_CODES.N && + !displaySupportsHdr10; + } + + static boolean shouldShowHdrRequiresAndroidNToast(boolean prefEnableHdr, + boolean onExternalDisplay, + int sdkInt) { + return prefEnableHdr && + !onExternalDisplay && + sdkInt < Build.VERSION_CODES.N; + } private final Runnable flushCommitTextQueue = new Runnable() { @Override @@ -598,36 +654,30 @@ public boolean onCapturedPointer(View view, MotionEvent motionEvent) { MediaCodecHelper.initialize(this, glPrefs.glRenderer); // Check if the user has enabled HDR - boolean willStreamHdr = false; - if (prefConfig.enableHdr) { - if (onExternelDisplay) { - // Enforce HDR on unsupported hardware can still enable 10bit streaming for better quality - willStreamHdr = true; - } else { - // Start our HDR checklist - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { - Display.HdrCapabilities hdrCaps = currentDisplay.getHdrCapabilities(); - - // We must now ensure our display is compatible with HDR10 - if (hdrCaps != null) { - // getHdrCapabilities() returns null on Lenovo Lenovo Mirage Solo (vega), Android 8.0 - for (int hdrType : hdrCaps.getSupportedHdrTypes()) { - if (hdrType == Display.HdrCapabilities.HDR_TYPE_HDR10) { - willStreamHdr = true; - break; - } - } - } + boolean displaySupportsHdr10 = false; + if (!onExternelDisplay && Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + displaySupportsHdr10 = displaySupportsHdr10(currentDisplay.getHdrCapabilities()); + } + boolean willStreamHdr = shouldRequestHdrStream( + prefConfig.enableHdr, + onExternelDisplay, + Build.VERSION.SDK_INT, + displaySupportsHdr10 + ); - if (!willStreamHdr) { - // Nope, no HDR for us :( - Toast.makeText(this, "Display does not support HDR10", Toast.LENGTH_LONG).show(); - } - } - else { - Toast.makeText(this, "HDR requires Android 7.0 or later", Toast.LENGTH_LONG).show(); - } - } + if (shouldShowSdr10BitOptInToast( + prefConfig.enableHdr, + onExternelDisplay, + Build.VERSION.SDK_INT, + displaySupportsHdr10 + )) { + Toast.makeText(this, "Display does not support HDR10. Artemis will request a 10-bit SDR stream.", Toast.LENGTH_LONG).show(); + } else if (shouldShowHdrRequiresAndroidNToast( + prefConfig.enableHdr, + onExternelDisplay, + Build.VERSION.SDK_INT + )) { + Toast.makeText(this, "HDR requires Android 7.0 or later", Toast.LENGTH_LONG).show(); } // Check if the user has enabled performance stats overlay @@ -4346,4 +4396,4 @@ private SurfaceView findFirstSurfaceViewFrom(View v) { return null; } -} \ No newline at end of file +} From 552c0888f78d1829889437c4bea6fa710faedc58 Mon Sep 17 00:00:00 2001 From: udbue <71850746+udbue@users.noreply.github.com> Date: Sat, 9 May 2026 19:14:56 +0300 Subject: [PATCH 2/4] Update StreamSettings.java credits to papi-ux/nova --- .../limelight/preferences/StreamSettings.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/com/limelight/preferences/StreamSettings.java b/app/src/main/java/com/limelight/preferences/StreamSettings.java index 5b2d20de13..f3db609c5a 100755 --- a/app/src/main/java/com/limelight/preferences/StreamSettings.java +++ b/app/src/main/java/com/limelight/preferences/StreamSettings.java @@ -629,7 +629,9 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { } }); - // Remove HDR preference for devices below Nougat + // Remove HDR preference for devices below Nougat. + // On SDR handheld panels running Android N+, we still expose this toggle + // because Nova can request a 10-bit SDR stream from Polaris/Main10 hosts. if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { LimeLog.info("Excluding HDR toggle based on OS"); PreferenceCategory category = @@ -650,21 +652,21 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { } } } + PreferenceCategory category = + (PreferenceCategory) findPreference("category_video_settings"); + CheckBoxPreference hdrPref = (CheckBoxPreference) category.findPreference("checkbox_enable_hdr"); - if (!foundHdr10) { - LimeLog.info("Excluding HDR toggle based on display capabilities"); - PreferenceCategory category = - (PreferenceCategory) findPreference("category_video_settings"); - category.removePreference(findPreference("checkbox_enable_hdr")); + if (!foundHdr10 && hdrPref != null) { + LimeLog.info("Keeping HDR toggle visible for 10-bit SDR opt-in"); + hdrPref.setSummary(R.string.summary_enable_hdr_sdr_10bit); } else if (PreferenceConfiguration.isShieldAtvFirmwareWithBrokenHdr()) { LimeLog.info("Disabling HDR toggle on old broken SHIELD TV firmware"); - PreferenceCategory category = - (PreferenceCategory) findPreference("category_video_settings"); - CheckBoxPreference hdrPref = (CheckBoxPreference) category.findPreference("checkbox_enable_hdr"); - hdrPref.setEnabled(false); - hdrPref.setChecked(false); - hdrPref.setSummary("Update the firmware on your NVIDIA SHIELD Android TV to enable HDR"); + if (hdrPref != null) { + hdrPref.setEnabled(false); + hdrPref.setChecked(false); + hdrPref.setSummary("Update the firmware on your NVIDIA SHIELD Android TV to enable HDR"); + } } } From 599bf053415eeee3ffe6dff733d5aadd7250e583 Mon Sep 17 00:00:00 2001 From: udbue <71850746+udbue@users.noreply.github.com> Date: Sat, 9 May 2026 19:15:48 +0300 Subject: [PATCH 3/4] Update strings.xml credits to papi-ux/nova --- app/src/main/res/values/strings.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 95f64c92a5..df366b19ce 100755 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -306,6 +306,7 @@ Newer codecs can lower video bandwidth requirements if your device supports them. Codec selections may be ignored if not supported by the host software or GPU. Enable HDR (Experimental) Stream HDR when the game and PC GPU support it. HDR requires a GPU with HEVC Main 10 encoding support. + Request a 10-bit stream even on SDR displays. On Devices with SDR panels Artemis will prefer a 10-bit SDR stream when the host supports Main10. Force full range video (Experimental) This will cause loss of detail in light and dark areas if your device doesn\'t properly display full range video content. Prevent Packet Loss From 2051ed0acf557901299b6f6b83a1632ad0ac9017 Mon Sep 17 00:00:00 2001 From: udbue <71850746+udbue@users.noreply.github.com> Date: Sat, 9 May 2026 19:33:29 +0300 Subject: [PATCH 4/4] Update StreamSettings.java --- app/src/main/java/com/limelight/preferences/StreamSettings.java | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/com/limelight/preferences/StreamSettings.java b/app/src/main/java/com/limelight/preferences/StreamSettings.java index f3db609c5a..4f8408f1f1 100755 --- a/app/src/main/java/com/limelight/preferences/StreamSettings.java +++ b/app/src/main/java/com/limelight/preferences/StreamSettings.java @@ -631,7 +631,6 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { // Remove HDR preference for devices below Nougat. // On SDR handheld panels running Android N+, we still expose this toggle - // because Nova can request a 10-bit SDR stream from Polaris/Main10 hosts. if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) { LimeLog.info("Excluding HDR toggle based on OS"); PreferenceCategory category =