-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 13fef68
Showing
115 changed files
with
27,982 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
BasedOnStyle: Google | ||
IndentWidth: 4 | ||
UseTab: Never | ||
ColumnLimit: 160 | ||
|
||
Language: Cpp | ||
AccessModifierOffset: -4 | ||
BreakBeforeBraces: Custom | ||
BraceWrapping: | ||
AfterCaseLabel: true | ||
AfterClass: true | ||
AfterControlStatement: true | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
AfterObjCDeclaration: true | ||
AfterStruct: true | ||
AfterUnion: true | ||
AfterExternBlock: false | ||
BeforeCatch: true | ||
BeforeElse: true | ||
IndentBraces: false | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: true | ||
SplitEmptyNamespace: true | ||
ConstructorInitializerAllOnOneLineOrOnePerLine : false | ||
BreakConstructorInitializers: BeforeComma | ||
DerivePointerAlignment: false | ||
IndentCaseLabels: false | ||
NamespaceIndentation: All | ||
AlignConsecutiveAssignments: true | ||
AlignConsecutiveDeclarations: true | ||
AlignEscapedNewlines: Left | ||
AlignTrailingComments: true | ||
AlignOperands: true | ||
AllowShortFunctionsOnASingleLine: false | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AllowShortBlocksOnASingleLine: false | ||
ReflowComments: false | ||
SortIncludes: false | ||
IncludeBlocks: Preserve | ||
SortUsingDeclarations: false | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
ExperimentalAutoDetectBinPacking: false | ||
AllowAllParametersOfDeclarationOnNextLine: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
# Copyright (c) 2024 Advanced Micro Devices, Inc. All rights reserved. | ||
# | ||
# FLM SDK | ||
# | ||
|
||
cmake_minimum_required(VERSION 3.10) | ||
|
||
if(POLICY CMP0091) | ||
cmake_policy(SET CMP0091 NEW) | ||
endif() | ||
|
||
if(POLICY CMP0076) | ||
cmake_policy(SET CMP0076 NEW) | ||
endif() | ||
|
||
project(FLM) | ||
|
||
# ------------------------------ | ||
# Helper function for the build | ||
# ------------------------------ | ||
include(cmake/helperfunctions.cmake) | ||
|
||
# ----------------------------------- | ||
# Required for FLM | ||
# ----------------------------------- | ||
find_package(Threads) | ||
|
||
# ----------------------------------- | ||
# Set standard to c++17 | ||
# ----------------------------------- | ||
set(CMAKE_CXX_STANDARD 17) | ||
add_compile_definitions(_CMP_CPP17_=1) | ||
set_directory_properties(PROPERTIES VS_STARTUP_PROJECT flm) | ||
|
||
# ----------------------------------------------------------- | ||
# enable multi-threaded compilation | ||
# ----------------------------------------------------------- | ||
add_compile_options(/MP) | ||
add_compile_definitions(API_DX12) | ||
|
||
# ----------------------------------------------------------- | ||
# Check for Visual Studio build tooling | ||
# ----------------------------------------------------------- | ||
if(MSVC_TOOLSET_VERSION VERSION_LESS 142) | ||
message(FATAL_ERROR "Cannot find MSVC toolset version 142 or greater. Please make sure Visual Studio 2019 or newer installed") | ||
endif() | ||
|
||
# ----------------------------------------------------------- | ||
# generate the output binary in the /bin directory | ||
# ----------------------------------------------------------- | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/build/win/bin) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/build/win/bin/lib) # Dynamic DLL's | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/build/win/bin/lib) # Static Libs | ||
|
||
# ----------------------------------------------------------- | ||
# Helper for copy files | ||
# ----------------------------------------------------------- | ||
macro(FLM_copy_to_output executable source dest) | ||
add_custom_command(TARGET ${executable} PRE_BUILD | ||
# COMMENT "Copying ${source} -> ${dest}" | ||
COMMAND ${CMAKE_COMMAND} -E copy_if_different | ||
${source} | ||
${dest} | ||
) | ||
endmacro() | ||
|
||
|
||
# ----------------------------------------------------------- | ||
# Use solution folders. | ||
# ----------------------------------------------------------- | ||
set_property(GLOBAL PROPERTY USE_FOLDERS ON) | ||
|
||
# ----------------------------------------------------------- | ||
# CLI Application | ||
# ----------------------------------------------------------- | ||
add_subdirectory(source/flm_cli) | ||
|
||
# ----------------------------------------------------------- | ||
# Backend Lib | ||
# ----------------------------------------------------------- | ||
add_subdirectory(source/flm_backend) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
# frame latency meter | ||
The performance of a gaming system is critical to the overall gaming experience. One of the key factors that can impact the performance of a gaming system is the latency of the mouse response time. Measuring the latency of the mouse response time is important to ensure that the gaming system is performing optimally. However, traditional methods of measuring the latency of the mouse response time can be expensive and require additional hardware. | ||
|
||
To address this issue, a software-based latency meter has been developed that is designed to measure the system mouse response times in games. This software-based solution is free and easy to use, making it a highly disruptive alternative to expensive hardware-based solutions. | ||
|
||
![FLM](./documentation/media/FLM_2.PNG) | ||
|
||
Key Features: | ||
|
||
The software-based latency meter offers a range of key features that make it an ideal solution for measuring the latency of the mouse response time in games. These features include: | ||
|
||
- Measurement of the entire latency of the mouse response time, from the moment the mouse is moved to the moment the frame is displayed on the screen. | ||
- Includes options to use : Advanced Media Framework (AMF) capture codec, optimized for AMD GPU or Desktop Duplication (DXGI) screen capture codec for use on any GPU. | ||
- Runs on Windows platforms, making it accessible to a wide range of users. | ||
- Provides detailed statistics for latency and per frame measurements, which can be exported to a csv file for further analysis. | ||
- Allows users to configure hotkeys for enabling measurements, making it easy to use and customize. | ||
- Provides users to configure the screen capture region, making it easy to capture the relevant area of the screen. | ||
- User configurable keys to do sequenced frame captures to BMP files for capture codec diagnostics and validation | ||
|
||
The software-based latency meter offers a range of key features for measuring the latency of the mouse response time in games. By using AMF or DXGI desktop duplication for screen capture, the software-based latency meter is compatible with a wide range of gaming systems. It provides detailed statistics for per frame and latency measurements, which can be exported to a csv file for further analysis. With user-configurable hotkeys and screen capture regions, the software-based latency meter is easy to use and customize. Overall, the software-based latency meter is an ideal solution for users who want to measure the latency of the mouse response time in games without incurring additional costs. | ||
|
||
## Quick Start | ||
|
||
Requirements Windows 10 or higher with DX11 and DX12 support, games should run in windowed mode for DXGI capture codec to work. AMF can run in full screen mode and high frame rates. | ||
|
||
**Step 1:** Configure your primary monitor to run the game on. | ||
|
||
Set the monitor to use free sync or have it set to an appropriate refresh rate try starting at 60Hz first. | ||
|
||
**Step 2:** Run flm.exe | ||
|
||
To see the capture region bounding box, press right Alt key.<br> | ||
Note: The bounding box will only show if the game is running in window mode.<br> | ||
<br> | ||
Adjust the game scene placement so that the FLM capture region is situated in an area.<br> | ||
where the scene transitions from dark to bright when the mouse is moved horizontally.<br> | ||
|
||
**Step 3:** Run the game. | ||
|
||
Adjust the game scene placement so that the FLM capture region is situated in an area where the scene transitions from dark to bright when the mouse is moved horizontally. | ||
|
||
**Step 4:** Select start measurements key sequence (default is ALT+T). | ||
|
||
* Wait for the capture process to start, it may take a few seconds to start as FLM process data, you should see the mouse move left and right in rapid concession while the application records latency measurements. Some games may require you to press down on the mouse keys to move the mouse left and right. If the mouse movements are too small, adjust the scene location or change the mouse steps in flm.ini using "MouseHorizontalStep". | ||
|
||
* If you do not see any measurements or the measurements are slow, stop the measurements by pressing Alt+T and try another scene location with better contrast between left and right capture regions, if that fails review the adjust setting section for addition details on how to change the default settings. | ||
|
||
* By default, FLM starts in "RUN" work mode, in which the output shows latency[ms] and latency[frames] averages of 16 consecutive measurements. The current work mode can be changed for the current session via the settings dialog, or a new default work mode can be set by modifying the INI file | ||
|
||
fps = xxx.x | ................ | latency = xxx.x | frames = x.xxx | ||
|
||
* A running series of measurements will indicate the rate at which these latency measurements are occurring. If it is not moving or is slow - then stop the measurements (Step 5), change the game scene's location and retry. If you change the scene while the measurement is still running the average latency value will not be correct until it reaches a steady state value. | ||
|
||
**Step 5**: Select stop measurements and review the output. | ||
|
||
Start measurements.<br> | ||
fps = xxx.x | ................ | latency = xxx.x | frames = x.xxx<br> | ||
Stop measurements.<br> | ||
|
||
|
||
## To Build Project Solution Files | ||
|
||
### Requirements | ||
- VS2022 installed | ||
- CMake v3.10 or higher | ||
|
||
### Run this batch file once for setup in the build folder | ||
|
||
- vsbuild | ||
|
||
A build/win folder containing FLM.sln should have been generated<br> | ||
Open the solution file and build the project files. | ||
|
||
### Run this batch file to remove build/win and bin folders | ||
- vsclean | ||
|
||
### Adding your own capture codec | ||
The FLM backend code is designed to add additional capture codecs, look at the capture entry code flm_capture_context and use the samples flm_capture_amf and flm_capture_dxgi as guides to developing your own specialized capture codec. | ||
|
||
|
||
## Known Issues and Limitations | ||
|
||
### Desktop Capture codec (DXGI) performance | ||
* Desktop capture is too slow when monitors refresh rate is set too high > 144 Hz. | ||
Try setting the monitor refresh rate to 60 Hz while you get accustomed to how FLM works, then try higher rates. | ||
* Certain games may limit the utilization of desktop duplication screen capture, making the option to use the DXGI codec inoperable. | ||
* DXGI capture codec must be running on the primary display, else frame capture will be too slow. | ||
* The current capture codecs are processing SAD measurements using CPU and may be too slow on some PC. | ||
|
||
### No result shown | ||
* The default settings may not trigger latency measurements. Try adjustments to settings for ThresholdCoefficient and AVGFilter in the flm file. | ||
* FLM will not work using remote desktop connections. | ||
|
||
### Latency results shown are too high | ||
|
||
* When games are running at high frame rates FLM measurements show higher values then those measured by hardware devices. | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!python | ||
# | ||
# simple script to read version information from Compressonator\Header\Version.h | ||
# Usage | ||
# export WORKSPACE=<workspace-root> | ||
# set <var>=`python $WORKSPACE/frame_latency_meter/build/jenkins/get_version.py --major|--minor` | ||
# | ||
import os | ||
import argparse | ||
|
||
# Get full path to script to support run from anywhere | ||
scriptRoot = os.path.dirname(os.path.realpath(__file__)) | ||
|
||
# handle command line arguments | ||
parser = argparse.ArgumentParser(description='Get FLM version information') | ||
parser.add_argument('--major', action='store_true', default=False, help='Return value of MAJOR version string') | ||
parser.add_argument('--minor', action='store_true', default=False, help='Return value of MINOR version string') | ||
args = parser.parse_args() | ||
|
||
# initialize file for search | ||
gpaVersionFile = os.path.join(os.environ['WORKSPACE'], 'frame_latency_meter/source/flm_backend/version.h') | ||
gpaVersionData = open(gpaVersionFile) | ||
|
||
# get major, minor, and update values | ||
for line in gpaVersionData: | ||
if 'define VERSION_MAJOR_MAJOR ' in line: | ||
major = (line.split()[2]) | ||
if 'define VERSION_MAJOR_MINOR ' in line: | ||
minor = (line.split()[2]) | ||
|
||
#close file | ||
gpaVersionData.close() | ||
|
||
# print requested value | ||
if args.major: | ||
print (major) | ||
if args.minor: | ||
print (minor) |
Oops, something went wrong.