From alsa-devel-owner@alsa.jcu.cz  Tue Dec 29 03:09:39 1998
Received: from tux.mit.edu (TUX.MIT.EDU [18.239.1.134])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id DAA20635
	for <alsa-devel@alsa.jcu.cz>; Tue, 29 Dec 1998 03:06:03 +0100
Received: (from amu@localhost)
	by tux.mit.edu (8.8.7/8.8.7) id VAA23554;
	Mon, 28 Dec 1998 21:05:36 -0500
To: alsa-devel@alsa.jcu.cz
Subject: AD1848 garbling problem found
From: amu@mit.edu (Aaron M. Ucko)
Date: 28 Dec 1998 20:01:07 -0600
Message-ID: <udlbtkn4sgs.fsf@kepler.x>
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

Sigh, I finally tracked down the AD1848 garbling problem, which turned
out to be a highlevel braino rather than a hardware misunderstanding.
(I still hear some recalibration clicks despite attempts at muting
them out, though.)  Enclosed is a patch to fix that, as well as a
patch to convince mozart.c to talk to my Diamond Sonic Sound LX
revision OP, which uses an OPTi 82c928.

Index: cards/mozart.c
===================================================================
RCS file: /home/alsa/cvsroot/alsa-driver/cards/mozart.c,v
retrieving revision 1.2
diff -u -r1.2 mozart.c
--- mozart.c	1998/11/08 19:10:02	1.2
+++ mozart.c	1998/12/29 01:39:39
@@ -188,10 +188,12 @@
 		snd_unregister_ioports(snd_card);
 		return -ENODEV;
 	}
+#if 0 /* allow 82c928 (MAD16) */
 	if ((snd_mozart_read(3) & 0x03) != 0x03) {
 		snd_printdd("mozart: reg 3: invalid value == 0x%x\n", snd_mozart_read(3));
 		return -ENODEV;
 	}
+#endif
 #if 0
 	/* write map... */
 	printk("mozart: map [0x00]: ");
Index: lowlevel/isa/ad1848.c
===================================================================
RCS file: /home/alsa/cvsroot/alsa-driver/lowlevel/isa/ad1848.c,v
retrieving revision 1.8
diff -u -r1.8 ad1848.c
--- ad1848.c	1998/11/29 16:32:47	1.8
+++ ad1848.c	1998/12/29 01:47:15
@@ -380,7 +380,7 @@
 	snd_pcm1_t *pcm1;
 	snd_pcm1_channel_t *pchn;
 
-	pcm1 = (snd_pcm1_t *) codec->pcm;
+	pcm1 = (snd_pcm1_t *) codec->pcm->private_data;
 	pchn = direction == SND_PCM1_PLAYBACK ? &pcm1->playback : &pcm1->record;
 	codec->image.dfr =
 	    snd_ad1848_get_format(pchn->mode, pchn->voices) |

