Commit Graph

591 Commits

Author SHA1 Message Date
lfsafady d9d51fe0c4 Renamed some variables to the current coding standard and some to better
fit what they really are.
2017-06-27 07:08:43 -03:00
LAGonauta 8fd1af6783 Changed OpenAL latency setting to really reflect how much time it is.
Before these changes each value of latency were actually 5ms, with a
minimum latency of ~10 ms. If it was set to 4 ms on the UI, the actual
latency was 10 + 5 * 4 = 30 ms.
Now 30 ms on the UI means 30 ms on the backend.
2017-06-27 06:54:28 -03:00
Michael Maltese 749889236d OpenALStream: remove commented-out ALC_REFRESH code 2017-06-27 00:06:14 -07:00
Michael Maltese c882d52f4a OpenAL: load DLL dynamically 2017-06-27 00:06:14 -07:00
Michael Maltese 18e70cdf91 Only build OpenAL on Windows 2017-06-27 00:06:14 -07:00
Michael Maltese 42ea1c8ecf OpenAL: remove aldlist.cpp 2017-06-27 00:06:13 -07:00
Michael Maltese 32470ef284 clean up OpenALStream::Start() 2017-06-27 00:06:13 -07:00
Michael Maltese 56961f5561 OpenALStream: don't include headers if not building 2017-06-27 00:06:13 -07:00
Michael Maltese b2c9d6d217 Rename CMixer to Mixer 2017-06-26 15:01:07 -07:00
JosJuice f09ceaa735 Move IOFile to a separate file
Reduces the number of files that need to be recompiled
when making changes to FileUtil.h.
2017-06-15 21:33:50 +02:00
Shawn Hoffman fd166032ab msbuild: obey some warnings about missing virtual destructors 2017-06-07 20:20:25 -07:00
Michael Maltese 60f4f499e8 OpenAL: hardcode that X-Fi supports surround 2017-06-06 15:23:55 -07:00
Michael Maltese 3bfebf396a Fix OpenAL backend on macOS
OpenALStream was querying the backend for AL_EXT_float32 support (which
suceeds), but AL_FORMAT_STEREO_FLOAT32 was defined incorrectly.

Also changes OpenALStream to query for AL_EXT_MCFORMATS (multichannel
support) rather than hard-coding that it doesn't work on macOS.
2017-06-06 15:23:55 -07:00
shuffle2 0b00477c8a Merge pull request #5311 from ligfx/mixerdpl2
AudioCommon: Move DPL2 decoding into Mixer
2017-06-05 20:09:18 -07:00
Shawn Hoffman 397720a9fe might as well update yet some more pointless version numbers.. 2017-06-03 18:20:40 -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
BhaaL 072c161445 upgrade to Windows SDK 10.0.15063.0
this is required for /permissive- to work, because some headers in the
Windows SDK use Microsoft extensions that are not allowed in standards mode
2017-05-28 13:37:31 +02:00
Lioncash 3e7af2a2cd CubebStream: Add missing <vector> include 2017-05-27 23:50:39 -04:00
Michael Maltese d416cbd9ed Add CubebUtils namespace and hook up cubeb logging 2017-05-27 18:28:57 -07:00
Michael Maltese f6e1da0dc0 AudioCommon: add Cubeb backend 2017-05-27 18:28:56 -07:00
Pierre Bourdon d592bdd4d4 Migrate to Visual Studio 2017.
Auto-generated by the IDE, I'll trust it knows what it's doing.
2017-05-25 15:58:59 -07:00
MerryMage c9f50fd4ed DPL2Decoder: Prefer static_cast to C-style casts 2017-04-23 09:21:30 +01:00
MerryMage 4f884d0b2f DPL2Decoder: Simplify DotProduct 2017-04-23 09:21:30 +01:00
MerryMage 42a1f7939d DPL2Decoder: Prefer std::vector to calloc-ed array 2017-04-23 09:21:29 +01:00
MerryMage 71dc810418 DPL2Decoder: Make constant variables const in DesignFIR 2017-04-23 09:18:29 +01:00
MerryMage 751351fd20 DPL2Decoder: Simplify cut-off frequency logic in DesignFIR 2017-04-23 09:18:29 +01:00
MerryMage 24027c1d4a DPL2Decoder: Reduce scope of variable in DesignFIR 2017-04-23 09:18:29 +01:00
MerryMage d0e75bb438 DPL2Decoder: Remove unnecessary pointer arguments of DesignFIR 2017-04-23 09:18:28 +01:00
Michael Maltese c538cdcd47 AudioCommon: set volume _after_ starting stream
Fixes an error with the CoreAudio backend, which apparently doesn't
allow you to set the volume before starting the stream:

```
59:31:087 AudioCommon/CoreAudioSoundStream.cpp:97 E[Audio]: error setting volume
```

This shouldn't cause any problems with other backends, since the mixer
starts with silence anyways.
2017-04-20 02:06:42 -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
MerryMage 6a4945090c OpenALStream: Remove audio stretching 2017-04-12 13:15:00 +01:00
Michael Maltese af63235dc4 Remove libao sound backend
A single person uses it[0], and it sometimes messes up the Linux
buildbots ("ninja: error: 'ao', needed by 'Binaries/dolphin-emu', missing
and no known rule to make it").

[0]: https://analytics.dolphin-emu.org/stats/popular-audio-backends.txt
2017-03-31 14:59:57 -07: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
Phil Christensen 2ed61b0ee1 C++ conformance fixes (MSVC /permissive-)
We (the Microsoft C++ team) use the dolphin project as part of our "Real world code" tests.
I noticed a few issues in windows specific code when building dolphin with the MSVC compiler
in its conformance mode (/permissive-).  For more information on /permissive- see our blog
https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/.

These changes are to address 3 different types of issues:

1) Use of qualified names in member declarations

    struct A {
        void A::f() { } // error C4596: illegal qualified name in member declaration
                        // remove redundant 'A::' to fix
    };

2) Binding a non-const reference to a temporary

    struct S{};
  
    // If arg is in 'in' parameter, then it should be made const.
    void func(S& arg){}
  
    int main() {
      //error C2664: 'void func(S &)': cannot convert argument 1 from 'S' to 'S &'
      //note: A non-const reference may only be bound to an lvalue
      func( S() );
   
      //Work around this by creating a local, and using it to call the function
      S s;
      func( s );
    }

3) Add missing #include <intrin.h>

Because of the workaround you are using in the code you will need to include
this.  This is because of changes in the libraries and not /permissive-
2017-02-15 20:37:04 -08:00
JosJuice 01073946b4 Fix default audio backend on Android being "No audio output"
People who already have encountered the problem will need to
manually change the audio backend (or delete the config INI).
2017-02-08 21:29:27 +01:00
Florent Castelli c1dcd06043 cmake: Move PulseAudio detection to AudioCommon 2017-02-07 23:35:44 +01:00
Florent Castelli d1eaa59a8e cmake: Move detection of OpenAL to AudioCommon 2017-02-07 03:42:43 +01:00
Florent Castelli cbb7e4072a cmake: Move AO detection to AudioCommon 2017-02-07 03:42:43 +01:00
Florent Castelli 2fceb016b4 cmake: Move ALSA detection to AudioCommon 2017-02-05 02:55:05 +01:00
Florent Castelli d615c0f868 cmake: Add imported target to FindALSA 2017-02-05 02:55:05 +01:00
Florent Castelli 9ebfaa9324 AudioCommon: Move logic for default sound backend there from ConfigManager
This way, we don't have to leak the HAVE_ALSA define there.
2017-02-05 02:55:04 +01:00
Florent Castelli 31dfaafe0b AudioCommon: Remove checks against NullSound::isValid()
The NullAudio backend is guaranteed to be compiled in, so no reason
to check it.
In addition to that, if it wasn't valid, it wouldn't work as a fallback
in InitSoundStream as there are uses to g_sound_stream later.
2017-02-05 02:55:04 +01:00
Florent Castelli ee8a21f1d0 cmake: In AudioCommon, append sources and dependencies to a real target 2017-02-05 02:55:04 +01:00
Florent Castelli f1ba7832a5 cmake: Reindent AudioCommon 2017-02-05 02:55:04 +01:00
Florent Castelli fb02a321b6 cmake: Move OpenSLES detection to AudioCommon through find_package() 2017-02-04 03:38:11 +01:00
Florent Castelli 87380c1c2c cmake: Change endif(.*) to endif() 2017-01-25 15:07:32 +01:00
Stenzek d315052552 AudioCommon: Remove unused _M_SSE test 2017-01-24 20:04:55 +10:00
Florent Castelli a7bf9271b5 Fix missing includes 2017-01-24 03:31:51 +01:00
Matthew Parlane f70a1a27fa Merge pull request #4726 from ligfx/addingwindowsheaders
Fix building without PCH on Windows
2017-01-24 13:47:36 +13:00
Mat M 93faf26217 Merge pull request #4721 from RisingFog/remove_dead_audiodump_code
Remove dead audio dumping code
2017-01-23 09:17:11 -05:00
Chris Burgener dd9709509c Remove dead audio dumping code 2017-01-23 09:11:48 -05:00
Michael Maltese 713ec5ffd5 Add includes for building on Windows without PCH 2017-01-23 01:37:41 -08:00
Florent Castelli b5b9c0cfc3 cmake: Build XAudio 2.7 backend on Windows 2017-01-21 00:34:02 +01:00
Chris Burgener 47b3a9c68e Add Silent Audio Dumping INI Option 2017-01-08 13:53:44 -05:00
Chris Burgener debc40e85b Display warning when dumping audio if file exists 2016-12-17 22:45:01 -05:00
Lioncash 87f2a74c08 AudioCommon: Remove unnecessary headers
Now AudioCommon code won't need to be recompiled if the TAS movie header
is ever modified.
2016-12-11 06:11:37 -05:00
Léo Lam 72e3f1ecec Remove unnecessary ConfigManager includes
Making changes to ConfigManager.h has always been a pain, because
it means rebuilding half of Dolphin, since a lot of files depend on
and include this header.

However, it turns out some includes are unnecessary. This commit
removes ConfigManager includes from files which don't contain
SConfig or GPUDeterminismMode or GPU_DETERMINISM (which means the
ConfigManager include is not used).

(I've also had to get rid of some indirect includes.)
2016-11-27 22:38:38 +01:00
Markus Wick 9ce1cdde98 Merge pull request #4414 from linkmauve/single-newline
Remove double newlines at the end of *_LOG messages
2016-11-02 12:20:46 +01:00
Emmanuel Gil Peyrot c9e6b05ce9 Core: Remove double newlines at the end of *_LOG messages. 2016-11-02 02:09:33 +00:00
LAGonauta 332e9bd378 Added 32-bit fixed point support to OpenAL backend.
Changed method to detect 32-bit floating point and
32-bit fixed point support.
2016-10-27 18:47:13 -02:00
Michael Maltese 45903b7b4d AudioCommon: SupportsDPL2Decoder, SupportsLatencyControl, SupportsVolumeChanges 2016-10-09 19:18:16 -07:00
Léo Lam 39fd6dcd5b Fix missing includes
Aren't indirect includes great?
2016-10-07 23:46:41 +02:00
LAGonauta d4759a55b6 Fix for false error about unqueuing buffers (OpenAL)
and hopefully added saner error reporting.
2016-10-04 21:57:36 -03:00
shuffle2 7f4106646e Merge pull request #4271 from ligfx/audiofix
OpenAL: Don't request samples if buffers are full
2016-10-02 21:00:10 -07:00
Michael Maltese 8fa79f3897 fix indendentation 2016-10-01 21:36:51 -07:00
Michael Maltese 567dffc1ee OpenAL: Don't request samples if buffers are full
Makes the buffering code a bit more explicit (circular buffer, but
blocks until individual buffers get unqueued by OpenAL), and fixes a
bug in the startup of Super Mario Sunshine:
https://bugs.dolphin-emu.org/issues/9811
2016-10-01 21:36:46 -07:00
aldelaro5 f0aa9b3751 Reorganise a ton of logs level
Most of this commits changes performance decreasing logs from info to debug and also cleans up innacurate levels.
2016-10-01 15:50:28 -04:00
Léo Lam dca22e08eb Use Common::Flag and Common::Event when possible
Replaces old and simple usages of std::atomic<bool> with Common::Flag
(which was introduced after the initial usage), so it's clear that
the variable is a flag and because Common::Flag is well tested.

This also replaces the ready logic in WiimoteReal with Common::Event
since it was basically just unnecessarily reimplementing Common::Event.
2016-08-10 16:08:15 +02:00
Lioncash 128d762aea AudioCommon: const correctness 2016-07-31 19:14:20 -04:00
Lioncash ecc1710676 AudioCommon: Make the SoundStream global a unique_ptr 2016-07-31 15:45:28 -04:00
Chris Burgener 76abf1f727 Remove AddStereoSample function 2016-07-01 00:59:25 -04: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
Mathew Maidment 08c9e3b7a4 Merge pull request #3602 from OatmealDome/coreaudio
CoreAudioSound: Minor clean up
2016-02-07 22:25:15 -05:00
OatmealDome 36a20c3535 CoreAudioSound: Replace deprecated parameters
The kAudioUnitParameterFlag_* parameters don't exist on iOS.
2016-02-06 16:48:03 -05:00
OatmealDome 2e24996a9c CoreAudioSound: Only include AudioUnit 2016-02-06 16:47:49 -05:00
Ryan Houdek 2f7e3ae58e CMakeLists cleanup and enable Android headless building. 2016-02-05 11:24:11 -06: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
Ryan Houdek 1db01a8c56 [OpenSLES] Fix a delay in audio processing.
A failure on my part. I was updating the two buffers in the wrong order, so we were always a buffer behind in sending audio out to OpenSLES.
2016-01-03 11:33:38 -06:00
skidau cfa925fbbe Updated SoundTouch library to 1.9.2 2015-12-28 23:08:55 +11:00
Markus Wick 164e045123 Merge pull request #3317 from lioncash/null
NullSound: Minor changes
2015-12-15 17:38:37 +01:00
Ryan Houdek cb5be45f72 Merge pull request #3200 from degasus/master
Throttler + Mixer: Configureable variance
2015-12-11 07:04:56 -05:00
Lioncash 0917db7fc0 NullSound: Use std::array for the buffer 2015-12-05 18:13:55 -05:00
Lioncash 0d4baa0744 NullSound: Replace header define with private constant 2015-12-05 18:13:49 -05:00
Lioncash e0eef7bef4 WaveFile: Get rid of an explicit delete 2015-12-02 20:05:18 -05:00
degasus 888c377b57 Throttler + Mixer: Configureable variance 2015-11-03 08:22:36 +01:00
shuffle2 9878004871 Merge pull request #3105 from phire/dont_block
ALSA: Don't block on Clear() call.
2015-10-03 17:55:26 -07:00