[PATCH] 3DSE support for AWE sound cards

Stanislav V. Voronyi (stas@cnti.uanet.kharkov.ua)
Sat, 5 Jun 1999 16:56:15 +0300


Hi All.

When I found that I can't turn on 3D Stereo Enhancement device under
Linux which I can easily turn on/off under MD95/98 it make me sad.
The patch at the end of my letter make its possible. To use this function
with the following patch get modified cam from my site:
ftp://esc.kharkov.com/pub/Linux/sound/cam-1.03.tgz

And also one question to linux sound people: like for AGC I used in my patch
SOUND_MIXER_PRIVATE2 ioctl. Why not make two new define in soundcard.h:

#define SOUND_MIXER_SB16_AGC _SIOWR('M', 103, int)
#define SOUND_MIXER_AWE_3DSE _SIOWR('M', 104, int)

Imho such two new ioctls for this purposes better than using SOUND_MIXER_PRIVATE[1-5].

Stanislav Voronyi.

The following patch against clean 2.2.9 - please include to mainstream kernel
--------------------- Patch to support AWE 3DSE ----------------------------------
diff -u --recursive linux.dist/drivers/sound/sb_mixer.c linux/drivers/sound/sb_mixer.c
--- linux.dist/drivers/sound/sb_mixer.c Fri May 21 19:50:59 1999
+++ linux/drivers/sound/sb_mixer.c Fri Jun 4 19:42:49 1999
@@ -551,13 +551,36 @@

/*
* Use ioctl(fd, SOUND_MIXER_PRIVATE1, &mode) to turn AGC off (0) or on (1).
+ * Use ioctl(fd, SOUND_MIXER_PRIVATE2, &mode) to turn 3DSE off (0) or on (1)
+ * or mode==2 put 3DSE state to mode.
*/
- if (cmd == SOUND_MIXER_PRIVATE1 && devc->model == MDL_SB16)
- {
- if (get_user(val, (int *)arg))
- return -EFAULT;
- sb_setmixer(devc, 0x43, (~val) & 0x01);
- return 0;
+ if (devc->model == MDL_SB16) {
+ if (cmd == SOUND_MIXER_PRIVATE1)
+ {
+ if (get_user(val, (int *)arg))
+ return -EFAULT;
+ sb_setmixer(devc, 0x43, (~val) & 0x01);
+ return 0;
+ }
+ if (cmd == SOUND_MIXER_PRIVATE2)
+ {
+ /* I put here 15, but I don't know the exact version.
+ At least my 4.13 havn't 3DSE, 4.16 has it. */
+ if (devc->minor < 15)
+ return -EINVAL;
+ if (get_user(val, (int *)arg))
+ return -EFAULT;
+ if (val == 0 || val == 1)
+ sb_chgmixer(devc, AWE_3DSE, 0x01, val);
+ else if (val == 2)
+ {
+ ret = sb_getmixer(devc, AWE_3DSE)&0x01;
+ return put_user(ret, (int *)arg);
+ }
+ else
+ return -EINVAL;
+ return 0;
+ }
}
if (((cmd >> 8) & 0xff) == 'M')
{
diff -u --recursive linux.dist/drivers/sound/sb_mixer.h linux/drivers/sound/sb_mixer.h
--- linux.dist/drivers/sound/sb_mixer.h Thu Jan 7 19:24:00 1999
+++ linux/drivers/sound/sb_mixer.h Fri Jun 4 19:07:06 1999
@@ -78,6 +78,11 @@
#define RIGHT_CHN 1

/*
+ * 3DSE register of AWE32/64
+ */
+#define AWE_3DSE 0x90
+
+/*
* Mixer registers of ALS007
*/
#define ALS007_RECORD_SRC 0x6c

-
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/