-
-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement FAudioDebugConfiguration #59
Comments
Using SetDebugConfiguration requires having the FAudio pointer available any place we want to add logging. Would you be OK if we have a global FAudioDebugConfiguration struct which just affects all FAudio instances instead of just the one that SetDebugConfiguration is called on? |
I'd be okay with that, but which functions don't have the FAudio instance? I think every function has access, though it requires a bunch of walking to get to it (i.e. |
The walking itself is annoying, but I was thinking of the internal resampler functions, for example. |
Ah, right - we may have to fudge that a bit by dumping the parameters as well as the function pointer handle before calling, without actually printing within the function. (Or maybe we can print the function pointer when we assign it, not sure...) |
SetDebugConfiguration now has an implementation, it just needs to be used now: |
Wrote a HUGE pile of code that allows writing debug traces with quick lines like this:
It should now be pretty easy to write up most of the essentials and all the DebugConfiguration stuff should Just Work with each config combination. It even supports environment variables for each TraceMask flag and LogX bools! |
A couple things that may be of interest to Proton builds: |
How can I let the log messages be written to a file instead of pop up windows? |
You can either build with the LOG_ASSERTIONS CMake option or set the SDL_ASSERT environment variable to “always_ignore”. |
From MSDN: https://docs.microsoft.com/en-us/windows/desktop/api/xaudio2/ns-xaudio2-xaudio2_debug_configuration
In addition to filling in one more XAudio2 feature, this is a legitimately useful for general FAudio debugging without having to step through a whole lot. It can be extremely verbose, however, so this should only be enabled for non-release builds (i.e.
!_DEBUG && !DEBUG && (GCC && !OPTIMIZED)
). Additionally, I would like to add the ability to enable features with environment variables, not just SetDebugConfiguration. This is useful for projects like Wine that won't have access to these entry points without added hackery. Each flag/bool should get a variable in some way.As for the implementation, this can be mapped to something like SDL_Log, though I don't know how complicated we'll need to get. I'm hoping we can make all these log types macros that are blanked in release builds, but that's totally speculation without having actually tried to write this at all.
It's a big ol checklist:
The text was updated successfully, but these errors were encountered: