Azimer / AziAudio

Azimer's Audio Plugin
GNU General Public License v2.0
46 stars 11 forks source link

Investigate surround sound #9

Open Azimer opened 4 years ago

Azimer commented 4 years ago

Some examples are Dolphin's implementation using FreeSurround. Kodi adsp also uses a modified version of this https://github.com/kodi-adsp/adsp.freesurround. Will need to investigate more. Perhaps for v0.90?

oddMLan commented 4 years ago

FreeSurround demuxes an encoded surround signal into multiple channels. You need to forward the decoded channels to the AudioMixer (or the equivalent in AziAudio), then have the corresponding channel layout in your backend.

  1. Backend calls AudioMixer https://github.com/dolphin-emu/dolphin/blob/19ed64122c11f7cd36ff92b61e7af7bb772c01a8/Source/Core/AudioCommon/CubebStream.cpp#L25

  2. AudioMixer processes decoded channels by FreeSurround (m_surround_decoder) https://github.com/dolphin-emu/dolphin/blob/19ed64122c11f7cd36ff92b61e7af7bb772c01a8/Source/Core/AudioCommon/Mixer.cpp#L164-L186

  3. Set the channel layout in cubeB backend https://github.com/dolphin-emu/dolphin/blob/19ed64122c11f7cd36ff92b61e7af7bb772c01a8/Source/Core/AudioCommon/CubebStream.cpp#L42-L55

KoB-Kirito commented 6 months ago

Hey, are you still working on this? I noticed surround sound is working flawless on dolphin, even when you play n64 games on it (be it virtualware or collections). There is a checkbox in audio options for Dolby Pro Logic II Dekoder, maybe you can look at their implementation?