Preliminary OPL3-SA2 sound driver patch

Scott Murray (scottm@interlog.com)
Fri, 11 Sep 1998 18:39:41 -0400 (EDT)


After some delay, here is a preliminary patch to add support to 2.1
for the OPL3-SA2 family of sound cards based on the Yamaha 7xx
chipsets. I started working on this in June to try and get my SAx
working, but have been procrastinating lately due to "real world"
demands. Since the ALSA drivers are still somewhat developmental, and
to my knowledge will not be officially 'in' 2.2, I thought I'd try and
finish this up, as there have been a couple of requests about support
for the SA2, SA3, adn SAx cards on the list in the last couple of
weeks.

The major caveat with this patch is that I have not yet added support
for the card's master volume mixer. I'm pretty sure I can get it done
in a couple more nights, so I thought I'd release what I've got so far
to get some feedback from other SA2 owners. Other than the master
volume mixer, I've tested the MIDI and DSP functions, and they seem to
work for me. This isn't too unexpected, as the driver basically is
just a wrapper for the MSS and MPU401 modules. With amplified
speakers, it's reasonably usable even in its current state.

For those brave enough to try it out, the patch should go in cleanly
against 2.1.120 and up (I've tested up to 2.1.122pre2). After
patching, just pick the OPL3-SA2 module option in the sound config, as
well as picking the MSS and MPU401 modules. I don't believe that the
SA2 and up cards are available in anything but PnP cards, so compiling
the driver into the kernel won't work. For my own SAx card, I needed
to upgrade the isapnp tools that come with RedHat 5.1 to a newer
version to detect the card correctly. I think 1.14 or newer should be
fine. Here is the isapnp.conf I'm running with:

-- cut here --
(READPORT 0x0203)
(ISOLATE PRESERVE)
(IDENTIFY *)

# Card 1: (serial identifier 0f ff ff ff ff 00 08 a8 65)
# Vendor Id YMH0800, No Serial Number (-1), checksum 0x0F.
# Version 1.0, Vendor version 0.0
# ANSI string -->OPL3-SA3 Sound Board<--
#
# Logical device id YMH0021

(CONFIGURE YMH0800/-1 (LD 0
(IO 0 (BASE 0x0000))
(IO 1 (BASE 0x0530))
(IO 2 (BASE 0x0388))
(IO 3 (BASE 0x0330))
(IO 4 (BASE 0x0370))
(INT 0 (IRQ 9 (MODE +E)))
(DMA 0 (CHANNEL 0))
(DMA 1 (CHANNEL 3))
(ACT Y)
))
-- cut here --

And here is what I've thrown together in my conf.modules to enable
autoloading:

alias char-major-14 opl3sa2
pre-install opl3sa2 modprobe "-k" "ad1848"
post-install opl3sa2 modprobe "-k" "opl3"
options opl3sa2 io=0x370 mss_io=0x530 mpu_io=0x330 irq=9 dma=0 dma2=3
options opl3 io=0x388

The module options are all pretty straightforward, except for 'io',
which is the cards own control IO port, which is separate from the MSS
port.

Feel free to contact me by email with any questions or comments.

Scott

-- cut here --
begin-base64 644 opl3sa2-2.1.120.patch.gz
H4sICNd++TUAA29wbDNzYTItMi4xLjEyMC5wYXRjaADFGmlz2sjys/wretls
AkFgJIwPvE4F29jLWw4/Y+eovBQlI2H0AhKrI7Y3m//+umdG0giJI8m+WqrM
0dN393T3jGzakwlUQqhUPGscer792cLvjvVQmdgzC2a2Ez5W9KpW1fTarunh
sufv+m7omLtnrjOx76u2w7FWre5UKpXt+CgXng1DawGaBrVas77XbOyBdnR0
uFMul9cLUYahw0hhH7TDZr3W1A846evXUNEO9tV9KNOHtg+vX+8Af9lOAC/O
hnt6XYde57wDnet/Q0OFAxWOVNQC/3RwPdAaL+Bs0L/oXI449qh3dTsi5CNi
NbF3YKcMYFqLUeDZfmAEFrwYhouF6wUwQQbvjbkxNWBw1a1Xhq0PulpXHz/C
neFbJhSvnKsSjA3P9GMpw8Ft/3xE6MOWDs/S0OGQhNkT+ACFZ3kEBTiBwlMB
Ph5DMLUcwqbX1HqEFxFPIzRtFzq7A6YFNOo1FfZreyq0D2tk8sVeLdZG0IxO
W8M2YUYMmfuWGG50YMSMMDVtDavzXgtQKY3o6xlytppL7Vtj10G3muFiZj2W
NvPRQct1Ec+IyEN18lD9gN5OmYfqF1kPUVowL9VXeGnLLJP58TQrszQrU7ql
06xrz+0A08iX0u0m9ALcvKeWMZ7CWwO39IXnohrFnhHaKtx47sL6swT+k4P5
4dt/4oZaSr1e67aTk3eQn3eEvZx0IHk0diIpRzqArqEjdXKpvk9vR+TXGr3p
9FY/ZB6uJx4mEYlrze+vWj3jk5UgrV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HfdK9qu
WrBZLGQoF5+7wrTIW0Fl8sAofQVYj+A75fa7q8H1zag/wIbWOx10hwyaF9Lx
5P44f4V0XrOKevPV6MymdBw/MGYz4OcwurtLDmBV6Fv4FRN/Sg9I+LUxGNSM
2MDGGFD+IZJnGeZTdOpgYcG9MuJHgyKlarbX2Ul5wpCesKEDx0iKZ/yDIin/
0JNfIjtOpJFDUVYVribmlypIVBKhEjeVGcPYzkOsMXcW+FZQZTucuIkiU2l3
+m9aXVGwol0fbaJB6IH74IiGk54v0NlVsV8w82yXWDBYnLP4LQImWYvfJKAe
A/XljnozlZtdU4wHPAdiwYIpN/5YRhBapFWJViN10jpJq3p6VZeXKX1GfngX
PC3Icu04VrnPn4DiYZWeOqK7w0VU03H1jHIRG8DCwDaJWSNMwrNt0UY+tWOw
4VfYx49yWW5YJJPPHfZHYesyiOe+DGKVQPQgysJ0t3+O2CVKr5osKE6J/uC8
/UbQL91zc9LjfL5sLHwuFPw+/mkWx6Kk/s1HM5rIeLFND/XJC8OFjNK5R/DI
06n8ExHgCZjCkpMwyUIZJZWJSSrKKMbswXjycdQNLCx6POFQv07wwudjpoqD
BQ5PuMGnhof1CnPQj/KOFaRsnPBU/FzwZ8MRoUVholfO6T/Gj/T7ygMYXx/z
Y0R3cPb7cfp6QR5ixth6nXCRrZ5/e5TjcsyDnewP7ePKsOdcHqTMls3NORHJ
ebu0Hu8byU2jdv88ck/8TIB//sBNq7jSwmLjr7jzTmFsvHFNYS8/8Nab+oYH
3mnypStwrdmoS1fgDY3dgePHIbsEl8fAwLMf197m0Bd0cIqIP2/8DpJtJH3T
lLqGZiurdthh2XPnwBWsshMtCL+xJ3f0rxSanjgu9WAWNs3PKCM5FSZO2IYu
K21LSn6tzaxKng9EQ1aqYm3DLOeQtA1Z7uXtd8rb1mMUTYXZPTdCW8RS5kfg
fD4gM/of+yX9zb8nAAA=
====

--
=============================================================================
      	    	      Scott Murray, scottm@interlog.com
-----------------------------------------------------------------------------
     "Good, bad ... I'm the guy with the gun." - Ash, "Army of Darkness"
=============================================================================

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/faq.html