From alsa-devel-owner@alsa.jcu.cz  Tue Jan 19 23:43:43 1999
Received: from anjala.mit.edu (IDENT:arvind@ANJALA.MIT.EDU [18.251.3.144])
	by marvin.jcu.cz (8.9.1a/8.9.1) with ESMTP id XAA23992
	for <alsa-devel@alsa.jcu.cz>; Tue, 19 Jan 1999 23:37:30 +0100
Received: (from arvind@localhost)
	by anjala.mit.edu (8.9.2/8.9.2) id RAA00673
	for alsa-devel@alsa.jcu.cz; Tue, 19 Jan 1999 17:37:08 -0500 (EST)
Message-ID: <19990119173708.A602@anjala.mit.edu>
Date: Tue, 19 Jan 1999 17:37:08 -0500
From: Arvind Sankar <arvinds@mit.edu>
To: alsa-devel@alsa.jcu.cz
Subject: Some points about the driver
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

Hi. I have a Creative Ensoniq AudioPCI. It has a ES1371 chip. According to
Creative, the thing has 3d surround support, so I was looking through
the driver to see why it isn't detected.

I discovered that ac97_codec.c:snd_ac97_mixer calls snd_ac97_try_volume_mix to
try the 3D features before reading hardware capabilites from the card.  But the
latter function, in certain cases, viz AC97_MASTER_TONE, AC97_HEADPHONE, and
AC97_3D_CONTROL depends on what the ac97->caps value is. This value would be
zero on all calls.

So I moved the initialization of caps up, before the calls to
snd_ac97_try_volume_mix, but the hardware returns 0. Now, either Creative
has a different way of implementing 3D surround, which doesn't show up in
the capabilities reg, or something else is the matter. I tried setting
the AC97_3D_CONTROL register, and values get written and can be read back.
Does that indicate anything useful?

Another thing, in the same file, function snd_ac97_volume_level:
The following lines seem messed:
        val = ac97->read(ac97->private_data, reg);
...
        val &= ~channel->hw.max;
        val |= left << shift;

If shift is non-zero, then the &= clears the wrong bits of the value to
be written. This should probably be something like
	val &= ~(channel->hw.max << shift);

Hope this helps!

-- arvind

p.s. please Cc: any replies to me as I am not subscribed to the list.

