Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flipper sounds missing half of the time #572

Open
francisdb opened this issue Jun 14, 2023 · 12 comments
Open

Flipper sounds missing half of the time #572

francisdb opened this issue Jun 14, 2023 · 12 comments
Labels
BASS sound issue related to BASS sound bug Something isn't working as it's supposed to. standalone Issue is related to the standalone player

Comments

@francisdb
Copy link
Contributor

francisdb commented Jun 14, 2023

Let me know if you don't want bug reports about tables behaving differently in 10.8 vs 10.7.

Describe the bug
When testing JP's Captain Fantastic (Bally 1975) v4.vpx on 10.8 (latest build) the flippers seem to be missing sounds when interacted with rapidly.

I don't see this on 10.7.x

To Reproduce
Steps to reproduce the behavior:

  1. Get JP's Captain Fantastic (Bally 1975) v4.vpx
  2. Run the table
  3. Insert coin
  4. Start game
  5. Go mad on the flippers

Expected behavior
Correct flipper sounds

Versions & Settings

  • VPinballX_GL-10.8.0-1259-8a86dca-Release-win-x64 and
  • VPinballX_GL-10.8.0-1260-40783b9-Release-macos-arm64
@francisdb francisdb added the bug Something isn't working as it's supposed to. label Jun 14, 2023
@vbousquet vbousquet added the BASS sound issue related to BASS sound label Jun 14, 2023
@francisdb
Copy link
Contributor Author

I can confirm this is fixed but I guess it still matters for standalone @jsm174

@jsm174
Copy link
Contributor

jsm174 commented Jun 17, 2023

Just curious, did you test with the example table? if you smash the buttons there you hear it. I wonder if it's scripting related instead of BASS?

@francisdb
Copy link
Contributor Author

I only saw it with a few tables. I'll append more to this ticket if I encounter them.

@rothbauerw
Copy link

I'm testing 10.8 1256 and when you savie a file, is corrupting the settings of the sound files. It setting the volume adjustment to -1 on many files and thus you can't hear the sounds.

@rothbauerw
Copy link

The above appears to be fixed in 10.8 beta 3

@jsm174
Copy link
Contributor

jsm174 commented Jul 20, 2023

This seems to be an issue as reported in jsm174/vpx-standalone-scripts#63

I was testing Lost World (Bally 1977) 4.0.1
https://www.vpforums.org/index.php?app=downloads&showfile=12941
You can clearly hear that a lot of the bumper sounds just don't play. Same for the flippers when flippering fast.

Somehow I think this is mostly with JPSalas tables.

This is a remaining issue from earlier but BASS was reverted on master
#572

So just to clarify:

  • Real VPX does not use BASS for playing WAV's
  • VPX Standalone does use BASS for playing WAV's

If you try standalone with the example table, the flipper sounds seem to be there as rapidly as you can press.

Most other tables, they are not. I think we need to take a look at the vbscript to see what the difference is.

@francisdb
Copy link
Contributor Author

francisdb commented Jul 24, 2023

Found the source of the issue on the vbscript side

This is the code finally playing flipper sounds

Sub PlaySoundAt(soundname, tableobj) 'play sound at X and Y position of an object, mostly bumpers, flippers and other fast objects
    PlaySound soundname, 0, 1, Pan(tableobj), 0.2, 0, 0, 0, AudioFade(tableobj)
End Sub

When I modify it to this the sounds play correctly

Sub PlaySoundAt(soundname, tableobj) 'play sound at X and Y position of an object, mostly bumpers, flippers and other fast objects
    PlaySound soundname, 0, 1, Pan(tableobj), 0.2, 0, 0, 1, AudioFade(tableobj)
End Sub

Docs

PlaySound(string, int loopcount, float volume, float pan, float randompitch, int pitch, bool useexisting, bool restart, float front_rear_fade)

So somehow the restart argument behaves differently on BASS

Validated with both Lost World (Bally 1977) 4.0.1 and JP's Captain Fantastic (Bally 1975) v4

@jsm174
Copy link
Contributor

jsm174 commented Jul 24, 2023

I will make a patch for standalone that does the following:

void Play(PinSound * const pps, const float volume, const float randompitch, const int pitch, const float pan, const float front_rear_fade, const int loopcount, const bool usesame, const bool restart)
{
	const int flags = (loopcount == -1) ? DSBPLAY_LOOPING : 0;

	if (!pps->IsWav())
	{
#ifndef __STANDALONE__
		pps->Play(volume, randompitch, pitch, pan, front_rear_fade, flags, restart);
#else
		if (pps->IsWav2())
			pps->Play(volume, randompitch, pitch, pan, front_rear_fade, flags, (!usesame) ? true : restart);
		else
			pps->Play(volume, randompitch, pitch, pan, front_rear_fade, flags, restart); 
#endif
		return;
	}

The ONLY_USE_BASS flag is set to always return false for IsWav which gets us in the block. IsWav2 then legitimately checks to see if its a wav file.

So we keep the existing behavior for non-wave files, and forces a restart when !usesame

@toxieainc, I don't really understand the whole copying of wavs logic. Any rough idea on the purpose of all this?

@jsm174 jsm174 added the standalone Issue is related to the standalone player label Jul 24, 2023
@francisdb
Copy link
Contributor Author

francisdb commented Jul 25, 2023

Just built a Windows GL x64 with ONLY_USE_BASS and the same issue is noticeable there. So this should be fixed on the master branch.

@toxieainc
Copy link
Member

Still needs a new BASS-only special build and testing

@toxieainc toxieainc reopened this Sep 9, 2023
@francisdb
Copy link
Contributor Author

@toxieainc what's left to do here?

@toxieainc
Copy link
Member

I hope nothing. As the dust settles with VP 10.8 we should re-evaluate all BASS related bugs then. I think @droscoe also wanted to look into sound code refactoring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BASS sound issue related to BASS sound bug Something isn't working as it's supposed to. standalone Issue is related to the standalone player
Projects
None yet
Development

No branches or pull requests

5 participants