mirror of
https://github.com/spice2x/spice2x.github.io.git
synced 2026-08-01 22:30:42 -07:00
audio: create a wrapper for asio drivers (#731)
## Link to GitHub Issue or related Pull Request, if one exists
n/a
## Description of change
Create `WrappedAsio`, similar to how we wrap `IAudioEndpoint`
So far, the wrapper does these things:
1. logging (for diagnosis, since iidx and gfdm don't produce any logs
when asio succeeds)
2. iidx32+ hack to work around refcount mismatch issue
3. sdvx valk cab hack to force 2-channel audio ("downmixing" by taking
only the front channels)
4. honor volume boost
As a result of `#2` the mempatch was removed from `iidx.cpp` since we
can tackle it cleanly in the hook. `#3` also removes the need for manual
patches.
Real downmixing is hard & expensive on the CPU so it was not
implemented.
## Testing
Tested iidx/sdvx/gfdm with xonar and flexasio
This commit is contained in:
@@ -72,6 +72,7 @@
|
||||
#include "games/museca/museca.h"
|
||||
#include "hooks/avshook.h"
|
||||
#include "hooks/audio/audio.h"
|
||||
#include "hooks/audio/asio_proxy.h"
|
||||
#include "hooks/audio/backends/wasapi/downmix.h"
|
||||
#include "hooks/debughook.h"
|
||||
#include "hooks/devicehook.h"
|
||||
@@ -496,6 +497,9 @@ int main_implementation(int argc, char *argv[]) {
|
||||
if (options[launcher::Options::spice2x_SDVXAsioDriver].is_active()) {
|
||||
games::sdvx::ASIO_DRIVER = options[launcher::Options::spice2x_SDVXAsioDriver].value_text();
|
||||
}
|
||||
if (options[launcher::Options::SDVXAsioTwoChannel].value_bool()) {
|
||||
WrappedAsio::FORCE_TWO_CHANNELS = true;
|
||||
}
|
||||
if (options[launcher::Options::spice2x_SDVXSubPos].is_active()) {
|
||||
auto txt = options[launcher::Options::spice2x_SDVXSubPos].value_text();
|
||||
if (txt == "top") {
|
||||
|
||||
Reference in New Issue
Block a user