Step-by-step guide to build and set up Opentrack on macOS for head tracking in games like X-Plane. Covers plugin installation, dependencies, managing macOS security, and building from source. Ideal for gaming enthusiasts seeking an easy head tracking setup.

IR Head Tracking on MacOS using Opentrack and DelanClip

Category:Tutorials
Post date:
Updated:
2024-10-16

In this document Iโ€™m describing how I was able to take full advantage of my DelanClip Fusion Pro on macOS despite the fact that itโ€™s currently not officially supported (Iโ€™ve been using it on Windows and itโ€™s working perfectly by the way).

Table of content

Introduction

When I was looking for it there were no official binaries of the OpenTrack application available for macOS. There were builds around on the internet but they were very old and lacking important features. Luckily Opentrack is open source software and I was able to build a basic version of it myself.

Getting the most important features to work as well however was a steep and extremely time consuming learning curve. Once up and running I noticed several problems in the macOS version which I had to fix before it really became usable. Although the DelanCam1 camera is recognized by macOS out of the box it did not perform well initially.

I found out that when connecting it to a Mac the initial exposure time settings are not ideal rendering it unusable for IR-Tracking. But once the settings are correct it performs very well. Iโ€™ve created a little utility called DelanCamUtil that will put the camera in the correct state. The opentrack plugin for x-plane needed some improvements and compatibility with X-Camera was requested on the X-Plane forums very often.

Iโ€™ve now come to a point where things have really become useable and enjoyable so Iโ€™d like to share this information with the public.

Setup DelanCam1 for IR Tracking on MacOS

If you connect DelanCam1 to a Mac it will not perform optimally on macOS like it does on Windows out of the box. Get the latest release of my DelanCamUtil to fix that. Copy the app to your Applications folder or wherever you like and open it. In the systemโ€™s menu bar on the right youโ€™ll then notice a little icon with three dots in the middle. It will be solid (like shown in the picture below) if a DelanCam1 camera is connected. Itโ€™ll be hollow otherwise.

The app is lightweight and it actually does nothing but react if a DelanCam1 camera is plugged in. It will then try to apply the recommended setting so that the camera performs optimally. Itโ€™ll also do that when the app starts and the camera is already connected.

If you have reason to believe the app may have failed to set the cameraโ€™s settings then you can manually apply the settings via the โ€œReapply camera settings nowโ€ menu item. Also note that the settings will not persist if you reconnect the camera or restart your computer.

So it’s mandatory to have the app apply the settings at least once before you want to use the camera for IR-Tracking. Some users have added the app to their startup item list so they need not to worry about it anymore. Hereโ€™s my โ€œLogin Itemsโ€ section of macOS System Settings:

OpenTrack Setup in MacOS

Opentrack is an open source program capable of tracking your headโ€™s movement and getting the movement data into your simulator or game. Get my latest builds of MacOpentrack.

Choose the .dmg file that fits your platform. x86_64 is for older Intel-Macs whereas everything else is optimised for Apple-Silicon. Open the disk image and copy the app to your Applications folder or wherever you like.

Note that I donโ€™t provide pre-built binaries directly at my fork of opentrack on GitHub. I offer code-signed and apple-notarised binaries at my Gumroad-page allowing you to also support me financially. Of course youโ€™re welcome to build the software yourself as I make all my code changes available.

MacOS might now ask you if Opentrack is allowed to access your Documents folder:

It is mandatory that you allow this because Opentrack currently stores its profiles in a folder called โ€œOpentrack-2.3โ€ within your Documents folder.

Youโ€™ll then probably see a window like this:

Opentrack basically consists of three modules:

  1. The Tracker module usually tracks your physical head-movement. The PointTracker module would be used for IR-Tracking with the DelanClip. The module neuralnet-tracker would use a regular webcam. In this case your face is being tracked using machine learning techniques.
    • Itโ€™ll work with most webcams and the built-in FaceTime HD camera of your MacBook, but itโ€™ll have a notable impact on the systemโ€™s CPU usage and tracking will not be nearly as good as with IR-Tracking.
    • It can still be usabled if configured and tuned well, but I never was really happy with it.
  2. The Filter module is used to fine tune the responsiveness and smoothness of the movements.
  3. The Output module passes the filtered data to a consumer e.g. your game.

There are other trackers and output methods available, but they are not covered in this document and may not even be functional on macOS.

Follow DelanClipโ€™s setup instructions to install their profiles for Opentrack. Itโ€™ll be applicable on macOS. When done and youโ€™ve selected one of those profiles youโ€™ll note that the Output drop-down menu will be empty because the freetrack 2.0 Enhanced module is only available on Windows.

On macOS please select the corresponding module called Wine/X-Plane:

The Wine/X-Plane module covers two use cases: Wine and X-Plane.

  1. Wine is a compatibility layer capable of running Windows applications on several POSIX-compliant operating systems, such as Linux, macOS, & BSD. This document will not cover Wine in depth, but I have successfully used it with windows software running using wine 9.0 on macOS.
  2. X-Plane is a well-known flight simulator available for Windows, Linux and macOS. Opentrack provides a plugin for X-Plane to feed the motion-data from Opentrack into X-Plane via shared memory. Technically this means that other applications could read this data as well, but as far as I know the only consumer currently is the X-Plane plugin – hence the name X-Plane. Weโ€™ll talk about the plugin later.

Weโ€™ll now assume that you are not going to use the Wine integration but X-Plane. Open the output moduleโ€™s settings by clicking on the hammer right next to it. Select the wine variant โ€œDisabled (X-Plane)โ€

Otherwise youโ€™ll get an error message when starting tracking in case you donโ€™t have Wine installed.

Basic configuration

Opentrack offers quite a lot. You can and probably should configure to your liking. We canโ€™t cover it here, but I recommend reviewing Opentrackโ€™s Options and Mappings dialogs. In Particular, you should configure the global keyboard shortcut โ€œCenterโ€.

By default the DelanClip provided profiles are configured to the โ€œHomeโ€-key which might not be available on your MacBookโ€™s keyboard. Note that these are system wide shortcuts, so please use a key you donโ€™t use in other applications. Use combinations with one or more modifier keys (like control, option or shift).

You can skip this now and come back later.

Starting the tracker for the first time

Review the trackerโ€™s setting by clicking on the hammer right next to it. Make sure you have the right camera selected. Now start the tracker by pressing the button Start. Of course youโ€™ll first have to allow Opentrack to use the camera:

There might be another error message stating that the camera could not be accessed. Just dismiss it. Allow the camera usage and then hit the Stop button and hit Start one more time.

The camera should now become active and the octopus should move in sync with your head movement – assuming your DelanClip is charged and turned on. Place your head to a neutral and central position then use the โ€œCenterโ€ command that you have mapped in the previous step and see the octopus recenter.

There are a lot of things you could tweak in the settings, but we canโ€™t go over all that here as Iโ€™m no expert either. Luckily I found with IR-Tracking thereโ€™s far less to configure since itโ€™s much smoother right from the start. However please make sure that when opening the Point-Trackerโ€™s settings by clicking the hammer right next to it the tracker reports around 30 FPS and that the dots are crisp and rather small.

They should look like white dots, not like actual light sources. They should move synchronously with your head without notable latency.

If however the PointTrackerโ€™s FPS are only around 12 then the camera is not in the correct state. Stop tracking and choose the โ€œReapply camera settings nowโ€ in DelanCamUtilsโ€™ menu and restart tracking.

Check the FPS again. If nothing changes then you might have a different camera that DelanCamUtil does not know about. In this case other apps like โ€œWebcam Settingโ€ (available in the App-Store) or the command-line tool uvc-util which DelanCamUtil uses internally may help you find the settings that make your camera work better.

Model calibration

Most trackers will have an option to calibrate the model and so does the PointTracker. You can calibrate it now or come back later. Also you can repeat this whenever you change the positioning of the camera and/or your head-clip. Youโ€™ll find the PointTrackerโ€™s calibration option here:

X-Plane setup in MacOS: installing the plugin

To make X-Plane receive the motion data from Opentrack you have to install a plugin that youโ€™ll find in the folder Xplane-Plugin on the disk image where you also did find Opentrack. The plugin only consists of a file name opentrack_arm64.xpl or opentrack_x86_64.xpl depending on which platform you have chosen. On an older intel-Mac youโ€™ll want the x86_64 file. Copy the file into path/to/X-Plane/Resources/plugins/.

Note that on an Apple-Silicon you might be using X-Plane in intel- aka Rosetta-mode so that you can use aeroplanes that are not yet optimised for Apple-Silicon. In this case also download the x86_64 *.dmg disk image and copy the intel version of the Opentrack plugin to X-Plane plugin folder as well. Youโ€™ll have to perform the Gatekeeper game for it too.

Using the X-Plane-Plugin

Start a flight and verify that the plugin has been loaded. Check the โ€œPluginโ€-menu. You should see a menu โ€œOpentrackโ€ that should look like this or similar:

The menu-item โ€œHead trackingโ€ toggles between head tracking completely on or off. The menu-item โ€œInput translationโ€ toggles between full motion (roll, yaw and pitch and x, y and z) or rotations only. If you turn the translations off the virtual head always stays in the same position and you will be able to move around in the cockpit using the arrow keys as usual or by using quick looks. The dotโ€™s indicate the on state.

Depending whether you have the X-Camera plugin installed and enabled then the last menu item will read โ€œOutput: X-Cameraโ€ or โ€œOutput: X-Planeโ€ indicating that the plugin will pass motion data to X-Camera or pass it to X-Plane respectively. X-Camera allows you to define views where you can individually choose whether head-tracking is turned on or off. For instance if you have defined a close-up view of your avionic instruments then you might want head-tracking to be disabled automatically as long as this view is active. If you disable or enable X-Camera then you must toggle the Opentrack plugin off and on again for it to notice X-Cameraโ€™s state.

Full motion head tracking is always active on first start. So if you are not using head-tracking you need to turn tracking off. Itโ€™s generally recommended that you define a key or controller-binding at least for the โ€œHead trackingโ€-toggle so you can turn it on and off quickly.

Remember to โ€œCenterโ€ the view and start exploring.

Happy flying!


Opentrack and Wine

I successfully used IR-Tracking with Falcon BMS and wine-stable 9.0 installed via MacPorts (sudo port install wine-stable) and Homebrew (brew install --cask --no-quarantine wine-stable). If youโ€™re familiar with how wine works then you should know what to do in order to set Opentrack up for it by opening the โ€œWine/X-Planeโ€ moduleโ€™s settings and select the wine variant โ€œWineโ€. Select the wine-prefix where your application you’d like to use Opentrack with is installed. Specify the path to the wine executable in case you don’t have installed it via Homebrew or macports.

Proton comes from Linux version of Opentrack and is meant to be used with Steam, but I don’t think it’s applicable to macOS’ version of Steam.

There are several wine-based solutions such as CrossOver, Whisky or Wineskin that offer a GUI and other conveniences to the underlying wine system, but they also add complexity and making them work with MacOpentrack is more difficult – in fact I tried but gave up once I realised it’s not trivial.

I might revisit this topic and revisit this section in future.

Where to go from here

So there you have it. But donโ€™t stop here in case you feel something could be better. Go and look into Opentracks Options. Youโ€™ll most likely find a possibility to tweak it to your liking.

A common issue might be that the x translation is reversed – meaning you move (not rotate) your head to the right, but the virtual pilot’s head moves to the left. This can be fixed in the options like this for instance:

Also the Mapping configuration window is a very powerful and important tool and you should use it to tweak how your physical movement is mapped to the virtual pilotโ€™s movements.

Look for other documentation on opentrack – most of it should be applicable to Opentrack on macOS as well.

Thanks and final words

Many thanks to cavu360 and Anthony Francis for their generous support and help at the X-Plane Forum. Last but not least, many thanks to the developers of Opentrack!

Update: As of October, 15th 2024 DelanEngineeringโ€™s Tomasz is now supporting my work – so that opentrack and DelanClipUtil will stay up to date and available for his macOS customers. He also created this link that gets you a 5 % discount on the DelanClip shop.

Conclusion

Bringing IR head-tracking to macOS has been a very complex journey in the past, but with the right tools and guidance, it’s absolutely achievable and now easier than ever. There might be not a lot of use cases at the moment, but even if you’re only flying X-Plane then that’s reason enough to consider it. The potential to use it with windows-games via Wine is promising as well. Following this guide helps you get the best out of Opentrack and DelanClip for enhanced gameplay immersion on macOS. Whether youโ€™re a flight sim enthusiast or just curious about improving your gaming experience, this setup is sure to provide an enhanced sense of control. If you encounter issues, revisiting the steps carefully and using the pre-built tools can help streamline the process.

FAQ - Frequently Asked Questions

1. What tools do I need to use IR Head-Tracking with X-Plane or windows games on macOS?
You need the Opentrack software, DelanClip and a suitable camera (e.g., DelanCam1 or any other IR-Camera known to work on macOS). For X-Plane you should use the plug-in included with Opentrack.

If youโ€™re able to run a windows game via Wine then chances are high that head-tracking will work with MacOpentrack as well.

2. How do I install Opentrack on macOS?
You can either build Opentrack from source if youโ€™re familiar with the development process around cmake or refer to the pre-built binaries linked in the article for an easy setup.

3. Can I use Opentrack with X-Plane on macOS?
Yes, you can use Opentrack with X-Plane by installing a plugin that bridges the connection between the head-tracking software and the flight simulator.

4. Do I need to build Opentrack from source, or are there pre-built binaries available?
Building Opentrack from source is one option, but the author of this article also provides pre-built binaries, which simplify the installation process significantly.

5. How can I adjust the head tracking settings for the best performance?
Use Opentrackโ€™s interface to fine-tune settings such as sensitivity, axis mapping, and filtering options to ensure smooth and responsive head tracking.

6. Why is the DelanCam1 camera recommended?
The DelanCam1 camera is designed to be compatibile across many devices and system, thanks to its versitality it is an easy solution to head tracking on any system!

Want to read more?

Check out our related posts

Check our range of IR Trackers

iR tracker is the way to go!