Commit Graph

118 Commits

Author SHA1 Message Date
Otávio Pace 215ca770df audio_core: remove unnecessary spaces on comments 2019-01-14 00:22:05 -02:00
Lioncash a73c7c73eb audio_core: Convert LOG_CRITICAL + UNREACHABLE over to UNIMPLEMENTED/UNIMPLEMENTED_MSG
These two macros being used in tandem were used prior to the
introduction of UNIMPLEMENTED and UNIMPLEMENTED_MSG. This provides
equivalent behavior, just with less typing/reading involved.
2018-12-28 14:13:58 -05:00
bunnei b88430c299
Merge pull request #1902 from lioncash/audio
audio_core: Make g_sink_details internally linked
2018-12-14 21:48:17 -05:00
Lioncash 6beb823f15 audio_core: Make g_sink_details internally linked
We can hide the direct array from external view and instead provide
functions to retrieve the necessary info. This has the benefit of
completely hiding the makeup of the SinkDetails structure from the rest
of the code.

Given that this makes the array hidden, we can also make the array
constexpr by altering the members slightly. This gets rid of several
static constructor calls related to std::vector and std::function.

Now we don't have heap allocations here that need to occur before the
program can even enter main(). It also has the benefit of saving a
little bit of heap space, but this doesn't matter too much, since the
savings in that regard are pretty tiny.
2018-12-13 16:44:32 -05:00
heapo 117b1f3ec1 Avoid (expensive) audio interpolation when sample rates already match 2018-12-06 09:46:08 -08:00
Zach Hilman ff610103b5 core: Port all current usages of Event to Readable/WritableEvent 2018-11-29 08:45:41 -05:00
Lioncash 81a39181b0 audio_core/audio_renderer: Fix typo in AuxInfo member name 2018-11-13 13:32:13 -05:00
Markus Wick 2ba4d878e5 microprofile: Drop ReleaseActiveBuffer scope.
This was created with the unfinished resampling PR in mind.
As the resampling is now on the audio thread, we don't need to care about this here any more.
2018-11-06 17:45:32 +01:00
fearlessTobi 655694253a time_stretch: Switch to values of Citra 2018-10-29 14:49:36 +01:00
Weiyi Wang 12c365b549 cubeb_sink: ignore null-name device when selecting
We already ignore them on listing devices. We should do the same when selecting devices. This fix a crash when opening a specific device while there is a null device in the list
2018-10-27 00:43:04 +02:00
Lioncash 6d27614994
time_stretch: Remove unused m_channel_count member variable
This is only stored to, but never read from.
2018-10-24 00:46:17 -04:00
David Marcec a47c1c77e6 EffectOutStatus padding is now in hex 2018-10-09 11:20:54 +11:00
David Marcec ceef334c1c Fixups for softlock 2018-10-07 14:25:39 +11:00
David Marcec 2534af040e Fixed missing return
Softlock explanation:
after effects are initialized in smo, nothing actually changes the state. It expects the state to always be initialized. With the previous testing, updating the states much like how we handle the memory pools continue to have the softlock(which is why I said it probably wasn't effects) after further examination it seems like effects need to be initialized but the state remains unchanged until further notice. For now, assertions are added for the aux buffers to see if they update, unable to check as I haven't gotten smo to actually update them yet.
2018-10-07 14:19:55 +11:00
David Marcec 2de52e3af6 Fixed smo softlock 2018-10-07 14:14:09 +11:00
Lioncash 2f6a611311 stream: Preserve enum class type in GetState()
Preserves the meaning/type-safetiness of the stream state instead of
making it an opaque u32. This makes it usable for other things outside
of the service HLE context.
2018-09-23 20:03:38 -04:00
David Marcec c461188f51 Added audren:u#GetAudioRendererState 2018-09-23 22:32:01 +10:00
Subv 8ba21e28cf Logging: Change the TimeStretch::Process log from debug to trace level.
This function is called too many times and makes the debug logging basically unusable due to the spam.
2018-09-20 22:33:54 -05:00
Lioncash f7308a6c25 time_stretch: Remove unused <array> include
This isn't used within this header and isn't necessary.
2018-09-17 15:08:34 -04:00
Lioncash 2fd124bc93 stream: Replace includes with forward declarations where applicable
Avoids propagating includes in headers where it's not necessary to do
so.
2018-09-17 15:08:34 -04:00
Lioncash 1adbcd54fe audio_renderer: Replace includes with forward declarations where applicable
Avoids including unnecessary headers within the audio_renderer.h header,
lessening the likelihood of needing to rebuild source files including
this header if they ever change.

Given std::vector allows forward declaring contained types, we can move
VoiceState to the cpp file and hide the implementation entirely.
2018-09-17 15:08:30 -04:00
bunnei 692e7cee4f
Merge pull request #1314 from lioncash/cast
audio_core/time_stretch: Silence truncation warnings in Process()
2018-09-17 12:28:19 -04:00
bunnei 59beb540ae
Merge pull request #1321 from lioncash/audio-shadow
cubeb_sink: Get rid of variable shadowing within CubebSink's constructor
2018-09-17 12:26:29 -04:00
bunnei 3476ba2aee
Merge pull request #1320 from lioncash/name
cubeb_sink: Correct context name in ListCubebSinkDevices()
2018-09-17 10:10:33 -04:00
fearlessTobi 63c2e32e20 Port #4182 from Citra: "Prefix all size_t with std::" 2018-09-15 15:21:06 +02:00
Lioncash fc669a97d4 cubeb_sink: Get rid of variable shadowing within CubebSink's constructor
The parameter of the lambda was shadowing the variable that was being
assigned to.
2018-09-14 12:20:51 -04:00
Lioncash b5218d9986 cubeb_sink: Correct context name in ListCubebSinkDevices()
This ain't Citra.
2018-09-14 12:18:09 -04:00
Lioncash 9969a5db1e audio_core/time_stretch: Silence truncation warnings in Process()
The SoundTouch API only accepts uint amount of samples.
2018-09-13 19:50:01 -04:00
bunnei 60899b80f0
Merge pull request #1298 from lioncash/view
audio_core/sink_details: Change std::string parameter into std::string_view
2018-09-12 18:24:57 -04:00
bunnei 926dd41587
Merge pull request #1163 from FearlessTobi/add-audio-stretching
audio_core: Add audio stretching support
2018-09-12 18:23:54 -04:00
MerryMage 957ddab679 audio_core: Flush stream when not playing anything 2018-09-12 18:09:14 +01:00
Lioncash bad035e9a3 audio_core/sink_details: Change std::string parameter into std::string_view
The given string is only ever used for lookup and comparison, so we can
just utilize a non-owning view to string data here
2018-09-11 21:36:12 -04:00
MerryMage 55af5bda55 cubeb_sink: Downsample arbitrary number of channels 2018-09-09 09:51:46 +01:00
MerryMage 1aa195a9c0 cubeb_sink: Perform audio stretching 2018-09-08 18:56:38 +01:00
MerryMage e51bd49f87 audio_core: Add audio stretcher 2018-09-08 18:56:38 +01:00
MerryMage 7e697ab7ff cubeb_sink: Hold last available value instead of writing zeros
This reduces clicking in output audio should we underrun.
2018-09-08 18:56:38 +01:00
MerryMage 6d9dd1dc6d cubeb_sink: Use RingBuffer 2018-09-08 18:56:38 +01:00
fearlessTobi a6efff8b02 Add audio stretching support 2018-09-08 18:26:23 +01:00
MerryMage a76f0d5d06 audio_renderer: Rename AudioOut instance to audio_out 2018-09-08 16:50:12 +01:00
Markus Wick 10bc725944 Update microprofile scopes.
Blame the subsystems which deserve the blame :)

The updated list is not complete, just the ones I've spotted on random sampling the stack trace.
2018-09-04 11:04:26 +02:00
Lioncash 0057a47e41 audio_core/filter: Add explicit cast to assignment in Process()
Previously this would cause warnings about implicit conversions to s16
from a double
2018-08-21 12:32:37 -04:00
bunnei f19b4fab5f
Merge pull request #1033 from MerryMage/interp
audio_core: Interpolate
2018-08-13 12:19:59 -04:00
MerryMage 01d199965a audio_renderer: samples_remaining counts frames, not samples 2018-08-13 11:26:50 +01:00
MerryMage 4b44b8b4fb audio_core: Interpolate 2018-08-13 11:26:50 +01:00
MerryMage 56300f2928 audio_core: Implement low-pass filter 2018-08-13 11:26:50 +01:00
MerryMage fcc5ffdfdd cubeb_sink: Protect queue with a mutex 2018-08-12 20:41:46 +01:00
David Marcec 094f6003e0 Pushed the requested sample rate instead of our fixed sample rate 2018-08-12 14:58:36 +10:00
David Marcec e5ee0afe6f Added GetAudioRendererSampleRate, GetAudioRendererSampleCount & GetAudioRendererMixBufferCount
GetAudioRendererSampleRate is set as a "STUB" as a game could check if the sample rate it sent and the sample rate it wants don't match. Just a thought of something which could happen so keeping it as stub for the mean time
2018-08-12 14:46:12 +10:00
KAMiKAZOW 0f5c4615ae
Make building cubeb optional 2018-08-07 13:21:56 +02:00
bunnei b46df98e93 audio_core: Implement audren_u audio playback. 2018-08-04 21:54:30 -04:00