[PATCH] AWE32 improvements

Discussion of development and patch submission.
Post Reply
JosepMa
Posts: 202
Joined: Tue 20 Jun, 2017 6:25 pm

[PATCH] AWE32 improvements

Post by JosepMa »

Hello.

This is the patch with the changes I made to improve the compatibility and features of the AWE32 emulation that I started in this thread.

This one contains chorus and reverb, although the emulation is not much good. The chorus seems a bit detuned in some configurations, and the reverb isn't as clean and nice as the emu one. (Also the panning mode doesn't seem to work well, too much amplified).
I haven't implemented an EQ, because it's not really clear how the EQ parameters are translated to the coefficients. Also, it's a bit unclear what kind of eq and amount of eq bands it has, so I finally didn't try to emulate it.

On the filter side, I've left the MOOG filter enabled instead of the other two, but neither of them is perfect. I also implemented cubic interpolation, but seems that I have a bug somewhere and sounds noisy and a bit incorrect, and that's why it's disabled.

Envelopes and lfos seem to operate correctly, although it might not be 100% correct yet.

Work that would be nice to be done at some point:

- Correctness of the "current" registers. I said I would implement a software to try on a real AWE, but I haven't done that yet.
- Correctness of the filter. Probably we would need some recording with different sounds and changing values to really get the shape that it outputs.
- Correctness of the chorus/reverb: Would need some sort of software that could generate sounds and altering the values in order to really get the innerworkings of the engine. I've taken as correct all the information that was in AST program, but it misses important information in terms of emulating it.
Attachments
emu8kpatch.patch
(165.49 KiB) Downloaded 335 times
User avatar
leilei
Posts: 1039
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [PATCH] AWE32 improvements

Post by leilei »

Tried the patch. Cranking up the reverb unfortunately has a late echo-like effect instead which sounds weird. Als apparent in FF7's awe playback
JosepMa
Posts: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [PATCH] AWE32 improvements

Post by JosepMa »

leilei: Currently, the reverb is implemented with 6 early reflections and one late tail, which currently isn't much long with any setting.
I assume you're using a preset like Hall 1 or Hall 2 where the early reflections are minimized and most of the sound comes from the tail.
Said that, possibly i am adding twice the delay that should be there given that the tail uses the reflection outputs as input, and they are already delayed from the main signal.

Not sure what would be better, if set the reverb disabled until it is improved further or what.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [PATCH] AWE32 improvements

Post by SarahWalker »

Could you tweak the patch to follow the coding style detailed at viewtopic.php?f=3&t=5 please?
JosepMa
Posts: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [PATCH] AWE32 improvements

Post by JosepMa »

Oh... I suppose you mean the comments, since on most of them I've used // instead of /**/, the other rules are followed, or almost followed.
JosepMa
Posts: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [PATCH] AWE32 improvements

Post by JosepMa »

I found an error in the reverb ( wasn't setting correctly the feedback of some of the reflections ) and now I need to make changes and retweak it, since now it sounds excessive.
Will try to tweak it over the week and resend the patch.
JosepMa
Posts: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [PATCH] AWE32 improvements

Post by JosepMa »

Hello.

Here's an updated patch file with some fixes, code formatting and overall ok performance (Reverb emulation is far from perfect)
emu8k-josepma.patch
reuploaded (there was a volume log in the older one)
(173.08 KiB) Downloaded 401 times
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [PATCH] AWE32 improvements

Post by SarahWalker »

Had a proper play with this, generally an improvement. One big issue though - Doom no longer works. I tried Ultimate Doom v1.9 and got silence. Doesn't happen with the old emulation. Could you have a look at this?
JosepMa
Posts: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [PATCH] AWE32 improvements

Post by JosepMa »

I don't have that game, so I got the shareware 1.9 from here. ( played rise of the triad/ duke nukem 3d at that time :P )

I can confirm that initially, it doesn't work. I say initially, because it seems that it is related to some volume or a mute setting that I implemented. In fact, I confirmed it too with cubic player 1.7.

In any of those, if I try to use the AWE after a reboot, I get silence.
If I then launch either impulse tracker or AST, exit, and then launch doom or cubic player again, then I get sound.

Will try to fix it and attach an updated patch.
JosepMa
Posts: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [PATCH] AWE32 improvements

Post by JosepMa »

Ok, here's the updated patch.
Indeed, it was the "HWCFG3" register, which now I obey.

I added a patch for DOOM, which simply does no configuration of the card at all. (but it does read these registers).
Attachments
emu8k-josepma20170822.patch
(174.14 KiB) Downloaded 337 times
SA1988
Posts: 274
Joined: Wed 30 Apr, 2014 9:38 am

Re: [PATCH] AWE32 improvements

Post by SA1988 »

An irritanting 5 second loop is on the latest patch, in Win98 and NT and I suppose DOS, to reproduce it, just run any Windows version with support for the AWE32 enabled and let the OS boot.
User avatar
leilei
Posts: 1039
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [PATCH] AWE32 improvements

Post by leilei »

Cannot reproduce. 95, 98, ME, stock driver and Creative drivers work fine
JosepMa
Posts: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [PATCH] AWE32 improvements

Post by JosepMa »

sa1988 : If you just applied the patch and didn't recompile everything, you might have a broken compilation.. Try to do a make clean.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [PATCH] AWE32 improvements

Post by SarahWalker »

Committed at rev 858. Sorry for the delay!

There are a couple of issues I noticed that should probably be looked at. Music in Doom occasionally goes wrong - a good example of this is about 30 seconds or so into E1M2. Also emu8k_work_chorus() has an out-of-bounds access to engine->chorus_left_buffer when starting System Shock. I hacked around the latter for now by clamping the read index.
JosepMa
Posts: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [PATCH] AWE32 improvements

Post by JosepMa »

Hi.

I've corrected an error in the chorus engine and also forced sane max values, even though I don't know the exact reason why you needed to ensure that the value was 0 or above for System Shoch (I logged the values received and they were adequate).
Didn't hear anything strange in E1M2, but the chorus could have had something to do with it.
Attachments
sound_emu8k-chorusfix.patch
(8.55 KiB) Downloaded 312 times
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: [PATCH] AWE32 improvements

Post by SarahWalker »

Committed at rev 866.

I've attached a sample of the glitch in E1M2.
Attachments
awe32_doom_e1m2_bad.zip
(171.01 KiB) Downloaded 341 times
JosepMa
Posts: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [PATCH] AWE32 improvements

Post by JosepMa »

Mmm... Yes, I think i've heard a few cases (not only in doom) of that problem, but after the chorus fix, it seemed to work well.
I will keep an eye on it to see if I get to reproduce it, since it seems a bit random.
JosepMa
Posts: 202
Joined: Tue 20 Jun, 2017 6:25 pm

Re: [PATCH] AWE32 improvements

Post by JosepMa »

I confirm that the weird notes at e1m2 are still there, so it seems i'll need to debug it.
Post Reply