Kermalis / VGMusicStudio

🎵 A program that lets you listen to the music from popular video game formats. 🎵
GNU Lesser General Public License v3.0
264 stars 32 forks source link

Animal Crossing: Wild World SDAT fails to open #112

Closed TheGag96 closed 1 year ago

TheGag96 commented 1 year ago

I tried loading the SDAT from Wild World (USA v1.0) and I got this error:

---------------------------
Error Loading SDAT File
---------------------------
Error Details:

The method or operation is not implemented.
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at NAudio.CoreAudioApi.AudioSessionManager.RefreshSessions()
   at NAudio.CoreAudioApi.MMDevice.GetAudioSessionManager()
   at Kermalis.VGMusicStudio.Core.Mixer.Init(IWaveProvider waveProvider)
   at Kermalis.VGMusicStudio.Core.Engine..ctor(EngineType type, Object playerArg)
   at Kermalis.VGMusicStudio.UI.MainForm.OpenSDAT(Object sender, EventArgs e)
---------------------------
OK   
---------------------------

Is it in some special format or something? I'm running this under Wine - hopefully that's not causing any extra issues lol.

Kermalis commented 1 year ago

This error doesn't actually have anything to do with the program. It seems to be crashing because you're not on windows (It is looking for WASAPI drivers but they don't exist in Linux) @PlatinumLucario was working on a Linux port, so maybe you can ask him about it. He's in the discord server as well

TheGag96 commented 1 year ago

Ah, lovely, Linux Momentâ„¢. Thanks lol.

PlatinumLucario commented 1 year ago

Ah, lovely, Linux Momentâ„¢. Thanks lol.

Yeah, I'm currently working on porting this to GTK4 via Gir.Core, which will work natively under the GNOME desktop environment and other desktop environments using GTK4.

And exactly like what @Kermalis described, this is because Linux relies on ALSA for sound output. WASAPI relies entirely on DirectSound, which are both exclusive to Windows, just like DirectX and other proprietary Microsoft drivers.

To solve this problem, I'm working on two things:

  1. Rewriting the entire GUI in GTK4 via Gir.Core, along with the piano key graphics being redone in GTK4's Cairo graphics API
  2. Replacing the NAudio WASAPI library with LibSoundIO bindings based on Ryujinx's implementation, and I may keep NAudio in there mostly to test if there's inaccuracies with LibSoundIO, NAudio itself may be cross-platform, but it has no bindings to other platforms

As I'm gradually working on the GUI, I'm still learning how to use and implement GTK4 APIs lol

And if you have any questions or need to get in contact with me, I'm on the VGMS Discord Server, just look out for Platinum Lucario on there lol