summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/audio (unfollow)
Commit message (Collapse)AuthorFilesLines
2024-02-17service: audio: Rewrite IAudioController to new IPCNarr the Reg5-253/+234
2024-02-14service: set: Migrate ISystemSettingsServer to new IPCNarr the Reg1-2/+2
2024-01-28Use the input process handle to get the correct application's memoryKelebek11-6/+10
2024-01-28service: set: Implement more Qlaunch Settingsgerman772-18/+86
2024-01-25result: Make fully constexpr, add ON_RESULT_INCLUDEDFearlessTobi1-1/+2
2024-01-12audio: fetch process object from handle tableLiam2-13/+49
2023-12-25service: fetch objects from the client handle tableLiam2-16/+6
2023-12-16Have GetActiveChannelCount return the system channels instead of host device channelsKelebek11-1/+1
2023-09-16Reimplement HardwareOpusKelebek13-333/+426
2023-09-04Rework ADSP into a wrapper for appsKelebek14-5/+5
2023-08-30hwopus: Implement GetWorkBufferSizeExExFearlessTobi2-1/+6
Allows Sea of Stars to boot. Fixes https://github.com/yuzu-emu/yuzu/issues/11415.
2023-08-27hwopus: Implement OpenHardwareOpusDecoderForMultiStreamEx and DecodeInterleavedForMultiStreamFearlessTobi2-3/+51
Allows MLB The Show 22 to boot. Fixes https://github.com/yuzu-emu/yuzu/issues/7911.
2023-08-06service: audctl: Stub functions needed by Qlaunchgerman772-4/+64
2023-08-01audren_u: Fix parameter alignmentMorph1-2/+3
The reduction in size from 0x38 to 0x34 caused the parameter to be misaligned. Skipping 1 word fixes this.
2023-07-01general: Use ScratchBuffer where possibleMorph4-31/+37
2023-06-22Remove memory allocations in some hot pathsKelebek15-35/+28
2023-04-16core: audio: return result when audio_out initialize failedFengChen1-6/+8
2023-03-07hle: rename legacy errors to ResultsLiam2-15/+15
2023-03-01service: move hle_ipc from kernelLiam10-104/+92
2023-02-25core: Update service function tables to 16.0.0+Narr the Reg1-0/+2
2023-02-21service: refactor server architectureLiam5-28/+26
Converts services to have their own processes
2023-02-14service: remove deleted servicesLiam11-239/+0
2023-02-14remove static from pointer sized or smaller types for aesthetics, change constexpr static to static constexpr for consistencyarades792-3/+3
Signed-off-by: arades79 <scravers@protonmail.com>
2023-02-14add static lifetime to constexpr values to force compile time evaluation where possiblearades792-3/+3
Signed-off-by: arades79 <scravers@protonmail.com>
2023-02-14general: rename CurrentProcess to ApplicationProcessLiam1-1/+1
2023-02-03Revert "Merge pull request #9718 from yuzu-emu/revert-9508-hle-ipc-buffer-span"ameerj2-2/+2
This reverts commit 25fc5c0e1158cb8e81cbc769b24ad84032a1fbfd, reversing changes made to af20e25081f97d55b451606c87922e2b49f0d363.
2023-02-02Revert "hle_ipc: Use std::span to avoid heap allocations/copies when calling ReadBuffer"liamwhite2-2/+2
2022-12-29hle_ipc: Rename ReadBufferSpan to ReadBufferameerj4-10/+10
2022-12-25service: Use ReadBufferSpan where it is trivial to do soameerj4-11/+11
2022-12-14Revert "hle: service: audio: Use default service thread."bunnei3-12/+18
2022-11-23service: Make use of buffer element count helpersLioncash4-14/+14
2022-11-23general: fix compile for Apple ClangLiam1-0/+1
2022-11-12hle: service: audio: Use default service thread.bunnei3-18/+12
- This was arbitrarily added by me, and does not appear to be helpful.
2022-10-26audio_in/out_system: Pass Initialize members by value where applicableLioncash2-2/+2
applet_resource_user_id isn't actually modified and is just assigned to a member variable, so this doesn't need to be a mutable reference. Similarly, the device name itself isn't modified and is only moved. We pass by value here, since we can still perform the move, but eliminate a sneaky set of calls that can unintentionally destroy the original string. Given how nested the calls are, it's good to get rid of this potential vector for a use-after-move bug.
2022-10-19Update audio_core for firmware 15.0.0Kelebek12-0/+42
2022-10-13kernel: remove KWritableEventLiam1-2/+2
2022-09-16core: implement HwOpus GetWorkBufferSizeForMultiStreamExFengChen2-1/+38
2022-09-15audio_device: Mark member functions as const where applicableLioncash1-2/+2
These member functions don't modify any internal state.
2022-09-15audio_device: Make AudioDeviceName constructor constexprLioncash1-2/+1
These are used as read-only arrays, so we can make the data read-only and available at compile-time. Now constructing an AudioDevice no longer needs to initialize some tables
2022-08-24Implement AudRenU:RequestUpdateAuto, and use C descriptors when B reports as empty.Kelebek11-6/+21
2022-07-22Project AndioKelebek18-743/+761
2022-06-27core: Replace all instances of ResultCode with Resultgerman771-3/+3
2022-04-23general: Convert source file copyright comments over to SPDXMorph27-81/+54
This formats all copyright comments according to SPDX formatting guidelines. Additionally, this resolves the remaining GPLv2 only licensed files by relicensing them to GPLv2.0-or-later.
2022-04-02hle: service: audio: Create a service thread where appropriate.bunnei2-4/+6
2022-01-21service/audio: Update audctl unknown function namesLioncash1-8/+8
2021-12-02general: Replace high_resolution_clock with steady_clockMorph1-2/+2
On some OSes, high_resolution_clock is an alias to system_clock and is not monotonic in nature. Replace this with steady_clock.
2021-11-04core: Remove unused includesameerj2-4/+0
2021-10-07service: Reduce header include overheadMorph4-4/+0
2021-10-02service: Replace service event creation with ServiceContext::CreateEventMorph5-41/+55
The service context helps to manage all created events and allows us to close them upon destruction.
2021-09-27service/audio: Update to 13.0.0german772-1/+10
2021-09-15audin_u: Return a buffer event in RegisterBufferEventlat9nq2-2/+12
Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com>
2021-09-15audin_u: stub Start, RegisterBufferEvent, AppendAudioInBufferAutolat9nq2-26/+57
This also moves IAudioIn's definition to the header. Required for Splatoon 2 LAN play.
2021-07-06Report 2 channels active. Fixes Tales of Vesperia's mono channel audio.Kelebek11-1/+1
2021-07-01Fix XC2/VOEZ crashing, add audio looping and a few misc fixesKelebek11-1/+1
2021-06-27Decouple audio processing and run at variable rateKelebek11-4/+6
Currently, processing of audio samples is called from AudioRenderer's Update method, using a fixed 4 buffers to process the given samples. Games call Update at variable rates, depending on framerate and/or sample count, which causes inconsistency in audio processing. From what I've seen, 60 FPS games update every ~0.004s, but 30 FPS/160 sample games update somewhere between 0.02 and 0.04, 5-10x slower. Not enough samples get fed to the backend, leading to a lot of audio skipping. This PR seeks to address this by de-coupling the audio consumption and the audio update. Update remains the same without calling for buffer queuing, and the consume now schedules itself to run based on the sample rate and count.
2021-06-26hle: service: hwopus: OpenHardwareOpusDecoderEx: Remove unused buffer size.bunnei1-1/+30
2021-06-25hle: service: hwopus: Implement GetWorkBufferSizeEx and OpenHardwareOpusDecoderEx.bunnei2-5/+15
- This is used by the latest update of Doom Eternal.
2021-06-22Implement audout GetAudioOutPlayedSampleCountKelebek11-1/+9
Used in Ninja Gaiden games.
2021-06-02general: Replace RESULT_UNKNOWN with ResultUnknownMorph1-2/+2
Transition to PascalCase for result names.
2021-06-02general: Replace RESULT_SUCCESS with ResultSuccessMorph5-42/+42
Transition to PascalCase for result names.
2021-05-16core: Make variable shadowing a compile-time errorLioncash2-6/+7
Now that we have most of core free of shadowing, we can enable the warning as an error to catch anything that may be remaining and also eliminate this class of logic bug entirely.
2021-05-11audrenbunnei2-25/+16
2021-05-06hle: kernel: Migrate KReadableEvent and KWritableEvent to KAutoObject.bunnei2-3/+3
2021-05-06hle: kernel: Ensure all kernel objects with KAutoObject are properly created.bunnei2-0/+5
2021-05-06hle: kernel: Migrate KEvent to KAutoObject.bunnei2-31/+25
2021-05-04service: Resolve cases of member field shadowingLioncash1-2/+3
Now all that remains is for kernel code to be 'shadow-free' and then -Wshadow can be turned into an error.
2021-04-09codecctl: Use proper namesgerman771-13/+13
2021-04-09audren_u: Use proper namesgerman772-4/+4
2021-04-09audren_a: Use proper namesgerman771-6/+6
2021-04-09audrec_u: Use proper names, update to 12.xgerman771-3/+4
2021-04-09audrec_a: Use proper namesgerman771-2/+2
2021-04-09audout_u: Use proper namesgerman771-3/+3
2021-04-09audout_a: Use proper namesgerman771-6/+6
2021-04-09audin_u: Use proper namesgerman771-7/+7
2021-04-09audin_a: Use proper namesgerman771-4/+4
2021-04-07hwopus: Update to 12.xMorph1-0/+4
2021-02-05hle: kernel: Reimplement KReadableEvent and KWritableEvent.bunnei2-23/+27
2021-02-05hle: kernel: Rename WritableEvent to KWritableEvent.bunnei2-7/+7
2021-02-05hle: kernel: Rename ReadableEvent to KReadableEvent.bunnei2-2/+2
2021-01-24audout: FlushAudioOutBuffersChloe Marcec1-1/+9
Fixes Devil May Cry
2021-01-15core: Silence Wclass-memaccess warningsReinUsesLisp1-1/+1
This requires making several types trivial and properly initialize them whenever they are called.
2020-12-29hle: service: Acquire and release a lock on requests.bunnei2-9/+11
- This makes it such that we can safely access service members from CoreTiming thread.
2020-11-27service: Eliminate usages of the global system instanceLioncash25-59/+87
Completely removes all usages of the global system instance within the services code by passing in the using system instance to the services.
2020-10-21Revert "core: Fix clang build"bunnei2-19/+17
2020-10-18core: Fix clang buildLioncash2-17/+19
Recent changes to the build system that made more warnings be flagged as errors caused building via clang to break. Fixes #4795
2020-08-13General: Tidy up clang-format warnings part 2Lioncash1-1/+1
2020-08-03yuzu: Resolve C++20 deprecation warnings related to lambda capturesLioncash1-1/+1
C++20 deprecates capturing the this pointer via the '=' capture. Instead, we replace it or extend the capture specification.
2020-08-03ipc: Allow all trivially copyable objects to be passed directly into WriteBuffer (#4465)David1-1/+1
* ipc: Allow all trivially copyable objects to be passed directly into WriteBuffer With the support of C++20, we can use concepts to deduce if a type is an STL container or not. * More agressive concept for stl containers * Add -fconcepts * Move to common namespace * Add Common::IsBaseOf
2020-07-25audio_core: Apollo Part 1, AudioRenderer refactorDavid Marcec1-72/+77
2020-04-28marked stubsDavid Marcec1-4/+5
2020-04-28Audin:u ListAudioIns, OpenAudioIn, ListAudioInsAuto, OpenAudioInAuto, ListAudioInsAutoFiltered, OpenAudioInProtocolSpecifiedDavid Marcec2-5/+93
Closes #2874
2020-04-21audio_renderer: Preliminary BehaviorInfo (#3736)David1-2/+7
* audio_renderer: Preliminary BehaviorInfo * clang format * Fixed IsRevisionSupported * fixed IsValidRevision * Fixed logic error & spelling errors & crash * Addressed issues
2020-04-20service: Update function tablesLioncash1-0/+2
Keeps the service function tables up to date. Updated based off information on SwitchBrew.
2020-04-20audren: Lower log level for RequestUpdateImpl to DebugFearlessTobi1-1/+1
2020-04-18service: Remove unused RequestParser instancesLioncash1-2/+0
These aren't used, so they should be removed to reduce compilation warnings.
2020-04-17core: memory: Move to Core::Memory namespace.bunnei1-1/+1
- helpful to disambiguate Kernel::Memory namespace.
2020-04-16CMakeLists: Specify -Wextra on linux buildsLioncash1-1/+1
Allows reporting more cases where logic errors may exist, such as implicit fallthrough cases, etc. We currently ignore unused parameters, since we currently have many cases where this is intentional (virtual interfaces). While we're at it, we can also tidy up any existing code that causes warnings. This also uncovered a few bugs as well.
2020-02-11update hwopus DecodeInterleaved for FW 7.0.0+makigumo1-2/+4
trivial change, see https://switchbrew.org/wiki/Audio_services#IHardwareOpusDecoder
2019-11-27core/memory: Migrate over Read{8, 16, 32, 64, Block} to the Memory classLioncash1-2/+4
With all of the trivial parts of the memory interface moved over, we can get right into moving over the bits that are used. Note that this does require the use of GetInstance from the global system instance to be used within hle_ipc.cpp and the gdbstub. This is fine for the time being, as they both already rely on the global system instance in other functions. These will be removed in a change directed at both of these respectively. For now, it's sufficient, as it still accomplishes the goal of de-globalizing the memory code.
2019-11-27core: Prepare various classes for memory read/write migrationLioncash1-2/+3
Amends a few interfaces to be able to handle the migration over to the new Memory class by passing the class by reference as a function parameter where necessary. Notably, within the filesystem services, this eliminates two ReadBlock() calls by using the helper functions of HLERequestContext to do that for us.
2019-11-12service: Update function tablesLioncash1-0/+1
Keeps the function tables up to date. Updated based off information from Switchbrew.
2019-11-12service: Resolve sign conversion errorsLioncash1-2/+2
These are fairly trivial to resolve and most of the changes entail using RESULT_UNKNOWN over ResultCode(-1).
2019-11-03kernel: events: Remove ResetType::Automatic.bunnei2-8/+8
- This does not actually seem to exist in the real kernel - games reset these automatically. # Conflicts: # src/core/hle/service/am/applets/applets.cpp # src/core/hle/service/filesystem/fsp_srv.cpp
2019-10-05audio/audout_u: Change formatting for old clang-format versionsReinUsesLisp1-1/+1
2019-10-05service/audio: Silence -WunusedReinUsesLisp1-1/+1
2019-09-04Add Kernel::EventPair audio_input_device_switch_event;Morph19841-0/+1
2019-09-04remove <f32>Morph19841-1/+1
We can remove this since its already a f32 value
2019-09-04audren_u: Stub IAudioDevice::QueryAudioDeviceInputEventMorph19841-1/+14
2019-09-04explicitly represent 1 as a float (1.0f instead of 1)Morph19841-1/+1
2019-09-04Change u32 -> f32Morph19841-1/+1
Volume is a f32 value. (SwIPC describes it as a u32, but it is actually f32 as corroborated by switchbrew docs and SetAudioDeviceOutputVolume) ```cpp const f32 volume = rp.Pop<f32>(); ```
2019-09-03service/audio/audren_u: Stub IAudioDevice::GetAudioDeviceOutputVolumeMorph19841-2/+15
2019-07-19service/audren_u: Handle audio USB output revision queries in ListAudioDeviceName()Lioncash2-16/+45
Audio devices use the supplied revision information in order to determine if USB audio output is able to be supported. In this case, we can only really handle using this revision information in ListAudioDeviceName(), where it checks if USB audio output is supported before supplying it as a device name. A few other scenarios exist where the revision info is checked, such as: - Early exiting from SetAudioDeviceOutputVolume if USB audio is attempted to be set when that device is unsupported. - Early exiting and returning 0.0f in GetAudioDeviceOutputVolume when USB output volume is queried and it's an unsupported device. - Falling back to AHUB headphones in GetActiveAudioDeviceName when the device type is USB output, but is unsupported based off the revision info. In order for these changes to also be implemented, a few other changes to the interface need to be made. Given we now properly handle everything about ListAudioDeviceName(), we no longer need to describe it as a stubbed function.
2019-07-19service/audren_u: Move revision testing code out of AudRenULioncash2-63/+63
The revision querying facilities are used by more than just audren. e.g. audio devices can use this to test whether or not USB audio output is supported. This will be used within the following change.
2019-07-19service/audio: Remove global system accessorsLioncash6-33/+53
Trims out the lingering reliance on global state out of the audio code.
2019-07-19service/audren_u: Remove unnecessary return value from GetActiveAudioDeviceName()Lioncash1-2/+1
This service function only ever returns a result and nothing more.
2019-07-19service/audren_u: Report proper device namesLioncash1-6/+29
AudioDevice and AudioInterface aren't valid device names on the Switch. We should also be returning consistent names in GetActiveAudioDeviceName(). While we're at it, we can also handle proper name output in ListAudioDeviceName, by returning all the available devices on the Switch.
2019-07-12Clang formatDavid Marcec1-2/+4
2019-07-12"AudioRenderer" thread should have a unique nameDavid Marcec2-4/+4
Creating multiple "AudioRenderer" threads cause the previous thread to be overwritten. The thread will name be renamed to AudioRenderer-InstanceX, where X is the current instance number.
2019-07-01IAudioDevice::QueryAudioDeviceOutputEventDavid Marcec1-3/+16
The event should only be signaled when an output audio device gets changed. Example, Speaker to USB headset. We don't identify different devices internally yet so there's no need to signal the event yet.
2019-06-20Revert PR 2590.Fernando Sahmkow1-1/+1
Even though it has been proven that IAudioRenderer:SystemEvent is actually an automatic event. The current implementation of such event is all thought to be manual. Thus it's implementation needs to be corrected when doing such change. As it is right now this PR introduced a series of regressions on softlocks on multiple games. Therefore, this pr reverts such change until a correct implementation is made.
2019-06-18service/audio/audren_u: Correct event reset type for the system eventLioncash1-1/+1
This is actually an auto-reset event in the audio service itself, not a manual one.
2019-06-16CleanupDavid Marcec1-2/+2
2019-06-16Impl'd IsUserAccountSwitchLocked, SetAudioOutVolume, GetAudioOutVolume & Partial impl of GetAccumulatedSuspendedTickChangedEventDavid Marcec1-2/+21
IPC-100 was changed to InitializeApplicationInfoOld instead of InitializeApplicationInfo. IPC-150 makes an indentical call to IPC-100 however does extra processing. They should not have the same name as it's quite confusing to debug.
2019-05-18core/kernel/object: Rename ResetType enum membersLioncash2-3/+3
Renames the members to more accurately indicate what they signify. "OneShot" and "Sticky" are kind of ambiguous identifiers for the reset types, and can be kind of misleading. Automatic and Manual communicate the kind of reset type in a clearer manner. Either the event is automatically reset, or it isn't and must be manually cleared. The "OneShot" and "Sticky" terminology is just a hold-over from Citra where the kernel had a third type of event reset type known as "Pulse". Given the Switch kernel only has two forms of event reset types, we don't need to keep the old terminology around anymore.
2019-05-01service/audren_u: Handle variadic command buffers in GetWorkBufferSize()Lioncash2-17/+93
Also introduced in REV5 was a variable-size audio command buffer. This also affects how the size of the work buffer should be determined, so we can add handling for this as well. Thankfully, no other alterations were made to how the work buffer size is calculated in 7.0.0-8.0.0. There were indeed changes made to to how some of the actual audio commands are generated though (particularly in REV7), however they don't apply here.
2019-05-01service/audren_u: Handle version 2 of performance frame info in GetWorkBufferSize()Lioncash2-6/+13
Introduced in REV5. This is trivial to add support for, now that everything isn't a mess of random magic constant values. All this is, is a change in data type sizes as far as this function cares.
2019-05-01service/audren_u: Clean up work buffer calculationsLioncash1-49/+214
"Unmagics" quite a few magic constants within this code, making it much easier to understand. Particularly given this factors out specific sections into their own self-contained lambda functions.
2019-04-28service/audctl: Update documentation comments to be relative to 8.0.0Lioncash1-2/+2
The state of these service calls are still the same in version 8.0.0.
2019-04-18service/audctl: Implement GetTargetVolumeMin() and GetTargetVolumeMax()Lioncash2-2/+32
These two service functions are literally hardcoded to always return these values without any other error checking.
2019-04-11service: Update service function tablesLioncash2-1/+5
Updates function tables based off information from SwitchBrew.
2019-04-04hle/service: Resolve unused variable warningsLioncash2-11/+6
In several places, we have request parsers where there's nothing to really parse, simply because the HLE function in question operates on buffers. In these cases we can just remove these instances altogether. In the other cases, we can retrieve the relevant members from the parser and at least log them out, giving them some use.
2019-04-04core: Add missing override specifiers where applicableLioncash2-8/+0
Applies the override specifier where applicable. In the case of destructors that are defaulted in their definition, they can simply be removed. This also removes the unnecessary inclusions being done in audin_u and audrec_u, given their close proximity.
2019-03-11hwopus: Leverage multistream API for decoding regular Opus packetsLioncash1-34/+48
After doing a little more reading up on the Opus codec, it turns out that the multistream API that is part of libopus can handle regular packets. Regular packets are just a degenerate case of multistream Opus packets, and all that's necessary is to pass the number of streams as 1 and provide a basic channel mapping, then everything works fine for that case. This allows us to get rid of the need to use both APIs in the future when implementing multistream variants in a follow-up PR, greatly simplifying the code that needs to be written.
2019-03-07service/audio/hwopus: Move decoder state to its own classLioncash1-50/+85
Moves the non-multistream specific state to its own class. This will be necessary to support the multistream variants of opus decoding.
2019-03-07service/audio/hwopus: Provide a name for the second word of OpusPacketHeaderLioncash1-2/+4
This indicates the entropy coder's final range.
2019-03-07service/audio/hwopus: Move Opus packet header out of the IHardwareOpusDecoderManagerLioncash1-17/+17
This will be utilized by more than just that class in the future. This also renames it from OpusHeader to OpusPacketHeader to be more specific about what kind of header it is.
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-07service/audio/audout_u: Only actually stop the audio stream in StopAudioOut if the stream is playingLioncash1-1/+3
The service itself only does further actions if the stream is playing. If the stream is already stopped, then it just exits successfully.
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