Page 1 of 1

[Patch] Aztech Sound Cards

Posted: Tue 11 Feb, 2020 12:49 am
by EluanCM
UPDATE: Support for the NT 3.1 drivers:

This patch adds support for two types of Aztech sound cards: AZT2316A and AZT1605.
These cards are Sound Blaster Pro v2 (8-bit) + Windows Sound System (16-bit) combos that were very common OEM cards during the mid-90's, Packard Bell for example used them extensively (including on some of the models emulated by PCem.)
The cards do not do anything new or different, but having support for them enables the usage of the Master CD or HDD dumps from lots of systems without any further configuration (this is actually the reason why I created this patch).

The two emulated families are Washington (Aztech MMPRO16AB, Aztech Sound Galaxy Pro 16 AB, Aztech Sound Galaxy Washington 16, other OEM names with FCC ID I38-MMSN824 and others) and Clinton (Packard Bell FORTE16, Aztech Sound Galaxy Nova 16 Extra, Aztech Sound Galaxy Clinton 16, other OEM names)

It also works more or less for drivers of other models with the same chipsets.

Some of them use the CS4248 DSP which is pin and software compatible with the AD1848 that is already emulated. Others use a CS4231 in CS4248 mode. You need to select the right one for your driver.

There is a jumper to load the startup configuration from an EEPROM. This is implemented, so any software-configured parameters will be saved.

The CD-ROM interface commands are just ignored, along with gameport (PCem takes care of these in other places).
The MPU401 is always enabled, but IRQs are not implemented yet in PCem so it should work in polling mode. The OPL3 is always active in some (all?) drivers/cards, so there is no configuration for this.

Tested with DOS (driver installation, tools, diagnostics), Win3.1 (driver installation, tools), Win95 (driver auto-detection), lots of games.

I consider the Washington family (AZT2316A) to be functionally complete and very well tested. The Clinton (AZT1605) family should work better in WSS mode (explanation below).
BEWARE that there are *too many* driver types and OEM versions for each card. Maybe yours isn't emulated or you have the wrong driver. Some features of each card may work when using wrong drivers. CODEC selection is also important. A wrong codec may render you without cd-volume control, etc.

Beware that CD music for some (all?) DOS games does not work under Win95, this is a known bug in PCem in all sound cards. The mode selects get truncated and send all zeros for output channel selection and volume, Descent 2 in particular also has excess zeros! CD audio works in Windows programs and in pure DOS.

I still don't know how the Clinton family AZT1605 DMA is configured and the SBPROV2 emulation seems to be done partly by a TSR. It's better to remove the TSR for now. I need to investigate this. Mixer is also weird under DOS. I've read horror stories about this TSR on the internet. There is absolutely no documentation for both of these chips (and the Linux drivers are very basic), so more reverse engineering will be necessary.

Descent 2 W95 version can't start cd music. Happens on real hardware. The game calls auxGetNumDevs() to check if any of the AUX devices has caps.wTechnology == AUXCAPS_CDAUDIO, but this fails because the Aztech Win95 driver only returns a "Line-In" device. I'm not aware of any other game that does this and this is completely unnecessary. Other games that play cd audio correctly have the exact *same* initialization code, minus this check that only Descent 2 Win95 does. It would work if it just skipped this check and progressed with calling mciSendCommand() with mciOpenParms.lpstrDeviceType = "cdaudio", like other games do. There are some sound cards listed as incompatible in the game's README.TXT file that are probably due to this.

You need to run autotools before configure (there is a new file and I wanted to keep the patch clean).

I don't know how much screenshots would be useful for a *sound* card, but here they are. Bonus screenshot of me using Visual C++ 1.52 to confirm the hypothesis of why Descent 2 CD Audio didn't work.

Re: [Patch] Aztech Sound Cards

Posted: Tue 11 Feb, 2020 1:00 pm
by omarsis81
Impressive! 8-)

Re: [Patch] Aztech Sound Cards

Posted: Tue 11 Feb, 2020 2:13 pm
by leilei
The Washington card seems to work fine with the '95 Packard legend's drivers :thumbsup:, surprised the other card didn't (especially considering the board names)

It didn't produce any additional luck on Turtle Beach drivers for their similar WSS clone though. :(

Re: [Patch] Aztech Sound Cards

Posted: Tue 11 Feb, 2020 10:47 pm
by EluanCM
There are some Washington cards with Packard Bell names, but I can't confirm right now. I think Packard Bell Sound16A is one such OEM name.

Re: [Patch] Aztech Sound Cards

Posted: Wed 12 Feb, 2020 9:23 am
by altheos
Just asking here : do you use SB DSP as Asktek DSP ?
Does it means that Aztech DSP (AZT1605-U05 , AZT2316, AZT2320 ...) functions are really on par with Creative's part ?

Re: [Patch] Aztech Sound Cards

Posted: Wed 12 Feb, 2020 11:11 pm
by EluanCM
Are you referring to the functionality or the quality?

It was made to mimic the SB Pro V2 DSP, so I use that with the Aztech extensions.
Also many people regard these cards as less noisy than the Creative cards of the time, but this makes no difference under emulation. (Unless you want to emulate analog noise!)

Re: [Patch] Aztech Sound Cards

Posted: Thu 13 Feb, 2020 10:49 am
by altheos
I am referring to functionality : internal DSP functions, OPL version, MIDI, ADPCM, mono/stereo, known bugs ...

Re: [Patch] Aztech Sound Cards

Posted: Thu 13 Feb, 2020 11:10 pm
by EluanCM
-I've implemented a few quirks of the DSP that should only affect poorly written software, but haven't tested every single command (there is no documentation anywhere).
-The OPL is always a real one, no clones like some SBs.
-For MIDI, there is no hanging notes bug in any model.
-There is also no reverse stereo bug in any model. This can be a problem with games that assume this bug is present because of the model selection and give no way of configuring the reversal! This probably should be an option in the PCem context menu. On real hardware you could use reversible cables for this rare occasion.
-Based on my experience from the past, the rest should be mostly the same.

Re: [Patch] Aztech Sound Cards

Posted: Sat 15 Feb, 2020 10:46 pm
by SA1988
NT 3.1 drivers seem to not work at all, even if I select the right settings (Nova 16 Extra drivers), in the sense on the read data available read register it issues a 0x80, then a write data available read with 0x00, then, a read data available one with 0x00, then says the audio board is not the right one.

Re: [Patch] Aztech Sound Cards

Posted: Sat 15 Feb, 2020 11:41 pm
by EluanCM
Are you using the right driver/AZT chip combination? There are various "Nova 16":

-Nova 16 (don't know the chip)
-Nova 16 Extra (AZT1605)
-Nova 16 Extra II (AZT2316A)
-...probably others I don't know about.

I've implemented only two types (0x0C and 0x11), which are the ones that I have. I've also put the exact names from my original driver files in the PCem config and didn't put names that I know but don't have the hardware to test. There are probably a dozen others.

Re: [Patch] Aztech Sound Cards

Posted: Sat 15 Feb, 2020 11:44 pm
by SA1988
I've used the AZT1605 one.
Edit: got news, it tries to use command 0x08 with data 0x55.

Re: [Patch] Aztech Sound Cards

Posted: Sun 16 Feb, 2020 5:13 pm
by EluanCM
OK, I've taken a look at the NT 3.X driver. It is somewhat different from the drivers I've used to test.

-Tries to identify the card with 0x08 0x55 instead of 0x08 0x05 - card behaviour seems to be the same.
-Accesses the CODEC differently, but luckily this was already handled.
-Tests MPU401 (after sending reset and UART mode commands) and WSS/CODEC interrupts (expects an interrupt after writing the config registers?)

The fixes:
-Added the new identification method.
-I've added the MPU401 interrupt selection so that they trigger after resetting/setting UART mode.
-Added an option to trigger the CODEC interrupt after configuring the WSS registers. I've kept this as an option because AFAIK the codec should only trigger interrupts on timer/DMA. Maybe this is just the AZT chip raising this interrupt and the option shouldn't be needed.

After that, installation works (don't forget to check the mixer settings).

I will post the patch later, my branch is quite polluted and I need to clean it.

Re: [Patch] Aztech Sound Cards

Posted: Mon 17 Feb, 2020 4:19 pm
by MiraiMiracle
Really nice!!

Should Sarah merge this patch ot not?

Re: [Patch] Aztech Sound Cards

Posted: Tue 18 Feb, 2020 1:09 am
by EluanCM
Updated patch to support the NT 3.1 drivers.

Re: [Patch] Aztech Sound Cards

Posted: Wed 19 Feb, 2020 10:07 pm
by Manaphy
This appers to be licensed using GPL v3 while PCem is GPL v2, though GPL v2 allows for a "GPL v2 or later" clause that makes it compatible but since the code files have no header, what is the license PCem should be considered to be under? GPL 2 or GPL 2+ ("v2 or later")?

Re: [Patch] Aztech Sound Cards

Posted: Wed 19 Feb, 2020 11:52 pm
by EluanCM
This was just a copy-paste error, I don't really care about the differences between GPL v2 and v3 GPL.

Re: [Patch] Aztech Sound Cards

Posted: Sat 29 Feb, 2020 2:24 pm
by SarahWalker
Config options are a bit overwhelming. Are all the options strictly necessary, do these cards really require the user to manually configure all resources for SB, WSS & MPU401?

It would also seem more sensible to me to present the Washington/Clinton selection as two different sound cards rather than a separate type field.

Re: [Patch] Aztech Sound Cards

Posted: Fri 06 Mar, 2020 11:37 pm
by EluanCM
Screenshot_2020-02-29_15-59-11_edited.png (69.44 KiB) Viewed 30220 times
You're right, the type (blue square) could be split into two separate cards.
The green square is an option because I don't know yet what the real behavior should be. (My cards are back in storage again and creating a test for this would be a pain :cry: )
All the options in the red squares can be completely removed. For a fresh driver install, only address = {220h, 240h, EEPROM setting} should be enough. The reason I put all as options was to skip one setup step and be able to directly boot dumped HDD images from real hardware without doing any setup, because dumping a 16-byte EEPROM from my cards would be overkill. (Some drivers have EEPROM overrides in config.sys, others do not.)

Would you recommend removing them?

Re: [Patch] Aztech Sound Cards

Posted: Sun 08 Mar, 2020 12:50 pm
by SarahWalker
Yes, I'd suggest removing the red options. If setup can reprogram the EEPROM, then we could always supply a default image.

Re: [Patch] Aztech Sound Cards

Posted: Wed 11 Mar, 2020 3:56 am
by EluanCM
OK, the excessive options are now removed.
Now, when there is no EEPROM, a new one will be created with default values instead of creating from the PCem config.

I didn't have much time to test all the combinations, but everything seems fine. There is some code that I should de-duplicate in the future.

The AZT2316A is release-ready, the AZT1605 still has issues when the DOS TSR is loaded and with the DOS mixer, but should work perfectly under Windows 3.X/NT/95/98.

EDIT: Looks like nvr.c from another patch leaked here, sorry.

Re: [Patch] Aztech Sound Cards

Posted: Wed 11 Mar, 2020 9:22 pm
by SarahWalker
Committed at rev 1534. I've marked the AZT1605 as DEVICE_NOT_WORKING due to the DOS issues, this will prevent it from showing in release builds but will still be available for dev builds.

Re: [Patch] Aztech Sound Cards

Posted: Sun 05 Apr, 2020 2:33 pm
by leilei
Noticed it's this patch causing [url=]a compatibility regression[/url] by uncommenting a couple lines to trigger fatal errors for bad/unknown commands. I might recomment those lines out that in my testing runs as I believe allowing it to fatal's a bit of an oversight

Re: [Patch] Aztech Sound Cards

Posted: Mon 13 Jul, 2020 9:31 pm
by paulojbe
@eluancm First I wish to thank you for bring Itautec Infoway to PCem. I've spent a good time of my childhood playing on it and learning about computers. Now, I've just created a Itautec machine (P133, 128MB, 1GB HD, Aztech sound card) and tried to boot my Master CD 1.1, that I hold until these days, and it gives me an error message saying that the computer is not a Itautec Infoway. I saw that you mentioned in this thread that you had to emulate Aztech cards to make Itautec's Master CD works. What am I doing wrong? Do you have any clues? Thank you!
Itautec Master CD 1.1 error message
Itautec Master CD 1.1 error message
Screenshot from 2020-07-13 18-28-58.png (11.26 KiB) Viewed 24962 times

Re: [Patch] Aztech Sound Cards

Posted: Thu 20 Aug, 2020 11:21 am
by DevanDrake99
There's a game I've never played before, but I would've remembered it if I was born in the late 1980s. The game was TuneLand. I haven't heard of that game until I recently got the Packard Bell Legend master CD disc image and the multimedia images. I've installed the Packard Bell OEM CD to Windows 95 on PCem, and launched TuneLand. It's a BIN and CUE files BTW. Unfortunately, certain sounds are missing from the game. I don't know what's the problem is, but it might've been because it's a CD audio game. I never tried the Sound Blaster cards to test it out, but I'd rather use the Aztech sound card since it's a pre-built driver for Packard Bell PCs.

Is it possible to run TuneLand with 100% sound data on an Aztech sound card, or do I have to use Sound Blaster to run it?

Re: [Patch] Aztech Sound Cards

Posted: Fri 21 Aug, 2020 6:48 pm
by darksabre76
I actually own a copy of TuneLand. It actually says it supports the MPC standard and Windows 3.1. The game does have audio tracks, 97 of them to be precise :lol:

The included README does not make mention of requiring any specific sound cards since it mentions that the setup should take care of any audio configuration.

Re: [Patch] Aztech Sound Cards

Posted: Fri 05 Feb, 2021 10:19 pm
by grommit2007
I found out that on real AZT2316 cards (I'm not sure if there are filters on the AZT1605 and earlier cards, I will have to look into this), there are no filters on the inputs and outputs of the cards, compared to a real Sound Blaster Pro 2.

It seems that some clones of the Sound Blaster Pro 2 had no filtering (including the aforementioned Aztech AZT2316 cards) on the inputs and outputs, presumably to save costs.

Would it be possible for the input and output filters to be removed on the emulated AZT2316 cards, whilst keeping them on the Sound Blaster Pro and Pro 2? (This is for the emulation to be closer to the real cards)

Sources (AZT2316 no filtering): ... t=#p529735

Also, on some of the AZT2316 cards (based on images I saw of various cards with this chipset), the AD1848 and AD1845 codecs were used on some models with this chipset, in addition to the CS4231 and CS4248, would it be possible to add the other codecs as options in the codec selection menu? (I can probably add the AD1848 as an option to the codec selection menu, since it is already implemented in PCem, but I am not sure about being able to add the AD1845)

Re: [Patch] Aztech Sound Cards

Posted: Sat 27 Feb, 2021 3:42 pm
by EluanCM
No filtering is doable. Unfortunately I'm not well educated in sound, so for me every difference is due to differences in speakers! :lol:
AD1848 would behave the same as the CS4248, unless the driver tries to identify it. AD1845 I've never seen, so I don't know if it would be easily implementable.