summaryrefslogtreecommitdiff
path: root/py_modules
diff options
context:
space:
mode:
authorKurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>2026-09-05 15:25:48 -0400
committerKurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>2026-09-05 15:25:48 -0400
commit630a8c7180650eb0a078014d8e869ace79d1e9e2 (patch)
treece0a6673bc346df8b766ba29744414f045e20f26 /py_modules
parente997a3fb74fa70f5e60b60807fb0897120e98313 (diff)
downloaddecky-lsfg-vk-630a8c7180650eb0a078014d8e869ace79d1e9e2.tar.gz
decky-lsfg-vk-630a8c7180650eb0a078014d8e869ace79d1e9e2.zip
chore: remove arm runtime support
Diffstat (limited to 'py_modules')
-rw-r--r--py_modules/lsfg_vk/configuration.py31
-rw-r--r--py_modules/lsfg_vk/constants.py3
-rw-r--r--py_modules/lsfg_vk/installation.py50
3 files changed, 11 insertions, 73 deletions
diff --git a/py_modules/lsfg_vk/configuration.py b/py_modules/lsfg_vk/configuration.py
index fce3738..de11b48 100644
--- a/py_modules/lsfg_vk/configuration.py
+++ b/py_modules/lsfg_vk/configuration.py
@@ -8,7 +8,6 @@ from typing import Dict, Any
from .base_service import BaseService
from .config_schema import ConfigurationManager, CONFIG_SCHEMA, ProfileData, DEFAULT_PROFILE_NAME
from .config_schema_generated import ConfigurationData, get_script_generation_logic
-from .constants import ARMADA_DEVICE_ENV, ARMADA_GAME_LAUNCH
from .types import ConfigurationResponse, ProfilesResponse, ProfileResponse
@@ -124,8 +123,10 @@ class ConfigurationService(BaseService):
generate_script_lines = get_script_generation_logic()
lines.extend(generate_script_lines(config))
- lines.append("export LSFG_PROCESS=decky-lsfg-vk")
- lines.extend(self._generate_game_launch_lines())
+ lines.extend([
+ "export LSFG_PROCESS=decky-lsfg-vk",
+ 'exec "$@"'
+ ])
return "\n".join(lines) + "\n"
@@ -153,29 +154,13 @@ class ConfigurationService(BaseService):
generate_script_lines = get_script_generation_logic()
lines.extend(generate_script_lines(merged_config))
- lines.append(f"export LSFG_PROCESS={current_profile}")
- lines.extend(self._generate_game_launch_lines())
+ lines.extend([
+ f"export LSFG_PROCESS={current_profile}",
+ 'exec "$@"'
+ ])
return "\n".join(lines) + "\n"
- @staticmethod
- def _generate_game_launch_lines() -> list[str]:
- """Generate a portable exec block with Armada's host wrapper."""
- device_env = ARMADA_DEVICE_ENV.as_posix()
- game_launch = ARMADA_GAME_LAUNCH.as_posix()
- return [
- f'armada_game_launch="{game_launch}"',
- 'for argument in "$@"; do',
- ' if [ "$argument" = "$armada_game_launch" ]; then',
- ' exec "$@"',
- " fi",
- "done",
- f'if [ -f "{device_env}" ] && [ -x "$armada_game_launch" ]; then',
- ' exec "$armada_game_launch" "$@"',
- "fi",
- 'exec "$@"',
- ]
-
def _get_profile_data(self) -> ProfileData:
"""Get current profile data from config file"""
if not self.config_file_path.exists():
diff --git a/py_modules/lsfg_vk/constants.py b/py_modules/lsfg_vk/constants.py
index 023894f..fe2febb 100644
--- a/py_modules/lsfg_vk/constants.py
+++ b/py_modules/lsfg_vk/constants.py
@@ -14,7 +14,6 @@ CONFIG_FILENAME = "conf.toml"
LIB_FILENAME = "liblsfg-vk.so"
JSON_FILENAME = "VkLayer_LS_frame_generation.json"
ZIP_FILENAME = "lsfg-vk_noui.zip"
-ARM_LIB_FILENAME = "liblsfg-vk-arm64.so"
FLATPAK_23_08_FILENAME = "org.freedesktop.Platform.VulkanLayer.lsfg_vk_23.08.flatpak"
FLATPAK_24_08_FILENAME = "org.freedesktop.Platform.VulkanLayer.lsfg_vk_24.08.flatpak"
@@ -25,8 +24,6 @@ JSON_EXT = ".json"
BIN_DIR = "bin"
-ARMADA_DEVICE_ENV = Path("/usr/libexec/armada/device-env")
-ARMADA_GAME_LAUNCH = Path("/usr/libexec/armada/armada-game-launch")
STEAM_COMMON_PATH = Path("steamapps/common/Lossless Scaling")
LOSSLESS_DLL_NAME = "Lossless.dll"
diff --git a/py_modules/lsfg_vk/installation.py b/py_modules/lsfg_vk/installation.py
index ce47268..4329d49 100644
--- a/py_modules/lsfg_vk/installation.py
+++ b/py_modules/lsfg_vk/installation.py
@@ -3,7 +3,6 @@ Installation service for lsfg-vk.
"""
import os
-import platform
import shutil
import traceback
import zipfile
@@ -15,7 +14,7 @@ from typing import Dict, Any
from .base_service import BaseService
from .constants import (
LIB_FILENAME, JSON_FILENAME, ZIP_FILENAME, BIN_DIR,
- SO_EXT, JSON_EXT, ARM_LIB_FILENAME, ARMADA_DEVICE_ENV
+ SO_EXT, JSON_EXT
)
from .config_schema import ConfigurationManager
from .types import InstallationResponse, UninstallationResponse, InstallationCheckResponse
@@ -49,13 +48,6 @@ class InstallationService(BaseService):
self._extract_and_install_files(zip_path)
- # If on ARM, overwrite the .so with the ARM version
- if self._is_arm_architecture():
- self.log.info("Detected ARM architecture, using ARM binary")
- arm_so_path = plugin_dir / BIN_DIR / ARM_LIB_FILENAME
- self._copy_plugin_file(arm_so_path, self.lib_file)
- self.log.info(f"Overwrote with ARM binary: {self.lib_file}")
-
self._create_config_file()
self._create_lsfg_launch_script()
@@ -72,42 +64,6 @@ class InstallationService(BaseService):
self.log.error(error_msg)
return self._error_response(InstallationResponse, str(e), message="")
- def _is_arm_architecture(self) -> bool:
- """Check if running on ARM architecture
-
- Returns:
- True if running on ARM (aarch64), False otherwise
- """
- if platform.machine().lower() in ('aarch64', 'arm64'):
- return True
-
- # Decky runs through FEX on Armada, so Python reports x86_64 even
- # though the host is AArch64. Armada exposes this native helper only
- # on its ARM image, including inside Decky's FEX rootfs.
- if ARMADA_DEVICE_ENV.is_file():
- self.log.info("Detected native AArch64 Armada host through device-env")
- return True
-
- # Fall back to the native PID 1 ELF header. e_machine 183 is AArch64.
- try:
- with Path('/proc/1/exe').open('rb') as host_executable:
- elf_header = host_executable.read(20)
- if elf_header[:4] == b'\x7fELF' and elf_header[5] in (1, 2):
- byte_order = 'little' if elf_header[5] == 1 else 'big'
- if int.from_bytes(elf_header[18:20], byte_order) == 183:
- self.log.info("Detected native AArch64 host through PID 1")
- return True
- except OSError as e:
- self.log.debug(f"Could not inspect native host architecture: {e}")
-
- return False
-
- @staticmethod
- def _copy_plugin_file(src_file: Path, dst_file: Path) -> None:
- """Copy plugin content without preserving FEX-incompatible metadata."""
- shutil.copyfile(src_file, dst_file)
- dst_file.chmod(0o644)
-
def _extract_and_install_files(self, zip_path: Path) -> None:
"""Extract zip file and install files to appropriate locations
@@ -145,7 +101,7 @@ class InstallationService(BaseService):
if file_path.suffix == JSON_EXT and file == JSON_FILENAME:
self._copy_and_fix_json_file(src_file, dst_file)
else:
- self._copy_plugin_file(src_file, dst_file)
+ shutil.copy2(src_file, dst_file)
self.log.info(f"Copied {file} to {dst_file}")
@@ -175,7 +131,7 @@ class InstallationService(BaseService):
except (json.JSONDecodeError, KeyError, OSError) as e:
self.log.error(f"Error fixing JSON file {src_file}: {e}")
# Fallback to simple copy if JSON modification fails
- self._copy_plugin_file(src_file, dst_file)
+ shutil.copy2(src_file, dst_file)
def _create_config_file(self) -> None:
"""Create or update the TOML config file in ~/.config/lsfg-vk with default configuration and detected DLL path