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

ES1688 emulation missing ESS Mixer registers #3700

Closed
3 tasks done
wbcbz7 opened this issue May 24, 2024 · 6 comments · Fixed by #3702
Closed
3 tasks done

ES1688 emulation missing ESS Mixer registers #3700

wbcbz7 opened this issue May 24, 2024 · 6 comments · Fixed by #3702
Assignees
Labels
audio Audio related issues or enhancements bug Something isn't working

Comments

@wbcbz7
Copy link

wbcbz7 commented May 24, 2024

Are you using the latest Dosbox-Staging Version?

  • I have checked releases and am using the latest release.

Different version than latest?

No response

What Operating System are you using?

Windows 10

If Other OS, please describe

No response

Relevant hardware info

No response

Have you checked that no other similar issue already exists?

  • I have searched and not found similar issues.

A clear and concise description of what the bug is.

Hey there!
I've been recently checking out DOSBox Staging, and noticed that ESS AudioDrive emulation does not support extended ESS mixer registers, in particular Extended FM Volume register (index 0x36).
For example, koolnESS by The Furnace Posse uses mixer registers to fade out audio during song changing or exit, and seems that this effect is missing in DOSBox Staging (reference capture from real ES1869 with fadeout here: https://youtu.be/i_4dg8xUaBA?si=cMV6Tn63Y4rMLMHs&t=190)

Thanks in advance! :)

Steps to reproduce the behaviour.

No response

Download URL of affected game or software

https://www.pouet.net/prod.php?which=96920

Your configuration

No response

Provide a Log

No response

Code of Conduct & Contributing Guidelines

  • Yes, I agree.
@wbcbz7 wbcbz7 added the bug Something isn't working label May 24, 2024
@johnnovak
Copy link
Member

johnnovak commented May 24, 2024

Indeed, thanks for reporting @wbcbz7! DOSBox-X has the 0x36 command implemented, so I missed that when I ported the code over.

I found it strange that the tunes kept playing for a few more seconds when you switched to a different one; now I understand the reason, that was the fade out time 😄

Enjoy Staging 😎

@johnnovak johnnovak added audio Audio related issues or enhancements bug Something isn't working and removed bug Something isn't working labels May 24, 2024
@johnnovak johnnovak self-assigned this May 24, 2024
@johnnovak
Copy link
Member

johnnovak commented May 25, 2024

I've been recently checking out DOSBox Staging, and noticed that ESS AudioDrive emulation does not support extended ESS mixer registers

@wbcbz7 I've fixed this in the linked ticket, should be in the next dev build. Are you aware of any other programs that exercise the ESS specific mixer registers?

@wbcbz7
Copy link
Author

wbcbz7 commented May 26, 2024

I've just checked the latest dev build, and seems like fadeout is almost there, but it sounds like volume curve being too steep; also volume adjustment (using -/+ keys) doesn't work properly (volume drops by ~12dB and locks at that level). Looking at mixer-related commit, I've noticed there is a typo in ctmixer_read() function - it uses register index 0x34 instead of 0x36 for extended FM volume read. As volume control in musicdisk reads current volume from the mixer, this can be the issue for now. Nice progress, anyway :)

As for other ESS-enabled applications that are using ESS-specific mixers, apart from Windows 3.x/9x driveres, I am not aware of those.

@johnnovak
Copy link
Member

johnnovak commented May 27, 2024

@wbcbz7 Thanks for the pointers, this is helpful.

I'll fix the wrong register index for the mixer read port, sure, but fixing the volume ramp would require some reversing (DOSBox-X uses the same wrong ramp, just by looking at the code).

I have a bunch of ESS sound cards so I could reverse it, but frankly I have better things to do 😄 Maybe I'll try a hack to use the SB16 ramp for ESS, maybe that curve is a bit closer.

Overall, the DOSBox-X ESS mixer seems to be shoehorned into the SB mixer implementation, so it's kinda expected to be somewhat wrong if there was no extra validation of the actual hardware behaviour.

EDIT: Seems like the attenuation is constant 2db per step according to this:
https://github.com/86Box/86Box/blob/e61c6205584e4414fc4a64494be5c6f1aab3e6ff/src/sound/snd_sb.c#L93

I'll give that a go.

@johnnovak
Copy link
Member

johnnovak commented May 28, 2024

@wbcbz7 Fixed, and this is the extent I'm willing to go. The "proper" fix would involve using "mixed" SB Pro volume curves for the master volume and the DAC, and the different ESS volume curve for the FM output (as we only support ESFM at the moment, but not the rest of the ESS card), and the complication is not worth it. It would involve significant refactors for not much benefit.

Our supported use case for the ESS card is a hybrid mode: ESFM for FM ("extended mode"), and SB Pro compatibility for the rest, including the DAC ("legacy mode").

@wbcbz7
Copy link
Author

wbcbz7 commented May 28, 2024

yup, with the recent dev build FM volume mixer seems to behave as intended, and the difference between emulated and real mixer curve seems to be negligible enough, so I'll leave it as now. thanks for fixing! :)

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

Successfully merging a pull request may close this issue.

2 participants