Commit Graph

634 Commits (079f67a7295a47eb2ca98a79f95ecf22dd17a5e1)

Author SHA1 Message Date
Lars Krämer 7cc76142f1 Tidy up DBus helper classes
make sure metadata is up-tp-date when switching players (WIP)
4 years ago
Lars Krämer 72b86b4371 Fix some weird behaviour with non-spotify media players
Add DBusMessage_wrap to wrap/hide some dbus_message_* calls
4 years ago
Lars Krämer 6484e09f01 Implement wrapper class for DBusMessageIter
Implement for_each-style helpers for common constructions
Reimplement most of the DBus message parsing in terms of these
4 years ago
Lars Krämer 4bf7a3f2f0 Make DBus signal handling more event-based 4 years ago
Lars Krämer 5850643db4 Change the media player functionality to allow changing active media
player
4 years ago
larskraemer a28931ef6b
General cleanup (#272)
* Cleanup unused struct fields, use uniform include guards
4 years ago
flightlessmango eafa62356b
Merge branch 'develop' into benchmark-percentages 4 years ago
jackun 8eba5e2ed2
[OpenGL] Use GL_R8 for font textures
Randomly getting squares with GL_ALPHA for some reason
4 years ago
Lars Krämer 0b29a7ea06 Remove conflict in render_imgui 4 years ago
Lars Krämer 329725c134 Move Log uploading; Cleanup 4 years ago
Lars Krämer 4101237fdd Move logging functionality into a class 4 years ago
jackun 5fe5ac5f3d
Build script and fixes for Steam Runtime SDK 4 years ago
jackun c63037efb5
Use 1-channel font textures; glyph ranges support; vulkan image descriptors and "helper" functions
* To save some memory, use just 1-channel alpha-only textures
* Add some sort of wider glyph ranges support
* Chop single-ish vulkan font image uploading function into separate reusable helper functions
* Use descriptor set for ImTextureID but probably use texture array and push constants for "fast-path" if need arises
4 years ago
jackun e0832c7e02
Re-add config file watch in case of IN_DELETE_SELF 4 years ago
jackun 068157f3d8
Fix cpu fallback temp sensor logic
Break the for loop either way so `path` still points to sensor module's hwmon folder.
4 years ago
jackun 62efa4acc4
[OpenGL] Simplify if check 4 years ago
jackun d0999ab01b
[OpenGL] Workaround: Merge version and shader strings for Feral games
FIXME: GLAD loads Feral's version of glShaderSource,
4 years ago
jackun 2db83f4e18
[OpenGL] Check if font texture is valid and regenerate if not 4 years ago
Lars Krämer 20221217d4 Frame-timing using chrono 4 years ago
Lars Krämer 22026cbc60 Create MesaClock class, use chrono classes for time points/durations 4 years ago
Kingsley McDonald 0e1fe708c8 make use of new float parsing function
i've also moved the input validation checks to the config parser, so that
warnings aren't displayed in the terminal output every time a benchmark is
run with an invalid percentile entry.
4 years ago
Kingsley McDonald 979c4d32ca oops! i didn't save changes from the merge conflict >.< 4 years ago
Kingsley McDonald aa77a351de implement configurable benchmark percentiles. 4 years ago
jackun 0d03b5a150
meson: use gnu_symbol_visibility argument
This uses a meson builtin to handle -fvisibility=hidden.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
4 years ago
FlightlessMango 118a105aa4 Check often if logUpdate has occured 4 years ago
FlightlessMango e957358786 Force a hw values update on log start 4 years ago
jackun 44060c2b80
Force blacklist re-check at certain points
Wine preloader that executed a non-blacklisted app may execute a blacklisted app,
or vice versa, and previous check applies to new app too.
4 years ago
FlightlessMango fbd60a102f Forgotten debugging in logging 4 years ago
FlightlessMango a9463ae06c Start logging after first update 4 years ago
FlightlessMango 0f171dbd9c Added labels to log csv file 4 years ago
jackun 03ec318d00
Make find_*_ptr function pointers static 4 years ago
jackun 2da02ee553
Try to limit exported symbols with --version-script 4 years ago
Alan Witkowski 61a443bd50
add .csv extension to log file and rename function that generates the log filename suffix 4 years ago
jackun 612d3b761d
Merge pull request #237 from larskraemer/float_parser
First implementation of custom float parsing
4 years ago
larskraemer ecd84c8cc0
Logging options (#234)
* Added config options for logging

* Documentation

* Log everything

* Add RAM/VRAM usage to the log

* add loggingOn-check for memory usage

* Always init GPU stats

* Move functions from logging.h to logging.cpp, remove params from writeFile
4 years ago
FlightlessMango 99cefe96a5 Created logging.cpp 4 years ago
jackun 66ddada43c
Fix `readlink` overloading for fortified musl
Issue #231
4 years ago
jackun 6887abbea8
Just <limits.h> 4 years ago
jackun edf9f95517
Use std::locale::classic with confiog file ifstream, just in case 4 years ago
FlightlessMango 916ef02eb2 Revert "Add readlink.c to meson"
This reverts commit 56933049d0.
4 years ago
FlightlessMango b614734ab6 Revert "Trying to fix issue #231 musl"
This reverts commit 01233e5f1f.
4 years ago
FlightlessMango 56933049d0 Add readlink.c to meson 4 years ago
FlightlessMango 01233e5f1f Trying to fix issue #231 musl 4 years ago
FlightlessMango 8f22ebae44 Also check for pci.ids in /usr/share/misc/ 4 years ago
FlightlessMango e2ec80d84e Upload log keybind setup 4 years ago
FlightlessMango 8d6ff5bd25 upload log functions 4 years ago
FlightlessMango 6a28a8f7f1 Track log files for current session 4 years ago
FlightlessMango 064c285f31 permit_upload and upload_log params 4 years ago
FlightlessMango f14c9a7587 Moved exec function in to logging.h 4 years ago
Lars Krämer 3421ad269a Use locale::classic 4 years ago
jackun 441f1d3f3f
Use std::locale::classic() in parse_float() 4 years ago
jackun d9a09670d8
Replace std::stoi with something that doesn't throw 4 years ago
jackun e1fb2fbf88
Parse floats in C locale, hopefully 4 years ago
Lars Krämer 4d22927776 Use a stringstream 4 years ago
Lars Krämer 01df8149ab sign bug 4 years ago
Lars Krämer b8571c27e2 First implementation of custom float parsing 4 years ago
FlightlessMango 8e34e752e5 Merge branch 'master' into develop 4 years ago
Kingsley McDonald 6178c5859c adjust benchHeight for 0.1% and fix percentages. 4 years ago
Kingsley McDonald 053a1d8a44 add 0.1% lows to the brief benchmark overlay 4 years ago
jackun 5ec6519832
Add `media_player_order` to set media player metadata order 4 years ago
Stephan Lachnit d956f60f86 remove old system nvml build option
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
4 years ago
FlightlessMango b9c00fc510 Check pci.ids without gpu_stats 4 years ago
FlightlessMango 38a78fa01e Fix logging window if bg alpha is 0 4 years ago
Rémi Verschelde f915d890f2 Fix -Wformat-security warning with GCC 10.1 4 years ago
FlightlessMango 71cbd66afb Fixing cpu temp for core 2 duo CPUs 4 years ago
FlightlessMango d41909321a More width fixing 4 years ago
FlightlessMango 0728d49a1d Fix width with no params 4 years ago
FlightlessMango df631a2343 Reduced width with io rw 4 years ago
FlightlessMango e9b1b70ebc Fixed nextRow for gpu_power 4 years ago
FlightlessMango 135f3a5009 Fixing compiler warnings and removing control 4 years ago
FlightlessMango 59268a34b3 Always do nextRow() with core_clock 4 years ago
FlightlessMango bc5d41f921 Changed IO rd/wr to rw 4 years ago
FlightlessMango 4a5e05c979 Trim gpuName from pci.ids 4 years ago
FlightlessMango 572ba69e3e More width fixing 4 years ago
FlightlessMango 816d6ca515 Fixing hud width issues 4 years ago
jackun b68f78028d
Fix "IO RD/RW" typo
Also micro-micro-micro optimization, probably: move READ/WRITE if statement before WRITE
as you'd probably find it more useful than just WRITE.
4 years ago
FlightlessMango 6d1ed9751d Changed default keybinds 4 years ago
Valters 40017bc1e6
Change blacklist type (#204)
* Set blacklist to std::vector<std::string>

Fix some strange crashes.

Co-authored-by: jackun <jack.un@gmail.com>
4 years ago
jackun 1495b1e88f
ifdef guard nvml header 4 years ago
jackun 953c8d0e0f
Add meson option `with_nvml` 4 years ago
jackun a236af66ee
Lock metadata mutexes in case they are cleared by inotify thread 4 years ago
jackun 467c53d22f
Keep track of notifier thread to make sure it exits before `notify_thread` struct is freed 4 years ago
jackun 31f9cce720
[COMMENTED] Make inotify monitor new per-app config file or if delete, the main config file again
Needs to be triggered by main config file change.
FIXME what if there's no config file?
4 years ago
jackun 2220cb9d74
Decouple `engine_version` from `fps` 4 years ago
jackun 16b05dfc5e
Show gpu core clock or power usage in 4th column or both on next row if both are enabled 4 years ago
jackun 91ccde4969
[blacklist] Add SocialClubHelper.exe
No much difference but at least doesn't spam log as much
4 years ago
FlightlessMango 3d503c9f29 Don't enable histogram with full param 4 years ago
jackun b837ce930e
[whitespace] fix indentation from `gpu_name` to `arch` 4 years ago
jackun 1f81889d1b
Show bitness in library loaders 4 years ago
FlightlessMango db151bb236 Add log_interval check to per frame log write 4 years ago
FlightlessMango 52989a727e Cleaning up for after change to log_interval 4 years ago
FlightlessMango d8727110b0 Replaced log_period env with log_interval param 4 years ago
FlightlessMango 128fbd4b88 Per frame logging use output_file and date 4 years ago
FlightlessMango 4bdd252393 Load 32bit libs if they exist with 64bit bin 4 years ago
Valters 6cebbba732
Always print blacklist info to STREAM 4 years ago
Valters 4721281952
Add LeagueClient{,UxRender} to blacklist 4 years ago
FlightlessMango 33a5ad6571 Format gpu_text and cpu_text in textColored 4 years ago
FlightlessMango dd1667bf3e Fixed typo 4 years ago
FlightlessMango 2d0ba9a076 Params to override cpu/gpu text 4 years ago
FlightlessMango 0e3508dcf0 Check if pci.ids was found 4 years ago
jackun 699de56fa1
[dbus] clear non-main players' metadata on dbus deinit 4 years ago
jackun 72602fab89
[dbus] remove missed exceptions; set dbus call timeout to 2 seconds 4 years ago
jackun c04658456a
Wider glyph ranges for custom font; media player text scaling with `font_scale_media_player` param 4 years ago
FlightlessMango c254347688 Use histogram in benchmark too 4 years ago
FlightlessMango ac926bbfd5 Added histogram param 4 years ago
jackun 15ed8df404
Fix keybinds init when building without X11 4 years ago
jackun 5ad67fe446
Remove unused vars 4 years ago
FlightlessMango 078617f999 Added param for engine version 4 years ago
FlightlessMango 0e396186a6 [OpenGL] Always use QueryDrawable 4 years ago
jackun ff48525313
Consolidated amdgpu file handles to a struct and add `gpu_power` param to show power usage for amdgpu/nvml 4 years ago
jackun 5c3c8a5ac9
Add nvmlDeviceGetPowerUsage import 4 years ago
jackun 9b595cef1a
[dbus] clear metadata on re-init; don't use exceptions 4 years ago
jackun 5057a47b05
Potential buffer overflow, use snprintf instead 4 years ago
jackun 159305bbc7
Use `display_time` instead of recalculating 4 years ago
FlightlessMango 357a819d67 Removed some debugging in logging 4 years ago
FlightlessMango 096fb626a3 Fixed logging date 4 years ago
FlightlessMango 1d375fd155 Removed crosshair 4 years ago
FlightlessMango 434aa04356 Fixed bench position even more 4 years ago
FlightlessMango 7f9bb2e6b8 Fixed mistake in bench positioning 4 years ago
FlightlessMango 54f83ee3d6 Corrected position and sizing for quick bench 4 years ago
jackun 613fa68491
Use `+` as keybind delimiter 4 years ago
FlightlessMango 22c25b6247 Fixo typo in quick benchmark 4 years ago
jackun c5bb35c10d
Merge branch '159' into develop 4 years ago
FlightlessMango 92b86ad8bf Added plot graph to quick benchmark 4 years ago
Valters 1afea91dab
Add multi hotkey 4 years ago
FlightlessMango 75f9128ce5 Redesigned logging, adding quick benchmark 4 years ago
FlightlessMango 0964f517b7 Change LogData previous to uint64_t 4 years ago
jackun d93a21589e
Find cpu temp sensor input by label or fallback to first `tempN_input` 4 years ago
FlightlessMango 927fee0f59 No need to add version for nvidia twice 4 years ago
FlightlessMango 2e1861ea09 Changed elapsedlog to int64_t 4 years ago
jackun 40255b62f9
Fix get_device_name, don't substr if no '[' in gpu name 4 years ago
jackun c25082b1dd
Fix blacklist array entries count 4 years ago
jackun 2622270e5c
Init remote control params even if blacklisted 4 years ago
jackun a8f01a75e6
Use std::array for blacklist
More annoying to add entries but maybe more streamlined
4 years ago
jackun a27ee0dc39
Generalize initial metadata error message 4 years ago
jackun d694a61d21
Add `media_player_name` and `media_player_color` params
Allows to set "main" media player and text color
4 years ago
jackun 6c2b00ffb7
Append driver version 4 years ago
jackun 768297b430
[editorconfig] Apply whitespace rules 4 years ago
FlightlessMango bc0a0aa53e No need to save deviceName for later 4 years ago
jackun 2308a4228a
Fix vulkan device name 4 years ago
jackun bb9721fe87
[OpenGL] Check if SRGB is enabled and Render ImGui in linear colorspace 4 years ago
FlightlessMango 31b01aab9f Uncommented most of prop.driverVersion code 4 years ago
FlightlessMango 1750c43716 No need to convert deviceID twice 4 years ago
FlightlessMango 848b296477 Display vulkan driver
Co-authored-by: Georg Lehmann <dadschoorse@gmail.com>
4 years ago
FlightlessMango f3422af562 Param gpu_name 4 years ago
FlightlessMango 1ddcc531ff Get device name from pci.ids and display it 4 years ago
FlightlessMango ed62155310 Parse pci.ids
Co-authored-by: jackun <jack.un@gmail.com>
4 years ago
FlightlessMango a2cc14f738 Get deviceID 4 years ago
jackun beee2b08c7
[OpenGL] Add glXSwapBuffersMscOML and disable XGetGeometry 4 years ago
jackun 9d1b548f69
Merge branch 'master' into develop 4 years ago
FlightlessMango 3f4949f593 Added top-center overlay position 4 years ago
FlightlessMango 03c9d1cd90 We don't need two vk_enum_to_str in shared_library 4 years ago
FlightlessMango 70d7ea4948 Add mangohud_version to shared_library 4 years ago
FlightlessMango 9cf6c502d2 Missing brackets for versions in render_imgui 4 years ago
FlightlessMango e170e64f9c [Params] Version option 4 years ago
FlightlessMango 0eaba7bb6c Removed obsolete license from params 4 years ago
FlightlessMango 5ee573730a Removed obsolete license from meson.build files 4 years ago
jackun 0ab53a1c06
Move MANGOHUD_PCI_DEV to config file param 'pci_dev'
Relax format requirements as long as it loosely resembles 'domain🚌slot.func' format.
4 years ago
FlightlessMango bff9958284 Changed pthreads to std::thread 4 years ago
Sporif c61d25da04 Simplify 'is_blacklisted' function 4 years ago
Sporif 1e1dcd3a98 Fix vulkan driver version shown for Nvidia and Intel on Windows 4 years ago
jackun 8b13f8db7c
Blacklist Final Fantasy XIV launchers 4 years ago
jackun 29e5c4e460
Show device's name and vulkan driver version 4 years ago
jackun 8b855e3251
Fix mul/div order when normalizing io stats to sample per second as `fps_sampling_period` is also an integer. 4 years ago
jackun d8264c485f
[OpenGL] Fixed version check mistakenly testing for GL 4.0+ instead of 3.2+ to enable ImGuiBackendFlags_RendererHasVtxOffset, leaving 3.2 contexts without it. (ocornut#3119, ocornut#2866, ocornut#2852) 4 years ago
jackun 22ee56def5
[OpenGL] Use 32bit font texture until someone figures out why 8-bit looks worse 4 years ago
jackun 0271aa6368
[OpenGL] Track threads with context, but might as well ignore glXMakeCurrent(NULL, NULL) calls probably 4 years ago
jackun 79e4c5223a
In C-only apps, std::cerr and friends can be uninitialized 4 years ago
jackun 934dc31e44
Add utility lib with dlsym hooking 4 years ago
jackun ebdaa901b9
Merge pull request #131 from Sporif/blacklist_v2
Blacklist: Add OpenGL and fix `mangohud steam`
4 years ago
Danilo Spinella b6340c832a Add include for dlopen flags, fix build on musl
RTLD_DEEPBIND is not defined on musl based systems, add a check
before using it.
4 years ago
Danilo Spinella fb64b2ae0e Add __ELF_NATIVE_CLASS to musl systems 4 years ago
Danilo Spinella 728fc9fe56 dbus: Add missing include 4 years ago
jackun 86f8ebed30
Trying to find XNVCtrl's display by iterating through 16 displays. 4 years ago
jackun 6caa4a5173
Try load XNVCtrl as "libXNVCtrl.so.0"
Seems not all distro symlink also to libXNVCtrl.so
4 years ago
Sporif 61ef9244e9 Disable dlsym hooking by default and fix LD_PRELOAD propagation to new processes
This allows `mangohud steam` to work
4 years ago
Sporif d1e90b5bec [OpenGL] Add blacklist functionality 4 years ago
Sporif c4a00704cf Separate out blacklist implementation 4 years ago
Georg Lehmann 1eca184157
Vulkan Overlay: Don't try to change the image layout to present twice
The render pass already does the transition.
The pipeline barrier is still needed to transfer the queue family ownership.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3740>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3740>
4 years ago
jackun efed107af6
[meson] check void* size once and better-ish xnvctrl checks 4 years ago
jackun cf5eb9e9a5
ifdef-guard dbus_info.h include 4 years ago
jackun ad0f010951
Don't print that nvmlDeviceGetHandleByPciBusId failed if it wasn't even called 4 years ago
jackun 723c6bedeb
Fix `init_x11` return value and X11/XNVCtrl logic checks 4 years ago
jackun 88188ee1da
[dbus] Generalize a bit more but still give Spotify special treatment, keep track of 'org.mpris.MediaPlayer2' service providers
Keeps and draws spotify's and other player's metadata separately.
Keep track of 'org.mpris.MediaPlayer2' service providers so when
a player that was the last metadata sender quits, we can stop
showing its metadata on overlay.
4 years ago
jackun 7e5afe96bb
Add dbus_message_get_sender to dbus loader 4 years ago
jackun bb4b78ada0
[OpenGL] Spam terminal a little less with version strings 4 years ago
jackun f35e49defa
[OpenGL] Merge "shared" files back to imgui_hud.cpp 4 years ago
jackun b40fb95a04
[OpenGL] Better version parsing and fix gl version checks for vertex arrays 4 years ago
FlightlessMango d6314da8b2 Merge branch 'master' into develop 4 years ago
jackun 2383ba26fc
Tell GCC to stop exporting static library functions
Should fix crashes where games using Dear ImGui link to ours.
4 years ago
flightlessmango 0f695d76c7
Merge pull request #119 from andrealmeid/log_to_mem
Write log in a memory buffer and periodically write it in disk
4 years ago
jackun 6576a0a09c
Print NVML return code as string 4 years ago
jackun a9311bb578
Allow to specify gpu with pci bus id by setting env var `MANGOHUD_PCI_DEV=xxxx:xx:xx:x` where x's are "domain🚌slot.function" 4 years ago
jackun e5a256bfc0
Move DBus init to overlay_params so it can be enabled/disabled on the fly from a single place 4 years ago
jackun d81dc7936a
[OpenGL] Use glXQueryDrawable if XGetGeometry fails 4 years ago
jackun ff3c58c9c5
[OpenGL] Change glXMakeCurrent return type to int just in case and convert missed #ifdefs 4 years ago
Stephan Lachnit f860418e7e
Allow system NVML to be used
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
4 years ago
André Almeida f07aea54b6 logging: check if duration is enabled before checking if it has expired
If we check if log_duration is enabled before checking if it has expired
we can save some math and comparison instructions on every log write.
4 years ago
André Almeida 0a942512e9 logging: don't sleep if time is over 4 years ago
André Almeida 0303f8de28 logging: write log to a memory buffer
Instead of writing every line of the log to the file (and, consequently,
to the disk), write to a memory buffer first and after the log finishes
flush from memory to disk. This improve the performance of the tool, since
it avoids making the program blocked by disk IO.
4 years ago