Some day this should be a working driver for ZA2. Now it's not!

If you want to test it, copy the files into the alsa-tree.
I used alsa-driver-0.3.0-pre2 and kernel 2.2.0pref5. 
alsa-driver-0.2 does not work!!!

Necessary changes to alsa
=========================

include/asoundid.h
------------------
Edit include/asoundid.h
Add the line
#define SND_CARD_TYPE_ZA2               0x00000016      /* ZA2 */
and increment SND_CARD_TYPE_LAST by one.

cards/Makefile
--------------
In cards/Makefile add
          $(TOPDIR)/modules/snd-za2.o
to TARGETS

Define 

ZA2              = za2.o

and

$(TOPDIR)/modules/snd-za2.o: .depend $(ZA2)
        $(LINKER) -o $@ $(ZA2)


Hopefully you should be able to compile now

Loading the device
==================

/etc/conf.modules
-----------------

alias char-major-14 snd
alias snd-minor-oss-0 snd-mixer
alias snd-minor-oss-3 snd-pcm1-oss
alias snd-minor-oss-4 snd-pcm1-oss
alias snd-minor-oss-5 snd-pcm1-oss
alias snd-minor-oss-12 snd-pcm1-oss
alias snd-card-0 snd-za2
options snd snd_major=14 snd_cards_limit=1
options snd-za2 snd_index=1 snd_port=0x210

Probably you must change the port. I think default port is 0x310. Possible
ports are 0x210, 0x250, 0x310, 0x350. Autodetect does not work. You must
specify the right port.

modprobe snd-za2 will load the device.

As I mentioned in the mailinglist alsa-devel I have problems producing sound:

I've coded the device driver for ZA2 (using alsa0.3.0-pre2 and Linux
kernel 2.2.0pre5). Interrupts and DMA are running
fine, but nothing comes out of my speaker. Because there is no real
documentation for the ALSA architecture (or have you recently worked
on it) I've a few questions. 

If I play au-files (cat test.au >/dev/dsp, vplay test.au) some noise
comes out of the speaker. That's because my driver only supports 16bit
at 48000Hz stereo and au-files are 8bit, 8kHz, mono. If I play the
same as wav-file (cat test.wav >/dev/dsp, vplay test.wav) nothing is
hearable. The same thing happens with playing 16bit, 48kHz, stereo
wav-files. So what is done with the data in the alsa-kernel in the
case of au-files, wav-files, 8bit or 16bits, if my driver only
supports 16bit, 48kHz stereo? If I play 16bit signed data with my own
programm using the alsa-lib (format=SND_PCM_SFMT_S16_LE) nothing is
hearable, although the alsa-kernel should not change the data and just
transfer it to the soundcard (dma and interrupts are working). Is the
dma-buffer altered after putting the data from userspace to the
DMA-buffer? Please give me some hints.

Martin Pahl

