From 5c8310e88f760cd9f5cc0baff7a4646fdccfb5a0 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Fri, 6 Sep 2024 11:56:33 +0200 Subject: [PATCH] Tweak default values, fix docs default client scale: 1.0 -> 1.4 default server scale: 0.8 -> 0.5 (0.35 if eye tracked) added docs for av1 as default when supported fixed docs about multiple encoders, it's not enabled by default --- client/configuration.h | 2 +- docs/configuration.md | 6 +++--- server/driver/wivrn_comp_target.cpp | 2 +- server/encoder/encoder_settings.cpp | 8 +++++--- server/encoder/encoder_settings.h | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/client/configuration.h b/client/configuration.h index 6f573434..ed085b6e 100644 --- a/client/configuration.h +++ b/client/configuration.h @@ -41,7 +41,7 @@ public: std::map servers; float preferred_refresh_rate = 0; - float resolution_scale = 1.0; + float resolution_scale = 1.4; bool show_performance_metrics = false; bool microphone = false; bool passthrough_enabled = false; diff --git a/docs/configuration.md b/docs/configuration.md index 97f8eb84..dbfe9dce 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1,6 +1,6 @@ # Configurable items: ## `scale` -Default value: `0.8` +Default value: `0.5`, `0.35` if headset supports eye tracking Controls the size of the video stream, either a number between 0 and 1 or a pair of numbers between 0 and 1. If two numbers are provided the first one is horizontal scale and the second vertical. Scaling is applied in a foveated fashion: the center has a 1:1 ratio and the rest is scaled so that the total number of pixels matches the desired scale. @@ -28,7 +28,7 @@ Bitrate of the video, in bit/s. Split among decoders based on size and codecs. ## `encoders` A list of encoders to use. -Default value: single encoder if using Nvidia or software encoding. Split into 3 sequential parts (1/8th, 3/8th, 4/8th) if using vaapi. +Default value: single encoder. WiVRn has the ability to split the video in blocks that are processed independently, this may use resources more effectively and reduce latency. All the provided encoders are put into groups, groups are executed concurrently and items within a group are processed sequentially. @@ -39,7 +39,7 @@ Default value: `nvenc` if Nvidia GPU and compiled with cuda, `vaapi` for all oth Identifier of the encoder, one of `x264` (software encoding), `nvenc` (Nvidia hardware encoding), `vaapi` (AMD/Intel hardware encoding) ### `codec` -Default value: `h265` +Default value: `av1` if supported by both headset and hardware encoder, else `h265`. One of `h264`, `h265` or `av1`. If using `x264` encoder, value is ignored and `h264` is used. `av1` is only supported on `vaapi` encoder. diff --git a/server/driver/wivrn_comp_target.cpp b/server/driver/wivrn_comp_target.cpp index b3bed975..fcd9d790 100644 --- a/server/driver/wivrn_comp_target.cpp +++ b/server/driver/wivrn_comp_target.cpp @@ -214,7 +214,7 @@ static bool comp_wivrn_init_post_vulkan(struct comp_target * ct, uint32_t prefer *cn->wivrn_bundle, cn->c->settings.preferred.width, cn->c->settings.preferred.height, - cn->cnx->get_info().supported_codecs); + cn->cnx->get_info()); print_encoders(cn->settings); } catch (const std::exception & e) diff --git a/server/encoder/encoder_settings.cpp b/server/encoder/encoder_settings.cpp index 4d4e6664..51d758eb 100644 --- a/server/encoder/encoder_settings.cpp +++ b/server/encoder/encoder_settings.cpp @@ -228,7 +228,7 @@ static void make_even(uint16_t & value, uint16_t max) value = std::min(value, max); } -std::vector xrt::drivers::wivrn::get_encoder_settings(wivrn_vk_bundle & bundle, uint32_t & width, uint32_t & height, const std::vector & headset_codecs) +std::vector xrt::drivers::wivrn::get_encoder_settings(wivrn_vk_bundle & bundle, uint32_t & width, uint32_t & height, const from_headset::headset_info_packet & info) { configuration config; try @@ -240,9 +240,11 @@ std::vector xrt::drivers::wivrn::get_encoder_settings(wivrn_vk U_LOG_E("Failed to read encoder configuration: %s", e.what()); } if (config.encoders.empty()) - config.encoders = get_encoder_default_settings(bundle, headset_codecs); + config.encoders = get_encoder_default_settings(bundle, info.supported_codecs); uint64_t bitrate = config.bitrate.value_or(default_bitrate); - auto scale = config.scale.value_or(std::array{0.8, 0.8}); + std::array default_scale; + default_scale.fill(info.eye_gaze ? 0.35 : 0.5); + auto scale = config.scale.value_or(default_scale); for (const auto & encoder: config.encoders) { check_scale(encoder.name, diff --git a/server/encoder/encoder_settings.h b/server/encoder/encoder_settings.h index 906b6a7a..5071f19c 100644 --- a/server/encoder/encoder_settings.h +++ b/server/encoder/encoder_settings.h @@ -41,7 +41,7 @@ struct encoder_settings : public to_headset::video_stream_description::item std::optional device; }; -std::vector get_encoder_settings(wivrn_vk_bundle &, uint32_t & width, uint32_t & height, const std::vector & headset_codecs); +std::vector get_encoder_settings(wivrn_vk_bundle &, uint32_t & width, uint32_t & height, const from_headset::headset_info_packet & info); } // namespace xrt::drivers::wivrn