top of page

Controllers & retro sims part 11: The WinMM problem

18 hours ago
5 min read

A TM Warthog throttle.

This article will be taking a look the problems associated with games that use the legacy WinMM library for joystick support. This games have had particular problems under the latest versions of Win10/11 rendering them unplayable with modern controllers.


This article will be explaining the problem and a solution to enable full HOTAS support for these games.


In order to help understanding, the problem and solutions will be broken down into smaller problems and solutions, working backwards from the game to physical controllers. The complete solution is presented, before an optimised solution is discussed. Finally, the role of device hiding will be covered.


Contents



The problem


Windows Multimedia API (WinMM) was first released in October 1991, as part of Windows 3.0 with Multimedia Extensions 1.0. With the release on Win95 in August 1995 it transitioned into the 32-bit WinMM library.


DirectX was released soon after in September 1995 as the Windows Game SDK (DirectX v1.0). However not all games released around this time would use DirectX and some would only support the existing WinMM library.


Fast-forward to the present day and with modern multi-controller HOTAS and DirectInput devices, the games relying on the WinMM library will either fail to recognise modern controllers or even freeze or hang during startup.


The WinMM library works with the legacy style gameport controllers. However modern PCs not longer have a gameport and solutions for using these controllers usually involves converting them into a USB device.


Trying to fly these flight sims without a joystick or HOTAS becomes rather difficult and not at all intuitive.


The WinMM problem/solution


The first problem is to get the WinMM library to work with a USB controller. It would be preferable if it were a DirectInput device (which joysticks/HOTAS are), but any controller would be better than nothing.


When looking at replacement WinMM libraries or WinMM wrappers, most are designed to fix issues with the multimedia/MIDI components and there are few, if none, specifically designed to fix joystick issues.


However, a different approach provides a solution. XInput was the controller library developed for the XBox in December 2005 and integrated into DirectX in April 2006 as XInput 1.1.


XInput in a simpler library than DirectInput and provides a controller library for XInput controllers like the XBox 360 controller. Games must support XInput in order to use XInput libraries. MicroSoft made the 360 controller both an XInput and DirectInput device to provide DirectInput compatibility, however customisation was often limited.


The customisation issue resulted in various open source projects to improve the situation with DirectInput mapping and some would go on to provide support for WinMM. Two such projects are:


  • Xidi, a DirectInput interface for XInput controllers, created by Samuel Grossman.

  • XInput Plus, a tool which performs a setup of an XInput device, created by 0dd14lab.


This provides us with a WinMM wrapper/library that is compatible with an XInput controller, as shown below:


WinMM solution.

The XInput problem/solution


The next problem is now to create an XInput controller. Fortunately both Xidi and XInput Plus require a logical XInput controller, this can be:


  • A physical XInput controller, e.g. an XBox 360 controller.

  • A virtual XInput controller.


This means a method is needed to convert a DirectInput joystick/HOTAS into a virtual XInput controller. Fortunately such an open source project exists, the ViGEm Bus Driver.


ViGEm Bus Driver is a Windows kernel-mode driver emulating well-known USB game controllers, created by Benjamin Höglinger-Stelzer.


ViGEm Bus Driver does not provide a configuration tool, so for such a tool, other open source projects are required. Two such projects are:


  • XOutput, created by Ármin Csutorás.

  • x360ce, created by the x360ce team.


The above tools were primarily designed to map a single DirectInput device to a virtual XInput device, for those with a single DirectInput device this may be sufficient, as shown below:


XInput solution.

The multiple controller problem/solution


The XOutput and x360ce tools in combination with the ViGEm Bus Driver, seems to solve the problem. However, these tools do not work well with multiple DIrectInput devices.


There can be freezes or a loss of response with one or more of the DirectInput controller. Fortunately the logical DirectInput device used by XOutput or x360ce can be:


  • A physical DirectInput device.

  • A virtual DirectInput device.


The final problem and solution is to convert multiple DirectInput devices into a single virtual DirectInput device. This issue has already been encountered many times and the solution is to use vJoy and Joystick Gremlin, as has been discussed previously, [6][7][8], and shown below:


Multiple controller solution.

The complete solution


The individual solutions can now be combined into a single workflow, converting multiple modern joystick/HOTAS devices into a device which can be supported by a WinMM wrapper, used by the game:


Complete solution.

This is a complex workflow, but it proves WinMM can work with multiple modern HOTAS controllers. However, with many 'moving parts'/components, more things can go wrong. Can this solution be optimised to make it simpler and more robust?


The optimized solution


The complete solution above relies in WinMM libraries/wrappers that cannot be changed, but the multiple DirectInput devices converted to a single XInput device can be simplified, with a single tool, GremlinEx (GEX), created by muchimi.


From the GitHub repository:

GremlinEx (GEX) is a universal controller integrator: it allows you to take input from multiple hardware devices from different manufacturers connected to a local machine, or a remote machine, such as joysticks and HID controllers, OSC (Open Sound Control), MIDI, Keyboard and mouse inputs and map them to virtual outputs like VJOY, or keyboard or mouse output, convert text to speech and play sounds. It can send output to a game or another process.

GremlinEx extends the original Joystick Gremlin and allows multiple DirectInput devices to be mapped to a single XInput device using the ViGEm Bus Driver, used in the complete solution. This drastically simplifies the workflow and the number of 'moving parts'.


However, the following points should be noted:


  • GremlinEx is still very much a work in progress with continuous releases of varying robustness. Although GremlinEx seems to function reliably during gaming, exceptions and faults should be expected when configuring devices. Since configuration is an initial 'one and done' task, this should be considered a fairly minor issue.


  • GremlinEx uses the older Joystick Gremlin release 13 style of configuration. Those familiar with the release 14/15 style will need to adapt to this older style.


Utilising GremlinEx, the optimized solution is shown below:


Optimized solution.

A place for (Hid) hiding


So far the role of device hiding has not been discussed with the compete or optimised solution we may have the following devices present:


  • Physical DirectInput controllers.

  • Virtual DirectInput controller.

  • Virtual XInput controller.


Which of these devices (if any) should be visible through a device firewall like HidHide? The answer is game specific and is best explained with examples:


F22 Raptor

F22 Raptor (NovaLogic)


F22 Raptor is very robust and indifferent to additional devices being present. It seems to ignore both DirectInput and XInput devices. This means that a HidHide device firewall isn't required and can be omitted. The optimised solution remains unchanged.


iF-22

iF-22 (Interactive Magic)


iF-22 is the exact opposite of F-22 Raptor. If any DirectInput or XInput devices are detected it will hang during startup. iF-22 requires a HidHide device firewall to hide all devices, both physical and virtual.



In order for iF-22 to start and work with controllers, GremlinEx and the Xidi libraries should be allowed to see through the device firewall with all devices hidden from iF-22. The affected part of the optimised solution is shown below:


iF-22 solution with HidHide

Finally...


Credit and thanks go to the following individuals and teams without which these old sims would never work on later Windows systems:


  • Samuel Grossman for Xidi.

  • 0dd14lab for Xinput Plus.

  • Benjamin Höglinger-Stelzer for ViGEm Bus Driver.

  • Ármin Csutorás for XOutput.

  • The team behind x360ce.

  • muchimi for GremlinEx.


Good hunting!

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

Drop Me a Line, Let Me Know What You Think

Thanks for submitting!

© 2035 by Train of Thoughts. Powered and secured by Wix

bottom of page