640K!enough wrote:I suspect that the source of the problems is the slight differences in timing between the two chips, resulting in a playback rate (and therefore audible pitch) that is slightly different on the InterWave. That is to say that the same software will produce different sound when running on a system with an InterWave card, than if the very same system were to have a GF1-based card installed.
This is generally not true for a voice count 14 or less. The main loop of the IW synth work exactly the same as the GF1. It takes two successive samples from memory based on the voice position count, optionally performs a weighted average of them based on the fractional position value (and corresponding two's complement), applies attenuation sources from volume and panning positions, and accumulates across all active voices (active, not 32). The FSM takes a maximum number of cycles per voice based on worst case state transitions and DRAM wait states. Multiply that by the active voice count. Then take the result and divide it into the system clock frequency and you have your effective max sample generation rate. IW just has a faster system clock and can thus keep up with all 32 voices 44100 times a second.
On the IW, there may be slight differences in the fixed point step progression (speed) for voice counts greater than 14 for software that is not IW aware. That is, the IW has to compensate for the compensation programs do to account for the voice mixing frequency for SAVI > 14 on the GF1. When you write to the fstep register on IW with SAVI > 14, the logic performs a scaling of that factor based on the original GUS frequency tables so that at a IW progression of 44.1 KHz, the sample pacing is approximately correct. That calculation has rounding error and could account for slight audible differences. It's essentially whatever value the program wrote for FSTEP * 14 / SAVI = the new effective FSTEP while the original value is returned on read-back as written.
Additional artifacting may also occur due to the fact the GF1 is pushing samples at a true 19293 HZ to the DAC at SAVI=31 while the IW is pushing samples at a true 44100 HZ while adding an adjusted fixed-point sample increment (FSTEP) that is compensated for by the difference in frequency. EG. adding a smaller increment at a faster rate at insufficient resolution causing rounding errors to compound over time.
640K!enough wrote:My current belief is that most of these problems are related exclusively to the InterWave's legacy GUS compatibility mode.
It's related to the fstep compensation outlined above. There are two parts to the GF1 and IW. What I like to call the 'core' and the 'synth'. The core is where the register file is maintained - including the dual port register RAM to the synth, things like Adlib timers, PIO and DMA DRAM access (LMC - or Local Memory Controller), and the SB/Adlib/MPU401 emulation hooks. The 'core' of the IW is a fairly pure superset with a compatibility mode for extended and dual function bits that is on be default after reset.
The synth of the IW is the same synth as the GF1 just clocked faster and with a few additional voice processing features (mostly the LFOs) outlined below. Both follow a simple mixing finite state machine to generate samples at a rate determined by the SAVI and system clock rate accessing local memory through a second higher priority port.
If you want a horrifically detailed dive in the inner workings of the IW, look-up US Patent # 6,058,066. Some yahoo at AMD decided to file all the gory design details as a patent. Lucky for us.
640K!enough wrote:if you're aware of any of these differences, please share them in as much detail as possible.
From my understanding the IW generally added the following enhancements over the GF1:
- Ability to address up to 24 bits of RAM or Flash (16 MB ea.) vs 20 bits for the GF1 (1 MB) of RAM only.
- Additional DMA on-the-fly transforms such as 16-bit signed conversion and auto-interleaving
- An enhanced LMC port which allows 16-bit PIO access with optional auto-increment
- Additional mappable general purpose registers with interrupt triggers to better facilitate Adlib, Sound Blaster, and MPU-401 emulation
- Full 44.1 KHz @ 32 voices - but this wasn't a functional change; only a qualitative one.
- Built-in direct codec to replace the Crystal add-on daughter board for the GUS. Built into the GUS MAX as well. Eventually adopted as the Windows Sound System standard with some later port mapping adjustments.
- Additional effect channel per voice
- Volume and frequency LFOs per voice
- Ability to play stereo samples per voice (LR offset regs)
- More comprehensive mixer (later ICS)
- ISA Plug-n-Play support (a curse - not a feature!)
Though as I've explained on VCForums, I don't believe any software made use of any of these features aside from the emulation and demo apps that shipped with the PnP cards.
I plan on demoing my IW Verilog core next month at VCF-MW. Look for videos of my talk to follow as well as some announcements later in the year on possible Kickstarter plans.
640K!enough wrote:I have been working on a simple piece of DOS software to explore some of these issues. Unfortunately for me, this is where I reach a bit of an impasse. In order to complete this experiment and document the results properly, I would need an InterWave-based card (I have a couple of those), a GF1-based card (which I don't have) and an oscilloscope (which I also don't have). So, is there anyone who is sufficiently interested in this, and who has at least one type of GUS-like card and an oscilloscope, to be willing to collaborate briefly?
I would be happy to do any testing you want. I have at least 3 variations of IW cards, nearly all major versions of GUS (about 10 cards), and have built my own core using a MachXO2 at the moment while moving to an ECP5 next month. I do have lots of DSP past the IW core, but I can zero or by-pass most of it. The output noise floor is pretty clean as well even before any analog tuning (next ECP5 version).
I plan on doing some of the comparisons myself as I mature the code before next month. However other paying work has higher interrupt priority.