diff --git a/.github/workflows/prepare-alxr-release.yml b/.github/workflows/prepare-alxr-release.yml index 2283f257ae..164bb43dda 100644 --- a/.github/workflows/prepare-alxr-release.yml +++ b/.github/workflows/prepare-alxr-release.yml @@ -368,13 +368,6 @@ jobs: cargo xtask build-alxr-pico-v4 --release cargo clean - - name: Build & Package alxr-android-lynx-release - run: | - unset ANDROID_HOME - JAVA_HOME=$JAVA_HOME_17_X64 - cargo xtask build-alxr-lynx --release - cargo clean - - name: Upload alxr-android-generic-release uses: actions/upload-release-asset@v1 env: @@ -414,16 +407,6 @@ jobs: asset_path: ./build/release/alxr_client_android/alxr-client-pico-v4.apk asset_name: alxr-client-pico-v4.apk asset_content_type: application/vnd.android.package-archive - - - name: Upload alxr-android-lynx-release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.prepare_release.outputs.upload_url }} - asset_path: ./build/release/alxr_client_android/alxr-client-lynx.apk - asset_name: alxr-client-lynx.apk - asset_content_type: application/vnd.android.package-archive build_alxr_android_debug: runs-on: ubuntu-22.04 @@ -498,17 +481,7 @@ jobs: mv alxr-client-pico-v4.apk alxr-client-pico-v4-debug.apk popd cargo clean - - - name: Build & Package alxr-android-lynx-debug - run: | - unset ANDROID_HOME - JAVA_HOME=$JAVA_HOME_17_X64 - cargo xtask build-alxr-lynx - pushd ./build/debug/alxr_client_android - mv alxr-clientlynx.apk alxr-client-lynx-debug.apk - popd - cargo clean - + - name: Upload alxr-android-generic-debug uses: actions/upload-release-asset@v1 env: @@ -548,17 +521,7 @@ jobs: asset_path: ./build/debug/alxr_client_android/alxr-client-pico-v4-debug.apk asset_name: alxr-client-pico-v4-debug.apk asset_content_type: application/vnd.android.package-archive - - - name: Upload alxr-android-lynx-debug - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.prepare_release.outputs.upload_url }} - asset_path: ./build/debug/alxr_client_android/alxr-client-lynx-debug.apk - asset_name: alxr-client-lynx-debug.apk - asset_content_type: application/vnd.android.package-archive - + build_libalxr_win_x64_release: runs-on: windows-2022 needs: [prepare_release] diff --git a/Cargo.toml b/Cargo.toml index 9cc3e62589..5578e0c10d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,5 @@ members = [ "alvr/openxr-client/alxr-android-client/quest", "alvr/openxr-client/alxr-android-client/pico", "alvr/openxr-client/alxr-android-client/pico-v4", - "alvr/openxr-client/alxr-android-client/lynx", "alvr/xtask", ] diff --git a/alvr/openxr-client/alxr-android-client/Cargo.toml b/alvr/openxr-client/alxr-android-client/Cargo.toml index 57eaef31db..8cc4503540 100644 --- a/alvr/openxr-client/alxr-android-client/Cargo.toml +++ b/alvr/openxr-client/alxr-android-client/Cargo.toml @@ -144,7 +144,7 @@ min_sdk_version = 28#24 # for offical low-latency medicodec mode to be enabled, # Note: there can be multiple .uses_feature entries. [[package.metadata.android.uses_feature]] name = "android.hardware.vr.headtracking" -required = false +required = true version = 1 [[package.metadata.android.uses_feature]] @@ -269,6 +269,12 @@ name = "android.permission.WAKE_LOCK" [[package.metadata.android.uses_permission]] name = "android.permission.READ_EXTERNAL_STORAGE" +[[package.metadata.android.uses_permission]] +name = "android.permission.WRITE_EXTERNAL_STORAGE" + +[[package.metadata.android.uses_permission]] +name = "android.permission.MANAGE_EXTERNAL_STORAGE" + [[package.metadata.android.uses_permission]] name = "android.permission.VIBRATE" diff --git a/alvr/openxr-client/alxr-android-client/lynx/Cargo.toml b/alvr/openxr-client/alxr-android-client/lynx/Cargo.toml deleted file mode 100644 index eb35b98136..0000000000 --- a/alvr/openxr-client/alxr-android-client/lynx/Cargo.toml +++ /dev/null @@ -1,272 +0,0 @@ -[package] -name = "alxr-client-lynx" -version = "0.36.0" -authors = ["korejan <64199710+korejan@users.noreply.github.com>"] -edition = "2021" -description = "An OpenXR based ALVR client for android platorms" - -# If you modify this file please consider if it needs replicating in ./quest/Cargo.toml & ./pico-neo/Cargo.toml -# cargo(-apk) has a limitation of not being able to apply build time conditional logic to toml meta data. -# as workaround for quest/pico-neo specific builds dumy Cargo.toml files are create but refer to the same code. - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[features] -no-decoder = ["alxr-common/no-decoder"] # disables building platform decoders & depeendencies. - -[lib] -crate-type = ["cdylib"] -path = "../src/lib.rs" - -[dependencies] -alxr-common = { path = "../../alxr-common", features = ["lynx-flavor"] } -jni = "0.21" -log = "0.4" -android_logger = "0.13" -android-activity = { version="0.6", features = [ "native-activity" ] } -ndk-context = "0.1" -libloading = "0.8" -lazy_static = "1" -parking_lot = "0.12" -version-compare = "0.2" - -[package.metadata.android] -build_targets = ["aarch64-linux-android"] - -# Path to your application's resources folder. -# If not specified, resources will not be included in the APK. -#resources = "path/to/resources_folder" - -# Path to the folder containing your application's assets. -# If not specified, assets will not be included in the APK. -#assets = "path/to/assets_folder" - -# Name for final APK file. -# Defaults to package name. -apk_name = "alxr-client-lynx" - -# Folder containing extra shared libraries intended to be dynamically loaded at runtime. -# Files matching `libs_folder/${android_abi}/*.so` are added to the apk -# according to the specified build_targets. -runtime_libs = "runtime-libs" - -# -# The following value can be customized on a per bin/example basis. See multiple_targets example -# If a value is not specified for a secondary target, it will inherit the value defined in the `package.metadata.android` -# section unless otherwise noted. -# - -# The Java package name for your application. -# Hyphens are converted to underscores. -package = "com.alvr.alxr_client" - -# The user-friendly name for your app, as displayed in the applications menu. -label = "alxr_client" - -install_location = "auto" - -# Path to your application's res/ folder. -#res = "res" - -# Virtual path your application's icon for any mipmap level. -#icon = "@mipmap/ic_launcher" - -# Path to the folder containing your application's assets. -#assets = "assets" - -# If set to true, makes the app run in full-screen, by adding the following line -# as an XML attribute to the manifest's tag : -# android:theme="@android:style/Theme.DeviceDefault.NoActionBar.Fullscreen -# Defaults to false. -fullscreen = true - -# Defaults to `$HOME/.android/debug.keystore` for the `dev` profile. Will ONLY generate a new -# debug.keystore if this file does NOT exist. -# A keystore path is always required on the `release` profile. -[package.metadata.android.signing.release] -path = "../debug.keystore" -keystore_password = "android" - -# See https://developer.android.com/guide/topics/manifest/uses-sdk-element -# -# Defaults to a `min_sdk_version` of 23 and `target_sdk_version` is based on the ndk's default platform. -[package.metadata.android.sdk] -target_sdk_version = 29 -compile_sdk = 34 -min_sdk_version = 28#24 # for offical low-latency medicodec mode to be enabled, min sdk must be >= 30. - -# Adds extra arbitrary XML attributes to the tag in the manifest. -# See https://developer.android.com/guide/topics/manifest/application-element.html -[package.metadata.android.application_attributes] -"android:debuggable" = "false" -"android:hardwareAccelerated" = "true" -"android:allowBackup" = "false" -"android:hasCode" = "false" - -# Adds extra arbitrary XML attributes to the tag in the manifest. -# See https://developer.android.com/guide/topics/manifest/activity-element.html -[package.metadata.android.activity_attributes] -"android:theme" ="@android:style/Theme.Black.NoTitleBar.Fullscreen" -"android:launchMode" = "singleTask" -"android:screenOrientation" = "landscape" -"android:excludeFromRecents" = "false" -"android:resizeableActivity"= "false" -"android:configChanges" = "screenSize|screenLayout|orientation|keyboardHidden|keyboard|navigation|uiMode|density" - -# See https://developer.android.com/guide/topics/manifest/uses-feature-element -# -# Note: there can be multiple .uses_feature entries. -[[package.metadata.android.uses_feature]] -name = "android.hardware.vr.headtracking" -required = true -version = 1 - -[[package.metadata.android.uses_feature]] -opengles_version = [3, 2] -required = true - -[[package.metadata.android.uses_feature]] -name = "android.hardware.microphone" -required = true - -#[[package.metadata.android.uses_feature]] -#name = "android.hardware.vulkan.compute" -#version = 0 -#required = true - -[[package.metadata.android.uses_feature]] -name = "android.hardware.vulkan.level" -version = 1 -required = true - -[[package.metadata.android.uses_feature]] -name = "android.hardware.vulkan.version" -version = 0x00401000 -required = true - -[[package.metadata.android.uses_permission]] -name = "android.permission.MODIFY_AUDIO_SETTINGS" - -[[package.metadata.android.uses_permission]] -name = "android.permission.RECORD_AUDIO" - -[[package.metadata.android.uses_permission]] -name = "android.permission.INTERNET" - -[[package.metadata.android.uses_permission]] -name = "android.permission.ACCESS_NETWORK_STATE" - -[[package.metadata.android.uses_permission]] -name = "android.permission.ACCESS_WIFI_STATE" - -[[package.metadata.android.uses_permission]] -name = "android.permission.WAKE_LOCK" - -[[package.metadata.android.uses_permission]] -name = "android.permission.READ_EXTERNAL_STORAGE" - -[[package.metadata.android.uses_permission]] -name = "android.permission.WRITE_EXTERNAL_STORAGE" - -[[package.metadata.android.uses_permission]] -name = "android.permission.MANAGE_EXTERNAL_STORAGE" - -[[package.metadata.android.uses_permission]] -name = "android.permission.VIBRATE" - -[[package.metadata.android.uses_permission]] -name = "org.khronos.openxr.permission.OPENXR" -[[package.metadata.android.uses_permission]] -name = "org.khronos.openxr.permission.OPENXR_SYSTEM" - -[[package.metadata.android.queries.provider]] -authorities = "org.khronos.openxr.runtime_broker;org.khronos.openxr.system_runtime_broker" - # `name` attribute is not to be part of query-provider but cargo-apk uses aapt which throws errors without - # possibly needs to change to use appt2 -name = "org.khronos.openxr" - -[[package.metadata.android.queries.intent]] -actions = ["org.khronos.openxr.OpenXRRuntimeService"] - -[[package.metadata.android.queries.intent]] -actions = ["org.khronos.openxr.OpenXRApiLayerService"] - -# For Lynx R1 -[[package.metadata.android.queries.package]] -name = "com.ultraleap.tracking.service" -# For Lynx R1 -[[package.metadata.android.queries.package]] -name = "com.ultraleap.openxr.api_layer" - -# See https://developer.android.com/guide/topics/manifest/application-element -[package.metadata.android.application] -# See https://developer.android.com/guide/topics/manifest/application-element#debug -# -# Defaults to false. -debuggable = false - -hardwareAccelerated = true - -# See https://developer.android.com/guide/topics/manifest/application-element#theme -# -# Example shows setting the theme of an application to fullscreen. -theme = "@android:style/Theme.Black.NoTitleBar.Fullscreen" - -# Virtual path your application's icon for any mipmap level. -# If not specified, an icon will not be included in the APK. -#icon = "@mipmap/ic_launcher" - -# See https://developer.android.com/guide/topics/manifest/application-element#label -# -# Defaults to the compiled artifact's name. -label = "alxr_client" - -allow_backup = false - -has_code = false - -# See https://developer.android.com/guide/topics/manifest/meta-data-element -# -# Note: there can be several .meta_data entries. -# Note: the `resource` attribute is currently not supported. - -# See https://developer.android.com/guide/topics/manifest/activity-element -[package.metadata.android.application.activity] - -# See https://developer.android.com/guide/topics/manifest/activity-element#config -# -# Defaults to "orientation|keyboardHidden|screenSize". -config_changes = "screenSize|screenLayout|orientation|keyboardHidden|keyboard|navigation|uiMode|density" - -# See https://developer.android.com/guide/topics/manifest/activity-element#label -# -# Defaults to the application's label. -label = "alxr_client" - -# See https://developer.android.com/guide/topics/manifest/activity-element#lmode -# -# Defaults to "standard". -launch_mode = "singleTask" - -# See https://developer.android.com/guide/topics/manifest/activity-element#screen -# -# Defaults to "unspecified". -orientation = "landscape" - -resizeableActivity = "false" - -#[[package.metadata.android.application.activity.intent_filters]] -- old version of cargo-apk/manifest.rs -[[package.metadata.android.application.activity.intent_filter]] -actions = ["android.intent.action.MAIN"] -categories = ["android.intent.category.LAUNCHER", "org.khronos.openxr.intent.category.IMMERSIVE_HMD"] - -# See https://developer.android.com/guide/topics/manifest/data-element -# -# Note: there can be several .data entries. -# Note: not specifying an attribute excludes it from the final data specification. -#[[package.metadata.android.application.activity.intent_filter.data]] -#scheme = "https" -#host = "github.com" -#port = "8080" -#path = "/rust-windowing/android-ndk-rs/tree/master/cargo-apk" -#path_prefix = "/rust-windowing/" -#mime_type = "image/jpeg" diff --git a/alvr/openxr-client/alxr-android-client/lynx/runtime-libs/arm64-v8a/libc++_shared.so b/alvr/openxr-client/alxr-android-client/lynx/runtime-libs/arm64-v8a/libc++_shared.so deleted file mode 100644 index b185b499fc..0000000000 Binary files a/alvr/openxr-client/alxr-android-client/lynx/runtime-libs/arm64-v8a/libc++_shared.so and /dev/null differ diff --git a/alvr/openxr-client/alxr-android-client/src/lib.rs b/alvr/openxr-client/alxr-android-client/src/lib.rs index 3f5cb54e10..f9b0be6c31 100644 --- a/alvr/openxr-client/alxr-android-client/src/lib.rs +++ b/alvr/openxr-client/alxr-android-client/src/lib.rs @@ -64,6 +64,30 @@ fn get_build_model<'a>(jvm: &'a jni::JavaVM) -> String { get_build_property(&jvm, "MODEL") } +#[allow(dead_code)] +fn get_build_device<'a>(jvm: &'a jni::JavaVM) -> String { + get_build_property(&jvm, "DEVICE") +} + +#[allow(dead_code)] +fn get_build_manufacturer<'a>(jvm: &'a jni::JavaVM) -> String { + get_build_property(&jvm, "MANUFACTURER") +} + +#[allow(dead_code)] +fn is_device<'a>(pname: &str, jvm: &'a jni::JavaVM) -> bool { + let key = pname.to_lowercase(); + let model_name = get_build_model(&jvm).to_lowercase(); + let device_name = get_build_device(&jvm).to_lowercase(); + let man_name = get_build_manufacturer(&jvm).to_lowercase(); + for dname in [model_name, device_name, man_name] { + if dname.contains(&key) { + return true; + } + } + false +} + #[no_mangle] fn android_main(android_app: AndroidApp) { let log_level = if cfg!(debug_assertions) { @@ -186,6 +210,9 @@ unsafe fn run(android_app: &AndroidApp) -> Result<(), Box assert!(app_data.window_inited && android_app.native_window().is_some()); log::debug!("alxr-client: is activity paused? {0} ", !app_data.resumed); + let no_linearize_srgb = APP_CONFIG.no_linearize_srgb || is_device("Lynx", &vm); + log::info!("alxr-client: Disable shader gamma/sRGB linearization? {no_linearize_srgb}"); + let ctx = ALXRClientCtx { graphicsApi: APP_CONFIG.graphics_api.unwrap_or(ALXRGraphicsApi::Auto), decoderType: ALXRDecoderType::NVDEC, // Not used on android. @@ -201,7 +228,7 @@ unsafe fn run(android_app: &AndroidApp) -> Result<(), Box batterySend: Some(battery_send), setWaitingNextIDR: Some(set_waiting_next_idr), requestIDR: Some(request_idr), - disableLinearizeSrgb: APP_CONFIG.no_linearize_srgb, + disableLinearizeSrgb: no_linearize_srgb, noSuggestedBindings: APP_CONFIG.no_bindings, noServerFramerateLock: APP_CONFIG.no_server_framerate_lock, noFrameSkip: APP_CONFIG.no_frameskip, diff --git a/alvr/openxr-client/alxr-common/Cargo.toml b/alvr/openxr-client/alxr-common/Cargo.toml index 36727e3ab2..7a25b06da7 100644 --- a/alvr/openxr-client/alxr-common/Cargo.toml +++ b/alvr/openxr-client/alxr-common/Cargo.toml @@ -11,7 +11,6 @@ generic-flavor = ["alxr-engine-sys/generic-flavor"] # default if none specified. quest-flavor = ["alxr-engine-sys/quest-flavor"] pico-flavor = ["alxr-engine-sys/pico-flavor"] pico-v4-flavor = ["alxr-engine-sys/pico-v4-flavor"] -lynx-flavor = ["alxr-engine-sys/lynx-flavor"] # These features are only for non-android builds. cuda-interop = ["alxr-engine-sys/cuda-interop"] bundled-ffmpeg = ["alxr-engine-sys/bundled-ffmpeg"] diff --git a/alvr/openxr-client/alxr-engine-sys/Cargo.toml b/alvr/openxr-client/alxr-engine-sys/Cargo.toml index 929c19e800..56e6b6a27e 100644 --- a/alvr/openxr-client/alxr-engine-sys/Cargo.toml +++ b/alvr/openxr-client/alxr-engine-sys/Cargo.toml @@ -11,7 +11,6 @@ generic-flavor = [] # default if none specified. quest-flavor = [] pico-flavor = [] pico-v4-flavor = [] -lynx-flavor = [] # These features are only for non-android builds. cuda-interop = [] diff --git a/alvr/openxr-client/alxr-engine-sys/android/app/build.gradle b/alvr/openxr-client/alxr-engine-sys/android/app/build.gradle index 34358d390f..7b2ad68a7c 100644 --- a/alvr/openxr-client/alxr-engine-sys/android/app/build.gradle +++ b/alvr/openxr-client/alxr-engine-sys/android/app/build.gradle @@ -77,13 +77,6 @@ android { } externalNativeBuild.cmake.arguments += ["-DBUILD_LOADER=OFF", "-DUSE_PICO_MOBILE_V4_LOADER=ON"] } - LynxOXR { - dimension 'headset' - ndk { - abiFilters 'arm64-v8a' - } - externalNativeBuild.cmake.arguments += ["-DBUILD_LOADER=OFF", "-DUSE_LYNX_LOADER=ON"] - } } } diff --git a/alvr/openxr-client/alxr-engine-sys/build.rs b/alvr/openxr-client/alxr-engine-sys/build.rs index cb48b99cf4..2f9fd0bbb9 100644 --- a/alvr/openxr-client/alxr-engine-sys/build.rs +++ b/alvr/openxr-client/alxr-engine-sys/build.rs @@ -99,19 +99,17 @@ fn cmake_option_from_feature(feature_name: &str) -> &'static str { cmake_option_from_bool(is_feature_enabled(&feature_name)) } -const FALVOR_FEATURE_NAMES: [&'static str; 5] = [ +const FALVOR_FEATURE_NAMES: [&'static str; 4] = [ "GENERIC_FLAVOR", "QUEST_FLAVOR", "PICO_V4_FLAVOR", "PICO_FLAVOR", - "LYNX_FLAVOR", ]; -const GRADLE_FLAVOR_NAMES: [&'static str; 5] = [ +const GRADLE_FLAVOR_NAMES: [&'static str; 4] = [ "Generic", "OculusMobileOXR", "PicoMobileOXR_V4", "PicoMobileOXR", - "LynxOXR", ]; fn get_product_flavour() -> &'static str { diff --git a/alvr/openxr-client/alxr-engine-sys/cpp/ALVR-OpenXR-Engine b/alvr/openxr-client/alxr-engine-sys/cpp/ALVR-OpenXR-Engine index 95082628c0..0ba9725b78 160000 --- a/alvr/openxr-client/alxr-engine-sys/cpp/ALVR-OpenXR-Engine +++ b/alvr/openxr-client/alxr-engine-sys/cpp/ALVR-OpenXR-Engine @@ -1 +1 @@ -Subproject commit 95082628c000e013e4bf31bf534318ab51ae5bf9 +Subproject commit 0ba9725b78fd01f25020bc872660149b646b8dc6 diff --git a/alvr/xtask/src/main.rs b/alvr/xtask/src/main.rs index f7991b7bf3..0923cd1056 100644 --- a/alvr/xtask/src/main.rs +++ b/alvr/xtask/src/main.rs @@ -36,7 +36,6 @@ SUBCOMMANDS: build-alxr-quest Build OpenXR based client for Oculus Quest (same as `build-alxr-android --oculus-quest`), then copy binaries to build folder build-alxr-pico Build OpenXR based client for Pico 4/Neo 3 PUI >= 5.2.x (same as `build-alxr-android --pico`), then copy binaries to build folder build-alxr-pico-v4 Build OpenXR based client for Pico 4/Neo 3 PRE PUI 5.2.x (same as `build-alxr-android --pico-v4`), then copy binaries to build folder - build-alxr-lynx Build OpenXR based client for Lynx R-1 (same as `build-alxr-android --lynx`), then copy binaries to build folder build-ffmpeg-linux Build FFmpeg with VAAPI, NvEnc and Vulkan support. Only for CI publish-server Build server in release mode, make portable version and installer publish-client Build client for all headsets @@ -900,7 +899,6 @@ pub enum AndroidFlavor { OculusQuest, // Q1 or Q2 Pico, // PUI >= 5.2.x PicoV4, // PUI >= 4.7.x && < 5.2.x - Lynx, } pub fn build_alxr_android( @@ -928,7 +926,6 @@ pub fn build_alxr_android( AndroidFlavor::OculusQuest => "quest", AndroidFlavor::Pico => "pico", AndroidFlavor::PicoV4 => "pico-v4", - AndroidFlavor::Lynx => "lynx", _ => "", }; // cargo-apk has an issue where it will search the entire "target" build directory for "output" files that contain @@ -1033,7 +1030,6 @@ fn main() { let for_generic = args.contains("--generic"); let for_pico = args.contains("--pico"); let for_pico_neo_v4 = args.contains("--pico-v4"); - let for_lynx = args.contains("--lynx"); let for_all_flavors = args.contains("--all-flavors"); let oculus_ext = args.contains("--oculus-ext"); // @@ -1158,7 +1154,6 @@ fn main() { (for_oculus_quest, AndroidFlavor::OculusQuest), (for_pico, AndroidFlavor::Pico), (for_pico_neo_v4, AndroidFlavor::PicoV4), - (for_lynx, AndroidFlavor::Lynx), ]; for (_, flavour) in flavours.iter().filter(|(f, _)| for_all_flavors || *f) { @@ -1207,19 +1202,6 @@ fn main() { ..Default::default() }, ), - "build-alxr-lynx" => build_alxr_android( - root, - AndroidFlavor::Lynx, - AlxBuildFlags { - is_release: is_release, - reproducible: reproducible, - no_nvidia: true, - bundle_ffmpeg: false, - fetch_crates: fetch, - no_decoder: no_decoder, - ..Default::default() - }, - ), "build-ffmpeg-linux" => { dependencies::build_ffmpeg_linux(true); }