Go Back   Project64 Forums > Public Version > Project 64 - v2.x - Issues

Reply
 
Thread Tools Display Modes
  #1  
Old 9th December 2016, 03:13 PM
crackyahead crackyahead is offline
Junior Member
 
Join Date: Dec 2016
Posts: 1
Angry Audio Crackling - Mario Party 2

Recently downloaded version 2.3 of PJ64 and now I'm receiving some audio crackling from certain roms such as Mario Party 2. What audio plug-in should I download?
Reply With Quote
  #2  
Old 10th December 2016, 12:21 AM
Frank74's Avatar
Frank74 Frank74 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Aug 2013
Location: UK
Posts: 829
Default

You can try this, I just built it from AziAudio 0.7 Git source. Made a few changes, and removed redundant options from dialog.

https://dl.dropboxusercontent.com/u/...ziAudioXA2.dll
Turn HLE Audio on when choosing this audio plugin.

Seems to work best if you turn off PJ64's frame limiter (F4). There's still an odd crackle, but I think that's due to graphic effects/transitions that the gfx plugin isn't handling very well.

Edit: Built with Visual Studio 2008 SP1. If the plugin doesn't show up, you need this:
https://www.microsoft.com/en-gb/down...s.aspx?id=5582

Last edited by Frank74; 12th December 2016 at 04:12 AM.
Reply With Quote
  #3  
Old 10th December 2016, 05:52 AM
RPGMaster's Avatar
RPGMaster RPGMaster is offline
Alpha Tester
Project Supporter
Super Moderator
 
Join Date: Dec 2013
Posts: 1,972
Default

additionally u can try this https://www.dropbox.com/s/8mngc7z2t4...P%206.dll?dl=0

If u use this plugin, turn off Fixed Audio Timing.
Reply With Quote
  #4  
Old 10th December 2016, 10:52 PM
Frank74's Avatar
Frank74 Frank74 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Aug 2013
Location: UK
Posts: 829
Default

With the XA2 plugin, enabling force old audio sync (and PBO) with PJ64's fixed audio timing off, the audio is perfect, but the VI's are around 50-52. The audio waits for the video, in Mario Party 2 intro, there are spaces of silence while the video catches up. Not a single crackle, snap or pop though.

I always get crackles when the spotlight turns off peach in the intro. With fixed audio on or off. Azimer's DS8, XA2, Jabo's. Only the above is free of crackles, but it's also wrong.

Last edited by Frank74; 10th December 2016 at 10:58 PM.
Reply With Quote
  #5  
Old 12th December 2016, 04:01 AM
Frank74's Avatar
Frank74 Frank74 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Aug 2013
Location: UK
Posts: 829
Default

I fixed restart bug with XA2. It now doesn't lose audio when switching plugins.

https://dl.dropboxusercontent.com/u/...ziAudioXA2.dll

If you get crackling in a game, enable sync using audio in PJ64, OR, disable frame limiter. Resident Evil 2 for example.

If a game is at a constant 50-52 VI's or lower. Enable force old audio sync in plugin.

Edit:
I also changed it to write 8 bytes a time to the buffers instead of 4.
Code:
	for (DWORD x = 0; x < length; x += 8)
	{
		bufferData[writeBuffer][x] = start[x + 2];
		bufferData[writeBuffer][x+1] = start[x + 3];
		bufferData[writeBuffer][x+2] = start[x];
		bufferData[writeBuffer][x+3] = start[x + 1];
		bufferData[writeBuffer][x+4] = start[x + 6];
		bufferData[writeBuffer][x+5] = start[x + 7];
		bufferData[writeBuffer][x+6] = start[x + 4];
		bufferData[writeBuffer][x+7] = start[x + 5];
	}
It's hard to tell if it's made a difference. But it makes sense if the length of the buffer to be played, must be multiple of 8, no larger than 262144 bytes.
I'm going to experiment a bit with the buffers.

Last edited by Frank74; 12th December 2016 at 06:23 AM.
Reply With Quote
  #6  
Old 14th December 2016, 01:12 AM
Frank74's Avatar
Frank74 Frank74 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Aug 2013
Location: UK
Posts: 829
Default

I've added a working volume slider to Azimer's XA2 options dialog.


Azimer's XA2 Plugin

I want to add saving of the config settings.

Edit: I removed the Emulate Audio Interface option, it doesn't do anything in the XA2 plugin. It only works for the DS8 version.

2nd Edit:
Config now saves settings to AziAudioXA2.cfg in Project64/Config. Link updated.

Code:
[AziAudio]
Audio Sync=1
Force Old Audio Sync=0
Volume=100
It doesn't read the AziAudioXA2.cfg yet though ... Too tired to finish it right now...

Added saving Volume setting. Next job: reading the file to get the settings.

3rd Edit:
It now reads the Audio Sync and Force Old Audio Sync settings from the .cfg. So settings are now remembered.

Last edited by Frank74; 15th December 2016 at 04:27 AM.
Reply With Quote
  #7  
Old 18th December 2016, 03:14 AM
HatCat's Avatar
HatCat HatCat is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Feb 2007
Location: In my hat.
Posts: 16,237
Default

I would then say send a pull request to Azimer except that now his repository has been permanently fucked by JunielKatarn's hi-fart.com build-bot faggotry so it's probably not possible to send him a PR without triggering his faggot bot.

But overlooking that I would say send a pull request.
Reply With Quote
  #8  
Old 18th December 2016, 07:18 PM
Frank74's Avatar
Frank74 Frank74 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Aug 2013
Location: UK
Posts: 829
Default

I'm working on the configuration and different methods of GetReadStatus().

Different games need different calculations for GetReadStatus.

For example, I fixed the issue of Mario Party 2 crackling, and running at 50 VI's if force audio sync is on. But Banjo games and others then run at ~64 VI's, causing crackling, audio/video sync issues.

Here is the plugin for Mario Party 2.
https://dl.dropboxusercontent.com/u/...oXA2mparty.zip

Here is the plugin for Banjo games.
https://dl.dropboxusercontent.com/u/...ioXA2banjo.zip

Enable force audio sync and prevent buffer overruns for both. It's the new default setting with fixed audio timing off in PJ64.

This is a problem that needs to be worked out. Maybe if the settings were saved per game instead of global, different methods of GetReadStatus could be chosen from the config. Better would be to fix GetReadStatus, it needs to be a bit more intelligent.

Last edited by Frank74; 18th December 2016 at 07:32 PM.
Reply With Quote
  #9  
Old 18th December 2016, 09:28 PM
Frank74's Avatar
Frank74 Frank74 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Aug 2013
Location: UK
Posts: 829
Default

There is also a problem with Project64 calling main() twice. Because of a bug in Jabo's plugins.

Options are either, remove the fix for Jabo's from Project64, or make a condition to not run main() on first call in Azimer's. Though this will break the plugin for other emulators.

The calls from RomOpen and RomClosed in main(), to snd->AI_ResetAudio() get around it, but cause crashes on loading savestates. Remove those calls from main(), and you can spam load state as fast as you can without a crash. I wonder if this Project64 fix for Jabo's plugins, is related to the problem I have with the Android version on my tablet, not being able to load save states with recompiler.

Last edited by Frank74; 18th December 2016 at 09:40 PM.
Reply With Quote
  #10  
Old 19th December 2016, 12:37 AM
Frank74's Avatar
Frank74 Frank74 is offline
Alpha Tester
Project Supporter
Senior Member
 
Join Date: Aug 2013
Location: UK
Posts: 829
Default

Quote:
Originally Posted by Frank74 View Post
Better would be to fix GetReadStatus, it needs to be a bit more intelligent.
After some calculation, this seems to fix it. The retVal line is the difference.

Code:
u32 XAudio2SoundDriver::GetReadStatus()
{
	XAUDIO2_VOICE_STATE xvs;
	UINT64 retVal;
	if (canPlay)
		g_source->GetState(&xvs);
	else return 0;
	if (lastLength == 0) return 0;
	if (xvs.SamplesPlayed == 0) return 0;
	else retVal = (lastLength / filledBuffers + xvs.SamplesPlayed) & ~7;
	return retVal % lastLength;
Both Mario Party 2 and Banjo Kazooie/Tooie, run at 60 VI's with frame limiter off and fixed audio off. No crackling at all with frame limiter on or off. Hooray.

Arrhghh, no good. Just tested Goemon games and they want to run at 53VI's now.... Grrrrrr....... They were fine before.

Last edited by Frank74; 19th December 2016 at 12:39 AM.
Reply With Quote
Reply

Tags
audio, issues, mario party

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 12:55 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.