Skip to content

Commit

Permalink
5.8.3 (#658)
Browse files Browse the repository at this point in the history
* add delay if interface not found

* adjust initialization behavior

* pushed for debugging reasons for concerned parties

* comment out simple recenter

* remove old style motion, some minor optimizations

* optimize default case check

* optimized default condition

* change manifest install behavior to trigger on desktop mode as well

* add desktop mode binding launch

* add tracker overlay option to utils

* commit to check status

* attempt to fix native LH issues with chaperone when exiting

* add desktop mode toggle and some cleanup

* remove adjust chaperone

* remove clang format from ci, increment version, cleanup

* update circle ci

* fix conversion warning

* add F13-19 to keyboard parser

* add additional logging around failure to initialize

* add unsaved changes

* update version 5.8.1

* fix some collisions in enum declaration

* add controller powers on steamvr, and no HMD to steamvr tab, increment version

* slightly alter drag movement, fix qml issue

* code cleanup

* fix logspam/attempt to delete non existant overlays

* increment version 5.8.3
  • Loading branch information
ykeara authored Feb 21, 2024
1 parent 54d22a4 commit 48a7cf4
Show file tree
Hide file tree
Showing 29 changed files with 529 additions and 493 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ init:

build_script:
- python ./build_scripts/append_to_version_file.py %APPVEYOR_REPO_COMMIT:~0,8%
- python ./build_scripts/run-clang-format.py ./src -r --clang-format-executable "C:\Program Files\LLVM\bin\clang-format.exe" --color always
# - python ./build_scripts/run-clang-format.py ./src -r --clang-format-executable "C:\Program Files\LLVM\bin\clang-format.exe" --color always
- call "build_windows.cmd"

artifacts:
Expand Down
24 changes: 12 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ jobs:
sudo add-apt-repository 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main'
sudo add-apt-repository 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main'
sudo apt-get update -qq
- run:
name: Install LLVM-8 binaries
# clang is required due to a check by Qmake.
# clang-tidy-8 has new errors compared to clang-tidy-7, so we haven't upgraded.
command: |
sudo apt-get install clang-format-8 -y
sudo apt-get install clang-tidy-7 -y
sudo apt-get install clang-8 -y
sudo apt-get install clang -y
- run:
name: Run clang-format
command: python ./build_scripts/run-clang-format.py ./src -r --color always --clang-format-executable clang-format-8
#- run:
# name: Install LLVM-8 binaries
# # clang is required due to a check by Qmake.
# # clang-tidy-8 has new errors compared to clang-tidy-7, so we haven't upgraded.
# command: |
# sudo apt-get install clang-format-8 -y
# sudo apt-get install clang-tidy-7 -y
# sudo apt-get install clang-8 -y
# sudo apt-get install clang -y
#- run:
# name: Run clang-format
# command: python ./build_scripts/run-clang-format.py ./src -r --color always --clang-format-executable clang-format-8
- run:
name: Install g++
command: |
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ before_install:
- sudo apt update -qq
- sudo apt install clang-format-8
- clang-format-8 --version
- python ./build_scripts/run-clang-format.py ./src -r --color always --clang-format-executable clang-format-8
# - python ./build_scripts/run-clang-format.py ./src -r --color always --clang-format-executable clang-format-8
- sed -i 's/QMAKE_CXXFLAGS += -flto//g' ./build_scripts/qt/compilers/clang-gcc-common-switches.pri # CI version of clang can't handle LTO
- sed -i 's/QMAKE_LFLAGS += -flto -fuse-ld=gold//g' ./build_scripts/qt/compilers/clang-gcc-common-switches.pri # CI version of clang can't handle LTO

Expand Down
2 changes: 1 addition & 1 deletion build_scripts/compile_version_string.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.7.4-release
5.8.3-release
1 change: 1 addition & 0 deletions build_scripts/qt/resources.pri
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ DISTFILES += \
src/res/qml/utilities_page/media_keys/* \
src/res/qml/utilities_page/keyboard_utils/* \
src/res/qml/utilities_page/alarm_clock/* \
src/res/qml/utilities_page/misc/* \
src/res/qml/audio_page/dialog_boxes/* \
src/res/qml/audio_page/device_selector/* \
src/res/qml/audio_page/proximity/* \
Expand Down
30 changes: 28 additions & 2 deletions src/keyboard_input/input_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,20 @@ std::optional<Token> getFunctionNumberExtended( const char& character ) noexcept
return Token::KEY_F11;
case '2':
return Token::KEY_F12;
// Theoretically we could extende out to f19, but as F12 is the only
// function key on Standard Keyboard.
case '3':
return Token::KEY_F13;
case '4':
return Token::KEY_F14;
case '5':
return Token::KEY_F15;
case '6':
return Token::KEY_F16;
case '7':
return Token::KEY_F17;
case '8':
return Token::KEY_F18;
case '9':
return Token::KEY_F19;
default:
LOG( INFO ) << "Unknown function key number: " << character;
return std::nullopt;
Expand Down Expand Up @@ -477,6 +489,20 @@ bool isLiteral( const Token token ) noexcept
return true;
case Token::KEY_F12:
return true;
case Token::KEY_F13:
return true;
case Token::KEY_F14:
return true;
case Token::KEY_F15:
return true;
case Token::KEY_F16:
return true;
case Token::KEY_F17:
return true;
case Token::KEY_F18:
return true;
case Token::KEY_F19:
return true;

case Token::KEY_BACKSPACE:
return true;
Expand Down
9 changes: 8 additions & 1 deletion src/keyboard_input/input_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,15 @@ enum class Token
KEY_F10,
KEY_F11,
KEY_F12,
KEY_F13,
KEY_F14,
KEY_F15,
KEY_F16,
KEY_F17,
KEY_F18,
KEY_F19,

KEY_BACKSPACE,
KEY_BACKSPACE = 150,
KEY_SPACE,
KEY_TAB,
KEY_ESC,
Expand Down
14 changes: 14 additions & 0 deletions src/keyboard_input/input_sender_X11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,20 @@ unsigned int tokenToKeySym( const Token token )
return XK_F11;
case Token::KEY_F12:
return XK_F12;
case Token::KEY_F13:
return XK_F13;
case Token::KEY_F14:
return XK_F14;
case Token::KEY_F15:
return XK_F15;
case Token::KEY_F16:
return XK_F16;
case Token::KEY_F17:
return XK_F17;
case Token::KEY_F18:
return XK_F18;
case Token::KEY_F19:
return XK_F19;

case Token::KEY_BACKSPACE:
return XK_BackSpace;
Expand Down
14 changes: 14 additions & 0 deletions src/keyboard_input/input_sender_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ WORD convertToVirtualKeycode( const Token token )
return VK_F11;
case Token::KEY_F12:
return VK_F12;
case Token::KEY_F13:
return VK_F13;
case Token::KEY_F14:
return VK_F14;
case Token::KEY_F15:
return VK_F15;
case Token::KEY_F16:
return VK_F16;
case Token::KEY_F17:
return VK_F17;
case Token::KEY_F18:
return VK_F18;
case Token::KEY_F19:
return VK_F19;

case Token::KEY_BACKSPACE:
return VK_BACK;
Expand Down
10 changes: 6 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
#ifdef _WIN64
# include <windows.h>
extern "C" __declspec( dllexport ) DWORD NvOptimusEnablement = 0x00000001;
extern "C" __declspec( dllexport ) DWORD
AmdPowerXpressRequestHighPerformance = 0x00000001;
extern "C" __declspec( dllexport ) DWORD AmdPowerXpressRequestHighPerformance
= 0x00000001;
#endif

INITIALIZE_EASYLOGGINGPP
Expand Down Expand Up @@ -81,7 +81,7 @@ int main( int argc, char* argv[] )
application_strings::applicationKey );

// Attempts to install the application manifest on all "regular" starts.
if ( !commandLineArgs.desktopMode && !commandLineArgs.forceNoManifest )
if ( !commandLineArgs.forceNoManifest )
{
try
{
Expand All @@ -103,7 +103,9 @@ int main( int argc, char* argv[] )
}
}

if ( commandLineArgs.desktopMode )
if ( commandLineArgs.desktopMode
|| settings::getSetting(
settings::BoolSetting::APPLICATION_desktopModeToggle ) )
{
auto m_pWindow = new QQuickWindow();
qobject_cast<QQuickItem*>( quickObj )
Expand Down
83 changes: 50 additions & 33 deletions src/openvr/openvr_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace openvr_init
{
void initializeProperly( const OpenVrInitializationType initType )
bool initializeProperly( const OpenVrInitializationType initType )
{
auto initializationType = vr::EVRApplicationType::VRApplication_Other;
if ( initType == OpenVrInitializationType::Overlay )
Expand All @@ -34,7 +34,7 @@ void initializeProperly( const OpenVrInitializationType initType )
+ std::string(
vr::VR_GetVRInitErrorAsEnglishDescription(
initError ) );
return;
return false;
}
LOG( ERROR ) << "Failed to initialize OpenVR: "
+ std::string(
Expand All @@ -45,75 +45,92 @@ void initializeProperly( const OpenVrInitializationType initType )
// probably pre-maturely killing ourselves from some sort of OpenVR race
// condition
// exit( EXIT_FAILURE );
return false;
}
else
{
LOG( INFO ) << "OpenVR initialized successfully.";
}

LOG( INFO ) << "OpenVR initialized successfully.";
return true;
}

void initializeOpenVR( const OpenVrInitializationType initType )
void initializeOpenVR( const OpenVrInitializationType initType, int count )
{
initializeProperly( initType );
bool success = initializeProperly( initType );

// The function call and error message was the same for all version checks.
// Specific error messages are unlikely to be necessary since both the type
// and version are in the string and will be output.
auto reportVersionError = []( const char* const interfaceAndVersion ) {
// 5.7.1
// Stop behavior from exiting out, again seems to be related to some
// sort of race condition in non-native Headsets (i.e. not lighthouse)

// QMessageBox::critical(
// nullptr,
// "OpenVR Advanced Settings Overlay",
// "OpenVR version is too outdated. Please update OpenVR." );

auto reportVersionError
= []( const char* const interfaceAndVersion, const int trynumber )
{
// as of 5.8.1 Based on some information from valve, if ANY interface
// fails to load we should have issues. we will re-initialize a few
// times if that is the case and hope that fixes things
LOG( WARNING ) << "OpenVR version is invalid: Interface version "
<< interfaceAndVersion << " not found.";
// throw std::runtime_error(
// std::string( "OpenVR version is too outdated: Interface
// version " )
// + std::string( interfaceAndVersion )
// + std::string( " not found." ) );
<< interfaceAndVersion << " not found. attempt number: "
<< std::to_string( trynumber );
};

// Check whether OpenVR is too outdated

// Sleep duration is an attempt to hopefully alleviate a possible race
// condition in steamvr
if ( !vr::VR_IsInterfaceVersionValid( vr::IVRSystem_Version ) )
{
reportVersionError( vr::IVRSystem_Version );
reportVersionError( vr::IVRSystem_Version, count );
success = false;
}
else if ( !vr::VR_IsInterfaceVersionValid( vr::IVRSettings_Version ) )
{
reportVersionError( vr::IVRSettings_Version );
reportVersionError( vr::IVRSettings_Version, count );
success = false;
}
else if ( !vr::VR_IsInterfaceVersionValid( vr::IVROverlay_Version ) )
{
reportVersionError( vr::IVROverlay_Version );
reportVersionError( vr::IVROverlay_Version, count );
success = false;
}
else if ( !vr::VR_IsInterfaceVersionValid( vr::IVRApplications_Version ) )
{
reportVersionError( vr::IVRApplications_Version );
reportVersionError( vr::IVRApplications_Version, count );
success = false;
}
else if ( !vr::VR_IsInterfaceVersionValid( vr::IVRChaperone_Version ) )
{
reportVersionError( vr::IVRChaperone_Version );
reportVersionError( vr::IVRChaperone_Version, count );
success = false;
}
else if ( !vr::VR_IsInterfaceVersionValid( vr::IVRChaperoneSetup_Version ) )
{
reportVersionError( vr::IVRChaperoneSetup_Version );
reportVersionError( vr::IVRChaperoneSetup_Version, count );
success = false;
}
else if ( !vr::VR_IsInterfaceVersionValid( vr::IVRCompositor_Version ) )
{
reportVersionError( vr::IVRCompositor_Version );
reportVersionError( vr::IVRCompositor_Version, count );
success = false;
}
else if ( !vr::VR_IsInterfaceVersionValid( vr::IVRNotifications_Version ) )
{
reportVersionError( vr::IVRNotifications_Version );
reportVersionError( vr::IVRNotifications_Version, count );
success = false;
}
else if ( !vr::VR_IsInterfaceVersionValid( vr::IVRInput_Version ) )
{
reportVersionError( vr::IVRInput_Version );
reportVersionError( vr::IVRInput_Version, count );
success = false;
}
if ( !success && count < 3 )
{
LOG( WARNING ) << "An error occured on initialization of "
"openvr/steamvr attempting again "
<< std::to_string( count + 1 ) << " of 3 Attempts";
std::this_thread::sleep_for( std::chrono::seconds( 5 ) );
// 5.8.1 Unknown if VR shutdown needs to be callled if vr init fails
initializeOpenVR( initType, ( count + 1 ) );
}
if ( count >= 3 )
{
LOG( ERROR ) << "initialization errors persist proceeding anyways";
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/openvr/openvr_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ enum class OpenVrInitializationType
Utility,
};

void initializeOpenVR( const OpenVrInitializationType initType );
void initializeOpenVR( const OpenVrInitializationType initType, int count = 0 );

} // namespace openvr_init
Loading

0 comments on commit 48a7cf4

Please sign in to comment.