lkml.org 
[lkml]   [1999]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Date
SubjectRe: [PATCH] 3DSE support for AWE sound cards
In message <E10qHFK-00047I-00@the-village.bc.nu> Alan Cox writes:

>> 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].
>>

>Better would be SOUND_MIXER_AGC and SOUND_MIXER_3DSE

>So the same values can be used for other cards with these features. I'll accept
>a patch that does this quite happily

I've made new patch witch make this new ioctls and support of 3DSE.
I've tested it on three machines without any problems with cam patched by me.
I attach the patch to end of this letter. Patched version of cam for testing
this features available for download from
ftp://esc.kharkov.com/pub/Linux/sound/cam-1.04.tgz

Stanislav Voronyi.
----------- Patch against clean 2.2.9 kernel tree --------------------------
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 Mon Jun 7 12:00:40 1999
@@ -13,6 +13,7 @@
*
* Thomas Sailer : ioctl code reworked (vmalloc/vfree removed)
* Rolf Fokkens (Dec 20 1998) : Moved ESS stuff into sb_ess.[ch]
+ * Stanislav Voronyi <stas@esc.kharkov.com> : Support for AWE 3DSE device (Jun 7 1999)
*/

#include <linux/config.h>
@@ -550,14 +551,37 @@
int val, ret;

/*
- * Use ioctl(fd, SOUND_MIXER_PRIVATE1, &mode) to turn AGC off (0) or on (1).
+ * Use ioctl(fd, SOUND_MIXER_AGC, &mode) to turn AGC off (0) or on (1).
+ * Use ioctl(fd, SOUND_MIXER_3DSE, &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_AGC)
+ {
+ if (get_user(val, (int *)arg))
+ return -EFAULT;
+ sb_setmixer(devc, 0x43, (~val) & 0x01);
+ return 0;
+ }
+ if (cmd == SOUND_MIXER_3DSE)
+ {
+ /* 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
diff -u --recursive linux.dist/include/linux/soundcard.h linux/include/linux/soundcard.h
--- linux.dist/include/linux/soundcard.h Sat Oct 24 21:40:16 1998
+++ linux/include/linux/soundcard.h Mon Jun 7 11:56:13 1999
@@ -891,6 +891,12 @@
#define SOUND_MIXER_ACCESS _SIOWR('M', 102, mixer_record)

/*
+ * Two ioctls for special souncard function
+ */
+#define SOUND_MIXER_AGC _SIOWR('M', 103, int)
+#define SOUND_MIXER_3DSE _SIOWR('M', 104, int)
+
+/*
* The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers.
* These features can be used when accessing device specific features.
*/
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:52    [W:0.036 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site