What's new

Audio v0.70 WIP 4 Feedback

Azimer

Emulator Developer
Moderator
This is a preview of what I am working on for v0.70. I am happy for the most part with the way the audio code works today. I recommend using the XAudio2 plugin. I plan on deprecating DirectSound if there's no demand for it. I am having much better luck simulating AI emulation with XAudio2 using zilmar's spec.

Untick Sync to audio and audio timing in PJ64 for best results except where indicated as a known issue.

New:
- XAudio2
- New DirectSound code (again)
- Allows plugin to keep working if there's a failure to initialize.
- Fixed various sound issues in multiple games
- Stability changes

Known Issues:
- Crusi'n World / Snowboard Kids 2 music is too fast (without using AudioSync / Audio Timing in PJ64)
- Twisted Edge - No Audio
- Boss Games - Sound issues
- Indiana Jones - Crackles during factor 5 intro

AziAudio v0.70 WIP 1 (Repack)
AziAudio v0.70 WIP 4 *new* Post #20

Thanks!

Please leave feedback in this thread. Thanks!
 
Last edited:

AIO

New member
This made my day! Thanks :satisfied

It's nice to see that SSB64's crackling has been reduced! Overall I'm liking the XAudio version.

I have 2 problems though. It seems that HLE uses more cpu than previous versions. I suspect it could just be the compiler you used. The other problem is that the XAudio version sometimes crashes the emulator. Like with Mupen64, if I run a game, close game, then run a game, it crashes. With PJ64 1.6 it crashes sometimes when switching plugins. For all I know, the problem could be my computer though, since I have problems with other plugins that no one else seems to have. I'll see about updating my drivers. I really need to try testing stuff on multiple computers ;/ .
 
OP
Azimer

Azimer

Emulator Developer
Moderator
Thanks for the feedback. I looked into your one concern about the HLE taking more CPU. This doesn't seem likely so after further investigation I noticed I packaged the debug version of the DLLs. Oops!! I repacked and uploaded to the website. This should fix one of your concerns at least.

The plugins crashing I don't know what could be doing that yet... especially the XA2. The plugin has never felt more stable to me. I will investigate but any leads would be useful. Thanks!
 

weinerschnitzel

Surreal64 Nut
Hi Azi! I'm glad you still kept DS8 in this release! Have you started working on MusyX more since Bobby.Smiles did all of that reverse engineering?
Sent you a PM. :)
 
Last edited:
OP
Azimer

Azimer

Emulator Developer
Moderator
I did start working on MusyX and it should be in the final v0.70 release. Hopefully by the end of the year but it all depends on how much time I get and if I use Bobby's code or not.
 
OP
Azimer

Azimer

Emulator Developer
Moderator
WIP 2 is coming in the next couple days. I added Bobby's code successfully but I am still getting a nasty dll_unloaded APPCRASH error. I think it's something funky Project64 is doing after unloading the DLL. I am not getting the same errors on Apollo so I will have to setup a work environment to debug it from the emulator's perspective to see what's going on and how I can develop a workaround.
 

weinerschnitzel

Surreal64 Nut
A-zi-mer! A-zi-mer! :happy:

Bobby's code doesn't handle the voice compression used in TWINE does it? That part is still coming out bad for me. Strangely, I can only play MusyX using 1964audio and the Mupen64Plus HLE RSP Plugin. I can have an audio plugin with audio code have ALists processed from RSP plugin instead, and I can have an RSP plugin with or without audio code connected with ALists processed from either audio or RSP plugin (if RSP processes ALists without audio code, there is no sound.) As of now an audio plugin w/o audio code, I.E. mupen64plus-audio-sdl, and an RSP plugin processing ALists, does not work. So MusyX only works when the audio plugin backs it, and it doesn't seem to matter which plugin does ProcessAList().

Is this behavior proper? Using 1964 and PJ64. I'd like to test MusyX on audio plugin side to further investigate, so I'm very excited for your work. Thanks for being so selfless with your achievements!
 
OP
Azimer

Azimer

Emulator Developer
Moderator
Bobby's (unmodified) code is handling TWINE voices fine. The lady that says there is a box waiting for you sounds crystal clear using WIP 2 and PJ64 2.1.0.1. I can give you a preview and you can let me know.

As far as stability goes, you might want to remove old plugins and other xaudio2 plugins. All these combine to make it unstable to go into the plugin menu after ending emulation. A weird error I will get to the bottom of.
 

Attachments

  • AziAudioXA2.zip
    30.9 KB · Views: 1,067
Last edited:

AIO

New member
I was debugging PJ64 1.6 and remembered that it redundantly calls ShutdownPlugins 2 times. When I commented out the extra ShutdownPlugins call, I was able to swap plugins a bit more before crashing. Idk a good way to prevent redundant CloseDll() calls on the plugin side.

Lol Azimer, you saved me the trouble of porting bsmiles code to an audio plugin :satisfied . I'm still not too experienced with building plugins.

weinerschnitzel, I think the sound problems you experienced are due to either the emulator core, or the audio plugin. Bsmile's HLE RSP worked great when I tested it in 1964 1.1. I noticed 1964 Audio had issues, but Azimer's 0.60 WIP2 had no issues afaik. For instance, in 1964 1.1, if I reset gauntlet legends, the intro's audio gets messed up, with 1964 Audio, it doesn't matter whether I use an RSP or its built in HLE.

Edit: After commenting out the redundant ShutDownPlugins() call, it would eventually crash at initiate audio after switching audio plugins a few times.
 
Last edited:

weinerschnitzel

Surreal64 Nut
They must be core related and specific to how I have the EnableRSPAudio feature implemented.

// going to use rsp audio plugin here instead of the use lle rsp bool
if (g_bUseRspAudio) // g_bUseLLERspPlugin // g_iAudioPlugin != _AudioPluginLleRsp
{
RspInfo10.ProcessAlist = ProcessAList;
RspInfo11.ProcessAlist = ProcessAList;
}
else
{
RspInfo10.ProcessAlist = NULL;
RspInfo11.ProcessAlist = NULL;
}

Basically this condition isn't doing enough justice to control ProcessAList(). I suppose I can switch somethings around for the audio plugin linking to follow that condition as well.

Thanks for the information, gonna fire up Azi's WIP2 for a quick test :)

Tested TWINE and sounds glorious. :drool:
 
Last edited:
OP
Azimer

Azimer

Emulator Developer
Moderator
Tested TWINE and sounds glorious. :drool:

Thank Bobby. I only spent an hour making it fit into the plugin without having to modify m64p hle source (makes it easier to apply fixes should I never make musyx my own). You will be happy to know I will be making the plugin open source when v0.70 is fully available. It will make it so I won't have to rewrite and research musyx on my own. His implementation sounds pretty much on target. I have no desire to recreate the wheel.
 
Last edited:

bobby.smiles32

New member
Thank Bobby. I only spent an hour making it fit into the plugin without having to modify m64p hle source (makes it easier to apply fixes should I never make musyx my own). You will be happy to know I will be making the plugin open source when v0.70 is fully available. It will make it so I won't have to rewrite and research musyx on my own. His implementation sounds pretty much on target. I have no desire to recreate the wheel.

Nice to see my code put to good use :)
If you're interested, we can discuss modifications I made to your original audio ucode HLE work.
Just for your information, the current HLE emulation of audio list in m64p is still not perfect :
-> for the ucode found in Conker Bad fur Day the filtering command is not correctly implemented + I haven't been able to successfully implement the additional biquad filters.
-> some ABI are still incorrect / not fuly implemented (mostly because there are so many variants of what I call the NEAD ucode family (eg ucodes internally developed by nintendo)).
-> for MusyX version found in Indiana Jones, there are some optional processing that I didn't bother implement because the game crashes before reaching that part.
And that is just what is on top of my head...
 
OP
Azimer

Azimer

Emulator Developer
Moderator
It is certainly my intention to go back and fix up my HLE code. It served as a nice base 10 years ago but it should really be fixed then optimized. I mostly left out all the filters. I was so tired of reverse engineering I started getting sloppy. :) I think it could be beneficial for both of us to work from a common base. I will seek you out once I am done fixing this darn bug crashing PJ64. I think it has something to do with Visual Studio 2013.
 

bobby.smiles32

New member
I was so tired of reverse engineering I started getting sloppy. :)
Oh man I really get what you're saying here ! more than 20 different version of audio ucodes can indeed lower your motivation...
(Still it's nothing compared to the jungle that is GFX ucodes... I compiled a list of more than 50 different versions/revisions.... but I digress)

I think it could be beneficial for both of us to work from a common base.
Agreed ! Less fragmentation could be beneficial for everyone. However it requires good comunication, so that everyone is on the same page.
How much does your current code base differs from m64p rsp hle code base ?
 
OP
Azimer

Azimer

Emulator Developer
Moderator
How much does your current code base differs from m64p rsp hle code base ?

Significantly! It will take me a bit to test and determine if there are any regressions using your work. If not, I think I will ditch what I've done and move forward with a common m64p code base.

Edit: Removed WIP 3 attachment. The build is garbage.
 
Last edited:

the_randomizer

New member
Significantly! It will take me a bit to test and determine if there are any regressions using your work. If not, I think I will ditch what I've done and move forward with a common m64p code base.

Edit: Removed WIP 3 attachment. The build is garbage.

It's all good man, keep up the good work!

Edit: It would seem I haven't posted in over a year. Weird.
 
Last edited:

Zapfy

New member
Hi. I used this plugin a little bit and had some questions / basic feedback I guess. (I'm using XAudio2)

First of all how can I get the audio options to save? I keep having to recheck the options I want each time I open the emulator / ROM.

That leads me to my next question. I don't really have much technical knowledge of plugin stuff, so could you give a little more information on what some of the options do; Emulate Audio Interface - I'm not sure if Project64 1.7 & 1.6 handles its own Al emulation? Enable RSP Emulation - Not really sure what this means. My RSP seems to work fine so do I need this?

I also have noticed the occasional popping in audio. Maybe if I apply the right settings I can eliminate that? I know it's not designed for 1.6/1.7 but I have to use these versions for speedrunning :p

Regardless this seems to be my new favorite audio plugin for the most part. Thanks!
 

AIO

New member
First of all how can I get the audio options to save? I keep having to recheck the options I want each time I open the emulator / ROM.
There's no way to save it. You'd have to manually change it everytime. What do you even want to change?

That leads me to my next question. I don't really have much technical knowledge of plugin stuff, so could you give a little more information on what some of the options do; Emulate Audio Interface - I'm not sure if Project64 1.7 & 1.6 handles its own Al emulation? Enable RSP Emulation - Not really sure what this means. My RSP seems to work fine so do I need this?
Long story short, it's meant for emulators like PJ64 where the audio is inaccurate. If you want to see the difference, play a game like Quest64 and listen to the music. With that option off, the music plays too fast, but with it on, it plays at the correct speed. Also I believe it syncs the audio with video, so it's better to have it on.

I also have noticed the occasional popping in audio. Maybe if I apply the right settings I can eliminate that? I know it's not designed for 1.6/1.7 but I have to use these versions for speedrunning :p

Regardless this seems to be my new favorite audio plugin for the most part. Thanks!
The default settings are the best you can do for eliminating the crackling. No audio plugin is perfect. Also I heard some games even have crackling on the real N64.
 
Last edited:
OP
Azimer

Azimer

Emulator Developer
Moderator
Hi. I used this plugin a little bit and had some questions / basic feedback I guess. (I'm using XAudio2)

First of all how can I get the audio options to save? I keep having to recheck the options I want each time I open the emulator / ROM.

That leads me to my next question. I don't really have much technical knowledge of plugin stuff, so could you give a little more information on what some of the options do; Emulate Audio Interface - I'm not sure if Project64 1.7 & 1.6 handles its own Al emulation? Enable RSP Emulation - Not really sure what this means. My RSP seems to work fine so do I need this?

I also have noticed the occasional popping in audio. Maybe if I apply the right settings I can eliminate that? I know it's not designed for 1.6/1.7 but I have to use these versions for speedrunning :p

Regardless this seems to be my new favorite audio plugin for the most part. Thanks!

Saving will be implemented soon as will a method to adjust the buffer caching. Please disregard RSP/HLE checkboxes if you are happy using the emulator's RSP to process audio. Those options will be going away. There is no point to disable HLE and I've removed RSP from the plugin. Some games do have a pop or crackle if the emulator isn't maintaining a constant 60 VI/s. If you can let me know what game is causing the most issues, I will put it on my list of games I use for QC (Quality Checks).
 
OP
Azimer

Azimer

Emulator Developer
Moderator
AziAudio WIP 4 released. I hope this fixes the instability issues. This might break 1964 or Mupen64. I tried it on Project64 1.4 AFE, 1.6 and 2.1 with success as well as Apollo.

Improvements:

* Added ExitThread to AiUpdate to get around a horrible bug. AiUpdate is remaining open even though PJ 2.1 is supposedly calling TerminateThread, the thread is never terminating. So if the emulator asks for the thread to be Wait = true, it will ExitThread.
* Removed CoInitializeEx and CoUninitialize from the dll for XAudio2. Supposedly they are required but it doesn't appear to be so. This might cause issues it might not. If it does I can always add it back. This is what WIP builds are for... testing.


Up next for WIP 5 (assuming minimal bugs in WIP 4):

* Fix up and implement the options dialog - make new options, deprecate old ones, and allow them to save.
* Source cleanup to prepare for the v0.70 final release
 

Top