fix: macos apple silicon compatability

This commit is contained in:
Prohurtz 2025-01-08 16:17:05 -06:00
parent 36c8a4ba15
commit 4050b7df5a
2 changed files with 11 additions and 6 deletions

View File

@ -37,8 +37,8 @@ from settings.general_settings_widget import SettingsWidget
from settings.algo_settings_widget import AlgoSettingsWidget
from osc.osc import OSCManager
from osc.OSCMessage import OSCMessage
from utils.misc_utils import is_nt, resource_path
from OVR.OpenVRService import openvr_service, OpenVRException
from utils.misc_utils import is_nt, is_macos, resource_path
import cv2
import numpy as np
import uuid
@ -230,12 +230,16 @@ def main():
# Start openvr service if autostart with openvr option is enabled
# Allow the app to be closed when SteamVR closes
if config.settings.gui_openvr_autostart:
if config.settings.gui_openvr_autostart and not is_macos:
from OVR.OpenVRService import openvr_service, OpenVRException
try:
openvr_service.initialize()
except OpenVRException:
pass
config.register_listener_callback(openvr_service.on_config_update)
# Check to see if we can connect to our video source first. If not, bring up camera finding
# dialog.
try:
@ -293,7 +297,7 @@ def main():
config.register_listener_callback(osc_manager.update)
config.register_listener_callback(eyes[0].on_config_update)
config.register_listener_callback(eyes[1].on_config_update)
config.register_listener_callback(openvr_service.on_config_update)
osc_manager.register_listeners(
config.settings.gui_osc_recenter_address,
@ -345,7 +349,8 @@ def main():
window = create_window(config, settings, eyes)
# Allow openvr service to access the windows to dynamically update the settings (uncheck autostart box)
openvr_service.window = window
if not is_macos:
openvr_service.window = window
while True:
event, values = window.read(timeout=tint) # this higher timeout saves some cpu usage

View File

@ -1,11 +1,11 @@
import os
import typing
import sys
from pathlib import Path
from typing import Union
is_nt = True if os.name == "nt" else False
is_macos = True if os.uname().sysname == "Darwin" else False
def PlaySound(*args, **kwargs):