Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard and settings minor rehearsal #1893

Merged
merged 21 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2ad2b0e
Disable adapt to framerate by default. Remove dynamic oculus foveatio…
Meister1593 Nov 7, 2023
999d3fb
Add 'Donate to ALVR button' in About tab.
Meister1593 Nov 7, 2023
8898201
Add Hand Gestures Setup Page. Change SoftwareRequirements tab for lin…
Meister1593 Nov 7, 2023
01082ba
Default sharpening to 0.5
Meister1593 Nov 7, 2023
48e5916
Remove commented code. Remove unnecessary import.
Meister1593 Nov 7, 2023
2828d40
Reformat code. Remove commented code. Remove unnecessary import.
Meister1593 Nov 7, 2023
1c07f84
Update hand tracking controller bindings
Meister1593 Nov 7, 2023
6a69cea
Updated distrobox guide
Meister1593 Nov 7, 2023
6a9e8ef
Fix table on hand tracking bindings wiki
Meister1593 Nov 7, 2023
f2502df
Rename label to Only Touch
Meister1593 Nov 7, 2023
8484b39
Set only touch to be true by default. Added note about disabling/enab…
Meister1593 Nov 7, 2023
2d99a37
Restore adapt to framerate toggle to be true by default
Meister1593 Nov 13, 2023
e9058bd
Added automatic audio script download/placement for alvr
Meister1593 Nov 13, 2023
13ca11f
Added platform-specific cfg's for linux code
Meister1593 Nov 13, 2023
bb7d62d
Fixed link after testing
Meister1593 Nov 13, 2023
4812efc
Remove reqwest and use ureq instead. Add more platform cfgs in setup …
Meister1593 Nov 14, 2023
2f7d699
Re-added OpenUrl for windows
Meister1593 Nov 14, 2023
d4be60e
Added specific cfg checks for windows to prevent compile errors on macos
Meister1593 Nov 14, 2023
666baf1
Moved platform specific import to function. Changed windows platform …
Meister1593 Nov 14, 2023
3bcf787
Fix incorrect OpenUrl import for windows
Meister1593 Nov 14, 2023
2c9e6cd
Remove whitespaces
Meister1593 Nov 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions alvr/dashboard/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ serde = { version = "1", features = ["derive"] }
serde_json = "1"
settings-schema = { git = "https://github.com/alvr-org/settings-schema-rs", rev = "676185f" }
statrs = "0.16"
reqwest = { version = "0.11", default-features = false, features = ["rustls-tls", "blocking", "json"] }
Meister1593 marked this conversation as resolved.
Show resolved Hide resolved

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
alvr_server_io.workspace = true
Expand Down
4 changes: 4 additions & 0 deletions alvr/dashboard/src/dashboard/components/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ This is a fork of ALVR that works with Meta Quest and other standalone headsets.
"Latest release",
"https://github.com/alvr-org/ALVR/releases/latest",
);
ui.hyperlink_to(
"Donate to ALVR on Open Collective",
"https://opencollective.com/alvr",
);
}
130 changes: 94 additions & 36 deletions alvr/dashboard/src/dashboard/components/setup_wizard.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
use alvr_packets::{FirewallRulesAction, ServerRequest};
use crate::dashboard::basic_components;
use alvr_common::{error, warn};
use alvr_packets::{FirewallRulesAction, PathValuePair, ServerRequest};
use eframe::{
egui::{Button, Label, Layout, OpenUrl, RichText, Ui},
emath::Align,
};
use std::{error::Error, f32::consts::E, os::unix::fs::PermissionsExt};
use std::{
fs::{self, File},
io,
};

pub enum SetupWizardRequest {
ServerRequest(ServerRequest),
Expand All @@ -15,10 +22,10 @@ enum Page {
ResetSettings = 1,
HardwareRequirements = 2,
SoftwareRequirements = 3,
Firewall = 4,
// PerformancePreset,
Recommendations = 5,
Finished = 6,
HandGestures = 4,
Firewall = 5,
Recommendations = 6,
Finished = 7,
}

fn index_to_page(index: usize) -> Page {
Expand All @@ -27,9 +34,10 @@ fn index_to_page(index: usize) -> Page {
1 => Page::ResetSettings,
2 => Page::HardwareRequirements,
3 => Page::SoftwareRequirements,
4 => Page::Firewall,
5 => Page::Recommendations,
6 => Page::Finished,
4 => Page::HandGestures,
5 => Page::Firewall,
6 => Page::Recommendations,
7 => Page::Finished,
_ => unreachable!(),
}
}
Expand Down Expand Up @@ -57,12 +65,14 @@ fn page_content(

pub struct SetupWizard {
page: Page,
only_touch: bool,
}

impl SetupWizard {
pub fn new() -> Self {
Self {
page: Page::Welcome,
only_touch: true,
}
}

Expand Down Expand Up @@ -110,15 +120,63 @@ impl SetupWizard {
Make sure you have at least one output audio device.",
|_| (),
),
Page::SoftwareRequirements => page_content(
Page::SoftwareRequirements => {
page_content(
ui,
"Software requirements",
r"To stream the Quest microphone on Windows you need to install VB-Cable or Voicemeeter.
On Linux, game audio and microphone might require pipewire and On connect/On disconnect script.
Script is not 100% stable and might cause some instability issues with pipewire, but it should work.",
|ui| {
if ui.button("Download VB-Cable").clicked() {
ui.ctx()
.open_url(OpenUrl::same_tab("https://vb-audio.com/Cable/"));
}
let button = ui.button("'On connect/On disconnect' audio script");
if button.clicked() {
match download_and_prepare_audio_script() {
Ok(audio_script_path) => {
request =
Some(SetupWizardRequest::ServerRequest(
ServerRequest::SetValues(vec![
PathValuePair {
path: alvr_packets::parse_path(
"session_settings.connection.on_connect_script",
),
value: serde_json::Value::String(audio_script_path.clone()),
},
PathValuePair {
path: alvr_packets::parse_path(
"session_settings.connection.on_disconnect_script",
),
value: serde_json::Value::String(audio_script_path.clone()),
},
]),
));
warn!("Successfully downloaded and set On connect / On disconnect script")
}
Err(e) => error!("{e}"),
}
}
},
)
}
Page::HandGestures => page_content(
ui,
"Software requirements",
r"To stream the Quest microphone on Windows you need to install VB-Cable or Voicemeeter.
On Linux some feaures are not working and should be disabled (foveated encoding and color correction) and some need a proper environment setup to have them working (game audio and microphone streaming).",
"Hand Gestures",
r"ALVR allows you to use Hand Tracking and emulate controller buttons using it.
By default, controller button emulation is set to prevent accidental clicks. You can re-enable gestures by disabling slider bellow.",
|ui| {
if ui.button("Download VB-Cable").clicked() {
ui.ctx()
.open_url(OpenUrl::same_tab("https://vb-audio.com/Cable/"));
ui.label("Only touch");
if basic_components::switch(ui, &mut self.only_touch).changed() {
request = Some(SetupWizardRequest::ServerRequest(
ServerRequest::SetValues(vec![PathValuePair {
path: alvr_packets::parse_path(
"session_settings.headset.controllers.content.gestures.content.only_touch",
),
value: serde_json::Value::Bool(self.only_touch),
}]),
));
}
},
),
Expand All @@ -135,30 +193,10 @@ This requires administrator rights!",
}
},
),
// Page::PerformancePreset => {
// ui.label(
// r#"Performance preset
// Please choose preset that fits your setup. This will adjust some settings for you.
// "#,
// );
// ui.horizontal(|ui| {
// // TODO correct preset strings
// if ui.button("Compatibility").clicked() {
// // request = Some(DashboardRequest::PresetInvocation(
// // "compatibility".to_string(),
// // ));
// }
// if ui.button("Visual quality").clicked() {
// // request = Some(DashboardRequest::PresetInvocation(
// // "visual_quality".to_string(),
// // ));
// }
// });
// }
Page::Recommendations => page_content(
ui,
"Recommendations",
r"ALVR supports multiple types of PC hardware and headsets but not all work correctly with default settings. For example some AMD video cards work only with the HEVC codec and GearVR does not support foveated encoding. Please try tweaking different settings if your ALVR experience is broken or not optimal.",
r"ALVR supports multiple types of PC hardware and headsets but not all might work correctly with default settings. Please try tweaking different settings like encoder, bitrate and others if your ALVR experience is great or not optimal.",
|_| (),
),
Page::Finished => page_content(
Expand Down Expand Up @@ -193,3 +231,23 @@ This requires administrator rights!",
request
}
}

fn download_and_prepare_audio_script() -> Result<String, Box<dyn Error>> {
let response = reqwest::blocking::get(
zarik5 marked this conversation as resolved.
Show resolved Hide resolved
"https://raw.githubusercontent.com/alvr-org/ALVR-Distrobox-Linux-Guide/main/audio-setup.s",
)?;
if !response.status().is_success() {
return Err(format!("Could not download script, status {}", response.status()).into());
}
let body = response.text()?;
let layout = alvr_filesystem::filesystem_layout_invalid();
let config_path = layout
.config_dir
.to_str()
.ok_or("Couldn't get config dir")?;
let audio_script_path = format!("{}/audio-setup.sh", config_path);
let mut out = File::create(audio_script_path.clone())?;
io::copy(&mut body.as_bytes(), &mut out)?;
fs::set_permissions(audio_script_path.clone(), fs::Permissions::from_mode(0o755))?;
Ok(audio_script_path)
}
7 changes: 2 additions & 5 deletions alvr/session/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,6 @@ pub struct VideoConfig {

pub clientside_foveation: Switch<ClientsideFoveation>,

pub dynamic_oculus_foveation: bool,

#[schema(flag = "steamvr-restart")]
pub color_correction: Switch<ColorCorrectionConfig>,
}
Expand Down Expand Up @@ -1266,7 +1264,6 @@ pub fn session_settings_default() -> SettingsDefault {
vertical_offset_deg: 0.0,
},
},
dynamic_oculus_foveation: true,
color_correction: SwitchDefault {
enabled: true,
content: ColorCorrectionConfigDefault {
Expand All @@ -1275,7 +1272,7 @@ pub fn session_settings_default() -> SettingsDefault {
contrast: 0.,
saturation: 0.5,
gamma: 1.,
sharpening: 0.,
sharpening: 0.5,
},
},
},
Expand Down Expand Up @@ -1412,7 +1409,7 @@ pub fn session_settings_default() -> SettingsDefault {
enabled: true,
content: HandGestureConfigDefault {
gui_collapsed: true,
only_touch: false,
only_touch: true,
pinch_touch_distance: 0.0,
pinch_trigger_distance: 0.25,
curl_touch_distance: 2.0,
Expand Down
22 changes: 8 additions & 14 deletions wiki/ALVR-in-distrobox.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,7 @@

4. Firewall configuration is skipped entirely and setup firewall configuration is broken, so it might not work in case you have strict firewall (alvr docs should have info about that) (Low priority TODO).

5. Don't use SteamVR Beta (1.26+) version, it contains a lot of breaking changes that are yet to be tested to work with.

6. Some nvidia users might experience 307 steamvr crash - seemingly related to 530 driver, update or downgrade, should resolve the issue.

7. At the moment, most of the podman portability issues were fixed, but it's not done, so if you happen to have any kind of issues while running both this and other distroboxes from your system, please report them. I created some issues at podman side ([documentation issue](https://github.com/containers/podman/issues/18375), [storage configuration issue, which prevents complete isolation from runtime containers at the moment](https://github.com/containers/storage/issues/1587)) and [created PR](https://github.com/89luca89/distrobox/pull/718) for distrobox (WIP) to upstream the changes.

8. This script unlikely to work on external disks.
5. This script unlikely to work on external disks.

## Installing alvr distrobox

Expand Down Expand Up @@ -55,11 +49,11 @@ After installing ALVR you may want to configure it and steamvr to run at best qu

2. **Preferred framerate:** If you know that you will have lower fps than usual (for instance, VRChat), run at lower fps. This is because when reprojection (this is what allows for smooth view despite being at low fps) goes lower than twice the amount of specified framerate - it fails to reproject and will look worse. So for example, you can run at 72hz if you know you're expecting low framerate, and 120hz if you are going to play something like Beat Saber, which is unlikely to run at low fps.

3. **Encoder preset:** Quality
3. **Encoder preset:** Balanced

4. **Game Audio & Microphone:** Set to pipewire as has been said in installation. ALVR uses default audio sink for audio, and doesn't care about volume (it's controlled only onboard audio on headset), and automatic audio scripts mutes default audio by default to prevent mirroring. As for microphone, every time ALVR is connected on headset, on connect script creates audio source named **ALVR-MIC-Source**, which can be used in game as default microphone, if you set it at least once. No need to un-set it back to default. And when headset disconnects it automatically clears audio source and restores back to previous microphone.

5. **Bitrate:** Adaptive, maximum bitrate: 150 mbps, minimum bitrate: 100 mbps.
5. **Bitrate:** Constant, bitrate: 350-450 mbps for h264 wireless/700 mbit-1 gbit cabled, 100-150 mbps for HEVC.

6. **Foveated rendering:** This highly depends on given headset, but generally default settings should be OK for Quest 2. For **pico neo 3** i would recommend setting center region width to 0.8 and height to 0.75, shifts to 0 and edge ratios can be set at 6-7, and for the same **pico neo 3** disable oculus foveation level and dynamic oculus foveation.

Expand All @@ -73,13 +67,13 @@ After installing ALVR you may want to configure it and steamvr to run at best qu

### AMD-specific configuration:

1. Preferred codec: HEVC, h264 looked choppy and has visual "blocking".
1. Preferred codec: HEVC, h264 works too.

2. Reduce color banding: turn on, makes image smoother.
2. Reduce color banding: turn on, might make image smoother.

### Nvidia-specific configuration (needs feedback):

1. Preferred codec: h264
1. Preferred codec: h264, HEVC works too

After that, restart your headset using power button and it will automatically restart steamvr once, applying all changes.

Expand All @@ -93,9 +87,9 @@ Inside SteamVR you also may need to change settings to improve experience. Open

3. **Video tab: Fade To Grid** on app hang - this will lock your view to last frame when app hangs instead of dropping you into steamvr void, completely optional but you may prefer that.

4. **Video tab: Disable Advanced Supersample Filtering**
4. **Video tab: Disable Advanced Supersample Filtering**

5. **Video tab: Per-application video settings** - Use Legacy Reprojection Mode for specific game. This can drastically change experience from being very uncomfortable, rubber-banding, to straight up perfect. This essentially disables reprojection on SteamVR side and leaves it to the client. Make sure to enable it for each game you will play. If you don't see that button, it is possible that you didn't apply patch from installation script, which means that opening each game video settings will take a while and may not even catch up at all after multiple minutes. If you want to apply that patch, get into the container (read bellow in the end how to do that) and run the `./patch_bindings_spam.sh` with absolute path to your steamvr inside container directory (relative to scripts folder, `installation/arch-alvr/.local/share/Steam/steamapps/SteamVR`).
5. **Video tab: Per-application video settings** - Use Legacy Reprojection Mode for specific game. This can drastically change experience from being very uncomfortable, rubber-banding, to straight up perfect. This essentially disables reprojection on SteamVR side and leaves it to the client. Make sure to enable it for each game you will play.

6. **Developer tab: Set steamvr as openxr runtime** - this ensures that games using openxr (such as Bonelab, or Beat Saber) will use SteamVR.

Expand Down
46 changes: 14 additions & 32 deletions wiki/Hand-tracking-controller-bindings.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,20 @@
Current bindings for ALVR 14.0.0
Current bindings for ALVR 20
===
Meister1593 marked this conversation as resolved.
Show resolved Hide resolved

There's no trackpad/joystick position mapping.
To control state of gestures, you can toggle `Headset -> Controllers -> Gestures -> Only touch`
Enabled state means that gestures won't be triggered, disabled would mean all gestures are activated.

Oculus Rift S
Gestures
---
|Action|w/ handtracking pinch|w/o pinch|
|-|-|-|
|Trigger|index + thumb pinch|index finger curl|
|Joystick press|thumb press towards palm|thumb press towards palm|
|Grip press|middle, ring, pinky fingers curl|middle, ring, pinky fingers curl|
|A|right ring + thumb pinch| N/A |
|B|right middle + thumb pinch| N/A |
|X|left ring + thumb pinch| N/A |
|Y|left middle + thumb pinch| N/A |
|Menu button|left pinky + thumb pinch| N/A |
|Action|Handtracking pinch|
|-|-|
|Trigger|Pinch thumb and index|
|Joystick click|Curl thumb to palm|
|Grip|Curl middle, ring and little|
|Y/B|Pinch thumb and middle|
|X/A|Pinch thumb and ring|
|Menu button|Pinch thumb and little on left hand|

Valve Index
Joystick
---
|Action|w/ handtracking pinch|w/o pinch|
|-|-|-|
|Trigger|index finger curl|index finger curl|
|Grip press|middle, ring, pinky fingers curl|middle, ring, pinky fingers curl|
|Trackpad press|thumb press towards palm|thumb press towards palm|
|A|middle + thumb pinch| N/A |
|B|index + thumb pinch| N/A |
|System button|ring + thumb pinch| N/A |

HTC Vive
---
|Action|w/ handtracking pinch|w/o pinch|
|-|-|-|
|Trigger|index finger curl|index finger curl|
|Grip press|middle, ring, pinky fingers curl|middle, ring, pinky fingers curl|
|Trackpad press|thumb press towards palm|thumb press towards palm|
|Menu button|middle + thumb pinch| N/A |
|System button|ring + thumb pinch| N/A |
Activation is done through curling all 4 fingers and touching top of hand with thumb