[UNOFFICIAL] Running BMS on Linux/WINE with opentrack HOWTO
-
After days of struggle to get BMS with opentrack running properly under Wine on Linux I’ve decided to put all the info I have in one place in form of HOWTO:
It’s crude, probably needs some work, esp on matter of wording/clarity, but here it is nonetheless.
I hope at least some of this may save some pains for other folks that might try to use BMS under LinuxDISCLAIMER: Running Falcon BMS on platform other than Windows was never supported and is never guaranteed to work. It may or might not.
Thus said those of us who for whatever reason are willing to try there are some good news, in state as for early 2021 it’s doable to run BMS on Linux with WINE.
Late 2023 update: BMS 4.37 up to update 3 should work just fine with some minor tweaksThis HOWTO is a compilation of info from many posts spread across BMS subforas and my personal experience. Many thanks to all the great dudes that shared bits of knowledge they have.
My setup is based on Fedora Workstation (GnomeShell/Wayland session), but in most parts should apply to other distros and DEs as well, with some obvious differences like package names. I assume reader knows basic things, like how to search and install a packages both from repositories and local drive in distro of his/her choice or edit text files. 4.37 updates were tested with Fedora 38 and Wine 8.19 was used.
I prefer to install each app in separate wineprefix, but keep all the installed games in one place. So I’ve made a directory, lets call it ~/WINE_Games mapped it as drive E: in all wine prefixes, then i’ve used it to install all my games This way I can install some additional libs or tools, set some game-specific options, reset settings or reinstall just one game without breaking others, while keep all the game files easily accessible.
It’s not mandatory to use prefixes and have dedicated dir for installed apps but I think it’s most convenient way to manage programs installed under wine.Basic Falcon BMS install procedure:
Phase 1: System preparation- Install wine packages, BMS needs 64 bit wine, but for sake of other apps I also install 32bit version too.
- In case of installing 32bit wine install 32bit version of gstreamer1 with plugins and mesa/userspace gfx driver (in case of nvidias proprietary driver).
- Install winetricks (optional but handy). It makes managing wine installs way easier
- Create a directory to store installation files somewhere in $HOME_DIR, lets say ~/WINE_Files.
- Create a dir for your instaled games (optional, see comments on my setup above)
Phase 2: Prepare dedicated wineprefix for BMS install
It’s a good habit to install Windows programs in separate prefixes, this way you keep them separated and messing with one app setup wont break others- run winetricks and create new 64bit prefix, lets name it Falcon_BMS (optional)
- open winecfg and add drives mapped to dirs created in last two steps of phase 1, if you’ve created BMS prefix, run winecfg in that prefix
- (optional) in the same prefix open explorer, go to "My Computer/Control Panel/Game Controllers and check if there are no double entries for your controllers, one for old joystick driver one for evdev. if so, then disable unused entries according to your preferences. With recent releases I prefer to use evdev driver.
Linux talks with game controllers using two drivers (kernel modules): older js and newer evdev.
Evdev has few cool features (force feedback, autocalibration, ability to set deadzones and other advanced settings) it has some disadvantages:
there’s no ability to remap axis/buttons
fixing calibration data (if OS gets it wrong) is quite complicated and needs lengthy line of cryptic numbers for each of the joystick axis.
IIRC calibration data is not permanent across reboots and there’s no way to store calibration in the system other than a shell script that runs all those calibration commands each reboot. ('tho I might be wrong about that)
Wine apps will see two distinct devices, while pysically there’s just one. This may lead to confusion with button mapping where one joystick is selected, but apps “thinks” button was pressed on the other device.
If evdev works for you, I’d recommend to disable js and keep just this one active to avoid situation described above. - (requiered for BMS 4.37 and later) install external d3dx11_43 library using winetricks or via winecfg: add library rule *d3dx11_43: external (note the asterix, it’s important)
- install latest dxvk and and enable it in BMS wineprefix (optional).
DXVK is a DirectX D3D9, 10 and 11 to Vulkan wrapper, in most cases it gives nice performance boost. Easiest way to do so is to use winetricks “install Windows DLL library or component”. - (optional for Alternative Launcher) install .Net 4.6.2. It requires recent wine version (iirc 7.0 or later
*note: Under WINE 5.22 I had some issues with VirtualDesktop emulation. once enabled FBMS and winecfg failed to start. If possible avoid enabling it.
To recover from this situation use regedit and remove entries:
HKEY_CURRENT_USER/Control Panel/Software/Wine/Explorer/Desktops/Defalt= <deskwithxdeskheight>HKEY_CURRENT_USER/Control Panel/Software/Wine/Explorer/Desktop=Default</deskwithxdeskheight>
Phase 3: Install Falcon 4.0 and Falcon_BMS
- Put all the BMS and Falcon 4.0 (if F4.0 install is a digital copy) install files in install storage dir.
- Start explorer and run Falcon 4.0 setup. Compact install option is enough. Make sure explorer is running in desired wineprefix and installation points to desired drive (see my notes about prefixes and storage locations)
- Run BMS installer same as above (prefix and drive).
- enable ACO compiler (optional, for Radeon cards owners when mesa drivers and dxvk is used, most likely not needed when mesa is 20.2 or newer, where ACO is on by default for Vulkan).
ACO is alternate shader compiler for radv (radeon Vulkan driver from mesa), its should give shorter load times (reduced compilation time) and better FPS.
To enable ACO edit BMS desktop file: ~/.local/share/applications/wine/Programs/Benchmark\ Sims/Falcon\ BMS\ 4.35.desktop and add RADV_PERFTEST=aco flag in Exec line before WINEPREFIX flag
If your joystick needs calibration each reboot use jscal to calibrate stick, then jscal-store to save calibration data, then run jscal-restore before launching BMS
jscal also can be used to change of axis/buttons order.Opentrack installation and setup
Unfortunately there are not many opentrack packages for various Linux distros There’s one for arch, one for suse tumbleweed (albeit it lacks wine protocol support and thus is not usable for our purpose) and one for Ubuntu
Hopefully this can be improved, i’m trying to do proper packaging for Fedora, using suse spec file as base. My package installs fine but still needs some polishing.
If there’s opentrack package with wine support enabled for your distro install it just like any other app.If not that means you gonna need to compile opentrack from the source, it’s not that difficult, so no worries.
I tried to avoid using absolute pathnames. Few remaining cases are put in italics.
MAKE SURE YOU’VE CHANGED THEM TO MATCH YOUR SYSTEMOpentrack install from source:
- Install all the packages needed to compile and run opentrack:
List of dependences:
Fedora
git glibc libstdc++ libgcc gcc gcc-c++ glibc-devel.x86_64 glibc-devel.i686 cmake cmake-rpm-macros opencv-devel opencv procps-ng procps-ng-devel libevdev libevdev-devel eigen3 eigen3-devel double-conversion double-conversion-devel qt5-linguist qt5-qtbase qt5-qtbase-devel qt5-qtbase-gui qt5-qtbase-gui* qt5-qttools qt5-qtbase-private-devel qt5-qtserialbus qt5-qtserialbus-devel qt5-qtserialport qt5-qtserialport-devel wine*fonts wine-core wine-desktop wine-dxvk wine-filesystem wine-pulseaudio wine-systemd wine-openal wine-devel wine-devel.i686 wine-devel.x86_64 wine-alsa.i686 wine-core.i686 wine-devel.i686 wine-openal.i686 wine-pulseaudio.i686 libX11
UBUNTU/Mint/Neon and alike
dpkg --add-architecture i386 emacs-nox libprocps-dev unzip libc6-dev-i386 libqt5serialport5-dev libqt5webkit5-dev qttools5-dev libopencv-dev htop apt-file libeigen3-dev lib32stdc++-7-dev libevdev-dev fonts-wine libwine:i386 libwine-dev:i386 libwine-development:i386 libwine-development-dev:i386 wine-devel-i386:i386 wine-development:i386 wine-stable:i386 wine-stable-dev:i386 wine-stable-i386:i386 wine32-development:i386 wine32-development-tools:i386 fonts-wine libwine libwine-dev libwine-development libwine-development-dev wine-devel-i386 wine-development wine-stable wine-stable-dev wine-stable-i386 wine32-development wine32-development-tools
-
download optional sdks (both opensource) from GitHub (here destination dir is ~/Downloads ) :
-
Create temporary dir for opentrack sourcecode (here ~/tmp_builddir) and enter this dir
cd ~/tmp_builddir
- Clone aruco and opentrack git repositories:
git clone https://github.com/opentrack/aruco.git git clone https://github.com/opentrack/opentrack.git
extract downloaded SDK files:
tar -xvzf *~/Downloads*/onnxruntime-linux-x64-1.12.1.tgz unzip *~/Downloads*/XPSDK303.zip
- create build dir inside aruco dir:
mkdir ./aruco/build && cd ./aruco/build
- Configure via cmake and build aruco library
cmake .. cmake --build . make cd ../..
- export aruco lib, xplane an onn sdk path and opentrack install dir (here ~/opentrack )
export otdir=*~/opentrack/* export xplane_sdk_dir=*~/temp_builddir*/SDK/ export onnxruntime_dir=*~/temp_builddir*/onnxruntime/ export arucolib=*~/temp_builddir*/aruco/build/src/libaruco.a
- create build dir inside opentrack dir:
mkdir ./opentrack/build && cd ./opentrack/build
- Configure via cmake
cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DSDK_XPLANE="$xplane_sdk_dir" \ -DSDK_ARUCO_LIBPATH="$arucolib" \ -DONNXRuntime_DIR="$onnxruntime_dir" \ -DSDK_WINE=ON \ -DCMAKE_INSTALL_PREFIX="$otdir"
- compile code and install opentrack
make make install
- copy ONN lib to lib dir of opentrack
cp $onnxruntime_dir/lib/libonnxruntime.so.* $otdir/libexec/opentrack/
Opentrack setup
- start opentrack set your input method, options profiles etc…
- set output to Wine–Windows layer for Unix
- configure Wine protocol
select Wine (system) and provide path to BMS wineprefix (~/.wine if no prefix was created)
check ESYNC and FSYNC
select Both from protocol list - save all the settings in profiles
- make running BMS wih ESYNC/FSYNC enabled.
Edit BMS desktop file: ~/.local/share/applications/wine/Programs/Benchmark\ Sims/Falcon\ BMS\ 4.35.desktop
and add WINEESYNC=1 flag in Exec line before WINEPREFIX flag
Without it app won’t be able to detect headtracking input.
Fast QnA:
Falcon BMS - which release works under wine?- BMS releases that are known to work under wine are 4.33 and 4.35. BMS 4.34 starts but user might experience crashes most likely related to TTS.
Which WINE version to choose?
- For now, i’d stick with latest 5.x one can find (here 5.22). Some couldn’t even make BMS start with 6.x releases. For me BMS itself worked just fine, but opentrack didn’t (wrapper process crashes).
Where can I obtain WINE?
- First place to look are your distro repositories. Also if distro of your choice exposes results of their build system (like Fedoras http://koji.fedoraproject.org) it’s a good source too
- Another good alternate source for many distros would be winehq wiki download section https://wiki.winehq.org/Download
What is a wine prefix?
- Wineprefix is kind of separate windows instance. It lets you create separate install with its own settings for each of your apps. To run an wine app in given prefix put “env WINEPREFIX=<path_to_prefix>” on the beginning of wine command or use winetricks.
Prefixes created with winetricks are stored in ~/.local/share/wineprefixes directory.
Changelog:
- 2021-03-31 - inital version
- 2021-03-31 - added: warning about VirtualDesktop Emualation, changelog
- 2021-03-31 - added: opentrack build dependences - Ubuntu</path_to_prefix>
- 2022-08-16 - enchanced opentrack build instructions with optional aruco and neuralnet trackers and
xplane plugin. - 2023-11-01 external D3D11_43 lib step for BMS 4.37 and optional .Net 4.6.2 install needed for AL…
-
Reserved for FAQ
-
Gents please read and post comments. I guess this how to might need some extra work, especially on language side. If there’s anything that needs rewording, extra clarification or anything else pls let me know.
I’ll also try to keep this post up to date with latest info. -
Thanks for this really useful guide. I’m trying to get a list of dependencies for Ubuntu together.
One thought - it might be worth mentioning how to get the Alt Launcher working?
winetricks –force dotnet48 should do the trick…
-
Thanks rubbra, I’ve never managed to make AL working, 'tho I didn’t try very hard. I’ll try it in spare moment and add to the guide.
List of dependences for for different linux distros would be fantastic.
In perfect world, opentrack would be packaged for each major distro It’s not that difficult and it automates building process as a bunus, just for each distro there has to be somebody who’d step up. -
Ubuntu deps: (this is from 20.04, but should be the same for most versions)
apt install build-essential wine dxvk dxvk-wine64-development libwine libwine-dev libwine-development libwine-development-dev wine64-development wine64-development-preloader wine64-development-tools wine64-preloader wine32-tools winetricks wine32 wine32-development wine32-development-preloader wine32-preloader libv4l-dev
If you get an error when building that looks a bit like:
format elf32-i386 (opentrack-wrapper-wine.wSYB85.o) is not supportedthis is because you have the wine64-tools installed not wine32-tools (so you end up trying to link a 64 bit executable with a 32 bit library)
-
What about opencv, qt5 and libevdev-development? First two are critical. Evdev headers are required for evdev output.
dxvk shouldn’t be nessesary for opentrack. -
You can find most of the needed dependencies in my ubuntu cloud init script that I posted here earlier.
Cheers, uwe
-
Thanks hoover and rubbra, Ubuntu deps added.
-
This post is deleted! -
WINESYNC=1 - that’s not something I have enabled, open track works fine. I’ve tried setting it, no observable difference.
Also, emacs-nox? Is that really a build dep? (No one should have to install emacs! )
Sent from my iPhone using Tapatalk
-
It’s WINEESYNC not WINESYNC, another flag is WINEFSYNC. It corresponds with settings in opentrack wine plugin. In my case that was the key to get headtracking working, without this flag BMS nor IL2 couldn’t detect opentrack. If it wasn’t nessesary for you, I guess it might be something to do with how WINE is configured/compiled in different distros.
Some more info here:
https://github.com/ValveSoftware/Proton/issues/1722#issuecomment-749061952 -
Sorry, yes, mobile phone fingers mis-typing it on here.
I’ve tested with winehq builds and Ubuntu releases, I don’t seem to need any extra env variables for opentrack to work.
Sent from my iPhone using Tapatalk
-
Also, emacs-nox? Is that really a build dep? (No one should have to install emacs! )
How could you want to live without an emacs installation on your Unix system? The mind, it is boggled
All the best,
Uwe
-
This post is deleted! -
Excuse me while I go load my supersoaker…
You can always do
M-x vi-mode
in emacs if you must
All the best, Uwe
-
This post is deleted! -
Guys, friendly banter is nice, but keep this thread informative. Let it be good source of info for those who struggle to run our beloved sim on the OS of their choice.
BTW It seems recommended wine version might be bumped to 6.0 maybe a bit higher. I need to upgrade it release by release and retest if opentrack wine wrapper is still working.
Hopefully it also enable AlternateLauncher as .NET 4.8 was broken under WINE 5.18-5.22.P.S.
Would somebody using Ubuntu or other distro, test this procedure to make sure it works for anybody else than me?
Once proven we might ask to make it sticky. -
Has anyone else encountered this from opentrack:
[ WARN:0] global ../modules/videoio/src/cap_v4l.cpp (998) tryIoctl VIDEOIO(V4L2:/dev/video0): select() timeout. ```Appears to have started only today, since a package upgrade (incl. kernel), and occurs when opentrack tries to open the camera at anything other than 30Hz. My headtracking knowledge is extremely limited, but running at 30Hz does work, in some sense of the word, but it's patchy at best, and rarely returns to the centre. It's the same build of opentrack as I've using for several weeks - hoover's build, in fact - and also affects my own build. Very strange! (I appreciate this isn't a general Linux support thread, but as this is about headtracking on Linux, if you experienced/wise folk have a solution it might be something that ends up in the FAQ - I can delete these comments later)
-
Here I’m running 5.11.10, cam is PS3 EYE
1415:2000 Nam Tai E&E Products Ltd. or OmniVision Technologies, Inc. Sony Playstation EyeOpentrack running @75FPS no problem. My first guess would kernel update. Could you boot older one and see if problem persists?
BTW confirmed, it’s WINE 6.3 that breaks opentrack, so if there are no reports of issues with v6.2, then i think it might be considered last known good version of wine for BMS and other sims.