Subject: Re: Yamaha sound card
To: Michael C. Richardson <mcr@sandelman.ottawa.on.ca>
From: David Stanhope <dms@celtech.com>
List: port-i386
Date: 11/01/1997 00:46:48
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> 
> 
>   I wound up with a:
> 
> isapnp0 at isa0 port 0x279: read port 0x203
> isapnp0: <OPL3-SA2 Sound Board, YMH0021, , > port 0x220/16,0x530/8,0x388/8,0x330
> /2,0x370/2 irq 5 drq 0,1 not configured
> joy0 at isapnp0 port 0x201/1
> joy0: OPL3-SA2 Sound Board 
> joy0: joystick not connected
> 
>   card in a system. The box claimed:
> 
> compatibility:
> "Pnp under Win95, Sound Blaster, SB PRO, MPC3, Window Sound System,
> Win 3.1, DOS 5.0 or higher, General MIDI"
> 
>   This one came with wave table support (the one without was out of
> stock).
> 
>   I find it strange that it has no ipa->ipa_devcompat string.
>   I've added this to sb_isapnp_match, and I'll test it in a moment
> with XFree86-3.3 is finished downloading.
> 
>   [I've given up on my sun3 xterminal. 7 years of service for a 10
> year old machine. A valiant effort. Its' hostname and IP address will
> be retired :-)] 
> 
>    :!mcr!:            |  Network and security consulting/contract programming
>    Michael Richardson |   I do IPsec policy code for SSH <http://www.ssh.fi/>
>  Personal: mcr@sandelman.ottawa.on.ca. PGP key available.
>  Corporate: sales@sandelman.ottawa.on.ca. 
> 
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: 2.6.3ia
> Charset: latin1
> Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface
> 
> iQB1AwUBNFot1qZpLyXYhL+BAQHRFAL8CzKHCAOkGJ7z1qRawG9Hcdgi7LyrtShC
> 0/QnXjbFn0oB67kmlz1O/1zo7fZcClRDt8Ut25dYcs6X6NXLp2ineW6MW2NsqJon
> oPxEuNKjo1k4RMlPTGwu/tVE5a9E5pz0
> =gVN8
> -----END PGP SIGNATURE-----
> 
This looks very much like the Yahama sound chip (YMF715) which is on
the intel anchorage board. I managed to get it to work but its SB
emulation is lame, it only supports playback, the record registers are there
but are non-functional (this is all in the chips data sheet). Adding "YHM0021"
to sb_isapnp.c was not enough, the YMF715 chip uses the second DMA channel
for SB emulation, not the first, so something must be done to fix which
DMA channel is passed to 'isapnp_config' in 'sb_isapnp_attach'. The
simplest way is to just change the following line:

	sc->sc_drq8 = ipa->ipa_drq[0].num;
to:
	sc->sc_drq8 = ipa->ipa_drq[1].num;

'drq16' is not used in SB/SBPRO emulation, so doesn't matter what it is set to.

I have implemented a somewhat more general mechanism since it looks like
many PnP chips return other things in various orders, i.e. the SB addresses
may not be the first address returned. A recent real PnP SB16, the ViBRA16X,
doesn't have have a 16-bit dma channel but instead two 8-bits, so some way
to keep the driver from using the second PnP dma channel is needed (the
driver fails trying to use it). (anyone know how to use the second channel?)
I can forward my 'sb_isapnp.c' if desired.

A much better solution for most of these non-SB sound cards would be a
Windows-Sound-System (ad1848) isapnp driver, since it appears most provide
much more complete WSS emulation (16 bit, full duplex).

                  Dave Stanhope
		  dms@celtech.com