Skip to content

Commit

Permalink
Adds option for face tracking data sources
Browse files Browse the repository at this point in the history
* Adds new local module option for setting which data sources to use (QPro) face tracking
* Changes the default face tracking data sources to visual only (audio causes conflicting expressions when talking on the mic)
* Updates libalxr to latest version (v0.43.0)
* Update vrcft project refs to latest version (5.2.3.0)
  • Loading branch information
korejan committed Jul 7, 2024
1 parent c4d5273 commit bea1f46
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 15 deletions.
17 changes: 17 additions & 0 deletions ALXRLocalModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ private ALXRClientCtx CreateALXRClientCtx(ref LibALXRConfig config, bool eyeAvai
decoderType = ALXRDecoderType.D311VA,
displayColorSpace = ALXRColorSpace.Default,
passthroughMode = ALXRPassthroughMode.None,
faceTrackingDataSources = GetFaceTrackingDataSourcesFlag(ref config),
facialTracking = GetFacialExpressionType(ref config, eyeAvailable),
eyeTracking = GetEyeTrackingType(ref config, expressionAvailable),
trackingServerPortNo = ALXRClientConfig.DefaultPortNo,
Expand Down Expand Up @@ -249,5 +250,21 @@ private ALXREyeTrackingType GetEyeTrackingType(ref LibALXRConfig config, bool ex
return ALXREyeTrackingType.None;
return config.EyeTrackingExt;
}

private static uint GetFaceTrackingDataSourcesFlag(ref LibALXRConfig config)
{
uint dataSources = 0;
if (config.FaceTrackingDataSources != null)
{
foreach (var source in config.FaceTrackingDataSources)
{
if (source == ALXRFaceTrackingDataSource.VisualSource)
dataSources |= (uint)ALXRFaceTrackingDataSourceFlags.VisualSource;
if (source == ALXRFaceTrackingDataSource.AudioSource)
dataSources |= (uint)ALXRFaceTrackingDataSourceFlags.AudioSource;
}
}
return dataSources;
}
}
}
9 changes: 6 additions & 3 deletions ALXRLocalModule.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>warnings</Nullable>
<Platforms>x64</Platforms>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<Version>1.2.0</Version>
<Version>1.3.0</Version>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand Down Expand Up @@ -38,12 +38,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<Reference Include="VRCFaceTracking.Core">
<HintPath>..\..\Program Files\WindowsApps\96ba052f-0948-44d8-86c4-a0212e4ae047_5.1.1.0_x64__d7rcq4vxghz0r\VRCFaceTracking.Core.dll</HintPath>
<HintPath>..\..\Program Files\WindowsApps\96ba052f-0948-44d8-86c4-a0212e4ae047_5.2.3.0_x64__4s4k90pjvq32p\VRCFaceTracking.Core.dll</HintPath>
</Reference>
<Reference Include="VRCFaceTracking.SDK">
<HintPath>..\..\Program Files\WindowsApps\96ba052f-0948-44d8-86c4-a0212e4ae047_5.2.3.0_x64__4s4k90pjvq32p\VRCFaceTracking.SDK.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
Expand Down
6 changes: 3 additions & 3 deletions ALXRLocalModule.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"ModuleId": "19ba52ba-ba20-4dd3-afa0-359f54b858af",
"LastUpdated": "2023-12-14T01:08:01Z",
"Version": "1.2.0",
"LastUpdated": "2024-07-07T13:00:00Z",
"Version": "1.3.0",
"Downloads": 0,
"Ratings": 0,
"Rating": 0,
"AuthorName": "korejan",
"ModuleName": "ALXR Local Module",
"ModuleDescription": "The module provides eye and/or facial tracking for PC OpenXR runtimes only (e.g. Link/AirLink) via libalxr.",
"UsageInstructions": "Set the active OpenXR runtime to the desired runtime and enable any relevant settings, start the runtime then run VRCFT. Details on config options/setup can be found on docs.vrcft.io or github repo.",
"DownloadUrl": "https://github.com/korejan/VRCFT-ALXR-Modules/releases/download/v1.2.0/ALXRLocalModule.zip",
"DownloadUrl": "https://github.com/korejan/VRCFT-ALXR-Modules/releases/download/v1.3.0/ALXRLocalModule.zip",
"ModulePageUrl": "https://github.com/korejan/VRCFT-ALXR-Modules",
"DllFileName": "ALXRLocalModule.dll"
}
9 changes: 6 additions & 3 deletions ALXRRemoteModule.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Nullable>warnings</Nullable>
<Platforms>x64</Platforms>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<Version>1.2.0</Version>
<Version>1.3.0</Version>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -36,12 +36,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<Reference Include="VRCFaceTracking.Core">
<HintPath>..\..\Program Files\WindowsApps\96ba052f-0948-44d8-86c4-a0212e4ae047_5.1.1.0_x64__d7rcq4vxghz0r\VRCFaceTracking.Core.dll</HintPath>
<HintPath>..\..\Program Files\WindowsApps\96ba052f-0948-44d8-86c4-a0212e4ae047_5.2.3.0_x64__4s4k90pjvq32p\VRCFaceTracking.Core.dll</HintPath>
</Reference>
<Reference Include="VRCFaceTracking.SDK">
<HintPath>..\..\Program Files\WindowsApps\96ba052f-0948-44d8-86c4-a0212e4ae047_5.2.3.0_x64__4s4k90pjvq32p\VRCFaceTracking.SDK.dll</HintPath>
</Reference>
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
Expand Down
6 changes: 3 additions & 3 deletions ALXRRemoteModule.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"ModuleId": "cb54e4bd-969c-47cd-934d-eb3293575b6e",
"LastUpdated": "2023-12-14T01:08:01Z",
"Version": "1.2.0",
"LastUpdated": "2024-07-07T13:00:00Z",
"Version": "1.3.0",
"Downloads": 0,
"Ratings": 0,
"Rating": 0,
"AuthorName": "korejan",
"ModuleName": "ALXR Remote Module",
"ModuleDescription": "The module provides OpenXR eye and/or facial tracking for variety of standalone & wired headsets via remote ALXR clients.",
"UsageInstructions": "Run VRCFT once and exit, add the client IP address to the generated ALXRModuleConfig.json desktop shortcut and run VRCFT. Details on other config options/setup can be found on docs.vrcft.io or github repo.",
"DownloadUrl": "https://github.com/korejan/VRCFT-ALXR-Modules/releases/download/v1.2.0/ALXRRemoteModule.zip",
"DownloadUrl": "https://github.com/korejan/VRCFT-ALXR-Modules/releases/download/v1.3.0/ALXRRemoteModule.zip",
"ModulePageUrl": "https://github.com/korejan/VRCFT-ALXR-Modules",
"DllFileName": "ALXRRemoteModule.dll"
}
9 changes: 8 additions & 1 deletion ModuleConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ public struct LibALXRConfig
public ALXREyeTrackingType EyeTrackingExt;
[JsonInclude]
public ALXRFacialExpressionType FacialTrackingExt;
[JsonInclude]
public List<ALXRFaceTrackingDataSource> FaceTrackingDataSources;

public static LibALXRConfig Default
{
Expand All @@ -59,7 +61,11 @@ public static LibALXRConfig Default
SimulateHeadless = true,
GraphicsApi = ALXRGraphicsApi.Auto,
EyeTrackingExt = ALXREyeTrackingType.Auto,
FacialTrackingExt = ALXRFacialExpressionType.Auto
FacialTrackingExt = ALXRFacialExpressionType.Auto,
FaceTrackingDataSources = new List<ALXRFaceTrackingDataSource>()
{
ALXRFaceTrackingDataSource.VisualSource,
},
};
}
}
Expand Down Expand Up @@ -183,6 +189,7 @@ private static void AddJsonConverters(JsonSerializerOptions jsonOptions)
jsonOptions.Converters.Add(new EnumStringConverter<ALXRGraphicsApi>());
jsonOptions.Converters.Add(new EnumStringConverter<ALXREyeTrackingType>());
jsonOptions.Converters.Add(new EnumStringConverter<ALXRFacialExpressionType>());
jsonOptions.Converters.Add(new EnumStringConverter<ALXRFaceTrackingDataSource>());
jsonOptions.Converters.Add(new EnumStringConverter<FBEyeOpennessMode>());
}

Expand Down
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ The following entries in `ALXRModuleConfig.json` are specifically for configurin
"SimulateHeadless": true,
"GraphicsApi": "Auto",
"EyeTrackingExt": "Auto",
"FacialTrackingExt": "Auto"
"FacialTrackingExt": "Auto",
"FaceTrackingDataSources": [
"VisualSource"
]
}
```

Expand Down Expand Up @@ -152,3 +155,7 @@ The following entries in `ALXRModuleConfig.json` are specifically for configurin
* [`"FB"`](https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#XR_FB_face_tracking) - Typically Quest Pro
* [`"HTC"`](https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#XR_HTC_facial_tracking) - Typically vive facial tracker (requires "Vive console for SteamVR") or Focus 3 facial tracker add-on
* `"Auto"` - default, auto selects any available in the above order.

`FaceTrackingDataSources` - Sets one or more data sources for face tracking. The following options are:
* `"VisualSource"` - default, enable visual data source for face tracking.
* `"AudioSource"` - enable audio data source for face tracking (not recommended).
2 changes: 1 addition & 1 deletion libalxr-sharp

0 comments on commit bea1f46

Please sign in to comment.