Commit Graph

81 Commits

Author SHA1 Message Date
Sam Belliveau
bc1cc9eeb4 CoreTiming: Throttle Before Every Event Using Chrono 2023-01-06 17:21:17 -05:00
Sam Belliveau
673f81c18a New FrameTime/VBlank Analyzer + Graph 2022-12-23 19:52:53 -05:00
Pokechu22
72de74d4fc Mixer: Add assertions regarding num_samples versus buffer length 2022-09-08 12:10:10 -07:00
Pokechu22
abb59a781a Mixer: Use smaller array for PushWiimoteSpeakerSamples 2022-09-08 12:10:02 -07:00
CasualPokePlayer
4234b25682 Do not directly store input sample rate, rather just store a divisor for that sample rate, with it using a fixed dividend of 54000000 * 2.
This should reduce (but not completely eliminate) gradual audio desyncs in dumps. This also allows for accurate sample rates for the GameCube.
Completely eliminating gradual audio desyncs will require resampling to an integer sample rate, as nothing seems to support a non-integer sample rate.
2022-07-03 15:07:06 -07:00
CasualPokePlayer
ad892176d0 have audio dumps apply volume (fixes cases of audio dumps being "too loud" and in game audio controls having no effect) 2022-06-10 21:27:10 -07:00
Admiral H. Curtiss
eb5bb2993e
Core/AudioCommon: Add config caching to Mixer. 2022-01-06 16:43:43 +01:00
Admiral H. Curtiss
2aa44b10ba
Config: Port TimingVariance setting to new config system. 2022-01-06 16:13:56 +01:00
Admiral H. Curtiss
fb47035f97
Config: Port emulation speed setting to new config system. 2022-01-06 16:13:54 +01:00
Pokechu22
2025763420 Treewide: Adjust order of includes 2021-12-10 14:49:57 -08:00
sowens99
8ea6bef98f Port Main.DSP to MainSettings
While trying to work on adding audiodump support for CLI, I was alerted that it was important to first try moving the DSP configs to the new config before continuing, as that makes it substantially easier to write clean code to add such a feature.

This commit aims to allow for Dolphin to only rely on the new config for DSP-related settings.
2021-10-15 23:24:46 -04:00
Bonta
502def7f71 Mixer: Support GBA samples mixing 2021-07-13 16:40:07 +02:00
Pierre Bourdon
e149ad4f0a
treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
Lioncash
22a79289d3 AudioCommon: Migrate logging over to fmt
printf specifiers, begone!
2020-10-21 13:32:28 -04:00
LAGonauta
2ff646b796 DSP must be set to LLE to select the decoder 2019-10-22 22:55:59 -03:00
LAGonauta
3c9eb37381 Allow user to change DPLII decoding quality 2019-10-22 22:55:15 -03:00
Léo Lam
ab9ece9bca Replace MathUtil::Clamp with std::clamp 2019-05-04 23:12:17 +02:00
LAGonauta
df631f0d75 Swapped FFDShow's DPL2 decoder by FreeSurround
Added class in AudioCommon for the surround decoder
2019-02-13 22:52:40 -02:00
JosJuice
b00ef39c1c Fix DTK audio not working after loading a savestate
The main problem was that the volume of the mixer wasn't savestated.
The volume is typically 0 at the beginning of a game, so loading a
savestate at the beginning of a game would lead to silent DTK audio.

I also added savestating to StreamADPCM.cpp.
2017-11-06 09:15:14 +01:00
Michael Maltese
b2c9d6d217 Rename CMixer to Mixer 2017-06-26 15:01:07 -07:00
Michael Maltese
14c3d4716f AudioStretcher: split StretchAudio into ProcessSamples / GetStretchedSamples 2017-06-03 16:54:00 -07:00
Michael Maltese
87a467fe42 AudioCommon: extract AudioStretcher class for time-stretching 2017-06-03 16:54:00 -07:00
Michael Maltese
a4508e85e8 AudioCommon: move DPL2 decoding into Mixer 2017-06-03 16:53:59 -07:00
MerryMage
cbaa00457a Mixer: Tweak audio stretch parameters 2017-04-12 17:56:58 +01:00
MerryMage
9397fdfe95 Mixer: Use a temporary buffer when stretching audio 2017-04-12 14:58:20 +01:00
MerryMage
f5018010d3 Mixer: Calculate actual_samples based on availability in all FIFOs 2017-04-12 14:58:19 +01:00
MerryMage
ac0df5b2db Mixer: Disable frequency shifting when stretching is enabled 2017-04-12 13:56:29 +01:00
MerryMage
26514358f4 Add audio stretching as a configuration option 2017-04-12 13:56:29 +01:00
MerryMage
b8c867dd7a Mixer: Implement audio stretching 2017-04-12 13:56:28 +01:00
MerryMage
5b81f2a31d Mixer: Return actual number of samples mixed into buffer from MixerFifo::Mix
No code in the codebase currently depends on the return value of this function.
2017-04-12 13:15:00 +01:00
Markus Wick
7b19475911 Merge pull request #4548 from stenzek/gcc-sse
Support SSSE3 texture decoders and CRC32 hashing on non-native builds (gcc)
2017-03-13 14:28:01 +01:00
Lioncash
552c0d8404 Common: Move byte swapping utilities into their own header
This moves all the byte swapping utilities into a header named Swap.h.

A dedicated header is much more preferable here due to the size of the
code itself. In general usage throughout the codebase, CommonFuncs.h was
generally only included for these functions anyway. These being in their
own header avoids dumping the lesser used utilities into scope. As well
as providing a localized area for more utilities related to byte
swapping in the future (should they be needed). This also makes it nicer
to identify which files depend on the byte swapping utilities in
particular.

Since this is a completely new header, moving the code uncovered a few
indirect includes, as well as making some other inclusions unnecessary.
2017-03-03 17:18:18 -05:00
Stenzek
d315052552 AudioCommon: Remove unused _M_SSE test 2017-01-24 20:04:55 +10:00
Chris Burgener
debc40e85b Display warning when dumping audio if file exists 2016-12-17 22:45:01 -05:00
Chris Burgener
ca2eaac704 Split Audio Dumps on Sample Rate Changes 2016-06-24 21:12:15 -04:00
Pierre Bourdon
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
EmptyChaos
c1922783f8 Core: Threadsafety Synchronization Fixes (Frame Advance / FifoPlayer)
Fix Frame Advance and FifoPlayer pause/unpause/stop.

CPU::EnableStepping is not atomic but is called from multiple threads
which races and leaves the system in a random state; also instruction
stepping was unstable, m_StepEvent had an almost random value because
of the dual purpose it served which could cause races where CPU::Run
would SingleStep when it was supposed to be sleeping.

FifoPlayer never FinishStateMove()d which was causing it to deadlock.
Rather than partially reimplementing CPU::Run, just use CPUCoreBase
and then call CPU::Run(). More DRY and less likely to have weird bugs
specific to the player (i.e the previous freezing on pause/stop).

Refactor PowerPC::state into CPU since it manages the state of the
CPU Thread which is controlled by CPU, not PowerPC. This simplifies
the architecture somewhat and eliminates races that can be caused by
calling PowerPC state functions directly instead of using CPU's
(because they bypassed the EnableStepping lock).
2016-05-13 09:23:44 +10:00
Lioncash
c70487163f Mixer: Convert defines into concrete variables
Gets defines out of global scope.
2016-01-15 23:41:53 -05:00
Lioncash
fc6a2f490f Mixer: Directly initialize class members 2016-01-14 01:32:31 -05:00
Lioncash
531a3ed09a Mixer: Devirtualize
Nothing in the codebase inherits from this class
2016-01-14 01:32:24 -05:00
degasus
3ff4ec275a Throttler: Rename "framelimiter" to "emulation speed".
We don't throttle by frames, we throttle by coretiming speed.
So looking up VI for calculating the speed was just very wrong.
The new ini option is a float, 1.0f for fullspeed.
In the GUI, percentual values are used.
2016-01-05 23:39:05 +01:00
degasus
888c377b57 Throttler + Mixer: Configureable variance 2015-11-03 08:22:36 +01:00
Rohit Nirmal
3b75f45cf6 Fix building with PCH disabled. 2015-09-28 11:51:08 -05:00
Lioncash
cc036ca86c Common: Remove other Common prefixed headers from Common.h 2015-09-26 18:51:58 -04:00
Lioncash
b9e360df7b MathUtil: Convert Clamp into a constexpr function 2015-09-12 01:18:28 -04:00
Lioncash
3f78d74fc1 AudioCommon: Log to AUDIO, not DSPHLE
This code is not related to DSPHLE.
2015-08-09 21:36:03 -04:00
Lioncash
9dd607b923 Mixer: Fix erroneous global prefixes on class variables 2015-06-20 21:48:50 -04:00
Lioncash
d81dffd4f0 Mixer: Devirtualize DTK and DSP audio logging functions
Their functionality is already complete in the base class; there's no need to allow overriding.
2015-06-20 21:46:20 -04:00
degasus
9a96e3c416 AudioCommon: Remove lock on Pause state
We had to lock audiocommon with the old asynchron HLE audio emulation,
now our Mixer is just a plain FIFO which may underrun.
Of course, this will stutter, but underruning the audio backend is likely worse.
2015-05-28 19:58:18 +02:00
Tillmann Karras
30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00