Oculus Quest with Virtual Desktop

 摘要:

Oculus Quest結合Virtual Desktop(以下稱VD)軟體,可實現遠端無線高品質VR體驗。

Virtual Desktop
Virtual Desktop VR Patch for Quest
Oculus Quest play Steam VR games with Virtual Desktop

---

Virtual Desktop - PC desktop & VR games

PC端與Quest各自安裝VD軟體,PC端輸入Quest使用者ID後自動搜索配對,連線速度很快,且可網際網路連線不需要在同一網域。不過連線安全性有疑慮,自動連線無其他安全驗證方式。

VR體驗感很好,透過VR裝置上的鏡頭做室內3D空間定位,不須額外架設感應基地台,無線VR行動自由,還有穿透模式(不用取下VR裝置透過攝影機畫面看到外面實景),藉由VD畫面串流體驗高品質內容,以Wi-Fi 5連線低延遲,輸入方面除了VR控制器還有手勢辨識,可支援Oculus/Steam的VR遊戲,唯一需要注意VR裝置電量使用情形連續使用約1~2小時。

Desktop mode video bitrate : ~32 Mbps
VR mode video bitrate : ~93 Mbps

// 中文路徑可能造成SideQuest無法正常安裝Virtual Desktop VR Patch
// 欲執行Steam或Oculus平台上的VR遊戲時,必須處於已登入的狀態
// Quest以手機無線基地台方式連線時,無法正常與VD連線
// 網際網路連線環境需開啟UPnP功能或是設定Port forwarding

---

Virtual Desktop - My UE4Game

正常流程執行UE4Game時會發生無法順利連結VR模式的問題(無法全螢幕運行、VR控制器無法正常運作),需要執行以下程式開啟「Auto-inject」模式。

// 與VD中斷連線後將會關閉自動注入(auto-inject)


RunMyUE4Game.vbs

Set WinScriptHost = CreateObject("WScript.Shell")
Return = WinScriptHost.Run("Powershell.exe -File ""D:\EnableAutoInject.ps1""", 0, True)
Return = WinScriptHost.Run("Powershell.exe -File ""D:\RunMyUE4Game.ps1""", 0, True)

'Run Method
'object.Run(strCommand, [intWindowStyle], [bWaitOnReturn])
'https://www.vbsedit.com/html/6f28899c-d653-4555-8a59-49640b0e32ea.asp

EnableAutoInject.ps1

If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator))
{
  # Relaunch elevated:
  Start-Process powershell.exe "-File",('"{0}"' -f $MyInvocation.MyCommand.Path) -Verb RunAs -WindowStyle Hidden

  exit
}

<#
# Switch auto-inject
if ((Get-ItemPropertyValue -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name "LoadAppInit_DLLs") -eq '1') {
    Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name "LoadAppInit_DLLs" -Value '0'
    Write-Output 'Auto-inject is Off'
} elseif ((Get-ItemPropertyValue -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name "LoadAppInit_DLLs") -eq '0') {
    Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name "LoadAppInit_DLLs" -Value '1'
    Write-Output 'Auto-inject is On'
} else {
    Write-Output 'Auto-inject is neither 0 nor 1, setting to 0'
    Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name "LoadAppInit_DLLs" -Value '0'
}

write-host "Press any key to continue..."
[void][System.Console]::ReadKey($true)
#>

# Turn on auto-inject
if ((Get-ItemPropertyValue -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name "LoadAppInit_DLLs") -eq '1') {    
    Write-Output 'Auto-inject is already On'
} else{
    Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Windows" -Name "LoadAppInit_DLLs" -Value '1'
    Write-Output 'Auto-inject is On'
}
RunMyUE4Game.ps1
& "D:\MyUE4Game.exe"
---

效能分析工具

Anroid SDK - Logcat
Oculus - OVR Metrics Tool
RenderDoc
fpsVR (Steam App)

---

延伸閱讀

WiFi 6是什麼?一次看懂802.11背後代表的規格涵義

---

障礙排除

透過Virtual Desktop執行VR內容需要安裝Virtual Desktop VR Patch,在PC安裝並開啟SideQuest軟體,將Quest頭盔以USB線跟PC連接,在商城中找到Virtual Desktop VR Patch按下「INSTALL TO HEADSET」,發生adb server version doesn't match this client的錯誤。

發生此情況原因為PC裡有其他軟體有安裝其他版本的adb檔案,解決方式開啟工作管理員在詳細資料頁籤找到adb.exe,查看內容找出檔案位置,在本例為C:\NVPACK\android-sdk-windows\platform-tools,複製以下檔案覆蓋至C:\Users\UserName\AppData\Roaming\SideQuest\platform-tools,即可排除此問題。

  • adb.exe
  • AdbWinApi.dll
  • AdbWinUsbApi.dll

這個網誌中的熱門文章

Windows10 版本1607後可啟用支援長路徑檔名 (Maximum Path Length Limitation)

標準使用者如何執行需系統管理者權限的程式

Shared Memory