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

Confidential Mission - Missing sounds #472

Closed
dukeblooders opened this issue Dec 30, 2021 · 8 comments
Closed

Confidential Mission - Missing sounds #472

dukeblooders opened this issue Dec 30, 2021 · 8 comments
Labels
audio Audio input/output related issue bug Something isn't working

Comments

@dukeblooders
Copy link

dukeblooders commented Dec 30, 2021

Some sounds, especially the reload one, are skipped/not played on Naomi and Dreamcast.

It starts at the beginning of the game, just after the first corner.

Configuration : Windows 10, flycast standalone (latest nightly)

@dukeblooders dukeblooders added the bug Something isn't working label Dec 30, 2021
@flyinghead flyinghead added the audio Audio input/output related issue label Apr 30, 2022
@flyinghead
Copy link
Owner

Some reload sounds are missing at some times. However it seems to be intermittent. Same behavior in dreamcast and Naomi versions.

flyinghead added a commit that referenced this issue Dec 31, 2023
Some games rely on the channel still being processed and CA/LP being
updated. Courtesy of @kihato
Issues #472, #483, #1180, #1249, #1030 (partial)
@flyinghead
Copy link
Owner

Should be fixed in the latest dev build.

@dukeblooders
Copy link
Author

Tested with the latest dev build and it works like a charm!

Thanks

flyinghead added a commit that referenced this issue Aug 29, 2024
CA was reset to 0 for non-looping sound when ending, but not for looping
ones when they reach full attenuation. This confuses some games.
Disable the channel when it reaches full attenuation and reset CA to 0.
Revert a7702c6
Issue #1602
Better fix for
Issues #472, #483, #1180, #1249, #1030 (partial)
@kihato
Copy link

kihato commented Aug 30, 2024

Unfortunately, there was a regression caused by b468c9b.
However, it seems to only affect #472 and #1180.

@flyinghead flyinghead reopened this Sep 4, 2024
@kihato
Copy link

kihato commented Sep 6, 2024

It seems that enabled=false in disable() affects #472 and #1180.
So I tried setting ch->CA=0 in EG_Release.
I tested it in this state and there were no more reboots or audio issues.

@flyinghead
Copy link
Owner

I might have a clue as to why disabling the channel causes problems: after AegStep() is called and disables the channel because max attenuation is reached, StreamStep() is still called and will decode one or more samples and increase CA.
One solution would be to test if the channel has been disabled in ChannelEx::Step() and avoid calling other step functions if this is the case:

                        StepAEG(this);
-                       StepFEG(this);
-                       StepStream(this);
-                       lfo.Step(this);
+                       if (enabled)
+                       {
+                               StepFEG(this);
+                               StepStream(this);
+                               lfo.Step(this);
+                       }

Can you test this change? (I'm having a hard time reproducing this issue consistently)

@kihato
Copy link

kihato commented Sep 7, 2024

Awesome!
It worked perfectly fine for #472, #1180 and other issues(#483, #1249, #1030, #1602, #1272) too.

flyinghead added a commit that referenced this issue Sep 7, 2024
CA is reset to 0 when channel is disabled due to AEG and this value must
not be changed.
Issue #472 and #1180
@flyinghead
Copy link
Owner

Fixed on master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audio Audio input/output related issue bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants