From bc4c6811087ed9dee4329be1b29122fcefff543a Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Mon, 2 Oct 2023 08:42:03 -0700 Subject: [PATCH 01/19] Add vulkan implementation --- vulkan/bin/breezy_vulkan_setup | 42 ++++++++++++++++++++++++++++++++++ vulkan/bin/package | 36 +++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 vulkan/bin/breezy_vulkan_setup create mode 100644 vulkan/bin/package diff --git a/vulkan/bin/breezy_vulkan_setup b/vulkan/bin/breezy_vulkan_setup new file mode 100644 index 0000000..c2acbfa --- /dev/null +++ b/vulkan/bin/breezy_vulkan_setup @@ -0,0 +1,42 @@ +#!/usr/bin/env bash + +# This setup script should do the minimum work required to download the release package, unzip it, and kick off the +# setup script contained within. + +# exit when any command fails +set -e + +# Make sure only root can run our script +if [ "$(id -u)" != "0" ]; then + echo "This script must be run as root" 1>&2 + exit 1 +fi + +# create temp directory +tmp_dir=$(mktemp -d -t xreal-air-XXXXXXXXXX) +pushd $tmp_dir > /dev/null +echo "Created temp directory: ${tmp_dir}" + +if [ -z "$1" ] +then + echo "Downloaded installation is not available yet" + exit 1 + + # download and unzip the latest driver + echo "Downloading latest release to: ${tmp_dir}/xrealAirLinuxDriver.tar.gz" + curl -L -O https://github.com/wheaney/xrealAirLinuxDriver/releases/latest/download/xrealAirLinuxDriver.tar.gz +else + cp $1 $tmp_dir +fi + +echo "Extracting to: ${tmp_dir}/breezy_vulkan" +tar -xf breezyVulkan.tar.gz + +pushd breezy_vulkan > /dev/null + +# run the setup script that comes with this release +./setup + +echo "Deleting temp directory: ${tmp_dir}" +rm -rf $tmp_dir +cd "$(dirs -l -0)" && dirs -c diff --git a/vulkan/bin/package b/vulkan/bin/package new file mode 100644 index 0000000..b9e9a5f --- /dev/null +++ b/vulkan/bin/package @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# exit when any command fails +set -e + +# build the driver +BUILD_PATH=build +if [ ! -d "$BUILD_PATH" ]; then + mkdir $BUILD_PATH +fi + +pushd $BUILD_PATH +cmake .. +make + +# create package +PACKAGE_DIR=driver_air_glasses +if [ ! -d "$PACKAGE_DIR" ]; then + mkdir $PACKAGE_DIR +fi + +# move and rename the compiled driver to the driver directory +mv xrealAirLinuxDriver $PACKAGE_DIR + +# copy setup and user-relevant scripts +cp ../bin/setup $PACKAGE_DIR +cp ../bin/xreal_driver_config $PACKAGE_DIR +cp ../bin/xreal_driver_uninstall $PACKAGE_DIR + +# copy the systemd files needed to run our service +cp -r ../systemd $PACKAGE_DIR + +# bundle up the driver directory +tar -zcvf xrealAirLinuxDriver.tar.gz $PACKAGE_DIR + +popd \ No newline at end of file From 6ad34378e34e1665d2c99c11f712b8e7efefd596 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Tue, 3 Oct 2023 09:42:04 -0700 Subject: [PATCH 02/19] Add Vulkan subdirectory, modules, and package script --- .gitmodules | 11 +++++++++ bin/package_vulkan | 46 +++++++++++++++++++++++++++++++++++++ modules/xrealAirLinuxDriver | 1 + vulkan/bin/package | 36 ----------------------------- vulkan/modules/sombrero | 1 + vulkan/modules/vkBasalt | 1 + 6 files changed, 60 insertions(+), 36 deletions(-) create mode 100644 .gitmodules create mode 100755 bin/package_vulkan create mode 160000 modules/xrealAirLinuxDriver delete mode 100644 vulkan/bin/package create mode 160000 vulkan/modules/sombrero create mode 160000 vulkan/modules/vkBasalt diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d10d540 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,11 @@ +[submodule "vulkan/modules/vkBasalt"] + path = vulkan/modules/vkBasalt + url = git@github.com:wheaney/vkBasalt.git + branch = runtime_uniforms +[submodule "vulkan/modules/sombrero"] + path = vulkan/modules/sombrero + url = git@github.com:wheaney/sombrero.git +[submodule "modules/xrealAirLinuxDriver"] + path = modules/xrealAirLinuxDriver + url = git@github.com:wheaney/xrealAirLinuxDriver.git + branch = sombrero diff --git a/bin/package_vulkan b/bin/package_vulkan new file mode 100755 index 0000000..e630981 --- /dev/null +++ b/bin/package_vulkan @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +# exit when any command fails +set -e + +# check out submodules, recursively for nested ones +git submodule update --init --recursive + +VULKAN_DIR=vulkan +VULKAN_MODULES=$VULKAN_DIR/modules +PACKAGE_DIR=$VULKAN_DIR/build/breezy_vulkan +if [ ! -d "$PACKAGE_DIR" ]; then + mkdir -p $PACKAGE_DIR +else + rm -rf $PACKAGE_DIR/* +fi + +VKBASALT_MODULE_DIR=$VULKAN_MODULES/vkBasalt +pushd $VKBASALT_MODULE_DIR +./docker-build +popd +VKBASALT_BUILD_DIR=$VKBASALT_MODULE_DIR/out + +# move and rename the compiled driver to the driver directory +mkdir -p $PACKAGE_DIR/vkbasalt.64 +cp $VKBASALT_BUILD_DIR/builddir/src/libvkbasalt.so $PACKAGE_DIR/vkbasalt.64/ +cp $VKBASALT_BUILD_DIR/builddir/config/vkBasalt.json $PACKAGE_DIR/vkbasalt.64/ + +mkdir -p $PACKAGE_DIR/vkbasalt.32 +cp $VKBASALT_BUILD_DIR/builddir.32/src/libvkbasalt.so $PACKAGE_DIR/vkbasalt.32/ +cp $VKBASALT_BUILD_DIR/builddir.32/config/vkBasalt.json $PACKAGE_DIR/vkbasalt.32/ + +cp $VKBASALT_MODULE_DIR/sombrero/IMUAdjust.fx $PACKAGE_DIR + +# copy setup and user-relevant scripts +cp -r $VULKAN_DIR/bin $PACKAGE_DIR + +XREAL_DRIVER_DIR=modules/xrealAirLinuxDriver +pushd $XREAL_DRIVER_DIR +bin/package +popd + +cp $XREAL_DRIVER_DIR/build/xrealAirLinuxDriver.tar.gz $PACKAGE_DIR + +# bundle up the driver directory +tar -zcvf breezyGaming.tar.gz $PACKAGE_DIR \ No newline at end of file diff --git a/modules/xrealAirLinuxDriver b/modules/xrealAirLinuxDriver new file mode 160000 index 0000000..af5fcfb --- /dev/null +++ b/modules/xrealAirLinuxDriver @@ -0,0 +1 @@ +Subproject commit af5fcfb0637f75a14df5f1115addcca1933ecb48 diff --git a/vulkan/bin/package b/vulkan/bin/package deleted file mode 100644 index b9e9a5f..0000000 --- a/vulkan/bin/package +++ /dev/null @@ -1,36 +0,0 @@ -#!/usr/bin/env bash - -# exit when any command fails -set -e - -# build the driver -BUILD_PATH=build -if [ ! -d "$BUILD_PATH" ]; then - mkdir $BUILD_PATH -fi - -pushd $BUILD_PATH -cmake .. -make - -# create package -PACKAGE_DIR=driver_air_glasses -if [ ! -d "$PACKAGE_DIR" ]; then - mkdir $PACKAGE_DIR -fi - -# move and rename the compiled driver to the driver directory -mv xrealAirLinuxDriver $PACKAGE_DIR - -# copy setup and user-relevant scripts -cp ../bin/setup $PACKAGE_DIR -cp ../bin/xreal_driver_config $PACKAGE_DIR -cp ../bin/xreal_driver_uninstall $PACKAGE_DIR - -# copy the systemd files needed to run our service -cp -r ../systemd $PACKAGE_DIR - -# bundle up the driver directory -tar -zcvf xrealAirLinuxDriver.tar.gz $PACKAGE_DIR - -popd \ No newline at end of file diff --git a/vulkan/modules/sombrero b/vulkan/modules/sombrero new file mode 160000 index 0000000..7f28367 --- /dev/null +++ b/vulkan/modules/sombrero @@ -0,0 +1 @@ +Subproject commit 7f2836727c66421b1c2b1e788e9c299d23e81989 diff --git a/vulkan/modules/vkBasalt b/vulkan/modules/vkBasalt new file mode 160000 index 0000000..77260be --- /dev/null +++ b/vulkan/modules/vkBasalt @@ -0,0 +1 @@ +Subproject commit 77260be44112b54933d6c6a4f4af38581191fd14 From 086f30d61fbc545b9290189fa972c7987d59e2e5 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Tue, 3 Oct 2023 11:40:43 -0700 Subject: [PATCH 03/19] Add vulkan setup and uninstall scripts --- .github/FUNDING.yml | 13 ++++++ .gitignore | 1 + README.md | 43 ++++++++++++++++++- {vulkan/bin => bin}/breezy_vulkan_setup | 11 ++--- bin/package_vulkan | 55 ++++++++++++++++--------- vulkan/bin/breezy_vulkan_uninstall | 32 ++++++++++++++ vulkan/bin/setup | 49 ++++++++++++++++++++++ vulkan/config/vkBasalt.conf | 12 ++++++ 8 files changed, 188 insertions(+), 28 deletions(-) create mode 100644 .github/FUNDING.yml create mode 100644 .gitignore rename {vulkan/bin => bin}/breezy_vulkan_setup (71%) mode change 100644 => 100755 create mode 100755 vulkan/bin/breezy_vulkan_uninstall create mode 100755 vulkan/bin/setup create mode 100644 vulkan/config/vkBasalt.conf diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..f61fc4e --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,13 @@ +# These are supported funding model platforms + +github: wheaney +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: wheaney +tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..abf7936 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/vulkan/build/ diff --git a/README.md b/README.md index 97122d5..60d1b88 100644 --- a/README.md +++ b/README.md @@ -1 +1,42 @@ -# breezy-desktop \ No newline at end of file +# Breezy Desktop + +[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/U7U8OVC0L) + +## What is this? + +This repo will eventually contain a collection of tools to enable virtual desktop environments for gaming and productivity on Linux using XREAL Air glasses. + +As of now, only a Vulkan implementation is available, primarily for gaming but could theoretically be used for anything that uses Vulkan rendering. + +## Breezy Vulkan + +### Setup + +#### Steam Deck via Decky Loader + +This is still a work in progress... star this repo or check back later. + +#### Manual installation + +1. [Download the setup script](https://github.com/wheaney/breezy-desktop/releases/latest/download/breezy_vulkan_setup) and set the execute flag (e.g. from the terminal: `chmod +x ~/Downloads/breezy_vulkan_setup`) +2. Run the setup script as root (e.g. `sudo ~/Downloads/breezy_vulkan_setup`) + +### Usage + +Once installed, you should be able to launch any Vulkan game, plug in your glasses (at any point, not just after launching), and see a floating screen. Note that the initial centering of the screen is based on pre-calibrated values, so it may not actually start out where you're looking, or you may even see it move around for 10+ seconds after you've plugged in your glasses. + +To re-center the screen, I've implemented an experimental double-tap feature: you'll want to give two decent taps on the top of the glasses. I tend to do this on the corner, right on top of the hinge. It should be a firm, sharp tap, and wait just a split second to do the second tap, as it needs to detect a slight pause in between (but it also shouldn't take more than a half a second between taps so don't wait too long). + +Framerate is really important here, because individual frames are static, so if you're moving your head and the next frame hasn't rendered yet, you'll see the screen move with you for just tiny fraction of a second (e.g. 30Hz, the screen follows you for 33ms) which produces a kind of "dragging" effect. I've found 60Hz to be the best experience, though there is still some dragging that I'd like to try to resolve; I expect 120Hz would work even better if you have the firmware version to support it. + +### Disabling + +To disable the floating screen effect, either unplug the glasses or hit the `Home` key (you'll need to bind this to your controller on Steam Deck). + +### Updating + +Rerun the `breezy_vulkan_setup` script. No need to redownload this script, as it will automatically download the latest installation binary for you. + +### Uninstalling + +If you wish to completely remove the installation, run the following script as root: `~/bin/breezy_vulkan_uninstall`. This won't uninstall the base driver package, following the instructions at the end of the uninstallation to do this manually. \ No newline at end of file diff --git a/vulkan/bin/breezy_vulkan_setup b/bin/breezy_vulkan_setup old mode 100644 new mode 100755 similarity index 71% rename from vulkan/bin/breezy_vulkan_setup rename to bin/breezy_vulkan_setup index c2acbfa..dfdcc6d --- a/vulkan/bin/breezy_vulkan_setup +++ b/bin/breezy_vulkan_setup @@ -13,18 +13,15 @@ if [ "$(id -u)" != "0" ]; then fi # create temp directory -tmp_dir=$(mktemp -d -t xreal-air-XXXXXXXXXX) +tmp_dir=$(mktemp -d -t breezy-vulkan-XXXXXXXXXX) pushd $tmp_dir > /dev/null echo "Created temp directory: ${tmp_dir}" if [ -z "$1" ] then - echo "Downloaded installation is not available yet" - exit 1 - # download and unzip the latest driver - echo "Downloading latest release to: ${tmp_dir}/xrealAirLinuxDriver.tar.gz" - curl -L -O https://github.com/wheaney/xrealAirLinuxDriver/releases/latest/download/xrealAirLinuxDriver.tar.gz + echo "Downloading latest release to: ${tmp_dir}/breezyVulkan.tar.gz" + curl -L -O https://github.com/wheaney/breezy-desktop/releases/latest/download/breezyVulkan.tar.gz else cp $1 $tmp_dir fi @@ -35,7 +32,7 @@ tar -xf breezyVulkan.tar.gz pushd breezy_vulkan > /dev/null # run the setup script that comes with this release -./setup +bin/setup echo "Deleting temp directory: ${tmp_dir}" rm -rf $tmp_dir diff --git a/bin/package_vulkan b/bin/package_vulkan index e630981..dd66e76 100755 --- a/bin/package_vulkan +++ b/bin/package_vulkan @@ -7,40 +7,55 @@ set -e git submodule update --init --recursive VULKAN_DIR=vulkan +VULKAN_BUILD=$VULKAN_DIR/build +if [ ! -d "$VULKAN_BUILD" ]; then + mkdir -p $VULKAN_BUILD +else + rm -rf $VULKAN_BUILD/* +fi + VULKAN_MODULES=$VULKAN_DIR/modules -PACKAGE_DIR=$VULKAN_DIR/build/breezy_vulkan +PACKAGE_DIR=$VULKAN_BUILD/breezy_vulkan if [ ! -d "$PACKAGE_DIR" ]; then mkdir -p $PACKAGE_DIR else rm -rf $PACKAGE_DIR/* fi +# build vkBasalt VKBASALT_MODULE_DIR=$VULKAN_MODULES/vkBasalt -pushd $VKBASALT_MODULE_DIR -./docker-build -popd VKBASALT_BUILD_DIR=$VKBASALT_MODULE_DIR/out +if [ ! -d "$VKBASALT_BUILD_DIR" ] || [ "$1" == "--clean" ]; then + pushd $VKBASALT_MODULE_DIR + ./docker-build + popd +fi -# move and rename the compiled driver to the driver directory -mkdir -p $PACKAGE_DIR/vkbasalt.64 -cp $VKBASALT_BUILD_DIR/builddir/src/libvkbasalt.so $PACKAGE_DIR/vkbasalt.64/ -cp $VKBASALT_BUILD_DIR/builddir/config/vkBasalt.json $PACKAGE_DIR/vkbasalt.64/ +# copy vkBasalt binaries and configs +mkdir -p $PACKAGE_DIR/{vkBasalt.64,vkBasalt.32} +cp $VKBASALT_BUILD_DIR/builddir/src/libvkbasalt.so $PACKAGE_DIR/vkBasalt.64/ +cp $VKBASALT_BUILD_DIR/builddir/config/vkBasalt.json $PACKAGE_DIR/vkBasalt.64/ +cp $VKBASALT_BUILD_DIR/builddir.32/src/libvkbasalt.so $PACKAGE_DIR/vkBasalt.32/ -mkdir -p $PACKAGE_DIR/vkbasalt.32 -cp $VKBASALT_BUILD_DIR/builddir.32/src/libvkbasalt.so $PACKAGE_DIR/vkbasalt.32/ -cp $VKBASALT_BUILD_DIR/builddir.32/config/vkBasalt.json $PACKAGE_DIR/vkbasalt.32/ +# copy Sombrero FX +cp $VULKAN_MODULES/sombrero/IMUAdjust.fx $PACKAGE_DIR -cp $VKBASALT_MODULE_DIR/sombrero/IMUAdjust.fx $PACKAGE_DIR - -# copy setup and user-relevant scripts +# copy vulkan setup scripts and configs cp -r $VULKAN_DIR/bin $PACKAGE_DIR +cp -r $VULKAN_DIR/config $PACKAGE_DIR +# build xreal driver XREAL_DRIVER_DIR=modules/xrealAirLinuxDriver -pushd $XREAL_DRIVER_DIR -bin/package -popd +XREAL_BINARY=$XREAL_DRIVER_DIR/build/xrealAirLinuxDriver.tar.gz +if [ ! -e "$XREAL_BINARY" ] || [ "$1" == "--clean" ]; then + pushd $XREAL_DRIVER_DIR + bin/package + popd +fi -cp $XREAL_DRIVER_DIR/build/xrealAirLinuxDriver.tar.gz $PACKAGE_DIR +# copy xreal binary and setup script +cp $XREAL_BINARY $PACKAGE_DIR +cp $XREAL_DRIVER_DIR/bin/xreal_driver_setup $PACKAGE_DIR/bin -# bundle up the driver directory -tar -zcvf breezyGaming.tar.gz $PACKAGE_DIR \ No newline at end of file +# bundle everything up +tar -zcvf $VULKAN_BUILD/breezyVulkan.tar.gz --directory $VULKAN_BUILD breezy_vulkan \ No newline at end of file diff --git a/vulkan/bin/breezy_vulkan_uninstall b/vulkan/bin/breezy_vulkan_uninstall new file mode 100755 index 0000000..9c838b2 --- /dev/null +++ b/vulkan/bin/breezy_vulkan_uninstall @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +for_install=0 +if [[ -n "$1" ]] && [[ "$1" == "--for-install" ]]; then + for_install=1 +fi + +# we don't want the uninstall script to be able to cause a failure if being triggered by the setup script +[ "$for_install" -eq 0 ] && set -e + +# Make sure only root can run our script +if [ "$(id -u)" != "0" ]; then + echo "This script must be run as root" 1>&2 + exit 1 +fi + +USER=${SUDO_USER:-$USER} +USER_HOME=$(getent passwd $USER | cut -d: -f6) + +[ "$for_install" -eq 0 ] && echo "Removing vkBasalt binaries from $USER_HOME/.local/lib[32]/" +rm $USER_HOME/.local/lib/libvkbasalt.so +rm $USER_HOME/.local/lib32/libvkbasalt.so + +[ "$for_install" -eq 0 ] && echo "Removing vkBasalt vulkan layer configs from $USER_HOME/.local/share/vulkan/implicit_layer.d/" +rm $USER_HOME/.local/share/vulkan/implicit_layer.d/vkBasalt.json +rm $USER_HOME/.local/share/vulkan/implicit_layer.d/vkBasalt.x86.json + +[ "$for_install" -eq 0 ] && echo "Removing vkBasalt config at $USER_HOME/.config/vkBasalt/vkBasalt.conf" +rm $USER_HOME/.config/vkBasalt/vkBasalt.conf + +[ "$for_install" -eq 0 ] && echo "SKIPPING xrealAirLinuxDriver uninstall to keep mouse/joystick driver functionality." +[ "$for_install" -eq 0 ] && echo "To manually uninstall xrealAirLinuxDriver, do: \"sudo ~/bin/xreal_driver_uninstall\"" \ No newline at end of file diff --git a/vulkan/bin/setup b/vulkan/bin/setup new file mode 100755 index 0000000..93e5f39 --- /dev/null +++ b/vulkan/bin/setup @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +# This script gets packaged with the release and should do the bulk of the setup work. This allows this setup to be tied +# to a specific release of the code, and guarantees it will never run along-side newer or older binaries. + +USER=${SUDO_USER:-$USER} +USER_HOME=$(getent passwd $USER | cut -d: -f6) +if [ -e "$USER_HOME/bin/breezy_vulkan_uninstall" ]; then + echo "Cleaning up the previous installation" + + # ` || true` will ensure that this can't cause a failure, even with `set -e` + $USER_HOME/bin/breezy_vulkan_uninstall --for-install || true +fi + +echo "Copying the breezy_vulkan scripts to ${USER_HOME}/bin" +if [ ! -d "$USER_HOME/bin" ]; then + mkdir $USER_HOME/bin +fi +cp bin/breezy_vulkan_uninstall $USER_HOME/bin + +echo "Installing vkBasalt; copying binaries, configs, and shader files to ${USER_HOME}/.local and ${USER_HOME}/.config" + +# much of the setup below was informed by https://github.com/simons-public/steam-deck-vkbasalt-install +# copy the vkBasalt binaries and configs +mkdir -p ${USER_HOME}/.local/{lib,lib32,share/vulkan/implicit_layer.d} +mkdir -p ${USER_HOME}/.config/{vkBasalt,reshade} +cp vkBasalt.64/libvkbasalt.so $USER_HOME/.local/lib/ +cp vkBasalt.32/libvkbasalt.so $USER_HOME/.local/lib32/ + +# there is only one vkBasalt.json file, use the 64-bit directory for both, copy and make replacements +if grep -q SteamOS /etc/os-release ; then + sed -e "s|libvkbasalt.so|${USER_HOME}/.local/lib/libvkbasalt.so|" -e "s/ENABLE_VKBASALT/SteamDeck/" vkBasalt.64/vkBasalt.json > $USER_HOME/.local/share/vulkan/implicit_layer.d/vkBasalt.json + sed -e "s|libvkbasalt.so|${USER_HOME}/.local/lib32/libvkbasalt.so|" -e "s/ENABLE_VKBASALT/SteamDeck/" vkBasalt.64/vkBasalt.json > $USER_HOME/.local/share/vulkan/implicit_layer.d/vkBasalt.x86.json +else + sed -e "s|libvkbasalt.so|${USER_HOME}/.local/lib/libvkbasalt.so|" vkBasalt.64/vkBasalt.json > $USER_HOME/.local/share/vulkan/implicit_layer.d/vkBasalt.json + sed -e "s|libvkbasalt.so|${USER_HOME}/.local/lib32/libvkbasalt.so|" vkBasalt.64/vkBasalt.json > $USER_HOME/.local/share/vulkan/implicit_layer.d/vkBasalt.x86.json +fi + +# copy the vkBasalt.conf file and make replacements +sed -e "s|/path/to/reshade-shaders|${USER_HOME}/.config/reshade|" -e "s|/path/to/sombrero|${USER_HOME}/.config/reshade/Shaders/IMUAdjust.fx|" config/vkBasalt.conf > $USER_HOME/.config/vkBasalt/vkBasalt.conf + +echo "Installing the Sombrero shader to ${USER_HOME}/.config/reshade/Shaders/IMUAdjust.fx" +cp IMUAdjust.fx $USER_HOME/.config/reshade/Shaders + +# set up the XREAL driver using the local binary +echo "Installing xrealAirLinuxDriver" +echo "BEGIN - xreal_driver_setup" +bin/xreal_driver_setup $(pwd)/xrealAirLinuxDriver.tar.gz +echo "END - xreal_driver_setup" \ No newline at end of file diff --git a/vulkan/config/vkBasalt.conf b/vulkan/config/vkBasalt.conf new file mode 100644 index 0000000..1402899 --- /dev/null +++ b/vulkan/config/vkBasalt.conf @@ -0,0 +1,12 @@ +effects = sombrero + +sombrero = /path/to/sombrero +reshadeTexturePath = "/path/to/reshade-shaders/Textures" +reshadeIncludePath = "/path/to/reshade-shaders/Shaders" +depthCapture = off + +#toggleKey toggles the effects on/off +toggleKey = Home + +#enableOnLaunch sets if the effects are enabled when started +enableOnLaunch = True From b3f100bd0cf266d8758f05eb79bcc3edd705a85d Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Tue, 3 Oct 2023 13:57:43 -0700 Subject: [PATCH 04/19] Fix permissions issues, vkBasalt binary issue --- bin/package_vulkan | 4 +++- vulkan/bin/breezy_vulkan_uninstall | 10 +++++++--- vulkan/bin/setup | 13 +++++++++---- vulkan/modules/vkBasalt | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/bin/package_vulkan b/bin/package_vulkan index dd66e76..6ebf034 100755 --- a/bin/package_vulkan +++ b/bin/package_vulkan @@ -37,8 +37,10 @@ cp $VKBASALT_BUILD_DIR/builddir/src/libvkbasalt.so $PACKAGE_DIR/vkBasalt.64/ cp $VKBASALT_BUILD_DIR/builddir/config/vkBasalt.json $PACKAGE_DIR/vkBasalt.64/ cp $VKBASALT_BUILD_DIR/builddir.32/src/libvkbasalt.so $PACKAGE_DIR/vkBasalt.32/ -# copy Sombrero FX +# copy Sombrero FX, get ReShade headers cp $VULKAN_MODULES/sombrero/IMUAdjust.fx $PACKAGE_DIR +wget -P $PACKAGE_DIR https://raw.githubusercontent.com/crosire/reshade-shaders/384465d0287999caa6190b5ebea506200b4f4a0a/Shaders/ReShade.fxh +wget -P $PACKAGE_DIR https://raw.githubusercontent.com/crosire/reshade-shaders/384465d0287999caa6190b5ebea506200b4f4a0a/Shaders/ReShadeUI.fxh # copy vulkan setup scripts and configs cp -r $VULKAN_DIR/bin $PACKAGE_DIR diff --git a/vulkan/bin/breezy_vulkan_uninstall b/vulkan/bin/breezy_vulkan_uninstall index 9c838b2..4100d8d 100755 --- a/vulkan/bin/breezy_vulkan_uninstall +++ b/vulkan/bin/breezy_vulkan_uninstall @@ -25,8 +25,12 @@ rm $USER_HOME/.local/lib32/libvkbasalt.so rm $USER_HOME/.local/share/vulkan/implicit_layer.d/vkBasalt.json rm $USER_HOME/.local/share/vulkan/implicit_layer.d/vkBasalt.x86.json -[ "$for_install" -eq 0 ] && echo "Removing vkBasalt config at $USER_HOME/.config/vkBasalt/vkBasalt.conf" -rm $USER_HOME/.config/vkBasalt/vkBasalt.conf +[ "$for_install" -eq 0 ] && echo "Removing vkBasalt and reshade directories at $USER_HOME/.config/" +rm -rf $USER_HOME/.config/vkBasalt +rm -rf $USER_HOME/.config/reshade [ "$for_install" -eq 0 ] && echo "SKIPPING xrealAirLinuxDriver uninstall to keep mouse/joystick driver functionality." -[ "$for_install" -eq 0 ] && echo "To manually uninstall xrealAirLinuxDriver, do: \"sudo ~/bin/xreal_driver_uninstall\"" \ No newline at end of file +[ "$for_install" -eq 0 ] && echo "To manually uninstall xrealAirLinuxDriver, do: \"sudo ~/bin/xreal_driver_uninstall\"" + +# this script is self-deleting, leave this as the last command +rm -f $USER_HOME/bin/breezy_vulcan_uninstall \ No newline at end of file diff --git a/vulkan/bin/setup b/vulkan/bin/setup index 93e5f39..b1975d1 100755 --- a/vulkan/bin/setup +++ b/vulkan/bin/setup @@ -14,7 +14,7 @@ fi echo "Copying the breezy_vulkan scripts to ${USER_HOME}/bin" if [ ! -d "$USER_HOME/bin" ]; then - mkdir $USER_HOME/bin + su -c 'mkdir -p '$USER_HOME'/bin' $USER fi cp bin/breezy_vulkan_uninstall $USER_HOME/bin @@ -22,10 +22,12 @@ echo "Installing vkBasalt; copying binaries, configs, and shader files to ${USER # much of the setup below was informed by https://github.com/simons-public/steam-deck-vkbasalt-install # copy the vkBasalt binaries and configs -mkdir -p ${USER_HOME}/.local/{lib,lib32,share/vulkan/implicit_layer.d} -mkdir -p ${USER_HOME}/.config/{vkBasalt,reshade} +su -c 'mkdir -p '$USER_HOME'/.local/{lib,lib32,share/vulkan/implicit_layer.d}' $USER +su -c 'mkdir -p '$USER_HOME'/.config/{vkBasalt,reshade/Shaders,reshade/Textures}' $USER cp vkBasalt.64/libvkbasalt.so $USER_HOME/.local/lib/ cp vkBasalt.32/libvkbasalt.so $USER_HOME/.local/lib32/ +chown $USER:$USER $USER_HOME/.local/lib/libvkbasalt.so +chown $USER:$USER $USER_HOME/.local/lib32/libvkbasalt.so # there is only one vkBasalt.json file, use the 64-bit directory for both, copy and make replacements if grep -q SteamOS /etc/os-release ; then @@ -35,12 +37,15 @@ else sed -e "s|libvkbasalt.so|${USER_HOME}/.local/lib/libvkbasalt.so|" vkBasalt.64/vkBasalt.json > $USER_HOME/.local/share/vulkan/implicit_layer.d/vkBasalt.json sed -e "s|libvkbasalt.so|${USER_HOME}/.local/lib32/libvkbasalt.so|" vkBasalt.64/vkBasalt.json > $USER_HOME/.local/share/vulkan/implicit_layer.d/vkBasalt.x86.json fi +chown $USER:$USER $USER_HOME/.local/share/vulkan/implicit_layer.d/vkBasalt.* # copy the vkBasalt.conf file and make replacements sed -e "s|/path/to/reshade-shaders|${USER_HOME}/.config/reshade|" -e "s|/path/to/sombrero|${USER_HOME}/.config/reshade/Shaders/IMUAdjust.fx|" config/vkBasalt.conf > $USER_HOME/.config/vkBasalt/vkBasalt.conf +chown -R $USER:$USER $USER_HOME/.config/vkBasalt echo "Installing the Sombrero shader to ${USER_HOME}/.config/reshade/Shaders/IMUAdjust.fx" -cp IMUAdjust.fx $USER_HOME/.config/reshade/Shaders +cp *.fx* $USER_HOME/.config/reshade/Shaders +chown -R $USER:$USER $USER_HOME/.config/reshade # set up the XREAL driver using the local binary echo "Installing xrealAirLinuxDriver" diff --git a/vulkan/modules/vkBasalt b/vulkan/modules/vkBasalt index 77260be..cbd53f7 160000 --- a/vulkan/modules/vkBasalt +++ b/vulkan/modules/vkBasalt @@ -1 +1 @@ -Subproject commit 77260be44112b54933d6c6a4f4af38581191fd14 +Subproject commit cbd53f7c2da3e130b2a9fb8772914c8a061d31d3 From f0eec4f2a9f8897da3935b834cf9292527bbc0cc Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Tue, 3 Oct 2023 14:20:15 -0700 Subject: [PATCH 05/19] Update README, add display size explanation and instructions --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 60d1b88..064f049 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,15 @@ To re-center the screen, I've implemented an experimental double-tap feature: yo Framerate is really important here, because individual frames are static, so if you're moving your head and the next frame hasn't rendered yet, you'll see the screen move with you for just tiny fraction of a second (e.g. 30Hz, the screen follows you for 33ms) which produces a kind of "dragging" effect. I've found 60Hz to be the best experience, though there is still some dragging that I'd like to try to resolve; I expect 120Hz would work even better if you have the firmware version to support it. +### Display size + +If the screen appears very small in your view, you may be playing at the Deck screen's native resolution, and not at the glasses' native +resolution. To fix this: +1. Go to the game details in Steam, hit the Settings/cog icon, and open `Properties`, then for `Game Resolution` choose `Native`. +2. After launching the game, if it's still small, go into the game options, and in the graphics or video settings, change the resolution (the glasses run at 1920x1080). + +If you *WANT* to keep a low resolution, then you can just use the `Zoom` setting to make the screen appear larger. For now this is done through the config script: `~/bin/xreal_driver_config -z 1.0`. Larger numbers zoom in (e.g. `2.0` doubles the screen size) and smaller numbers zoom out (e.g. `0.5` is half the screen size). + ### Disabling To disable the floating screen effect, either unplug the glasses or hit the `Home` key (you'll need to bind this to your controller on Steam Deck). From 0ef296b68380e71e3f3c545eca7dcfe9ed4ddc08 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:47:14 -0700 Subject: [PATCH 06/19] Incorporate latest udpates to the driver, shader, and vkBasalt fork --- README.md | 5 +++-- modules/xrealAirLinuxDriver | 2 +- vulkan/modules/sombrero | 2 +- vulkan/modules/vkBasalt | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 064f049..2f4f9e0 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ This is still a work in progress... star this repo or check back later. ### Usage -Once installed, you should be able to launch any Vulkan game, plug in your glasses (at any point, not just after launching), and see a floating screen. Note that the initial centering of the screen is based on pre-calibrated values, so it may not actually start out where you're looking, or you may even see it move around for 10+ seconds after you've plugged in your glasses. +Once installed, you'll want to make sure you've enabled the driver (`~/bin/xreal_driver_config -e`) and you'll probably want to disable mouse/joystick output (`~/bin/xreal_driver_config -eo`); note that these two commands can't be combined, they have to be done separately. From there, you should be able to launch any Vulkan game, plug in your glasses (at any point, not just after launching), and see a floating screen. Note that the initial centering of the screen is based on pre-calibrated values, so it may not actually start out where you're looking, or you may even see it move around for 10+ seconds after you've plugged in your glasses. To re-center the screen, I've implemented an experimental double-tap feature: you'll want to give two decent taps on the top of the glasses. I tend to do this on the corner, right on top of the hinge. It should be a firm, sharp tap, and wait just a split second to do the second tap, as it needs to detect a slight pause in between (but it also shouldn't take more than a half a second between taps so don't wait too long). @@ -48,4 +48,5 @@ Rerun the `breezy_vulkan_setup` script. No need to redownload this script, as it ### Uninstalling -If you wish to completely remove the installation, run the following script as root: `~/bin/breezy_vulkan_uninstall`. This won't uninstall the base driver package, following the instructions at the end of the uninstallation to do this manually. \ No newline at end of file +If you wish to completely remove the installation, run the following: `sudo ~/bin/breezy_vulkan_uninstall`. This won't uninstall the base driver package, follow the instructions at the end of the uninstallation to do this manually. + diff --git a/modules/xrealAirLinuxDriver b/modules/xrealAirLinuxDriver index af5fcfb..f199b18 160000 --- a/modules/xrealAirLinuxDriver +++ b/modules/xrealAirLinuxDriver @@ -1 +1 @@ -Subproject commit af5fcfb0637f75a14df5f1115addcca1933ecb48 +Subproject commit f199b187a1b62a6c5f9dfb922bfe81104a636feb diff --git a/vulkan/modules/sombrero b/vulkan/modules/sombrero index 7f28367..22e4f1f 160000 --- a/vulkan/modules/sombrero +++ b/vulkan/modules/sombrero @@ -1 +1 @@ -Subproject commit 7f2836727c66421b1c2b1e788e9c299d23e81989 +Subproject commit 22e4f1fd3f9f1ea8701fcb63e7c35671c13b1769 diff --git a/vulkan/modules/vkBasalt b/vulkan/modules/vkBasalt index cbd53f7..e247da4 160000 --- a/vulkan/modules/vkBasalt +++ b/vulkan/modules/vkBasalt @@ -1 +1 @@ -Subproject commit cbd53f7c2da3e130b2a9fb8772914c8a061d31d3 +Subproject commit e247da4dae10031d9676c4a1bc40b7326fd9826d From fde1de5cbebfc41d4a90628a15c7666b410c38d0 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:26:28 -0700 Subject: [PATCH 07/19] Pull in latest updates for look-ahead --- README.md | 3 +-- modules/xrealAirLinuxDriver | 2 +- vulkan/modules/sombrero | 2 +- vulkan/modules/vkBasalt | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 2f4f9e0..ceaf9a4 100644 --- a/README.md +++ b/README.md @@ -44,9 +44,8 @@ To disable the floating screen effect, either unplug the glasses or hit the `Hom ### Updating -Rerun the `breezy_vulkan_setup` script. No need to redownload this script, as it will automatically download the latest installation binary for you. +Rerun the `breezy_vulkan_setup` script. No need to re-download this script, as it will automatically download the latest installation binary for you. ### Uninstalling If you wish to completely remove the installation, run the following: `sudo ~/bin/breezy_vulkan_uninstall`. This won't uninstall the base driver package, follow the instructions at the end of the uninstallation to do this manually. - diff --git a/modules/xrealAirLinuxDriver b/modules/xrealAirLinuxDriver index f199b18..601d6ac 160000 --- a/modules/xrealAirLinuxDriver +++ b/modules/xrealAirLinuxDriver @@ -1 +1 @@ -Subproject commit f199b187a1b62a6c5f9dfb922bfe81104a636feb +Subproject commit 601d6ac48c59291e1fdec86c5dd7e6d074db6eac diff --git a/vulkan/modules/sombrero b/vulkan/modules/sombrero index 22e4f1f..fdec987 160000 --- a/vulkan/modules/sombrero +++ b/vulkan/modules/sombrero @@ -1 +1 @@ -Subproject commit 22e4f1fd3f9f1ea8701fcb63e7c35671c13b1769 +Subproject commit fdec9878cce8c6ca7b4526822a2342de1667dd63 diff --git a/vulkan/modules/vkBasalt b/vulkan/modules/vkBasalt index e247da4..4856414 160000 --- a/vulkan/modules/vkBasalt +++ b/vulkan/modules/vkBasalt @@ -1 +1 @@ -Subproject commit e247da4dae10031d9676c4a1bc40b7326fd9826d +Subproject commit 4856414ce33a8c651818c9ebf619aa6233d2e47d From e6d2c81a6b33a38263704b135e2483b9786f87c5 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Thu, 12 Oct 2023 09:37:23 -0700 Subject: [PATCH 08/19] Update README notes regarding framerate --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ceaf9a4..594051d 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Once installed, you'll want to make sure you've enabled the driver (`~/bin/xreal To re-center the screen, I've implemented an experimental double-tap feature: you'll want to give two decent taps on the top of the glasses. I tend to do this on the corner, right on top of the hinge. It should be a firm, sharp tap, and wait just a split second to do the second tap, as it needs to detect a slight pause in between (but it also shouldn't take more than a half a second between taps so don't wait too long). -Framerate is really important here, because individual frames are static, so if you're moving your head and the next frame hasn't rendered yet, you'll see the screen move with you for just tiny fraction of a second (e.g. 30Hz, the screen follows you for 33ms) which produces a kind of "dragging" effect. I've found 60Hz to be the best experience, though there is still some dragging that I'd like to try to resolve; I expect 120Hz would work even better if you have the firmware version to support it. +Framerate is really important here, because individual frames are static, so moving your head quickly may produce a noticeable flicker as it moves the screen. Higher framerates will produce an overall better experience (less flicker and smoother follow), but lower framerates should still be totally usable. ### Display size From bf0d57b45b4cfa9baa0914c832ff0d0baf8620a7 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Thu, 12 Oct 2023 13:09:33 -0700 Subject: [PATCH 09/19] Add 3d perspective and multi-tap detection more sensitive --- modules/xrealAirLinuxDriver | 2 +- vulkan/modules/sombrero | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/xrealAirLinuxDriver b/modules/xrealAirLinuxDriver index 601d6ac..f64260d 160000 --- a/modules/xrealAirLinuxDriver +++ b/modules/xrealAirLinuxDriver @@ -1 +1 @@ -Subproject commit 601d6ac48c59291e1fdec86c5dd7e6d074db6eac +Subproject commit f64260da6e4431aba213a9034abb72ac15472157 diff --git a/vulkan/modules/sombrero b/vulkan/modules/sombrero index fdec987..ea83f7f 160000 --- a/vulkan/modules/sombrero +++ b/vulkan/modules/sombrero @@ -1 +1 @@ -Subproject commit fdec9878cce8c6ca7b4526822a2342de1667dd63 +Subproject commit ea83f7fd18858d7d40d3687304270324553954ae From 068ddf1a945dac501c4d3253b770915786d23dcd Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Mon, 16 Oct 2023 22:48:20 -0700 Subject: [PATCH 10/19] Pull latest changes to IPC and quaternion usage --- README.md | 2 ++ bin/package_vulkan | 16 ++++++---------- modules/xrealAirLinuxDriver | 2 +- vulkan/modules/sombrero | 2 +- vulkan/modules/vkBasalt | 2 +- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 594051d..552e7c0 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,8 @@ To re-center the screen, I've implemented an experimental double-tap feature: yo Framerate is really important here, because individual frames are static, so moving your head quickly may produce a noticeable flicker as it moves the screen. Higher framerates will produce an overall better experience (less flicker and smoother follow), but lower framerates should still be totally usable. +It's important that your glasses are either on your head or sitting on a flat surface when they're first plugged in and calibrated. If you notice that your screen continues to move for several seconds after a head movement, almost as if the screen has some momentum that takes time to slow down, then try unplugging and reconnecting your glasses. + ### Display size If the screen appears very small in your view, you may be playing at the Deck screen's native resolution, and not at the glasses' native diff --git a/bin/package_vulkan b/bin/package_vulkan index 6ebf034..81c5896 100755 --- a/bin/package_vulkan +++ b/bin/package_vulkan @@ -25,11 +25,9 @@ fi # build vkBasalt VKBASALT_MODULE_DIR=$VULKAN_MODULES/vkBasalt VKBASALT_BUILD_DIR=$VKBASALT_MODULE_DIR/out -if [ ! -d "$VKBASALT_BUILD_DIR" ] || [ "$1" == "--clean" ]; then - pushd $VKBASALT_MODULE_DIR - ./docker-build - popd -fi +pushd $VKBASALT_MODULE_DIR +./docker-build +popd # copy vkBasalt binaries and configs mkdir -p $PACKAGE_DIR/{vkBasalt.64,vkBasalt.32} @@ -49,11 +47,9 @@ cp -r $VULKAN_DIR/config $PACKAGE_DIR # build xreal driver XREAL_DRIVER_DIR=modules/xrealAirLinuxDriver XREAL_BINARY=$XREAL_DRIVER_DIR/build/xrealAirLinuxDriver.tar.gz -if [ ! -e "$XREAL_BINARY" ] || [ "$1" == "--clean" ]; then - pushd $XREAL_DRIVER_DIR - bin/package - popd -fi +pushd $XREAL_DRIVER_DIR +bin/package +popd # copy xreal binary and setup script cp $XREAL_BINARY $PACKAGE_DIR diff --git a/modules/xrealAirLinuxDriver b/modules/xrealAirLinuxDriver index f64260d..2239dbb 160000 --- a/modules/xrealAirLinuxDriver +++ b/modules/xrealAirLinuxDriver @@ -1 +1 @@ -Subproject commit f64260da6e4431aba213a9034abb72ac15472157 +Subproject commit 2239dbb56e42b6a57029ff1020c247a3ecf81c34 diff --git a/vulkan/modules/sombrero b/vulkan/modules/sombrero index ea83f7f..95b9104 160000 --- a/vulkan/modules/sombrero +++ b/vulkan/modules/sombrero @@ -1 +1 @@ -Subproject commit ea83f7fd18858d7d40d3687304270324553954ae +Subproject commit 95b9104af0f14fdfe1b66c5adbdd536b05f9d2f9 diff --git a/vulkan/modules/vkBasalt b/vulkan/modules/vkBasalt index 4856414..00eaebc 160000 --- a/vulkan/modules/vkBasalt +++ b/vulkan/modules/vkBasalt @@ -1 +1 @@ -Subproject commit 4856414ce33a8c651818c9ebf619aa6233d2e47d +Subproject commit 00eaebc7ef6b7f92e9a930e050f065d246054447 From 0930c6bcdff2da0586e57dce6987a922a94f3350 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Tue, 17 Oct 2023 10:23:58 -0700 Subject: [PATCH 11/19] Update default look-ahead settings --- modules/xrealAirLinuxDriver | 2 +- vulkan/modules/sombrero | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/xrealAirLinuxDriver b/modules/xrealAirLinuxDriver index 2239dbb..cec6e30 160000 --- a/modules/xrealAirLinuxDriver +++ b/modules/xrealAirLinuxDriver @@ -1 +1 @@ -Subproject commit 2239dbb56e42b6a57029ff1020c247a3ecf81c34 +Subproject commit cec6e303d824df8c07dcb9e7f4f5d15cd341d0ee diff --git a/vulkan/modules/sombrero b/vulkan/modules/sombrero index 95b9104..e314f1e 160000 --- a/vulkan/modules/sombrero +++ b/vulkan/modules/sombrero @@ -1 +1 @@ -Subproject commit 95b9104af0f14fdfe1b66c5adbdd536b05f9d2f9 +Subproject commit e314f1e8f195526f31051052b0913f7908e94038 From 108473e906b9bf2ae4e4f5f8d502d9b4f8e4ee3a Mon Sep 17 00:00:00 2001 From: Wayne Heaney <42350981+wheaney@users.noreply.github.com> Date: Tue, 17 Oct 2023 14:14:09 -0700 Subject: [PATCH 12/19] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 552e7c0..4999424 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,18 @@ This is still a work in progress... star this repo or check back later. Once installed, you'll want to make sure you've enabled the driver (`~/bin/xreal_driver_config -e`) and you'll probably want to disable mouse/joystick output (`~/bin/xreal_driver_config -eo`); note that these two commands can't be combined, they have to be done separately. From there, you should be able to launch any Vulkan game, plug in your glasses (at any point, not just after launching), and see a floating screen. Note that the initial centering of the screen is based on pre-calibrated values, so it may not actually start out where you're looking, or you may even see it move around for 10+ seconds after you've plugged in your glasses. +#### Screen re-centering To re-center the screen, I've implemented an experimental double-tap feature: you'll want to give two decent taps on the top of the glasses. I tend to do this on the corner, right on top of the hinge. It should be a firm, sharp tap, and wait just a split second to do the second tap, as it needs to detect a slight pause in between (but it also shouldn't take more than a half a second between taps so don't wait too long). +### Troubleshooting + +#### Screen drag or flickering Framerate is really important here, because individual frames are static, so moving your head quickly may produce a noticeable flicker as it moves the screen. Higher framerates will produce an overall better experience (less flicker and smoother follow), but lower framerates should still be totally usable. +#### Unexpected screen movement or drift It's important that your glasses are either on your head or sitting on a flat surface when they're first plugged in and calibrated. If you notice that your screen continues to move for several seconds after a head movement, almost as if the screen has some momentum that takes time to slow down, then try unplugging and reconnecting your glasses. -### Display size +#### Display size If the screen appears very small in your view, you may be playing at the Deck screen's native resolution, and not at the glasses' native resolution. To fix this: From c71124f58bf24493b062d8f7c343d0131cf3a4a1 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Tue, 17 Oct 2023 22:34:26 -0700 Subject: [PATCH 13/19] Add calibration wait period on initial connection of device, and re-calibration with multi-tap --- README.md | 11 ++++++++--- modules/xrealAirLinuxDriver | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4999424..e23222e 100644 --- a/README.md +++ b/README.md @@ -23,10 +23,15 @@ This is still a work in progress... star this repo or check back later. ### Usage -Once installed, you'll want to make sure you've enabled the driver (`~/bin/xreal_driver_config -e`) and you'll probably want to disable mouse/joystick output (`~/bin/xreal_driver_config -eo`); note that these two commands can't be combined, they have to be done separately. From there, you should be able to launch any Vulkan game, plug in your glasses (at any point, not just after launching), and see a floating screen. Note that the initial centering of the screen is based on pre-calibrated values, so it may not actually start out where you're looking, or you may even see it move around for 10+ seconds after you've plugged in your glasses. +Once installed, you'll want to make sure you've enabled the driver (`~/bin/xreal_driver_config -e`) and you'll probably want to disable mouse/joystick output (`~/bin/xreal_driver_config -eo`); note that these two commands can't be combined, they have to be done separately. From there, you should be able to launch any Vulkan game, plug in your glasses (at any point, not just after launching), and see a floating screen. + +There's a wait period of 15 seconds after plugging in the glasses where the screen will stay static to allow for the glasses to calibrate. Once ready, the screen will anchor to the space where you are looking. + +#### Multi-tap +I've implemented an experimental multi-tap detection feature for screen re-centering (2 taps) and re-calibrating the device (3 taps). To perform a multi-tap, you'll want to give decent taps on the top of the glasses. I tend to do this on the corner, right on top of the hinge. It should be a firm, sharp tap, and wait just a split second to do the second tap, as it needs to detect a slight pause in between (but it also shouldn't take more than a half a second between taps so don't wait too long). #### Screen re-centering -To re-center the screen, I've implemented an experimental double-tap feature: you'll want to give two decent taps on the top of the glasses. I tend to do this on the corner, right on top of the hinge. It should be a firm, sharp tap, and wait just a split second to do the second tap, as it needs to detect a slight pause in between (but it also shouldn't take more than a half a second between taps so don't wait too long). +To re-center the screen, ### Troubleshooting @@ -34,7 +39,7 @@ To re-center the screen, I've implemented an experimental double-tap feature: yo Framerate is really important here, because individual frames are static, so moving your head quickly may produce a noticeable flicker as it moves the screen. Higher framerates will produce an overall better experience (less flicker and smoother follow), but lower framerates should still be totally usable. #### Unexpected screen movement or drift -It's important that your glasses are either on your head or sitting on a flat surface when they're first plugged in and calibrated. If you notice that your screen continues to move for several seconds after a head movement, almost as if the screen has some momentum that takes time to slow down, then try unplugging and reconnecting your glasses. +It's important that your glasses are either on your head or sitting on a flat surface when they're first plugged in and calibrated. If you notice that your screen is constantly drifting in one direction or continues to move for several seconds after a head movement, almost as if the screen has some momentum that takes time to slow down, then you'll want to re-calibrate them. To do this, do a triple-tap as described in the Multi-tap section above. #### Display size diff --git a/modules/xrealAirLinuxDriver b/modules/xrealAirLinuxDriver index cec6e30..d79fde9 160000 --- a/modules/xrealAirLinuxDriver +++ b/modules/xrealAirLinuxDriver @@ -1 +1 @@ -Subproject commit cec6e303d824df8c07dcb9e7f4f5d15cd341d0ee +Subproject commit d79fde9c0c30cad1ed869a3582199c1551cb3084 From 22a6fd00fca2dcb8bd33c2c4c9a7a4d0911b18fd Mon Sep 17 00:00:00 2001 From: Wayne Heaney <42350981+wheaney@users.noreply.github.com> Date: Tue, 17 Oct 2023 22:40:49 -0700 Subject: [PATCH 14/19] Update README.md --- README.md | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e23222e..90d2e53 100644 --- a/README.md +++ b/README.md @@ -27,11 +27,8 @@ Once installed, you'll want to make sure you've enabled the driver (`~/bin/xreal There's a wait period of 15 seconds after plugging in the glasses where the screen will stay static to allow for the glasses to calibrate. Once ready, the screen will anchor to the space where you are looking. -#### Multi-tap -I've implemented an experimental multi-tap detection feature for screen re-centering (2 taps) and re-calibrating the device (3 taps). To perform a multi-tap, you'll want to give decent taps on the top of the glasses. I tend to do this on the corner, right on top of the hinge. It should be a firm, sharp tap, and wait just a split second to do the second tap, as it needs to detect a slight pause in between (but it also shouldn't take more than a half a second between taps so don't wait too long). - -#### Screen re-centering -To re-center the screen, +#### Multi-tap to re-center or re-calibrate +I've implemented an experimental multi-tap detection feature for screen **re-centering (2 taps)** and **re-calibrating the device (3 taps)**. To perform a multi-tap, you'll want to give decent taps on the top of the glasses. I tend to do this on the corner, right on top of the hinge. It should be a firm, sharp tap, and wait just a split second to do the second tap, as it needs to detect a slight pause in between (but it also shouldn't take more than a half a second between taps so don't wait too long). ### Troubleshooting @@ -52,7 +49,7 @@ If you *WANT* to keep a low resolution, then you can just use the `Zoom` setting ### Disabling -To disable the floating screen effect, either unplug the glasses or hit the `Home` key (you'll need to bind this to your controller on Steam Deck). +To disable the floating screen effect, either disable the driver (`~/bin/xreal_driver_config -d`), unplug the glasses, or hit the `Home` key (you'll need to bind this to your controller, if on Steam Deck). ### Updating From b9bb77df00ad80c0271768cf7b1afcd37fef0884 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Wed, 18 Oct 2023 11:22:06 -0700 Subject: [PATCH 15/19] Add analytics for install, update, uninstall --- bin/package_vulkan | 23 +++++++++++++++-------- modules/xrealAirLinuxDriver | 2 +- vulkan/bin/breezy_vulkan_uninstall | 5 +++++ vulkan/bin/setup | 6 ++++++ 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/bin/package_vulkan b/bin/package_vulkan index 81c5896..fd25665 100755 --- a/bin/package_vulkan +++ b/bin/package_vulkan @@ -3,6 +3,9 @@ # exit when any command fails set -e +XREAL_DRIVER_DIR=modules/xrealAirLinuxDriver +source $XREAL_DRIVER_DIR/bin/inject_ua + # check out submodules, recursively for nested ones git submodule update --init --recursive @@ -25,9 +28,11 @@ fi # build vkBasalt VKBASALT_MODULE_DIR=$VULKAN_MODULES/vkBasalt VKBASALT_BUILD_DIR=$VKBASALT_MODULE_DIR/out -pushd $VKBASALT_MODULE_DIR -./docker-build -popd +if [ ! -d "$VKBASALT_BUILD_DIR" ] || [ "$1" != "--skip-module-builds" ]; then + pushd $VKBASALT_MODULE_DIR + ./docker-build + popd +fi # copy vkBasalt binaries and configs mkdir -p $PACKAGE_DIR/{vkBasalt.64,vkBasalt.32} @@ -41,15 +46,17 @@ wget -P $PACKAGE_DIR https://raw.githubusercontent.com/crosire/reshade-shaders/3 wget -P $PACKAGE_DIR https://raw.githubusercontent.com/crosire/reshade-shaders/384465d0287999caa6190b5ebea506200b4f4a0a/Shaders/ReShadeUI.fxh # copy vulkan setup scripts and configs -cp -r $VULKAN_DIR/bin $PACKAGE_DIR +mkdir -p $PACKAGE_DIR/bin +copy_and_inject_ua "$XREAL_DRIVER_DIR/bin/ua.sh" "$PACKAGE_DIR/bin" "$VULKAN_DIR/bin/setup" "$VULKAN_DIR/bin/breezy_vulkan_uninstall" cp -r $VULKAN_DIR/config $PACKAGE_DIR # build xreal driver -XREAL_DRIVER_DIR=modules/xrealAirLinuxDriver XREAL_BINARY=$XREAL_DRIVER_DIR/build/xrealAirLinuxDriver.tar.gz -pushd $XREAL_DRIVER_DIR -bin/package -popd +if [ ! -e "$XREAL_BINARY" ] || [ "$1" != "--skip-module-builds" ]; then + pushd $XREAL_DRIVER_DIR + bin/package + popd +fi # copy xreal binary and setup script cp $XREAL_BINARY $PACKAGE_DIR diff --git a/modules/xrealAirLinuxDriver b/modules/xrealAirLinuxDriver index d79fde9..646f123 160000 --- a/modules/xrealAirLinuxDriver +++ b/modules/xrealAirLinuxDriver @@ -1 +1 @@ -Subproject commit d79fde9c0c30cad1ed869a3582199c1551cb3084 +Subproject commit 646f123397c7852a1db9d1a9754f79aebf9ea9af diff --git a/vulkan/bin/breezy_vulkan_uninstall b/vulkan/bin/breezy_vulkan_uninstall index 4100d8d..adddf14 100755 --- a/vulkan/bin/breezy_vulkan_uninstall +++ b/vulkan/bin/breezy_vulkan_uninstall @@ -16,6 +16,11 @@ fi USER=${SUDO_USER:-$USER} USER_HOME=$(getent passwd $USER | cut -d: -f6) +if [ "$for_install" -eq 0 ]; then + UA_EVENT_NAME="uninstall" + UA_CLIENT_ID="BreezyVulkan" + #INJECT_UA_CALL +fi [ "$for_install" -eq 0 ] && echo "Removing vkBasalt binaries from $USER_HOME/.local/lib[32]/" rm $USER_HOME/.local/lib/libvkbasalt.so diff --git a/vulkan/bin/setup b/vulkan/bin/setup index b1975d1..a54d952 100755 --- a/vulkan/bin/setup +++ b/vulkan/bin/setup @@ -5,13 +5,19 @@ USER=${SUDO_USER:-$USER} USER_HOME=$(getent passwd $USER | cut -d: -f6) +UA_EVENT_NAME="install" if [ -e "$USER_HOME/bin/breezy_vulkan_uninstall" ]; then echo "Cleaning up the previous installation" # ` || true` will ensure that this can't cause a failure, even with `set -e` $USER_HOME/bin/breezy_vulkan_uninstall --for-install || true + + UA_EVENT_NAME="update" fi +UA_CLIENT_ID="BreezyVulkan" +#INJECT_UA_CALL + echo "Copying the breezy_vulkan scripts to ${USER_HOME}/bin" if [ ! -d "$USER_HOME/bin" ]; then su -c 'mkdir -p '$USER_HOME'/bin' $USER From 8624af5f16549bbc8b43091c8d471335ae0ac01d Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Wed, 18 Oct 2023 15:02:24 -0700 Subject: [PATCH 16/19] Update driver and shader to use more conventional axes and quat rotation --- modules/xrealAirLinuxDriver | 2 +- vulkan/bin/breezy_vulkan_uninstall | 2 +- vulkan/bin/setup | 4 ++-- vulkan/modules/sombrero | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/xrealAirLinuxDriver b/modules/xrealAirLinuxDriver index 646f123..19ba816 160000 --- a/modules/xrealAirLinuxDriver +++ b/modules/xrealAirLinuxDriver @@ -1 +1 @@ -Subproject commit 646f123397c7852a1db9d1a9754f79aebf9ea9af +Subproject commit 19ba816e99d88982793b653717efa70d786cd865 diff --git a/vulkan/bin/breezy_vulkan_uninstall b/vulkan/bin/breezy_vulkan_uninstall index adddf14..3d73820 100755 --- a/vulkan/bin/breezy_vulkan_uninstall +++ b/vulkan/bin/breezy_vulkan_uninstall @@ -17,7 +17,7 @@ fi USER=${SUDO_USER:-$USER} USER_HOME=$(getent passwd $USER | cut -d: -f6) if [ "$for_install" -eq 0 ]; then - UA_EVENT_NAME="uninstall" + UA_EVENT_NAME="breezy_uninstall" UA_CLIENT_ID="BreezyVulkan" #INJECT_UA_CALL fi diff --git a/vulkan/bin/setup b/vulkan/bin/setup index a54d952..0303b40 100755 --- a/vulkan/bin/setup +++ b/vulkan/bin/setup @@ -5,14 +5,14 @@ USER=${SUDO_USER:-$USER} USER_HOME=$(getent passwd $USER | cut -d: -f6) -UA_EVENT_NAME="install" +UA_EVENT_NAME="breezy_install" if [ -e "$USER_HOME/bin/breezy_vulkan_uninstall" ]; then echo "Cleaning up the previous installation" # ` || true` will ensure that this can't cause a failure, even with `set -e` $USER_HOME/bin/breezy_vulkan_uninstall --for-install || true - UA_EVENT_NAME="update" + UA_EVENT_NAME="breezy_update" fi UA_CLIENT_ID="BreezyVulkan" diff --git a/vulkan/modules/sombrero b/vulkan/modules/sombrero index e314f1e..9b19dd7 160000 --- a/vulkan/modules/sombrero +++ b/vulkan/modules/sombrero @@ -1 +1 @@ -Subproject commit e314f1e8f195526f31051052b0913f7908e94038 +Subproject commit 9b19dd7552fd242aed067c66f709a30866cc00a0 From 241b6411a911bcdc593af5cb62688458acaaf462 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Thu, 19 Oct 2023 14:16:00 -0700 Subject: [PATCH 17/19] Pull in some stale-state fixes and calibrating detection + banner --- bin/package_vulkan | 1 + modules/xrealAirLinuxDriver | 2 +- vulkan/bin/setup | 3 ++- vulkan/modules/sombrero | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/package_vulkan b/bin/package_vulkan index fd25665..5a9d17a 100755 --- a/bin/package_vulkan +++ b/bin/package_vulkan @@ -42,6 +42,7 @@ cp $VKBASALT_BUILD_DIR/builddir.32/src/libvkbasalt.so $PACKAGE_DIR/vkBasalt.32/ # copy Sombrero FX, get ReShade headers cp $VULKAN_MODULES/sombrero/IMUAdjust.fx $PACKAGE_DIR +cp $VULKAN_MODULES/sombrero/calibrating.png $PACKAGE_DIR wget -P $PACKAGE_DIR https://raw.githubusercontent.com/crosire/reshade-shaders/384465d0287999caa6190b5ebea506200b4f4a0a/Shaders/ReShade.fxh wget -P $PACKAGE_DIR https://raw.githubusercontent.com/crosire/reshade-shaders/384465d0287999caa6190b5ebea506200b4f4a0a/Shaders/ReShadeUI.fxh diff --git a/modules/xrealAirLinuxDriver b/modules/xrealAirLinuxDriver index 19ba816..ae9b09f 160000 --- a/modules/xrealAirLinuxDriver +++ b/modules/xrealAirLinuxDriver @@ -1 +1 @@ -Subproject commit 19ba816e99d88982793b653717efa70d786cd865 +Subproject commit ae9b09fac02a0c5ae669a41cb690db08911800b0 diff --git a/vulkan/bin/setup b/vulkan/bin/setup index 0303b40..18d249a 100755 --- a/vulkan/bin/setup +++ b/vulkan/bin/setup @@ -49,8 +49,9 @@ chown $USER:$USER $USER_HOME/.local/share/vulkan/implicit_layer.d/vkBasalt.* sed -e "s|/path/to/reshade-shaders|${USER_HOME}/.config/reshade|" -e "s|/path/to/sombrero|${USER_HOME}/.config/reshade/Shaders/IMUAdjust.fx|" config/vkBasalt.conf > $USER_HOME/.config/vkBasalt/vkBasalt.conf chown -R $USER:$USER $USER_HOME/.config/vkBasalt -echo "Installing the Sombrero shader to ${USER_HOME}/.config/reshade/Shaders/IMUAdjust.fx" +echo "Installing the Sombrero shader and texture files to ${USER_HOME}/.config/reshade/{Shaders,Textures}" cp *.fx* $USER_HOME/.config/reshade/Shaders +cp calibrating.png $USER_HOME/.config/reshade/Textures chown -R $USER:$USER $USER_HOME/.config/reshade # set up the XREAL driver using the local binary diff --git a/vulkan/modules/sombrero b/vulkan/modules/sombrero index 9b19dd7..d305f77 160000 --- a/vulkan/modules/sombrero +++ b/vulkan/modules/sombrero @@ -1 +1 @@ -Subproject commit 9b19dd7552fd242aed067c66f709a30866cc00a0 +Subproject commit d305f77adccdb134f6643fa16ecc5c58fa1da86a From 3936be9632f795011d11f1dea269145792c24c43 Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Thu, 19 Oct 2023 22:33:53 -0700 Subject: [PATCH 18/19] Add keepalive, better IPC value defaults, and improved look-ahead for top-to-bottom screen refresh rates --- modules/xrealAirLinuxDriver | 2 +- vulkan/modules/sombrero | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/xrealAirLinuxDriver b/modules/xrealAirLinuxDriver index ae9b09f..34d020f 160000 --- a/modules/xrealAirLinuxDriver +++ b/modules/xrealAirLinuxDriver @@ -1 +1 @@ -Subproject commit ae9b09fac02a0c5ae669a41cb690db08911800b0 +Subproject commit 34d020f43aaf9eea529355fd82088cee56438219 diff --git a/vulkan/modules/sombrero b/vulkan/modules/sombrero index d305f77..92ceaf1 160000 --- a/vulkan/modules/sombrero +++ b/vulkan/modules/sombrero @@ -1 +1 @@ -Subproject commit d305f77adccdb134f6643fa16ecc5c58fa1da86a +Subproject commit 92ceaf12b836ab3fd6e9748e5e43e1caa5cf5510 From f53cc828ba6a16040556efc2f0bc3fec5e87bd6e Mon Sep 17 00:00:00 2001 From: wheaney <42350981+wheaney@users.noreply.github.com> Date: Fri, 20 Oct 2023 11:49:40 -0700 Subject: [PATCH 19/19] Pull in latest driver changes to get multi-tap tweaks and convention fix --- modules/xrealAirLinuxDriver | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/xrealAirLinuxDriver b/modules/xrealAirLinuxDriver index 34d020f..f4130ba 160000 --- a/modules/xrealAirLinuxDriver +++ b/modules/xrealAirLinuxDriver @@ -1 +1 @@ -Subproject commit 34d020f43aaf9eea529355fd82088cee56438219 +Subproject commit f4130ba863b4976faada90ee48f454ccf3c7d201