[Patch] Aztech Sound Cards

Post new patches here!
Post Reply
EluanCM
Posts: 94
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

[Patch] Aztech Sound Cards

Post by EluanCM » Tue 11 Feb, 2020 12:49 am

UPDATE: Support for the NT 3.1 drivers: https://pcem-emulator.co.uk/phpBB3/viewtopic.php?f=4&t=3395&p=13262#p13262

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.
Attachments
Screenshot from 2020-02-10 19-39-09.png
Screenshot from 2020-02-10 19-39-09.png (63.43 KiB) Viewed 1049 times
Screenshot from 2020-02-10 19-36-39.png
Screenshot from 2020-02-10 19-36-39.png (57.3 KiB) Viewed 1049 times
Screenshot from 2020-02-10 19-35-34.png
Screenshot from 2020-02-10 19-35-34.png (46.95 KiB) Viewed 1049 times
Screenshot from 2020-02-10 19-35-14.png
Screenshot from 2020-02-10 19-35-14.png (47.12 KiB) Viewed 1049 times
Screenshot from 2020-01-19 22-28-25.png
Screenshot from 2020-01-19 22-28-25.png (47.85 KiB) Viewed 1049 times
aztech_sound_cards.patch
(99.11 KiB) Downloaded 24 times
Last edited by EluanCM on Tue 18 Feb, 2020 1:11 am, edited 1 time in total.

User avatar
omarsis81
Posts: 783
Joined: Thu 17 Dec, 2015 6:20 pm

Re: [Patch] Aztech Sound Cards

Post by omarsis81 » Tue 11 Feb, 2020 1:00 pm

Impressive! 8-)

User avatar
leilei
Posts: 731
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Patch] Aztech Sound Cards

Post by leilei » Tue 11 Feb, 2020 2:13 pm

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. :(

EluanCM
Posts: 94
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] Aztech Sound Cards

Post by EluanCM » Tue 11 Feb, 2020 10:47 pm

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.

altheos
Posts: 68
Joined: Wed 24 Feb, 2016 7:27 pm

Re: [Patch] Aztech Sound Cards

Post by altheos » Wed 12 Feb, 2020 9:23 am

Hi.
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 ?

EluanCM
Posts: 94
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] Aztech Sound Cards

Post by EluanCM » Wed 12 Feb, 2020 11:11 pm

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!)

altheos
Posts: 68
Joined: Wed 24 Feb, 2016 7:27 pm

Re: [Patch] Aztech Sound Cards

Post by altheos » Thu 13 Feb, 2020 10:49 am

I am referring to functionality : internal DSP functions, OPL version, MIDI, ADPCM, mono/stereo, known bugs ...

EluanCM
Posts: 94
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] Aztech Sound Cards

Post by EluanCM » Thu 13 Feb, 2020 11:10 pm

-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.

SA1988
Posts: 259
Joined: Wed 30 Apr, 2014 9:38 am

Re: [Patch] Aztech Sound Cards

Post by SA1988 » Sat 15 Feb, 2020 10:46 pm

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.

EluanCM
Posts: 94
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] Aztech Sound Cards

Post by EluanCM » Sat 15 Feb, 2020 11:41 pm

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.

SA1988
Posts: 259
Joined: Wed 30 Apr, 2014 9:38 am

Re: [Patch] Aztech Sound Cards

Post by SA1988 » Sat 15 Feb, 2020 11:44 pm

I've used the AZT1605 one.
Edit: got news, it tries to use command 0x08 with data 0x55.

EluanCM
Posts: 94
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] Aztech Sound Cards

Post by EluanCM » Sun 16 Feb, 2020 5:13 pm

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.

User avatar
MiraiMiracle
Posts: 26
Joined: Fri 06 Jul, 2018 4:42 pm

Re: [Patch] Aztech Sound Cards

Post by MiraiMiracle » Mon 17 Feb, 2020 4:19 pm

Really nice!!

Should Sarah merge this patch ot not?

EluanCM
Posts: 94
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] Aztech Sound Cards

Post by EluanCM » Tue 18 Feb, 2020 1:09 am

Updated patch to support the NT 3.1 drivers.
Attachments
aztech_sound_cards_v2.patch
(105.8 KiB) Downloaded 13 times

Manaphy
Posts: 10
Joined: Sat 18 May, 2019 7:26 pm

Re: [Patch] Aztech Sound Cards

Post by Manaphy » Wed 19 Feb, 2020 10:07 pm

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")?

EluanCM
Posts: 94
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] Aztech Sound Cards

Post by EluanCM » Wed 19 Feb, 2020 11:52 pm

This was just a copy-paste error, I don't really care about the differences between GPL v2 and v3 GPL.

Post Reply