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

feat: ✨ Reduce session file length #2480

Merged
merged 1 commit into from
Nov 3, 2024
Merged

feat: ✨ Reduce session file length #2480

merged 1 commit into from
Nov 3, 2024

Conversation

zmerp
Copy link
Member

@zmerp zmerp commented Oct 28, 2024

We rely on code generation, and we generate a long list of OpenVR props. This list gets copied to the session file even for props we don't use. But even worse, because of how we structured the session generation, the whole list is copied for each added prop (where only one value is used at a time). This PR makes the OpenVR props and Mediacodec props untyped so we work around the issue. Instead I added runtime checks with warns if case of errors.

For OpenVR props, I appended the value type in the prop name as hint for the user.

This PR is not urgent but review when you can

Vixea
Vixea previously approved these changes Oct 28, 2024
Copy link
Collaborator

@The-personified-devil The-personified-devil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This modified the session file in a way that breaks compat right? Is that an issue or do we just not treat the settings as relevant (we already ask the user to delete the old config)

MediacodecDataType::String(value) => format.set_str(key, value),
for (key, prop) in &config.options {
let maybe_error = match prop.ty {
MediacodecPropType::Float => prop
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whats the advantage of delaying parsing to this point?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no advantage but I feel it's the most sensible place. In any case noone should usually change these options, and the error is still passed to the server.

Comment on lines +332 to +335
pub struct MediacodecProperty {
#[schema(strings(display_name = "Type"))]
pub ty: MediacodecPropType,
pub value: String,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the rationale between splitting it up like this? Seems like a step back if anything

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well it actually doesn't change that much after writing the session to json. it's mainly for symmetry with the OpenVR config, and it does make it a bit clearer when reading the session manually.

Comment on lines -24 to -30
let name = if code == "1007" {
"HardwareRevisionString".into()
} else if code == "1017" {
"HardwareRevisionUint64".into()
} else {
cap[1].replace('_', "")
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did steamvr get upgraded enough or what happened

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the workaround for HardwareRevision because now we straight up append the data type in the name, so there is no more naming conflict.

@zmerp
Copy link
Member Author

zmerp commented Oct 31, 2024

This modified the session file in a way that breaks compat right? Is that an issue or do we just not treat the settings as relevant (we already ask the user to delete the old config)

I consider session changes non-breaking changes, up to a point. An example of a breaking change would be renaming the field "protocol" to "transport" (transport is the more correct name but we can't change it now). If you do the rename and update only server and select TCP, then the client will not recognize it and default to UDP, breaking the connection completely.

These changes instead are non breaking. if the user updates the server but not the client, and then changes the mediacodec settings, once the session is parsed by the client the updated options are discarded and the default ones (in the old format) are used.

Make OpenVR and Mediacodec props untyped
Copy link
Contributor

@shinyquagsire23 shinyquagsire23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the old enum was kind of a pain to extend for quick tests on undocumented IDs

@zmerp
Copy link
Member Author

zmerp commented Nov 3, 2024

You still have to recompile alvr_session to get update the enum. The only difference is that now the enum is "pure" without associated data. But indeed this greatly simplifies adding new entries if you are manually editing the session.

@zmerp zmerp merged commit 15b4561 into master Nov 3, 2024
9 checks passed
@zmerp
Copy link
Member Author

zmerp commented Nov 3, 2024

LGTM, the old enum was kind of a pain to extend for quick tests on undocumented IDs

Actually, undocumented IDs are still unsupported, but we can add support

@zmerp zmerp deleted the reduce-session-length branch November 3, 2024 13:11
zmerp added a commit that referenced this pull request Dec 7, 2024
zmerp added a commit that referenced this pull request Jan 15, 2025
zmerp added a commit that referenced this pull request Jan 15, 2025
* wiki updates for flatpak stuff (#2401)

* wiki updates for flatpak stuff

* explain difference between native and flatpak steam more clearly

* give examples of using hybrid graphics with other fixes

* notes about wlx-overlay-s testing

---------

Co-authored-by: failboat78 <failboat@ocean.world>

* refactor: 🚨 Use "crate-type"

* ci: ⬆️ Update platform tools to v32

* refactor(streamer): ♻️ Clarify distinction between bitrate and throughput (#2423)

* chore: ⬆️ Update some dependencies

* fix(client_core): 🐛 Fix potential blank render bug

This bug was already mitigated on #2397 but this is the proper fix. Discovered by @nowak-pl

* Add Quest 3S support

* refactor(client): ♻️ Use VIEW reference space; tweak client API

* feat(client): ✨ Add platform vendor shortcuts

* refactor(client): ♻️ Move decoder out of ClientCoreContext; fix IDR race condition (#2421)

* feat(client_core): ✨ Add `alvr_initialize_logging()` (#2439)

* fix(client_openxr): 🐛 Fix crash on Focus 3 with 0 timestamp (#2440)

* feat(server_openvr) NVENC AV1 support (#2438)

* Initial attempt at AV1, ffplay is happy with the AV1 stream, but the Quest 3 is not.

* Trim out IVF bits for NVENC AV1

* Working OSLog for iOS/macOS

* Not AMD only any more

* One more bounds check

* Fix writing AV1 to files

* Remove logging changes

* No hex

* tracking rewrite(1): client API

* fix(server): 🐛 Fix IDR resend logic (#2403)

Co-authored-by: zarik5 <riccardo.zaglia5@gmail.com>

* build: ✨ Support aarch64 Windows host

* fix(client_core): 🐛 Fix wrong controller timestamp

Fixes #2445

* Revert "chore: ⬆️ Update some dependencies"

This reverts commit c08e67e.

* fix(server_core): 🐛 Fix tilt mode origin; refactoring

* tracking rewrite (2): server API

* Negotiated encoding settings for OLED-based headsets (#2442)

* fix(server_core): 🐛 Do not crash with Custom controllers profile

* fix(client_openxr): 🐛 Fix blank flashes

* feat(client): ✨ Add Pico 4 Ultra support (#2466)

* fix(client_openxr): 🐛 Fix controllers profile for Pico 4 Ultra (#2470)

* feat: ✨ Use generic loader for Pico >= 4 (#2471)

* Create iptables folder during firewall set up if it doesn't exist. (#2457)

* Publish tracking data through VMC Protocol (#2461)

* VMC Protocol implementation

* VMC Protocol: add configuration parameters

* VMC Protocol: work with id's instead of strings

* fix formating

* Merge VMCSinkConfig into VMCConfig

* Apply bone rotation comply with VMC standard.

* VMC: Add toggle for orientation correction

* VMC: set the correct default port

* VMC: Add hand tracking

* VMC: Update rotations

* VMC: Weird constant collision error

* refactor(server_openvr): ♻️ Refactor around TrackedDevice

* refactor(server_openvr): ♻️ Use TrackedDevice for FakeViveTracker

* fix(client_core): 🐛 Fix Pico 4 detection; add Focus Vision (#2479)

* Fix SteamVR restart loops on AVP (#2484)

* feat-fix(server_openvr): Add timewarped compositing to Windows OpenVR compositor (#2472)

* WIP

* cleanup

* done

* Fix linux build

* nits

* take 2

* refactor(client): ♻️ Move platform to alvr_system_info; rename video decoder (#2488)

* feat: ✨ Reduce session file length (#2480)

* feat(client): ✨ Make lobby use passthrough (#2485)

* feat(server_openvr): Add Quest Pro controller and headset emulation; Use VRLink hand tracking icons for the hand tracker controllers; Misc refactoring to reduce prop.rs linecount (#2489)

* feat: integrate adb port forwarding (#2451)

* fix(server_openvr): Fix CPU/GPU deadlocking at 100% usage before the headset connects (#2495)

* Fix CPU/GPU deadlocking at 100% usage before the headset connects

* Temporary stats manager and nits

* Remove optimize_game_render_latency

* fix(server_openvr): 🐛 Fix prop parse fail; use key name for log

* refactor: 💄 Fix dashboard spacing; refactor alvr_adb

* refactor(client_openxr): ♻️ Remove redundant state and fix potential refactoring pitfall

* docs: 📝 Add Steam store link

* feat(xtask): ✨ Add Pico store build; fix Pico 4e and G3

* fix(adb): fix device serial parsing and use TCP (#2507)

* Fix device serial number parsing

* Force stream protocol to TCP when wired

* feat(server_openvr): ✨ Add option to disable hand skeleton prediction (#2517)

* feat(server_openvr): ✨ Add option to disable hand skeleton prediction

* Add `predict` help string

* feat(adb): add client flavors and autolaunch (#2515)

* Add client flavours

* Add client autolaunch

* Apply requested changes

* Fix wired connection status message

* Fix wired client type help string

* fix(sockets): 🐛 Ignore error 997 (overlapped IO) (#2522)

* refactor(client_core): ♻️ Port FFE to Rust and remove all C++ code (#2523)

* build(xtask): 💚 Pin cargo-about (#2524)

* build(xtask): 💚 Really fix cargo about (#2525)

* feat(client): ✨ Add passthrough alpha support (#2527)

* refactor(launcher): refactor client APK installation from launcher (#2531)

* Refactor client APK installation from launcher

* Apply requested changes

* refactor(client_openxr): ♻️ Do not recreate OpenXR session (#2519)

* refactor(client_openxr): ♻️ Do not recreate OpenXR session

* Address comments

* docs(linux): update wiki (#2512)

* docs(linux): Updates for linux wiki, make sure user knows where wiki for linux is

* docs(linux): finalize wiki update

---------

Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>

* docs: fix wiki breaking yet again (#2540)

* docs: temp fix for quest framerate throttling (#2538)

* fix(xtask): 🐛 Fix package commands; update release ci (#2545)

* build(xtask): 🔧 Fix Flatpak script (#2547)

* chore: recreate logos as SVG (#2548)

* chore: recreate logos as SVG

* fix: update image link in readme to new logos

* fix: convert text to paths in SVG logo

* fix: 🐛 Fix package-launcher requiring openvr submodule (#2549)

* fix: 🐛 Fix package-launcher requiring openvr submodule

* Do not delete launch build dir with package-launcher; fix launcher installations dir

* fix(dashboard): 🐛 Reject unsupported servers (#2536)

* feat(client): ✨ Add reprojection support for C API (#2543)

* feat(client): ✨ Add reprojection support for C API

* Address comment

* chore(ci): update deprecated actions (#2554)

* chore(ci): update deprecated actions

* chore(ci): Fancy annotations uwu

* chore(ci): update ci some more

* chore(xtask): Dont run submodule update (#2556)

* chore(xtask): Dont run submodule update

* fix(linux): Fix compilitation error without jack installed

* chore: Add composited background resource (#2561)

* docs(linux): fix for no steamvr dashboard on hybrid graphics (#2511)

* docs(linux): fix for no steamvr dashboard on hybrid graphics

* docs(linux) specify dashboard fix is for nvidia

* docs(linux): note to first close the steam client before opening it with render offload

* chore(cpp): Fix warnings from openvr headers

* chore(xtask): Fully remove windows installer

* chore: Bump rust msrv to 1.82

* chore: Fix clippy lints

* chore(ci): fix cargo msrv and print clippy output

* feat(common): ✨ Add `Pose * DeviceMotion` operator (#2574)

* refactor(client_openxr): ♻️ Refactor around reference spaces (#2576)

* refactor(client_openxr): ♻️ Refactor around reference spaces

* Fix clippy

* fix(client_openxr): 🐛 Fix head angular velocity (#2577)

* chore: 💚 Fix CI build (#2578)

* fix launcher on deck (#2585)

* Made the dashboard and launcher report respective appids to the system (#2595)

* fix(server_openvr): 🐛 Fix tracked toggle for controllers (#2604)

* fix(server_core): 🐛 Don't trigger ALVR gestures if holding controllers (#2606)

* Full range wgpu partial fix (#2597)

* Full range HDR works?

* Fix full range for non-HDR

* Cleanup

* Adjust this note

* Fix CI

* Fix server

* Return fractions

* fix(server_core): 🐛 Fix controllers disabling with lag (#2609)

* fix(server_core): 🐛 Fix controllers disabling with lag

* clippy

* fix(client): 🐛 Fix controller angular velocity for some devices; show velocities in lobby (#2608)

* fix(client): 🐛 Fix controller angular velocity for some devices; show velocities in lobby

* Draw velocities only in debug builds

* Add push constants consts and bound checks

* Add support for Virtual Audio Cable (#2483)

* docs: 📝 Mark Vive Focus Vision as supported (#2613)

* fix(client): 🐛 Fix Pico wrong prediction; refactoring (#2612)

* fix(server_core): 🐛 Fix server locking the session unnecessarily (#2619)

* fix(client_openxr): 🐛 Fix crash on unsupported eye tracking permission on Pico (#2618)

* feat: Make on connect script toggle only + disable remote dash by default (#2621)

* Bump to v20.12.0

* chore: fix prepare-release ci (#2624)

---------

Co-authored-by: failboat78 <pwalsh0+github@gmail.com>
Co-authored-by: failboat78 <failboat@ocean.world>
Co-authored-by: Max Thomas <mtinc2@gmail.com>
Co-authored-by: Vixea <112600048+Vixea@users.noreply.github.com>
Co-authored-by: Simon Storfors <simon.storfors@gmail.com>
Co-authored-by: Grillo <grillo@delmal.cl>
Co-authored-by: E1int <110526002+E1int@users.noreply.github.com>
Co-authored-by: Meister1593 <leruop@Gmail.com>
Co-authored-by: Leonhard Saam <leonhard.saam@yahoo.com>
Co-authored-by: Leonhard Saam <54042101+The-personified-devil@users.noreply.github.com>
Co-authored-by: Ozzy Helix <ozonehelix@gmail.com>
Co-authored-by: Issac Dowling <git@issacdowling.com>
Co-authored-by: yobson1 <45133474+yobson1@users.noreply.github.com>
Co-authored-by: Kirottu <56396750+Kirottu@users.noreply.github.com>
Co-authored-by: Sobble Entertainment Inc. <8494722+DevanWolf@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants