AlienFX SDK 5.2 User Guide
AlienFX SDK 5.2 User Guide
2
User Guide
Abstract
This is the software development kit (SDK) including features and
functions available for application developers to configure colored
lighting on AlienFX hardware platforms and/or platforms with attached
AlienFX-compatible devices to achieve various desired visual effects.
March 2019
Revisions
SDK
Version Released Comments
Version
2.0 5.2 March 6, 2019 • Clarified deprecated-managed DLLs and functions
• Changed development requirements to support latest version of
SDK
• Added FAQs and Troubleshooting appendices
The information in this publication is provided “as is.” Dell Inc. makes no representations or warranties of any kind with respect to the information in this
publication, and specifically disclaims implied warranties of merchantability or fitness for a particular purpose.
Use, copying, and distribution of any software described in this publication requires an applicable software license.
© March 2019 Dell Inc. All Rights Reserved. Dell, EMC, Dell EMC and other trademarks are trademarks of Dell Inc. or its subsidiaries. Other trademarks
may be trademarks of their respective owners.
Dell believes the information in this document is accurate as of its publication date. The information is subject to change without notice.
Table of Contents
Revisions.............................................................................................................................................................................2
1 Introduction ...................................................................................................................................................................5
1.1 Identification........................................................................................................................................................5
1.2 Purpose ..............................................................................................................................................................5
1.3 Scope ..................................................................................................................................................................5
2 Getting started ..............................................................................................................................................................6
2.1 SDK 5.2 contents ................................................................................................................................................6
2.2 System requirements for development ...............................................................................................................6
2.3 Library linking for development ...........................................................................................................................7
2.3.1 Explicit dynamic linking .......................................................................................................................................7
2.4 How Alienware AlienFX SDK works ...................................................................................................................7
2.5 “Hello World” with Alienware AlienFX SDK ........................................................................................................7
3 Application development guidelines .............................................................................................................................9
3.1 Deprecated functions ..........................................................................................................................................9
3.2 Location and positioning semantics....................................................................................................................9
3.3 Multithreading and command timing...................................................................................................................9
3.4 Plug and Play capabilities ...................................................................................................................................9
4 Function Reference ....................................................................................................................................................10
4.1 Overview ...........................................................................................................................................................10
4.2 LFX_Initialize ....................................................................................................................................................10
4.3 LFX_Release ....................................................................................................................................................10
4.4 LFX_Reset ........................................................................................................................................................11
4.5 LFX_Update......................................................................................................................................................11
4.6 LFX_UpdateDefault ..........................................................................................................................................11
4.7 LFX_GetNumDevices .......................................................................................................................................12
4.8 LFX_GetDeviceDescription ..............................................................................................................................12
4.9 LFX_GetNumLights ..........................................................................................................................................13
4.10 LFX_GetLightDescription .................................................................................................................................13
4.11 LFX_GetLightLocation ......................................................................................................................................14
4.12 LFX_GetLightColor ...........................................................................................................................................15
4.13 LFX_SetLightColor ...........................................................................................................................................15
4.14 LFX_Light .........................................................................................................................................................16
4.15 LFX_SetLightActionColor .................................................................................................................................16
1 Introduction
1.1 Identification
The Dell Alienware AlienFX software development kit (SDK) is intended for users who develop applications
for AlienFX hardware platforms and/or platforms with attached AlienFX compatible devices.
Note: Apps developed with AlienFX SDK 5.2 are backwards-compatible with systems using previous AlienFX
SDKs.
1.2 Purpose
The purpose of this document is to provide a detailed, programmatic outline of the features and functions
available in the Alienware AlienFX SDK. With this, an application developer can control the lighting for any
available Alienware AlienFX devices attached to the system. By gaining control of the Alienware AlienFX
ecosystem, an application may configure devices with colored lights to achieve various desired visual effects
in response to application request(s).
1.3 Scope
This document encompasses the available features and functions of the LightFX.dll library, including its
functions, dependent libraries, data and methods needed for manipulation of color lights in the system.
Note: AlienFX SDK 2.1 and lower, which were deployed with AWCC 4.x, are not supported for development.
2 Getting started
Warning: Do not distribute the above libraries with applications developed using Alienware AlienFX SDK.
Final releases of applications must use the LightFX.dll deployed with Alienware Command Center.
After identifying all the hardware, Alienware AlienFX waits for requests from the application through the
function exports provided by the AlienFX SDK. The functions can be as simple as LFX_Light, in which all the
decisions about state changes are done by the library, or as detailed as LFX_SetLightColor, which requires
an index to a valid device and a valid light to set the color value.
LFX_Initialize();
While this example simply sets the color and immediately exits (thus restoring the previous state), it also
demonstrates how easy it is to incorporate Alienware AlienFX support into an application. The light, update
loop could be performed alongside a regular application interval. As well, calls to LFX_Light can be tied to
events which are queued up and submitted to the hardware upon a call to LFX_Update. See the function
reference section within this document for more details on these functions and their parameters.
Additionally, the Alienware AlienFX hardware abstraction layer incorporates a command queue and a
command handler thread, which masks hardware latencies.
These hardware latencies vary by device, so the command handler monitors the performance of the hardware
and drops updates that take too long in order to maintain a tight window of software request to physical
change. Currently this window is set to 100 milliseconds, meaning if an update is in the command queue for
more than 100 milliseconds, it will be dropped to allow the hardware to catch up with software. This command
buffering approach ensures that the core Alienware AlienFX functions (LFX_Light, LFX_SetLightColor,
LFX_Update) do not block the main application thread.
Note: If commands are queued longer than 100 milliseconds, they will not be applied to the hardware.
4 Function Reference
4.1 Overview
All unmanaged Alienware AlienFX library functions are exported as C-language, and all return LFX_RESULT
(type defined as unsigned integer). The following sections outline the minimum mandatory set of functions
available in a compliant Alienware AlienFX library.
4.2 LFX_Initialize
This function initializes the Alienware AlienFX system. It must be called prior to calling other library functions.
If this function is not called, the system will not be initialized, and the other library functions will return
LFX_ERROR_NOINIT or LFX_FAILURE.
Syntax:
LFX_RESULT LFX_Initialize();
Parameters:
None
Inputs:
None
Outputs:
None
Returns:
LFX_SUCCESS if the system is successfully initialized, or was already initialized
LFX_FAILURE if the initialization fails
LFX_ERROR_NODEVS if the system is initialized, but no devices are available
4.3 LFX_Release
This function releases the Alienware AlienFX system, freeing memory and restores the system to its initial
state. It may be called when the system is no longer needed.
Plug-and-Play Note: An application may choose to release the system and reinitialize it again, in response to
a device arrival notification. Doing so will account for new devices added while the application is running.
Syntax:
LFX_RESULT LFX_Release();
Parameters:
None
Inputs:
None
Outputs:
None
Returns:
4.4 LFX_Reset
This function sets all lights in the Alienware AlienFX system to ‘off’ or uncolored state. It must be noted that the
change(s) to the physical light(s) does not occur immediately. The change(s) occurs only after a call to the
LFX_Update function. For example, to disable all the lights, call LFX_Reset followed by LFX_Update.
Syntax:
LFX_RESULT LFX_Reset();
Parameters:
None
Inputs:
None
Outputs:
None
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NODEVS if there are no devices available to reset
LFX_SUCCESS if the reset is successful
4.5 LFX_Update
This function updates the Alienware AlienFX system by submitting any state changes to the hardware.
Syntax:
LFX_RESULT LFX_Update();
Parameters:
None
Inputs:
None
Outputs:
None
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NODEVS if there are no devices available to reset
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the update is successful
4.6 LFX_UpdateDefault
This function updates the Alienware AlienFX system by submitting any state changes to the hardware, as well
as setting the appropriate flags to enable the updated state to be the new power-on default state.
Syntax:
LFX_RESULT LFX_UpdateDefault();
Parameters:
None
Inputs:
None
Outputs:
None
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NODEVS if there are no devices available to reset
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.7 LFX_GetNumDevices
This function provides the number of Alienware AlienFX devices attached to the system.
Syntax:
LFX_RESULT LFX_GetNumDevices (unsigned int* const numDevices);
Parameters:
Inputs:
None
Outputs:
Populates an unsigned integer with the current number of devices attached
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NODEVS if there are no devices available to reset
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.8 LFX_GetDeviceDescription
This function gets the description and type of a device attached to the system.
Syntax:
Parameters:
Inputs:
Accepts an index to the device
Outputs:
Populates a character array with the indexed device’s description
Populates an unsigned short with the device type
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NODEVS if there are no devices at the index
LFX_ERROR_BUFFSIZE if the character array provided was too small
LFX_FAILURE if some other error occurred
LFX_SUCCESS If the function is successful
4.9 LFX_GetNumLights
This function returns the number of Alienware AlienFX lights attached to a device in the system.
Prototype:
LFX_RESULT LFX_GetNumLights(const unsigned int devIndex,
unsigned int* const numLights);
Parameters:
Outputs:
Populates an unsigned integer with the current number of lights attached to the device at the given
index
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NODEVS if there are no devices at the index
LFX_ERROR_NOLIGHTS if no lights are available at the device index provided
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.10 LFX_GetLightDescription
This function gets the description of a light attached to the system.
Syntax:
LFX_RESULT LFX_GetLightDescription(const unsigned int devIndex,
const unsigned int lightIndex, char* const lightDesc,
const unsigned int lightDescSize);
Parameters:
Inputs:
Accepts an index to the device
Accepts an index to the light
Outputs:
Populates a character array with the indexed light’s description
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NODEVS if there are no devices at the index
LFX_ERROR_NOLIGHTS if no lights are available at the device index provided
LFX_ERROR_BUFFSIZE if the character array provided was too small
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.11 LFX_GetLightLocation
This function gets the location of a light attached to the system.
Syntax:
LFX_RESULT LFX_GetLightLocation(const unsigned int devIndex,
const unsigned int lightIndex, PLFX_POSITION const lightLoc);
Parameters:
Inputs:
Accepts an index to the device
Accepts an index to the light
Outputs:
Populates an LFX_POSITION structure with the indexed light’s location
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NODEVS if there are no devices at the index
LFX_ERROR_NOLIGHTS if no lights are available at the device index provided
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.12 LFX_GetLightColor
This function gets the color of a light attached to the system. This function provides the current color stored in
the active state. It does not necessarily represent the color of the physical light. To ensure that the returned
value represents the state of the physical light, call this function immediately after a call to LFX_Update.
Syntax:
LFX_RESULT LFX_GetLightColor(const unsigned int devIndex,
const unsigned int lightIndex, PLFX_COLOR const lightCol);
Parameters:
Inputs:
Accepts an index to the device
Accepts an index to the light
Outputs:
Populates an LFX_COLOR structure with the indexed light’s color
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NODEVS if there are no devices at the index
LFX_ERROR_NOLIGHTS if no lights are available at the device index provided
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.13 LFX_SetLightColor
This function submits a light command into the command queue, which sets the current color of a light to the
provided color value. This function changes the current color stored in active state since the last reset. It does
not immediately update the physical light settings, instead requires a call to LFX_Update.
Syntax:
LFX_RESULT LFX_SetLightColor(const unsigned int devIndex,
const unsigned int lightIndex, const PLFX_COLOR lightCol);
Parameters:
Inputs:
Accepts an index to the device
Accepts an index to the light
Accepts a pointer to an LFX_COLOR structure
Outputs:
None
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NODEVS if there are no devices at the index
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.14 LFX_Light
This function submits a light command into the command queue, which sets the current color of any light
within the provided location mask to the provided color setting. Like LFX_SetLightColor, these settings are
changed in the active state and must be submitted with a call to LFX_Update. Location mask is a 32-bit field,
where each of the first 27 bits represents a zone in the virtual cube representing the system. The color is
packed into a 32-bit value as ARGB, with the alpha value corresponding to brightness.
Syntax:
LFX_RESULT LFX_Light(const unsigned int locationMask,
const unsigned int colorVal);
Parameters:
Inputs:
Accepts a 32-bit location mask.
Accepts a 32-bit packed color value
Outputs:
None
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NOLIGHTS if no lights were found at the location mask specified
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.15 LFX_SetLightActionColor
This function sets the primary color and an action type to a light. It changes the current color and action type
stored in the active state since the last LFX_Reset() call. It does not immediately update the physical light
settings, but instead requires a call to LFX_Update(). If the action type is a morph, then the secondary color
for the action is black.
Syntax:
LFX_RESULT LFX_SetLightActionColor(const unsigned int devIndex,
const unsigned int lightIndex, const unsigned int actionType,
const PLFX_COLOR primaryColor);
Parameters:
Inputs:
Accepts an index to the device, an index to the light, an action type (LFX_ACTION_MORPH,
LFX_ACTION_PULSE, LFX_ACTION_COLOR), and a new primary LFX_COLOR value
Outputs:
None
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.16 LFX_SetLightActionColorEx
This function sets the primary and secondary colors and an action type to a light. It changes the current color
and action type stored in the active state since the last LFX_Reset() call. It does not immediately update the
physical light settings, but instead requires a call to LFX_Update(). If the action type is not a morph, then the
secondary color is ignored.
Syntax:
LFX_RESULT LFX_SetLightActionColorEx(const unsigned int devIndex,
const unsigned int lightIndex, const unsigned int actionType,
const PLFX_COLOR primaryColor, const PLFX_COLOR secondaryColor);
Parameters:
Inputs:
Accepts an index to the device, an index to the light, an action type (LFX_ACTION_MORPH,
LFX_ACTION_PULSE, LFX_ACTION_COLOR), and two LFX_COLOR values
Outputs:
None
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.17 LFX_ActionColor
This function sets the primary color and an action type for any devices with lights in a location. It changes the
current primary color and action type stored in the active state since the last LFX_Reset() call. It does not
immediately update the physical light settings, but instead requires a call to LFX_Update(). If the action type is
a morph, then the secondary color for the action is black. Location mask is a 32-bit field, where each of the
first 27 bits represents a zone in the virtual cube representing the system. The color is packed into a 32-bit
value as ARGB, with the alpha value corresponding to brightness.
Syntax:
LFX_RESULT LFX_ActionColor(const unsigned int locationMask,
const unsigned actionType, const unsigned int primaryColor);
Parameters:
Inputs:
Accepts a 32-bit location mask
Accepts a 32-bit packed color value
Outputs:
None
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NOLIGHTS if no lights were found at the location mask specified.
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.18 LFX_ActionColorEx
This function sets the primary and secondary color and an action type for any devices with lights in a location.
It changes the current primary and secondary color and action type stored in the active state since the last
LFX_Reset() call. It does not immediately update the physical light settings, but instead requires a call to
LFX_Update. If the action type is not a morph, then the secondary color is ignored. Location mask is a 32-bit
field, where each of the first 27 bits represents a zone in the virtual cube representing the system. The color is
packed into a 32-bit value as ARGB, with the alpha value corresponding to brightness.
Syntax:
LFX_RESULT LFX_ActionColorEx(const unsigned int locationMask,
const unsigned actionType, const unsigned int primaryColor,
const unsigned int secondaryColor);
Parameters:
Inputs:
Accepts a 32-bit location mask
Accepts a 32-bit packed color value
Outputs:
None
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_NOLIGHTS if no lights were found at the location mask specified.
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.19 LFX_SetTiming
This function changes the current tempo or timing to be used for the next actions. It does NOT immediately
update the physical light settings, but instead requires a call to LFX_Update(). The timing is a value between
minimum and maximum tempo allowed for each device. If a value is lower than minimum or greater than
maximum is entered, then the value is readjusted to those extremes.
Syntax:
LFX_RESULT LFX_SetTiming(const int timing);
Parameters:
Inputs:
Accepts a 32-bit timing value
Outputs:
None
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_FAILURE if some other error occurred
LFX_SUCCESS if the function is successful
4.20 LFX_GetVersion
This function gets the version of the SDK installed in the system.
Syntax:
Parameters:
Inputs:
Accepts the bugger and buffer size
Outputs:
Populates a character array with the SDK version
Returns:
LFX_ERROR_NOINIT if the system is not initialized
LFX_ERROR_BUFFSIZE if the character array provided was too small
LFX_FAILURE if some other error occurred
LFX_SUCCESS If the function is successful
Note: If the LFX_GetVersion function is not found then the SDK version will be 1.0 or 2.x
A FAQs
Q: Where I can find SDK documentation, examples, header files and/or DLLs for testing?
A: The SDK is deployed in the system through AWCC installation. Please check location in SDK 5.2 content.
Q: Should the app installer distribute SDK’s DLLs and/or any SDK related items?
A: No. App installer should not distribute SDK’s DLLs or any SDK related items. By distributing the DLLs, the
app lighting implementation will not function.
Q: Can the development be done in old Alienware system with Alienware Command Center 4.x or older?
A: No. Only development using Alienware Command Center 5.2 or newer is supported.
Q: Does the development done using SDK 5.2 affect final users using old SDKs?
A: No. AlienFX SDK 5.2 is backwards compatible with old SDK versions.
B Troubleshooting
• The app worked on SDK v1.x and v2.x, but it is not working with v5.2
Check that the app is not deploying LightFX.dll as part of its files.
• Lighting is controlled in App is sending commands, but HW does not reflect the changes, or only
partially
o Is LFX_Update function being called? See function reference in LFX_Update.
o Is the app sending commands too fast and/or addressing each LED individually?
▪ SDK does guarantee that each command will affect the hardware, as some commands can be
discarded. If this is the case, the app developer should try to reduce the amount of commands
being sent by increasing delay between them or addressing all LEDs at once using LFX_Light
function. See section on Plug and Play and LFX_Light function for more info.
▪ Also, the developer should bear in mind that not all HW is the same when sending the commands.
It is not the same addressing individual LEDs in a system with 4 LEDS than in the system with 100+
LEDS