-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Support for Master volume level setting #5268
Conversation
I don't understand the idea of this. |
@@ -121,7 +121,7 @@ void XAudio2Thread::xa27_open() | |||
return; | |||
} | |||
|
|||
s_tls_source_voice->SetVolume(g_cfg.audio.downmix_to_2ch ? 1.0f : 4.0f); | |||
s_tls_source_voice->SetVolume(g_cfg.audio.downmix_to_2ch ? 1.0f * (g_cfg.audio.volume / 100.0) : 4.0f * (g_cfg.audio.volume / 100.0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s_tls_source_voice->SetVolume(g_cfg.audio.downmix_to_2ch ? 1.0f * (g_cfg.audio.volume / 100.0) : 4.0f * (g_cfg.audio.volume / 100.0)); | |
s_tls_source_voice->SetVolume((g_cfg.audio.downmix_to_2ch ? 1.0f : 4.0f) * g_cfg.audio.volume / 100.0f); |
@@ -123,7 +123,7 @@ void XAudio2Thread::xa28_open() | |||
return; | |||
} | |||
|
|||
s_tls_source_voice->SetVolume(g_cfg.audio.downmix_to_2ch ? 1.0 : 4.0); | |||
s_tls_source_voice->SetVolume(g_cfg.audio.downmix_to_2ch ? 1.0 * (g_cfg.audio.volume / 100.0) : 4.0 * (g_cfg.audio.volume / 100.0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s_tls_source_voice->SetVolume(g_cfg.audio.downmix_to_2ch ? 1.0 * (g_cfg.audio.volume / 100.0) : 4.0 * (g_cfg.audio.volume / 100.0)); | |
s_tls_source_voice->SetVolume((g_cfg.audio.downmix_to_2ch ? 1.0f : 4.0f) * g_cfg.audio.volume / 100.0f); |
rpcs3/Emu/System.h
Outdated
@@ -508,6 +508,7 @@ struct cfg_root : cfg::node | |||
cfg::_bool downmix_to_2ch{this, "Downmix to Stereo", true}; | |||
cfg::_int<2, 128> frames{this, "Buffer Count", 32}; | |||
cfg::_int<1, 128> startt{this, "Start Threshold", 1}; | |||
cfg::_int<0, 100> volume{this, "Master volume", 100}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of the options are capitalized:
cfg::_int<0, 100> volume{this, "Master volume", 100}; | |
cfg::_int<0, 100> volume{this, "Master Volume", 100}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some of them are capitalized and some of them are not, f.ex. "Dump to file" in start of the audio section and other examples include "Camera type", "Enter button assignment", "Log shader programs" and so on. But I guess uppercase is the more common variation.
@isshininu I've seen some users request this option as they want to reduce game sounds without having to fiddle with the cubersome volume mixer in Windows. Having to set the volume level game-by-game is a tedious process. And there could be a rare title out there with no support for volume adjustments as well, not to mention games that don't let you fiddle with settings before an introduction movie or something similar. |
The volume should be applied on cellAudio.cpp side, this way it doesn't rely on audio API. |
@Nekotekina My idea with this was to just modify the audio output and leave the whole emulation side untouched. But I'll look into your proposal. Setting volume beyond 100% can cause distortion or reduction in quality, but I guess that's up for user to decide. @Hirato Yes, the actual volume changes woudn't be too hard to implement. The problem is that RPCS3 uses a simplified version of the PulseAudio API that has just enough functionality to play audio and pretty much nothing else. Getting any additional features to work would require rewriting the whole PulseAudio support as there doesn't seem to be any "bridges" between simple and compicated APIs. |
fd2661a
to
c86130a
Compare
Alirght, I switched to manipulating the port levels directly. I still prefer my eariler idea, but if neko wishes this implementation then I'll comply. Now it does not require any support from the audio backends at least. I tried modifying the three |
I'd prefer to add my own PR for hacktoberfest |
That's understandable, I guess this PR is ready for merge then. I tried fiddling around with the settings menu files but I couldn't get the layout to behave nicely. |
rpcs3/Emu/Cell/Modules/cellAudio.cpp
Outdated
@@ -679,6 +679,7 @@ error_code cellAudioSetPortLevel(u32 portNum, float level) | |||
cellAudio.trace("cellAudioSetPortLevel(portNum=%d, level=%f)", portNum, level); | |||
|
|||
const auto g_audio = g_idm->lock<named_thread<audio_thread>>(0); | |||
level *= g_cfg.audio.volume / 100.0f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you move this to line 700?
Right now this line will be redundant in case any of those other checks fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't really make a huge difference, but I guess it's a more logical location.
Not that this has anything to do with this emulator but there is an app on the m$ store called eartrumpet that lets you control the sound levels for individual apps, i've been using it for quite awhile now and it works brilliantly for everything, games, emulators, web browsers the lot and its free. |
The idea with this PR is to allow users to modify the loudness of game sounds without having to tinker with OS settings, and add the possibility of having game-specific volume settings.
Notes:
config.yml
manually.If someone wants to do GUI support
(@Megamouse perhaps?)for this setting then I could cherrypick your commits into this PR, or those can be submitted as separate PR's after this one has been merged.