Skip to content

Commit

Permalink
Idle time/stat report fixes/optimizations
Browse files Browse the repository at this point in the history
* Idle time/stat report fixes/optimizations
* Reduces excessive empty/full queue wait times.
* Add new basic options for (decoded) frame pacing/buffering
* alxr-engine submodule ref update.
  • Loading branch information
korejan committed Oct 29, 2022
1 parent e09ab13 commit d319f19
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 4 deletions.
2 changes: 2 additions & 0 deletions alvr/openxr-client/alxr-android-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ fn run(app_data: &mut AppData) -> Result<(), Box<dyn std::error::Error>> {
requestIDR: Some(request_idr),
disableLinearizeSrgb: APP_CONFIG.no_linearize_srgb,
noSuggestedBindings: APP_CONFIG.no_bindings,
noServerFramerateLock: APP_CONFIG.no_server_framerate_lock,
noFrameSkip: APP_CONFIG.no_frameskip,
};
let mut sys_properties = ALXRSystemProperties::new();
if !alxr_init(&ctx, &mut sys_properties) {
Expand Down
2 changes: 2 additions & 0 deletions alvr/openxr-client/alxr-client/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ fn main() {
verbose: APP_CONFIG.verbose,
disableLinearizeSrgb: APP_CONFIG.no_linearize_srgb,
noSuggestedBindings: APP_CONFIG.no_bindings,
noServerFramerateLock: false,
noFrameSkip: false,
};
let mut sys_properties = ALXRSystemProperties::new();
if !alxr_init(&ctx, &mut sys_properties) {
Expand Down
35 changes: 33 additions & 2 deletions alvr/openxr-client/alxr-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,17 @@ pub struct Options {
#[structopt(/*short,*/ long)]
pub no_alvr_server: bool,

// short and long flags (-d, --debug) will be deduced from the field's name
/// Disables all OpenXR Suggested bindings for all interaction profiles. This means disabling all inputs.
#[structopt(/*short,*/ long)]
pub no_bindings: bool,

/// Disables locking/typing the client's frame-rate to the server frame-rate
#[structopt(/*short,*/ long)]
pub no_server_framerate_lock: bool,

/// Disables skipping frames, disabling may increase idle times.
#[structopt(/*short,*/ long)]
pub no_frameskip: bool,
// /// Set speed
// // we don't want to name it "speed", need to look smart
// #[structopt(short = "v", long = "velocity", default_value = "42")]
Expand Down Expand Up @@ -96,6 +103,8 @@ impl Options {
no_linearize_srgb: false,
no_alvr_server: false,
no_bindings: false,
no_server_framerate_lock: false,
no_frameskip: false,
};

let sys_properties = AndroidSystemProperties::new();
Expand Down Expand Up @@ -125,7 +134,27 @@ impl Options {
.unwrap_or(new_options.no_linearize_srgb);
println!(
"ALXR System Property: {property_name}, input: {value}, parsed-result: {}",
new_options.verbose
new_options.no_linearize_srgb
);
}

let property_name = "debug.alxr.no_server_framerate_lock";
if let Some(value) = sys_properties.get(&property_name) {
new_options.no_server_framerate_lock = std::str::FromStr::from_str(value.as_str())
.unwrap_or(new_options.no_server_framerate_lock);
println!(
"ALXR System Property: {property_name}, input: {value}, parsed-result: {}",
new_options.no_server_framerate_lock
);
}

let property_name = "debug.alxr.no_frameskip";
if let Some(value) = sys_properties.get(&property_name) {
new_options.no_frameskip =
std::str::FromStr::from_str(value.as_str()).unwrap_or(new_options.no_frameskip);
println!(
"ALXR System Property: {property_name}, input: {value}, parsed-result: {}",
new_options.no_frameskip
);
}

Expand All @@ -145,6 +174,8 @@ impl Options {
no_linearize_srgb: false,
no_alvr_server: false,
no_bindings: false,
no_server_framerate_lock: false,
no_frameskip: false,
};
new_options
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ android {
dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.6.1'
implementation 'com.google.android.material:material:1.7.0'
//implementation 'org.khronos.openxr:openxr_loader_for_android:1.0.20'
//implementation files('libs/openxr_loader_for_android-1.0.22.aar')
}

0 comments on commit d319f19

Please sign in to comment.