It's a nice pad with precise sticks and a switch for DirectInput mode where it supports force feedback effects on old games, which the original Microsoft pad is incapable of. Vibration effects in XInput mode however are kinda broken.
- To XInput mode or the gamepad is configured using the Logitech Profiler software. DirectInput is an older input standard for games on the Windows operating system.
- XInput is an API that allows applications to receive input from the Xbox Controller for Windows. Controller rumble effects and voice input and output are supported. This topic provides a brief overview of the capabilities of XInput and how to set it up in an application. It includes the following.
- Note: Whether you're running Windows 10 or an older version of Windows, if the blue screen doesn't allow you to boot to Windows to try the fixes listed below, boot to Safe Mode instead and perform.
XInput is an API that allows applications to receive input from the Xbox Controller for Windows. Controller rumble effects and voice input and output are supported.
This topic provides a brief overview of the capabilities of XInput and how to set it up in an application. It includes the following:
- Introduction to XInput
- Using XInput
Introduction to XInput
The Xbox console uses a gaming controller that is compatible with Windows. Applications can use the XInput API to communicate with these controllers when they are plugged into a Windows PC (up to four unique controllers can be plugged in at a time).
What Is Xinput Mode
Using this API, any connected Xbox Controller can be queried for its state, and vibration effects can be set. Controllers that have the headset attached can also be queried for sound input and output devices that can be used with the headset for voice processing.
The Xbox Controller
The Xbox Controller has two analog directional sticks, each with a digital button, two analog triggers, a digital directional pad with four directions, and eight digital buttons. The states of each of these inputs are returned in the XINPUT_GAMEPAD structure when the XInputGetState function is called.
The controller also has two vibration motors to supply force feedback effects to the user. The speeds of these motors are specified in the XINPUT_VIBRATION structure that is passed to the XInputSetState function to set vibration effects.
Optionally, a headset can be connected to the controller. The headset has a microphone for voice input, and a headphone for sound output. You can call the XInputGetAudioDeviceIds or legacy XInputGetDSoundAudioDeviceGuids function to obtain the device identifiers that correspond to the devices for the microphone and headphone. You can then use the Core Audio APIs to receive voice input and send sound output.
Using XInput is as simple as calling the XInput functions as required. Using the XInput functions, you can retrieve controller state, get headset audio IDs, and set controller rumble effects.
D Input X Input
The XInput API supports up to four controllers connected at any time. The XInput functions all require a dwUserIndex parameter that is passed in to identify the controller being set or queried. This ID will be in the range of 0-3 and is set automatically by XInput. The number corresponds to the port that the controller is plugged into, and is not modifiable.
Each controller displays which ID it is using by lighting up a quadrant on the 'ring of light' in the center of the controller. A dwUserIndex value of 0 corresponds to the top-left quadrant; the numbering proceeds around the ring in clockwise order.
Applications should support multiple controllers.
Getting Controller State
Throughout the duration of an application, getting state from a controller will probably be done most often. From frame to frame in a game application, state should be retrieved and game information updated to reflect the controller changes.
To retrieve state, use the XInputGetState function:
Note that the return value of XInputGetState can be used to determine if the controller is connected. Applications should define a structure to hold internal controller information; this information should be compared against the results of XInputGetState to determine what changes, such as button presses or analog controller deltas, were made that frame. In the above example, g_Controllers represents such a structure.
Once the state has been retrieved in a XINPUT_STATE structure, you can check it for changes and get specific information about controller state.
The dwPacketNumber member of the XINPUT_STATE structure can be used to check if the state of the controller has changed since the last call to XInputGetState. If dwPacketNumber does not change between two sequential calls to XInputGetState, then there has been no change in state. If it differs, then the application should check the Gamepad member of the XINPUT_STATE structure to get more detailed state information.
For performance reasons, don't call XInputGetState for an 'empty' user slot every frame. We recommend that you space out checks for new controllers every few seconds instead.
In order for users to have a consistent gameplay experience, your game must implement dead zone correctly. The dead zone is 'movement' values reported by the controller even when the analog thumbsticks are untouched and centered. There is also a dead zone for the 2 analog triggers.
Games that use XInput that do not filter dead zone at all will experience poor gameplay. Please note that some controllers are more sensitive than others, thus the dead zone may vary from unit to unit. It is recommended that you test your games with several Xbox controllers on different systems.
Applications should use 'dead zones' on analog inputs (triggers, sticks) to indicate when a movement has been made sufficiently on the stick or trigger to be considered valid.
Your application should check for dead zones and respond appopriately, as in this example:
This example calculates the controller's direction vector and how far along the vector the controller has been pushed. This allows enforcement of a circular deadzone by simply checking whether the controller's magnitude is greater than the deadzone value. In addition the code normalizes the controller's magnitude which can then be multiplied by a game specific factor to convert the controller's position to units relevant to the game.
Note that you may define your own dead zones for the sticks and triggers (anywhere from 0-65534), or you may use the provided deadzones defined as XINPUT_GAMEPAD_LEFT_THUMB_DEADZONE, XINPUT_GAMEPAD_RIGHT_THUMB_DEADZONE, and XINPUT_GAMEPAD_TRIGGER_THRESHOLD in XInput.h:
Once the deadzone is enforced, you may find it useful to scale the resulting range [0.0..1.0] floating point (as in the example above), and optionally apply a non-linear transform.
For example, with driving games, it may be helpful to cube the result to provide a better feel to driving the cars using a gamepad, as cubing the result gives you more precision in the lower ranges, which is desirable, since gamers typically either apply soft force to get subtle movement or apply hard force all the way in one direction to get rd response.
Setting Vibration Effects
In addition to getting the state of the controller, you may also send vibration data to the controller to alter the feedback provided to the user of the controller. The controller contains two rumble motors that can be independently controlled by passing values to the XInputSetState function.
The speed of each motor can be specified using a WORD value in the XINPUT_VIBRATION structure that is passed to the XInputSetState function as follows:
Note that the right motor is the high-frequency motor, the left motor is the low-frequency motor. They do not always need to be set to the same amount, as they provide different effects.
Getting Audio Device Identifiers
What Is Xinput Modeling
The headset for an Xbox Controller has these functions:
- Record sound using a microphone
- Play back sound using a headphone
Use this code to obtain the device identifiers for the headset:
After you obtain the device identifiers, you can create the appropriate interfaces. For example, if you use XAudio 2.8, use this code to create a mastering voice for this device:
For info about how to use the captureId device identifier, see Capturing a Stream.
Getting DirectSound GUIDs (legacy DirectX SDK only)
The headset that can be connected to an Xbox Controller has two functions: it can record sound using a microphone, and it can play back sound using a headphone. In the XInput API, these functions are accomplished through DirectSound, using the IDirectSound8 and IDirectSoundCapture8 interfaces.
To associate the headset microphone and headphone with their appropriate DirectSound interfaces, you must get the DirectSoundGUIDs for the capture and render devices by calling XInputGetDSoundAudioDeviceGuids.
Use of the legacy DirectSound is not recommended, and is not available in Windows Store apps. The info in this section only applies to the DirectX SDK version of XInput (XInput 1.3). The Windows 8 version of XInput (XInput 1.4) exclusively uses Windows Audio Session API (WASAPI) device identifiers that are obtained through XInputGetAudioDeviceIds.
Once you have retrieved the GUIDs you can create the appropriate interfaces by calling DirectSoundCreate8 and DirectSoundCaptureCreate8 like this:
Raspberry Pi 2, Retropie 3.3.1 Wheezy SD image download (no update performed).
I have a Logitech F710 wireless. It has a switch between 2 different modes: D (DInput) and X (XInput). Depending on the switch position it is seen as different devices (usb disconnects and reconnects when switching):
lsusb with DInput:
dmesg with DInput:
lsusb with XInput:
dmesg with XInput:
Using DInput the joystick works perfectly in emulation station, mupen64 and scummvm but is not recognised by retroarch.
Retroarch says when starting a game (snes, gba, gbc):
Now I have no idea where retroarch gets this joystick identifier (udev, SDL?). It does not appear in dmesg or lsusb.
I did a recursive find in /opt and /home/pi grepping files for the string ‘F710’ and there is no config file mentioning an F710 controller (in DInput it should be: Logitech Logitech Cordless RumblePad 2). The configured joysticks are:
There are also these same 2 joysticks in the emulation station config file.
I have tried copying the file LogitechLogitechCordlessRumblePad2.cfg to another file with the name of the joystick that appears in retroarch error message (without blank and special characters) and I also tried changing the name of the joystick inside the file. This was unsuccessful. Is there any documentation on how retroarch gets the joystick name (here: Logitech F710 Gamepad (DInput) (1133/49689)) and how I can map that name to a config file?
With XInput it is worse:
Not only do I get the very similar message:
but also emulation station GUI cannot configure all buttons in XInput mode (in XInput, lower R and L buttons are actually axis and when pressing one of them it triggers the configuration of 3 consecutive buttons with (axis-,axis+,not defined). It can be circumvented by editing the config file manually if only I could find a nice description of the config file settings).
I have read somewhere in this forum that DInput does not work, but according to http://linuxhacksandfixes.blogspot.de/2013/02/the-logitech-f710-gamepad.html it seems DInput should work fine on Linux. Also DInput works perfectly in emulation station, mupen64plus, scummvm (and with jstest /dev/input/js0) and also works on my PCs (also Linux but on Intel) so it could also work for retroarch (in the worst case by using xboxdrv to expose it as xinput).
I must say also that I seem to remember a week ago using this controller succesfully in retroarch snes or gba/gbc. I cannot say for sure, but this is surprising since I have not changed/updated anything except editing these joystick configs (only after the problem arised) and configuring mupen64.
Thank you, thank you, thank you herbfargus!!! I’ve been looking and trying different steps for the last 3 days in order to get my F710 controller working properly. Even though I was able to get many games working through the controller by manually editing retroarch.cfg in the “all” folder, the hotkeys were definitely not behaving as advertised (hence making exiting without the keyboard next to impossible), changing to udev and reconfiguring the controller was definitely what I was after. I should now be able to ditch the keyboard and take this thing on the road…..
- The forum ‘Controller Configuration in RetroPie’ is closed to new topics and replies.