You don't really need IRQs for most ISA boards. OPL3/Adlib sound cards don't need one, MIDI doesn't, joystick port doesn't. I saw various I/O boards that don't need IRQ. Soundblaster does, but I don't know for what purpose. Maybe someone here can explain?
Coincidentally I'm currently working on a Sound Blaster driver for some DOS homebrew, so here's quick rundown of how an SB is programmed and what its resources do:
Base Address: This is the beginning of the IO port range you use to program the card, commonly it's 0x220, but can be configured with jumpers (or software on later cards). You can add offsets to this address to access different functionality of the card, such as the OPL chip or the Mixer chip.
IRQ: The interrupt number that will be fired when the soundcard finishes playback of an audio chunk. Early cards usually used 7, later models defaulting to 5. More on this below.
DMA Channel: Which channel of the PC's DMA controller will be supplying audio data to the card. Usually 1 for 8-bit cards, with 5 being used for 16-bit cards.
The general process for playback is as follows:
- Program the DMA controller with the address and size of an audio buffer you'll be using to mix your PCM sound into. This buffer will conventionally be used in 2 halves by the interrupt service routine, a front buffer and backbuffer, similar to what you'd have for double buffered video. The DMA channel should also be put in "auto-init" mode so that the DMA transfer will loop back to the start when it finishes, which allows continuous playback.
- Install an interrupt service routine to write data into the "backbuffer" half of the DMA buffer, which switches back and forth each time an IRQ fires.
- Initialize the DSP chip via its IO port, pick a sample rate (usually around 11khz for most DOS games), then issue a continuous playback command. For this part, you tell the soundcard that your playback buffer is half the size it actually is, which causes the IRQ to fire once in the middle of the buffer, and again at the end of the buffer before looping back to the start. These halfway IRQs allow you to fill the unused half of the buffer while the other half is playing, for smooth gapless playback with no clicks or pops.
This is probably more info than you or anyone actually wanted, but it's a fun topic so I couldn't help myself.
388h is indeed the original adlib base port. Most sound cards that feature an OPL chip will also monitor reads/writes to this port for backward compatibility with older software, but the FM chip is also addressable from a base port offset.
Incidentally, the DSP isn't actually at 220h, it's at 22a/22ch. How the ports are mapped exactly depends on which sound blaster model you have. What's actually at 220h on older cards is the old CMS chips, while the OPL2 is at 228/229h. As CMS chips fell out of use and later cards featured dual OPL2 or an OPL3 chip, 220h-223h were repurposed for FM writes also, which means you can access the OPL chip from a grand total of 3 different IO ports.
Interestingly, cards with dual OPL2 chips would often be designed such that writes to 388h would actually go to both FM chips instead of just one, so that you still get proper mono sound, otherwise it would be panned hard left.
Sound Blasters and compatible cards used IRQ lines because back in the bad old days CPUs were slow, bandwidth was tiny, and buffers were minuscule.
To get responsive/real time audio the card needs to signal to the CPU, not the other way around, and at the time IRQs were the way to do that on ISA busses.
I would imagine that ISA cards that didn't need IRQs either required CPU polling or DMA.
I imagined that the game / audio driver would just send data to the card at regular intervals and that's it. I realize now that the card uses it's own clock that can drift when compared to the system timer and this method would have a buffer underrun/overrun problem.