summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon
AgeCommit message (Collapse)Author
2026-01-27feat: Add an option to preserve audio pitch when emulation speed changes, ↵Sam Belliveau
integrating it into core configuration and both Qt and Android UIs.
2026-01-25Remove unused importsMartino Fontana
Yellow squiggly lines begone! Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes. If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed. The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports. Not everything is removed, but the cleanup should be substantial enough. Because this done on Linux, code that isn't used on it is mostly untouched. (Hopefully no open PR is depending on these imports...)
2025-11-22AudioCommon / VideoBackends / WinUpdater - cleanup WRL codeoltolm
2025-11-07CubebStream: Use WorkQueueThread::PushBlocking instead of sync_eventDentomologist
Push and wait on WorkQueueThread items using PushBlocking. Previously we created a Common::Event sync_event on the caller's stack, called Wait on it, then had the WorkQueueThread call Set on the sync_event once the thread was done. In addition to being simpler the new way avoids a use-after-free that could happen in convoluted and unlikely yet possible thread scheduling sequences. One such case can be triggered as follows: * Set your audio backend to Cubeb * In CubebStream::SetVolume set a breakpoint at the call to Wait and at the call to cubeb_stream_set_volume. * Start a game. * Continue until the Cubeb Worker thread hits the cubeb_stream_set_volume breakpoint and Emuthread hits the Wait breakpoint, freezing each thread when it hits its breakpoint. * Unfreeze Cubeb Worker. * In Event::Set set a breakpoint at the end of the scope containing the lock_guard such that the guard has been constructed but not destructed when the breakpoint is hit. * Continue until that breakpoint is hit by Cubeb Worker. If other threads hit it first keep going. * Freeze Cubeb Worker. * For convenience remove the breakpoint in Event::Set so other threads don't trigger it. * In CubebStream::SetRunning set a breakpoint at the call to Wait. * Unfreeze Emuthread and continue until the breakpoint is hit. * In Cubeb Worker go to Event::Set and examine the values of m_mutex's member variables. In Visual Studio Debug these are locking_thread_id == 0xcccccc01 and ownership_levels == 0xcccccccc. This is the result of Visual Studio overwriting the memory used on the stack by sync_event in CubebStream::SetVolume with cc bytes to represent uninitialized memory on the stack (since that function already returned), and then allocating enough memory on the stack when calling AudioCommon::SetSoundStreamRunning and then CubebStream::SetRunning that it overwrote one byte of the memory formerly occupied by locking_thread_id. * If you unfreeze Cubeb Worker at this point it will trigger the lock guard's destructor which will then try to unlock m_mutex. Since m_mutex is no longer in scope this is a use-after-free, and in VS debug triggers a debug assert due to locking_thread_id not matching the current thread id.
2025-08-05Merge pull request #13725 from Sam-Belliveau/more-consistent-loopingJMC47
Fade audio after an entire loop
2025-07-23AudioCommon/Mixer: Skip sample processing when NullSoundStream is being used.Jordan Woyak
2025-07-11AudioCommon/Mixer: make large array in Mixer::MixerFifo::Enqueue() static ↵ITotalJustice
so that it's not created on the stack.
2025-06-08AudioCommon: Re-add missing includesJosJuice
7c237bb ("AudioCommon: Remove unused includes") removed some includes that were in fact in use.
2025-06-07Merge pull request #12836 from JosJuice/opensles-buffer-sizeJMC47
Android: Ask system for optimal audio buffer size and sample rate
2025-06-08Merge pull request #13727 from JoshuaVandaele/fmt-11.2.0-localtime-deprecTilka
fmt: Replace deprecated `fmt::localtime` usage with `Common::LocalTime`
2025-06-07Merge pull request #13522 from ↵Jordan Woyak
tygyh/Enforce-overriding-destructor-style-Core&UnitTests Core & UnitTests: Make overriding explicit and remove redundant virtual specifiers on overriding destructors
2025-06-07Merge pull request #13697 from tygyh/AudioCommon/Remove-unused-includesJordan Woyak
AudioCommon: Remove unused includes
2025-06-07Merge pull request #13698 from ↵Jordan Woyak
tygyh/AudioCommon/Remove-unused-qualifiers-and-make-variables-constant AudioCommon: Remove unused qualifiers and make variables constant
2025-06-04fmt: Replace deprecated `fmt::localtime` usage with `Common::LocalTime`Joshua Vandaële
2025-06-02Fade audio after an entire loopSam Belliveau
2025-06-01WaveFile: Add m_ prefix to member variablesDentomologist
2025-05-30AudioCommon: Remove unused qualifiers and make variables constantDr. Dystopia
2025-05-25Android: Ask system for optimal audio buffer size and sample rateJosJuice
This can reduce audio latency according to https://developer.android.com/ndk/guides/audio/opensl/opensl-prog-notes#perform. Previously we were using the hardcoded values of 48000 Hz and 256 frames per buffer. The sample rate we use with this change is 48000 Hz on all devices I'm aware of, but the buffer size does vary across devices. Terminology note: The old code used the term "sample" to refer to what Android refers to as a "frame". "Frame" is a clearer term to use for this, so I've changed OpenSLESStream's terminology. One frame consists of one sample per channel.
2025-05-25Android: Get rid of OpenSLESStream's global stateJosJuice
Not sure if we're ever going to want to have more than one of these at the same time, but these global variables are a code smell nonetheless. I'm also deleting the existing member variables because they were unused.
2025-05-25AudioCommon: Remove unused includesDr. Dystopia
2025-05-07CubebUtils: Add COM helper classSepalani
2025-05-07IOS/USB: Emulate Wii Speak using cubebSepalani
Based on @noahpistilli (Sketch) PR: https://github.com/dolphin-emu/dolphin/pull/12567 Fixed the Windows support and the heisenbug caused by uninitialized members. Config system integration finalized.
2025-05-04Merge pull request #13608 from jordan-woyak/async-work-threadAdmiral H. Curtiss
Common: Add AsyncWorkThread.
2025-05-02AudioCommon/CubebUtils: Fix logged file name.Jordan Woyak
2025-05-01Core and AudioCommon: Use AsyncWorkThread.Jordan Woyak
2025-05-01Make overriding explicit and remove redundant virtual specifiers on ↵Dr. Dystopia
overriding destructors - Core & UnitTests
2025-04-21AudioCommon: Make cubeb sound backend default on Linux.Jordan Woyak
2025-04-05Mixer: Use Doubles for Sample Rate Conversion.Sam Belliveau
2025-04-01Improve Performance of Granular Buffering + User Adjustable Buffer SizeSam Belliveau
2025-03-26AudioPanel: Refactor to use Config system. Some options were changed to a ↵TryTwo
different format, for easier compatibility. Removed VolumeChanged signal, as ConfigChanged will trigger what is needed. Only applies UpdateSoundStream to things that can change during emulation. Settings::SetVolume might no longer be used, but left it in.
2025-03-14AudioCommon: Added Granular SynthesisSam Belliveau
2025-01-25CMakeLists: Add flag to disable CubebOatmealDome
2024-07-26Adjust order and spacing of various #includesDentomologist
Move some #includes around to match the Contributing guidelines.
2024-06-20AudioCommon: unlock mutex explicitly to avoid -Wunused-result warningTillmann Karras
2024-06-04Android: Implement OpenSLESStream::SetRunningJosJuice
2024-04-16AudioCommon: When ALSA is absent on Linux, default to Cubeb backendDentomologist
Default to Cubeb instead of the NULL backend on Linux when ALSA isn't valid.
2024-04-14Set default sound backend on OpenBSD to cubebBrad Smith
Set the default sound backend to cubeb instead of the default being none.
2024-03-17Cubeb: check correct log levelTillmann Karras
2024-03-14Cubeb: change log level from NOTICE to INFOTillmann Karras
Cubeb logs a message at CUBEB_LOG_NORMAL verbosity every time you start or stop a stream which can get a bit annoying when using frame advance at Dolphin's default verbosity.
2023-08-17Use structs for config callback IDsJosJuice
This way you can't mix up regular config callback IDs and CPU thread config callback IDs. (It would be rather bad if you did!)
2023-07-22cubeb: Change name to "Dolphin Emulator"Martino Fontana
To avoid conflicts with KDE's file manager.
2023-06-30Merge pull request #11955 from TellowKrinkle/CMakeDependenciesAdmiral H. Curtiss
CMake: Allow ignoring system packages
2023-06-18Replace std::ostringstream usage with fmt::formatget
2023-06-15CMake: Use targets for all optionally-external dependenciesTellowKrinkle
2023-03-22Common: Move FixedSizeQueue into Common namespaceLioncash
Gets this out of the global namespace.
2023-03-13Skylander Portal: Play Trap Team AudioJoshua de Reeper
Asserts and length handling
2023-02-04WorkQueueThread: provide name and function at same timeScott Mansell
2023-01-30Merge pull request #10947 from Zopolis4/opensleuthAdmiral H. Curtiss
Restrict OpenSLES to Android via CMake
2023-01-23windows: replace comdef dependency with winrtShawn Hoffman
2023-01-06CoreTiming: Throttle Before Every Event Using ChronoSam Belliveau