Commit Graph

36 Commits

Author SHA1 Message Date
Dima
e8e1b910c3 Add possibility to disable audio output 2022-12-02 00:33:28 +01:00
Billy Laws
af90d4f977 Implement audren Surround->Stereo downmixing 2022-04-14 14:14:52 +05:30
PixelyIon
7e9b0fec77 Increase reported audren revision to 11
Some games crash due to requiring an `audren` version greater than 7. The `audren` version can be increased without any issues as `audren` is stubbed and therefore the reported version doesn't matter.
2022-04-14 14:14:52 +05:30
Billy Laws
78238d550a Add 6 channel downmixing support for Audout
The specific attenuations used for each channel are taken from Ryujinx.
2022-04-14 14:14:52 +05:30
lynxnb
5cd1f01690 Refactor all logger calls 2021-11-11 16:13:24 +01:00
PixelyIon
df64ff5d14 Zero-Fill IAudioRenderer::RequestUpdate Output Buffer
Some titles don't clear the output buffer prior to submission, as the service is expected to fill all of it in, our audren implementation is incomplete and doesn't end up doing this leaving the contents of the buffer to be undefined leading to UB in the form of SEGFAULTs or the application throwing a fatal error. This has been patched over by 0-filling the buffer which is a sane default value for the fields that aren't filled in albeit not a replacement for a proper audren implementation.
2021-10-27 16:18:20 +05:30
Billy Laws
48acb6d369 Address a bunch of issues detected by clang-tidy 2021-03-06 18:58:04 +05:30
Billy Laws
ce0e032255 Avoid constantly signalling audren DSP done event
This was causing a significant amount of sched thrashing and pinning a
core to 100% as games constantly updated audren, now change it to only
signal on buffer release.
2021-03-05 14:55:34 +05:30
◱ PixelyIon
ef52e22cef Improve Synchronization SVCs + Fix TLS Page Allocation Race + Fix KProcess::GetHandle<KObject> 2021-03-05 14:55:34 +05:30
Billy Laws
4c9d453008 Update formatter config for new AS and reformat 2020-11-22 23:56:17 +05:30
◱ PixelyIon
779884edcf Introduce TID to Logger + Fix VMM Bug + Fix NSO Backtrace + Improve Logger 2020-11-22 23:56:17 +05:30
Billy Laws
17feb68eb5 Fix audren voice sample copying 2020-11-22 23:56:17 +05:30
◱ PixelyIon
02f3e37c4f Remove KProcess Memory Functions 2020-11-22 23:56:17 +05:30
◱ PixelyIon
4070686897 Refactor Comments + Other Minor Fixes 2020-10-02 15:28:48 +00:00
◱ PixelyIon
429af1990a Equal -> Brace Initializer + Remove Constexpr Auto for Integers 2020-10-02 15:28:48 +00:00
◱ PixelyIon
2764bd7c96 Use Vector for Kernel Handles + Remove Redundant Includes 2020-10-02 15:28:48 +00:00
◱ PixelyIon
20559c5dca Introduce Custom Span Class + IPC Buffer -> Span 2020-10-02 15:28:48 +00:00
◱ PixelyIon
4d6ae9aa26 Constexpr Maps for Service Functions 2020-10-02 15:28:48 +00:00
Billy Laws
89718804d0 Refactor service functions to return result codes 2020-09-06 19:12:18 +00:00
Billy Laws
74a150dff1 Rework service API to be cleaner with significantly less boilerplate
This patch reduces the burden of adding services significantly, rather
than having to create an enum entry and add strings in the constructor
it will all be determined at runtime through RTTI. A macro is also used
in the service creation case to reduce clutter.
2020-09-06 19:12:18 +00:00
Billy Laws
d8ccdd723e
Refactor Audio + Fix NV Bugs (#92)
* Fix NvHostCtrl:EventSignal event ID parsing
* Divide the audout buffer length by the sample size
* Correct audout channel quantity handling
* A few bugfixes for audio tracks
* * Correctly lock in CheckReleasedBuffers and only call the callback once
* * Check if the identifier queue is empty before accessing it's iterator
* Refactor audio to better fit the codestyle
* Explictly specify reference when using GetReference
* Fix CheckReleasedBuffers
2020-08-21 18:58:47 +05:30
Billy Laws
817d37600e Convert all make all hex uppercase according to codestyle 2020-08-15 10:21:41 +00:00
Billy Laws
ade8a711fb Format code and misc cleanup 2020-08-15 10:21:41 +00:00
Billy Laws
e3313ae731 Use the device sample rate when creating an audio track in audren 2020-07-17 14:30:53 +00:00
Willi Ye
c69e72a12e services: Add missing audio functions
* Those are needed to run playtone and audren from switch homebrew examples
2020-07-13 21:14:57 +01:00
Billy Laws
6329537a9e Correct audren event handling and zero the sample buffer
Not zeroing the sample buffer causes issues when a voice is started but
is playing no samples. The system event handling was also reworked
according to Thog's info.
2020-07-09 14:08:58 +00:00
Billy Laws
30936ce6dc Implement an ADPCM decoder for audren
This is used by many retail games, it only supports mono sound.

This implementation is based on Ryu's.
2020-07-09 13:56:04 +00:00
◱ PixelyIon
c76ef3730b Move to MPL-2.0
We earlier moved to LGPLv3.0 or Later. This was a mistake as what we wanted was being able to link to proprietary libraries but LGPL is the opposite and it allows linking proprietary libraries to libskyline instead. After further consideration, we've moved to MPL-2.0, it allows linking to proprietary libraries and is a standardized license as compared to adding an exception to GPL.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
fb1a158e8f Optimize Audio by using Circular Buffers, Handle Device Disconnection and Fix Some Bugs
This optimizes a lot of audio by using a circular buffer rather than queues. In addition to handling device disconnection using oboe callbacks and fix bugs in regards to audio saturation.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
4e4ed5aac0 Refactor Audio
This commit refactors a lot of audio by fixing a lot of nitpicks here and there.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
af98455ede Add Mutexes to Logger, Introduce util::MakeMagic and Refactor IPC
This commit adds mutexes to the logger so they produce a valid log file rather than breaking due to a race condition. It also introduced `util::MakeMagic` so the magic functions are far more clear. A small refactor of IPC was also done which cleared up some of the for loops.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
c37f350c02 Move from GPLv3 to LGPLv3 or later
Skyline has been licensed with GPLv3 but as we want to look into optional ads in the future, and that would require linking AdMob SDKs which are proprietary. So, we decided to move to LGPLv3 so we could keep that option open as a revenue stream. 

We've gathered consent from all contributors for the license change:
* PixelyIon - https://github.com/PixelyIon (Commit Author)
* Zephyren25 - https://github.com/zephyren25
* ByLaws - https://github.com/bylaws
* IvarWithoutBones - https://github.com/IvarWithoutBones
* Cyuubi - https://github.com/Cyuubi
* greggamesplayer - https://github.com/greggameplayer
2020-04-23 22:26:27 +05:30
◱ PixelyIon
a60ab89c5d Fix Include Order
This commit fixes the include order of files throughout the code-base to be compliant with the new guidelines.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
d75d30b809 Minor Audio Refactor (and fix sm:IUserManager service name)
This makes some tiny changes to audio to make them compliant with the guidelines. In addition, to changing `IUserManager:IUserManager` to `sm:IUserManager`.
2020-04-23 22:26:27 +05:30
◱ PixelyIon
773ee25e5a Refactor Common
This refactored common by:
* Moving out as many constants to class/function local scopes from being declared in `common`
* Spacing out common and any function to which a constant was moved out to
* Fixing comments here and there
In addition, some naming inconsistencies were fixed as well.
2020-04-23 22:26:27 +05:30
Billy Laws
52d47120a8 Refactor audio backend and services
Use the new service naming convention.
Move both audout and audren into one directory.
Close the audio stream upon emulator exit.
2020-04-23 22:26:27 +05:30