summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/audio (unfollow)
Commit message (Collapse)AuthorFilesLines
2019-03-07service/audio/hwopus: Enclose internals in an anonymous namespaceLioncash1-2/+3
Makes it impossible to violate the ODR, as well as providing a place for future changes.
2019-03-06hle/service/audio/audout_u: Correct lack of return in failure case of AppendAudioOutBufferImpl()Lioncash1-0/+1
Previously we were overwriting the error case with a success code further down (which is definitely not what we should be doing here).
2019-03-05hle/service/audio: Extract audio error codes to a headerLioncash3-10/+20
Places all error codes in an easily includable header. This also corrects the unsupported error code (I accidentally used the hex value when I meant to use the decimal one).
2019-03-01service/audio/audren_u: Implement OpenAudioRendererAutoLioncash2-7/+20
This currently has the same behavior as the regular OpenAudioRenderer API function, so we can just move the code within OpenAudioRenderer to an internal function that both service functions call.
2019-03-01service/audio: Provide an implementation of ExecuteAudioRendererRenderingLioncash1-1/+12
This service function appears to do nothing noteworthy on the switch. All it does at the moment is either return an error code or abort the system. Given we obviously don't want to kill the system, we just opt for always returning the error code.
2019-02-27audio_core/audio_renderer: Name previously unknown parameters of AudioRendererParameterLioncash1-13/+13
Provides names for previously unknown entries (aside from the two u8 that appear to be padding bytes, and a single word that also appears to be reserved or padding). This will be useful in subsequent changes when unstubbing behavior related to the audio renderer services.
2019-02-16core_timing: Convert core timing into a classLioncash2-9/+10
Gets rid of the largest set of mutable global state within the core. This also paves a way for eliminating usages of GetInstance() on the System class as a follow-up. Note that no behavioral changes have been made, and this simply extracts the functionality into a class. This also has the benefit of making dependencies on the core timing functionality explicit within the relevant interfaces.
2019-01-30hwopus: Implement DecodeInterleavedLioncash1-4/+35
This functions almost identically to DecodeInterleavedWithPerfOld, however this function also has the ability to reset the decoder context. This is documented as a potentially desirable thing in the libopus manual in some circumstances as it says for the OPUS_RESET_STATE ctl: "This should be called when switching streams in order to prevent the back to back decoding from giving different result from one at a time decoding."
2019-01-30hwopus: Deduplicate the decoding code within DecodeInterleavedOld and DecodeInterleavedWithPerfOldLioncash1-19/+14
Keeps the logic in one spot for use by both functions.
2019-01-30hwopus: Replace std::optional<std::reference_wrapper<u64>> with u64*Lioncash1-9/+6
This doesn't really offer anything over the use of a direct pointer, so we can just use that instead.
2019-01-30hwopus: Mark local variables as const where applicableLioncash1-8/+16
Makes non-mutable state more explicit.
2019-01-30hwopus: Fill in the rest of the unknown service function namesLioncash1-9/+11
Filled in via information provided by SwitchBrew.
2019-01-30service/audio: Update function tablesLioncash4-8/+23
Updates function tables based off information provided by SwitchBrew.
2018-12-02service/audio/audout_u: Amend constructor initialization list orderLioncash1-2/+2
Orders the constructor initializer list the same way the members of the class are declared. Prevents -Wreorder warnings
2018-11-29kernel/event: Reference ReadableEvent from WritableEventZach Hilman2-23/+18
2018-11-29core: Port all current usages of Event to Readable/WritableEventZach Hilman2-14/+24
2018-11-26Fixed hwopus compile errorDavid Marcec1-1/+1
2018-11-26Improved error messages in AM, HwOpus and NvMapDavid Marcec1-8/+16
2018-11-26Changed logging to be "Log before execution", Added more error logging, all services should now log on some levelDavid Marcec3-30/+60
2018-11-22audout_u: Add support for multiple IAudioOut streams.bunnei2-9/+22
- Used by Undertale.
2018-11-17hwopus: DecodeInterleavedWithPerformance: Fix ordering of output parameters.bunnei1-1/+1
- Fixes audio issues with Pokemon: Let's Go Pikachu & Eevee.
2018-11-14service/audren_u: Forward RequestUpdateAuto through the same function as RequestUpdateLioncash1-3/+3
Based off RE, they both currently go through the same codepath with no difference in behavior.
2018-11-13hle/audren_u: Implement Get/SetRenderingTimeLimitLioncash1-2/+23
These appear to be a basic getter and setter pair, so these are fairly trivial to implement and get out of the way.
2018-11-02Fixed incorrect hwopus assertDavid Marcec1-1/+1
2018-10-19audio: Update service function tablesLioncash1-17/+20
Updated based off information provided by Switchbrew.
2018-10-11HwOpus, Implemented DecodeInterleavedWithPerformanceDavid Marcec1-3/+34
Used by sonic ages
2018-09-25service: Add missing headers inclusions where applicableLioncash1-0/+1
Gets rid of a few indirect inclusions.
2018-09-24stream: Preserve enum class type in GetState()Lioncash1-1/+1
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-23Added audren:u#GetAudioRendererStateDavid Marcec1-1/+8
2018-09-19Removed the use of rp.MakeBuilderDavid Marcec2-4/+4
Due to keeping the code style consistent in the yuzu codebase. `rb = rp.MakeBuilder(...)` was replaced with `rb{ctx, ...}`
2018-09-15Port #4182 from Citra: "Prefix all size_t with std::"fearlessTobi1-3/+3
2018-09-12service/audio: Replace includes with forward declarations where applicableLioncash7-17/+34
A few headers were including other headers when a forward declaration can be used instead, allowing the include to be moved to the cpp file.
2018-09-11hle/service: Default constructors and destructors in the cpp file where applicableLioncash24-6/+36
When a destructor isn't defaulted into a cpp file, it can cause the use of forward declarations to seemingly fail to compile for non-obvious reasons. It also allows inlining of the construction/destruction logic all over the place where a constructor or destructor is invoked, which can lead to code bloat. This isn't so much a worry here, given the services won't be created and destroyed frequently. The cause of the above mentioned non-obvious errors can be demonstrated as follows: ------- Demonstrative example, if you know how the described error happens, skip forwards ------- Assume we have the following in the header, which we'll call "thing.h": \#include <memory> // Forward declaration. For example purposes, assume the definition // of Object is in some header named "object.h" class Object; class Thing { public: // assume no constructors or destructors are specified here, // or the constructors/destructors are defined as: // // Thing() = default; // ~Thing() = default; // // ... Some interface member functions would be defined here private: std::shared_ptr<Object> obj; }; If this header is included in a cpp file, (which we'll call "main.cpp"), this will result in a compilation error, because even though no destructor is specified, the destructor will still need to be generated by the compiler because std::shared_ptr's destructor is *not* trivial (in other words, it does something other than nothing), as std::shared_ptr's destructor needs to do two things: 1. Decrement the shared reference count of the object being pointed to, and if the reference count decrements to zero, 2. Free the Object instance's memory (aka deallocate the memory it's pointing to). And so the compiler generates the code for the destructor doing this inside main.cpp. Now, keep in mind, the Object forward declaration is not a complete type. All it does is tell the compiler "a type named Object exists" and allows us to use the name in certain situations to avoid a header dependency. So the compiler needs to generate destruction code for Object, but the compiler doesn't know *how* to destruct it. A forward declaration doesn't tell the compiler anything about Object's constructor or destructor. So, the compiler will issue an error in this case because it's undefined behavior to try and deallocate (or construct) an incomplete type and std::shared_ptr and std::unique_ptr make sure this isn't the case internally. Now, if we had defaulted the destructor in "thing.cpp", where we also include "object.h", this would never be an issue, as the destructor would only have its code generated in one place, and it would be in a place where the full class definition of Object would be visible to the compiler. ---------------------- End example ---------------------------- Given these service classes are more than certainly going to change in the future, this defaults the constructors and destructors into the relevant cpp files to make the construction and destruction of all of the services consistent and unlikely to run into cases where forward declarations are indirectly causing compilation errors. It also has the plus of avoiding the need to rebuild several services if destruction logic changes, since it would only be necessary to recompile the single cpp file.
2018-08-29kernel: Eliminate kernel global stateLioncash2-4/+8
As means to pave the way for getting rid of global state within core, This eliminates kernel global state by removing all globals. Instead this introduces a KernelCore class which acts as a kernel instance. This instance lives in the System class, which keeps its lifetime contained to the lifetime of the System class. This also forces the kernel types to actually interact with the main kernel instance itself instead of having transient kernel state placed all over several translation units, keeping everything together. It also has a nice consequence of making dependencies much more explicit. This also makes our initialization a tad bit more correct. Previously we were creating a kernel process before the actual kernel was initialized, which doesn't really make much sense. The KernelCore class itself follows the PImpl idiom, which allows keeping all the implementation details sealed away from everything else, which forces the use of the exposed API and allows us to avoid any unnecessary inclusions within the main kernel header.
2018-08-14audout_u: Correct IAudioOut initializer list orderLioncash1-1/+1
Orders elements in the precise order they'll be initialized.
2018-08-12GetAudioDeviceServiceWithRevisionInfoDavid Marcec2-1/+13
As we're not handling any anything about the revision data for GetAudioDeviceServiceWithRevisionInfo, it's currently marked as stubbed. However for games this shouldn't affect the result. Proper revision info would be more for homebrew.
2018-08-12Pushed the requested sample rate instead of our fixed sample rateDavid Marcec1-4/+2
2018-08-12Added GetAudioRendererSampleRate, GetAudioRendererSampleCount & GetAudioRendererMixBufferCountDavid Marcec1-5/+28
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-06Service/Audio: audout_a.cpp: remove pragma oncemailwl1-2/+0
2018-08-05audio_core: Implement audren_u audio playback.bunnei2-218/+9
2018-08-05audio_core: Use s16 where possible for audio samples.bunnei1-3/+3
2018-08-05audio_core: Port codec code from Citra for ADPCM decoding.bunnei2-11/+3
2018-08-04service: Remove redundant #pragma once directivesLioncash3-6/+0
These don't do anything within .cpp files (we don't include cpp files, so...)
2018-08-04audio_core: Streams need unique names for CoreTiming.bunnei1-1/+1
2018-08-01service/audio: Add missing servicesLioncash13-0/+277
Adds the missing audctl service, as well as the :a and :d services for audin, audout, audrec, and audren.
2018-07-31audout_u: Remove std::move in OpenAudioOutImpl()Lioncash1-1/+1
Previously the code was using the values from params further below after it was std::moved. Thankfully, given AudoutParams is a trivially copyable struct, the values would have simply been copied in this instance and not invalidated to garbage values.
2018-07-31audio_core: Move to audout_u impl.bunnei2-4/+6
- This is necessary so streams are created on the same thread.
2018-07-31Implemented various hwopus functions (#853)David2-5/+131
2018-07-28audout: Implement IAudioOut interface with AudioCore.bunnei2-93/+114
2018-07-24core_timing: Split off utility functions into core_timing_utilMerryMage2-0/+2
2018-07-20audren_u: Use a std::array instead of std::string for holding the audio interface/device nameLioncash1-2/+4
std::string doesn't include the null-terminator in its data() + size() range. This ensures that the null-terminator will also be written to the buffer
2018-07-20audout_u: Use a std::array instead of std::string for holding the audio interface nameLioncash1-1/+2
Uses a type that doesn't potentially dynamically allocate, and ensures that the name of the interface is properly null-terminated when writing it to the buffer.
2018-07-19hle_ipc: Introduce generic WriteBuffer overload for multiple container typesLioncash2-3/+3
This introduces a slightly more generic variant of WriteBuffer(). Notably, this variant doesn't constrain the arguments to only accepting std::vector instances. It accepts whatever adheres to the ContiguousContainer concept in the C++ standard library. This essentially means, std::array, std::string, and std::vector can be used directly with this interface. The interface no longer forces you to solely use containers that dynamically allocate. To ensure our overloads play nice with one another, we only enable the container-based WriteBuffer if the argument is not a pointer, otherwise we fall back to the pointer-based one.
2018-07-19hle/service: Make constructors explicit where applicableLioncash1-2/+2
Prevents implicit construction and makes these lingering non-explicit constructors consistent with the rest of the other classes in services.
2018-07-13We only need to alert for memory pool changesDavid Marcec1-2/+0
2018-07-13initialized voice status and unused sizes in the update data headerDavid Marcec1-1/+3
2018-07-12Audout "Auto" functionsDavid Marcec2-14/+14
Audout autos are identical to their counterpart except for the buffer type which yuzu already handles for us.
2018-07-03Update AudioRenderer Voice Sections (#614)David1-0/+87
* voice section updating * fixed slight offset miscalculation * fixed overflow
2018-07-03Rename logging macro back to LOG_*James Rowe3-21/+21
2018-06-25Send the correct RequestUpdateAudioRenderer revision in the output header (#587)David1-1/+1
* We should be returning our revision instead of what is requested. Hardware test on a 5.1.0 console * Added sysversion comment
2018-06-25Service/Audio: add hwopus service, stub GetWorkBufferSize functionmailwl3-0/+51
2018-06-24Removed duplicate structs, changed AudioRendererResponse -> UpdateDataHeader (#583)David2-34/+21
* Removed duplicate structs, changed AudioRendererResponse -> UpdateDataHeader According to game symbols(SMO), there's references to UpdateDataHeader which seems to be what AudioRendererResponse actually is * oops * AudioRendererParameters should be AudioRendererParameter according to SMO
2018-06-23Fixed RequestUpdateAudioRenderer deadlocks and calculated section sizes properly (#580)David2-44/+76
* Fixed RequestUpdateAudioRenderer deadlocks and calculated section sizes properly This fixes RequestUpdateAudioRenderer deadlocks in games like Puyo Puyo Tetris and games which require a proper section size in games such as Retro City Rampage. This fixes causes various games to start rendering or trying to render
2018-06-21Service/Audio: update audren:u servicemailwl2-49/+60
2018-06-20Build: Fixed some MSVC warnings in various parts of the code.Subv1-1/+1
2018-05-26GetAudioRendererWorkBufferSize impl (#465)David2-2/+88
* GetAudioRendererWorkBufferSize impl Impl of GetAudioRendererWorkBufferSize based on RE, if this can be cleaned up, please contribute! * Naming conventions * Removed unneeded placeholder * lioncache changes * fixed const * switched to Common::AlignUp
2018-05-21Correct audio command numbers & add or rename some functions (#455)greggameplayer5-34/+34
* Add unknown function at the number command 2 * correct audout:u commands numbers * correct audrec:u cmd number & add Unknown function * correct IAudioDevice command numbers * correct codecctl cmd numbers & rename the 8 function * correct place of unknown function & fix clang-format
2018-04-30core_timing: Namespace all functions and constants in core_timing's headerLioncash2-2/+2
All of these variables and functions are related to timings and should be within the namespace.
2018-04-24audio: Move logging macros over to new fmt-compatible onesLioncash2-21/+21
2018-04-23GetIUserInterface->CreateUserInterface, Added todos and stub logs. Playreport->PlayReport.David Marcec1-5/+3
2018-04-22Implemented GetIUserInterface properly, Playreport and SSL::SetInterfaceVersion. Fixed ipc issues with IAudioDevice(wrong ids)David Marcec1-6/+9
2018-04-20service: Use nested namespace specifiers where applicableLioncash12-48/+24
Tidies up namespace declarations
2018-04-10Decimal changeHexagon121-4/+4
2018-04-10Updated CodecCtl with more service names.Hexagon121-3/+3
2018-04-10Updated audren with more service names.Hexagon121-10/+14
2018-04-10Updated audrec with more service names.Hexagon121-7/+9
2018-04-10Updated audout with more service names.Hexagon121-13/+16
2018-04-10Updated audin with more service names.Hexagon121-9/+16
2018-04-03audren_u: Stub out GetActiveAudioDeviceName.bunnei1-1/+13
2018-04-03audout_u: Implement GetAudioOutState.bunnei1-1/+8
2018-03-30audren_u: Stub QueryAudioDeviceSystemEvent and GetActiveChannelCount.bunnei1-8/+36
2018-03-25audren_u: Fix GetAudioDevice.bunnei2-7/+48
2018-03-04CoreTiming: Unschedule the pending events when an Interface is destroyed.Subv2-2/+6
2018-02-22Stub more functionsmailwl1-2/+2
2018-02-16Service/hid: stub some functionsmailwl1-1/+2
2018-02-14audio: Use WriteBuffer instead of BufferDescriptorB.bunnei2-9/+3
2018-02-14audren_u: Schedule reoccuring event. (#183)bunnei2-6/+36
* audren_u: Schedule reoccuring event. * audren_u: Stub GetAudioRenderersProcessMasterVolume, and misc. changes.
2018-02-12Add RequestUpdateAudioRenderer, StartAudioRenderer and StopAudioRenderer stubs to audren:ugdkchan1-2/+76
2018-02-07Service: stub some functions in am, audio, time, vi servicesmailwl2-4/+51
2018-01-25audout_u: Various cleanups.bunnei1-29/+17
2018-01-25hle: Rename RequestBuilder to ResponseBuilder.bunnei1-7/+7
2018-01-25service: Fix all incorrect IPC response headers.bunnei1-1/+1
2018-01-25audout:u OpenAudioOut and IAudioOut (#138)st4rk2-14/+166
* Updated the audout:u and IAudioOut, now it might work with RetroArch without trigger an assert, however it's not the ideal implementation * Updated the audout:u and IAudioOut, now it might work with RetroArch without trigger an assert, however it's not the ideal implementation * audout:u OpenAudioOut implementation and IAudioOut cmd 1,2,3,4,5 implementation * using an enum for audio_out_state as well as changing its initialize to member initializer list * Minor fixes, added Service_Audio for LOG_*, changed PcmFormat enum to EnumClass * Minor fixes, added Service_Audio for LOG_*, changed PcmFormat enum to EnumClass * added missing Audio loggin subclass, minor fixes, clang comment breakline * Solving backend logging conflict * minor fix * Fixed duplicated Service NVDRV in backend.cpp, my bad
2018-01-22Stub OpenAudioOut and fix a issue with HID IAppletResource being created more than oncegdkchan2-1/+15
2018-01-22Added stubs for audio services. (#116)st4rk11-5/+299
* stubs for audout:u, audin:u, audrec:u, audren:u, codecctl and decoding tables with nullptr for future implementations * fixing the changes requested (remove private, explicit)
2018-01-15audio: Add files to CMake.bunnei1-1/+0
2018-01-15audio: Stub out AudOutU::ListAudioOuts.bunnei4-0/+82