patch-1.3.34 linux/drivers/sound/configure.c
Next file: linux/drivers/sound/cs4232.c
Previous file: linux/drivers/sound/audio.c
Back to the patch index
Back to the overall index
- Lines: 519
- Date:
Wed Oct 11 07:55:39 1995
- Orig file:
v1.3.33/linux/drivers/sound/configure.c
- Orig date:
Tue Jul 11 10:02:52 1995
diff -u --recursive --new-file v1.3.33/linux/drivers/sound/configure.c linux/drivers/sound/configure.c
@@ -2,7 +2,7 @@
/*
* sound/configure.c - Configuration program for the Linux Sound Driver
*
- * Copyright by Hannu Savolainen 1993
+ * Copyright by Hannu Savolainen 1993-1995
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -27,6 +27,8 @@
*/
#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
#define B(x) (1 << (x))
@@ -49,28 +51,31 @@
#define OPT_SSCAPE 10
#define OPT_TRIX 11
#define OPT_MAD16 12
+#define OPT_CS4232 13
+#define OPT_MAUI 14
-#define OPT_HIGHLEVEL 13 /* This must be same than the next one */
-#define OPT_SBPRO 13
-#define OPT_SB16 14
-#define OPT_AEDSP16 15
-#define OPT_AUDIO 16
-#define OPT_MIDI_AUTO 17
-#define OPT_MIDI 18
-#define OPT_YM3812_AUTO 19
-#define OPT_YM3812 20
-#define OPT_SEQUENCER 21
-#define OPT_LAST 21 /* Last defined OPT number */
+#define OPT_HIGHLEVEL 15 /* This must be same than the next one */
+#define OPT_SBPRO 15
+#define OPT_SB16 16
+#define OPT_AEDSP16 17
+#define OPT_AUDIO 18
+#define OPT_MIDI_AUTO 19
+#define OPT_MIDI 20
+#define OPT_YM3812_AUTO 21
+#define OPT_YM3812 22
+#define OPT_SEQUENCER 23
+#define OPT_LAST 23 /* Last defined OPT number */
#define ANY_DEVS (B(OPT_AUDIO)|B(OPT_MIDI)|B(OPT_SEQUENCER)|B(OPT_GUS)| \
B(OPT_MPU401)|B(OPT_PSS)|B(OPT_GUS16)|B(OPT_GUSMAX)| \
B(OPT_MSS)|B(OPT_SSCAPE)|B(OPT_UART6850)|B(OPT_TRIX)| \
- B(OPT_MAD16))
+ B(OPT_MAD16)|B(OPT_CS4232)|B(OPT_MAUI))
#define AUDIO_CARDS (B (OPT_PSS) | B (OPT_SB) | B (OPT_PAS) | B (OPT_GUS) | \
B (OPT_MSS) | B (OPT_GUS16) | B (OPT_GUSMAX) | B (OPT_TRIX) | \
- B (OPT_SSCAPE)| B(OPT_MAD16))
+ B (OPT_SSCAPE)| B(OPT_MAD16) | B(OPT_CS4232))
#define MIDI_CARDS (B (OPT_PSS) | B (OPT_SB) | B (OPT_PAS) | B (OPT_MPU401) | \
- B (OPT_GUS) | B (OPT_TRIX) | B (OPT_SSCAPE)|B(OPT_MAD16))
+ B (OPT_GUS) | B (OPT_TRIX) | B (OPT_SSCAPE)|B(OPT_MAD16) | \
+ B (OPT_CS4232)|B(OPT_MAUI))
/*
* Options that have been disabled for some reason (incompletely implemented
* and/or tested). Don't remove from this list before looking at file
@@ -123,6 +128,8 @@
{0, 0, "SSCAPE", 1, 0, 0},
{0, 0, "TRIX", 1, 0, 0},
{0, 0, "MAD16", 1, 0, 0},
+ {0, 0, "CS4232", 1, 0, 0},
+ {0, 0, "MAUI", 1, 0, 0},
{B (OPT_SB), B (OPT_PAS), "SBPRO", 1, 0, 1},
{B (OPT_SB) | B (OPT_SBPRO), B (OPT_PAS), "SB16", 1, 0, 1},
@@ -150,6 +157,8 @@
"Ensoniq Soundscape support",
"MediaTriX AudioTriX Pro support",
"Support for MAD16 and/or Mozart based cards",
+ "Support for Crystal CS4232 based (PnP) cards",
+ "Support for Turtle Beach Wave Front (Maui, Tropez) synthesizers",
"SoundBlaster Pro support",
"SoundBlaster 16 support",
@@ -172,33 +181,6 @@
int
can_select_option (int nr)
{
-#if 0
- switch (nr)
- {
- case 0:
- fprintf (stderr, "The SoundBlaster, AdLib and ProAudioSpectrum\n"
- "CARDS cannot be installed at the same time.\n\n"
- "However the PAS16 has a SB emulator so you could select"
- "the SoundBlaster DRIVER with it.\n");
- fprintf (stderr, " - ProAudioSpectrum 16\n");
- fprintf (stderr, " - SoundBlaster / SB Pro\n");
- fprintf (stderr, " (Could be selected with a PAS16 also)\n");
- fprintf (stderr, " - AdLib\n");
- fprintf (stderr, "\nDon't enable SoundBlaster if you have GUS at 0x220!\n\n");
- break;
-
- case OPT_LAST_MUTUAL + 1:
- fprintf (stderr, "\nThe following cards should work with any other cards.\n"
- "CAUTION! Don't enable MPU-401 if you don't have it.\n");
- break;
-
- case OPT_HIGHLEVEL:
- fprintf (stderr, "\nSelect one or more of the following options\n");
- break;
-
-
- }
-#endif
if (hw_table[nr].conditions)
if (!(hw_table[nr].conditions & selected_options))
@@ -220,7 +202,7 @@
char answ[512];
int len;
- if ((len = read (0, &answ, sizeof (answ))) < 1)
+ if ((len = read (0, answ, sizeof (answ))) < 1)
{
fprintf (stderr, "\n\nERROR! Cannot read stdin\n");
@@ -251,7 +233,7 @@
play_it_again_Sam:
- if ((len = read (0, &answ, sizeof (answ))) < 1)
+ if ((len = read (0, answ, sizeof (answ))) < 1)
{
fprintf (stderr, "\n\nERROR! Cannot read stdin\n");
@@ -282,76 +264,46 @@
{
int i, num, def_size, full_driver = 1;
char answ[10];
+ int sb_base = 0;
printf ("/*\tGenerated by configure. Don't edit!!!!\t*/\n\n");
fprintf (stderr, "\nConfiguring the sound support\n\n");
-#if 0
- /*
- * The full driver appeared to be impossible to compile and boot.
- * There are too much supported cards now.
- */
- fprintf (stderr, "Do you want to include full version of the sound driver (n/y) ? ");
+ {
+ /*
+ * Partial driver
+ */
- if (think_positively (0))
- {
- /*
- * Select all but some most dangerous cards. These cards are difficult to
- * detect reliably or conflict with some other cards (SCSI, Mitsumi)
- */
- selected_options = 0xffffffff &
- ~(B (OPT_MPU401) | B (OPT_UART6850) | B (OPT_PSS)) &
- ~DISABLED_OPTIONS;
+ full_driver = 0;
- fprintf (stderr, "Note! MPU-401, PSS and 6850 UART drivers not enabled\n");
- full_driver = 1;
- }
- else
-#endif
- {
-#if 0
- fprintf (stderr, "Do you want to DISABLE the Sound Driver (n/y) ?");
- if (think_positively (0))
+ for (i = 0; i <= OPT_LAST; i++)
+ if (can_select_option (i))
{
- printf ("#undef CONFIGURE_SOUNDCARD\n");
- printf ("#undef KERNEL_SOUNDCARD\n");
- exit (0);
- }
-#endif
- /*
- * Partial driver
- */
-
- full_driver = 0;
-
- for (i = 0; i <= OPT_LAST; i++)
- if (can_select_option (i))
- {
- if (!(selected_options & B (i))) /*
+ if (!(selected_options & B (i))) /*
* Not selected yet
*/
- if (!hw_table[i].verify)
- {
+ if (!hw_table[i].verify)
+ {
+ if (hw_table[i].alias)
+ selected_options |= B (hw_table[i].alias);
+ else
+ selected_options |= B (i);
+ }
+ else
+ {
+ int def_answ = hw_table[i].default_answ;
+
+ fprintf (stderr,
+ def_answ ? " %s (y/n) ? " : " %s (n/y) ? ",
+ questions[i]);
+ if (think_positively (def_answ))
if (hw_table[i].alias)
selected_options |= B (hw_table[i].alias);
else
selected_options |= B (i);
- }
- else
- {
- int def_answ = hw_table[i].default_answ;
-
- fprintf (stderr,
- def_answ ? " %s (y/n) ? " : " %s (n/y) ? ",
- questions[i]);
- if (think_positively (def_answ))
- if (hw_table[i].alias)
- selected_options |= B (hw_table[i].alias);
- else
- selected_options |= B (i);
- }
- }
- }
+ }
+ }
+ }
if (selected_options & B (OPT_SBPRO))
{
@@ -493,6 +445,8 @@
if (think_positively (1))
goto genld_again;
}
+ else
+ printf ("#define PSS_HAVE_LD\n");
}
else
{
@@ -543,6 +497,8 @@
else
printf ("#define KERNEL_SOUNDCARD\n");
+ printf ("#define EXCLUDE_PNP\n");
+
for (i = 0; i <= OPT_LAST; i++)
if (!hw_table[i].alias)
if (selected_options & B (i))
@@ -556,7 +512,6 @@
*/
printf ("\n");
-#if defined(linux)
if (selected_options & B (OPT_AEDSP16))
{
fprintf (stderr, "\nI/O base for Audio Excel DSP 16 ?\n"
@@ -577,7 +532,7 @@
"The factory default is 220\n"
"Enter the SB I/O base: ");
- num = ask_value ("%x", 0x220);
+ sb_base = num = ask_value ("%x", 0x220);
fprintf (stderr, "SB I/O base set to %03x\n", num);
printf ("#define SBC_BASE 0x%03x\n", num);
@@ -718,7 +673,7 @@
num = 0x220;
}
- if ((selected_options & B (OPT_SB)) && (num == 0x220))
+ if ((selected_options & B (OPT_SB)) && (num == sb_base))
{
fprintf (stderr, "FATAL ERROR!!!!!!!!!!!!!!\n"
"\t0x220 cannot be used if SoundBlaster is enabled.\n"
@@ -763,26 +718,20 @@
fprintf (stderr, "\nGravis UltraSound DMA set to %d\n", num);
printf ("#define GUS_DMA %d\n", num);
- if (selected_options & B (OPT_GUSMAX))
- {
- fprintf (stderr, "\nSecond DMA channel for GUS MAX (optional)?\n"
- "The default value is 7 (0 disables)\n"
- "Enter the value: ");
-
- num = ask_value ("%d", 7);
- if (num > 0)
- {
- if (num > 7)
- {
- fprintf (stderr, "*** Illegal input! ***\n");
- num = 7;
- }
+ fprintf (stderr, "\nSecond DMA channel for GUS (optional)?\n"
+ "The default value is 7 (-1 disables)\n"
+ "Enter the value: ");
- fprintf (stderr, "\nGUSMAX DMA set to %d\n", num);
- printf ("#define GUSMAX_DMA %d\n", num);
- }
+ num = ask_value ("%d", 7);
+ if (num > 7)
+ {
+ fprintf (stderr, "*** Illegal input! ***\n");
+ num = 7;
}
+ fprintf (stderr, "\nGUS DMA2 set to %d\n", num);
+ printf ("#define GUS_DMA2 %d\n", num);
+
if (selected_options & B (OPT_GUS16))
{
fprintf (stderr, "\nI/O base for GUS16 (GUS 16 bit sampling option)?\n"
@@ -895,6 +844,7 @@
fprintf (stderr, "PSS I/O base set to %03x\n", num);
printf ("#define PSS_BASE 0x%03x\n", num);
+#if YOU_WANT_TO_WASTE_RESOURCES
fprintf (stderr, "\nIRQ number for PSS?\n"
"Valid numbers are: 3, 4, 5, 7, 9(=2) or 10.\n"
"The default value is 10.\n"
@@ -922,6 +872,7 @@
}
fprintf (stderr, "\nECHO-PSS DMA set to %d\n", num);
printf ("#define PSS_DMA %d\n", num);
+#endif
fprintf (stderr, "\nMSS (MS Sound System) I/O base for the PSS card?\n"
"The factory default is 530\n"
@@ -1155,6 +1106,21 @@
fprintf (stderr, "\nAudioTriX/WSS DMA set to %d\n", num);
printf ("#define TRIX_DMA %d\n", num);
+ fprintf (stderr, "\nSecond (capture) DMA number for AudioTriX?\n"
+ "Valid values are 0, 1 and 3.\n"
+ "The default value is 0\n"
+ "(-1 disables the second DMA)\n"
+ "Enter the value: ");
+
+ num = ask_value ("%d", 0);
+ if (num != 0 && num != 1 && num != 3 || num != -1)
+ {
+ fprintf (stderr, "*** Illegal input! ***\n");
+ num = 0;
+ }
+ fprintf (stderr, "\nAudioTriX/WSS DMA2 set to %d\n", num);
+ printf ("#define TRIX_DMA2 %d\n", num);
+
fprintf (stderr, "\nSoundBlaster I/O address for the AudioTriX card?\n"
"The factory default is 220\n"
"Other possible values are 200, 210, 230, 240, 250, 260 and 270\n"
@@ -1216,6 +1182,88 @@
printf ("#define TRIX_MPU_IRQ %d\n", num);
}
+ if (selected_options & B (OPT_CS4232))
+ {
+ int dma1;
+
+ fprintf (stderr, "\nWindows Sound System I/O base for CS4232?\n"
+ "The factory default is 534\n"
+ "Other possible values are 608, E84 or F44\n"
+ "Enter the MSS I/O base: ");
+
+ num = ask_value ("%x", 0x534);
+ fprintf (stderr, "CS4232 MSS I/O base set to %03x\n", num);
+ printf ("#define CS4232_BASE 0x%03x\n", num);
+
+ fprintf (stderr, "\nIRQ number for the WSS mode of CS4232 ?\n"
+ "Valid numbers are: 5, 7, 9(=2), 11, 12 or 15.\n"
+ "The default value is 11.\n"
+ "Enter the value: ");
+
+ num = ask_value ("%d", 11);
+ if (num != 5 && num != 7 && num != 9 && num != 11 && num != 12 || num != 15)
+ {
+ fprintf (stderr, "*** Illegal input! ***\n");
+ num = 11;
+ }
+ fprintf (stderr, " CS4232 WSS IRQ set to %d\n", num);
+ printf ("#define CS4232_IRQ %d\n", num);
+
+ fprintf (stderr, "\nWSS DMA number for CS4232?\n"
+ "Valid values are 0, 1 and 3.\n"
+ "The default value is 0\n"
+ "(select the lowes possible one if you want to\n"
+ "use full duplex mode)\n"
+ "Enter the value: ");
+
+ num = ask_value ("%d", 0);
+ if (num != 0 && num != 1 && num != 3)
+ {
+ fprintf (stderr, "*** Illegal input! ***\n");
+ num = 0;
+ }
+ fprintf (stderr, "\nCS4232/WSS DMA set to %d\n", num);
+ printf ("#define CS4232_DMA %d\n", num);
+ dma1 = num;
+
+ fprintf (stderr, "\n Second WSS DMA number for CS4232?\n"
+ "Valid values are 0, 1 and 3.\n"
+ "The default value is 3\n"
+ "Enter the value (-1 disables duplex mode): ");
+
+ num = ask_value ("%d", 3);
+ if (num == dma1 || (num != -1 && num != 0 && num != 1 && num != 3))
+ {
+ fprintf (stderr, "*** Illegal input! ***\n");
+ num = 3;
+ }
+ fprintf (stderr, "\nCS4232/WSS DMA2 set to %d\n", num);
+ printf ("#define CS4232_DMA2 %d\n", num);
+
+ fprintf (stderr, "\nMIDI (MPU-401) I/O address for the CS4232 card?\n"
+ "The factory default is 330\n"
+ "Other possible values are 330, 370, 3B0 and 3F0\n"
+ "Enter the MPU I/O base: ");
+
+ num = ask_value ("%x", 0x330);
+ fprintf (stderr, "CS4232 MIDI I/O base set to %03x\n", num);
+ printf ("#define CS4232_MPU_BASE 0x%03x\n", num);
+
+ fprintf (stderr, "\nMIDI IRQ number for CS4232?\n"
+ "Valid numbers are: 5, 7, 9(=2), 11, 12 or 15.\n"
+ "The default value is 5.\n"
+ "Enter the value: ");
+
+ num = ask_value ("%d", 5);
+ if (num != 5 && num != 7 && num != 9 && num != 11 && num != 12 || num != 15)
+ {
+ fprintf (stderr, "*** Illegal input! ***\n");
+ num = 5;
+ }
+ fprintf (stderr, " CS4232 MIDI IRQ set to %d\n", num);
+ printf ("#define CS4232_MPU_IRQ %d\n", num);
+ }
+
if (selected_options & B (OPT_MAD16))
{
fprintf (stderr, "\n*** Options for the MAD16 and Mozart based cards ***\n\n");
@@ -1230,6 +1278,20 @@
fprintf (stderr, "MAD16 MSS I/O base set to %03x\n", num);
printf ("#define MAD16_BASE 0x%03x\n", num);
+ if ((sb_base == 0x220 && (num == 0x530 || num == 0x480)) ||
+ (sb_base == 0x240 && (num == 0xf40 || num == 0x604)))
+ {
+ fprintf (stderr, "FATAL ERROR!!!!!!!!!!!!!!\n"
+ "\tThis I/O port selection makes MAD16/Mozart\n"
+ "\tto use 0x%03x as the SB port.\n"
+ "\tThis conflicts with the true SB card.\n"
+ "\tRun the config again and select another I/O base.\n",
+ sb_base);
+ printf ("#undef CONFIGURE_SOUNDCARD\n");
+ printf ("#undef KERNEL_SOUNDCARD\n");
+ exit (-1);
+ }
+
fprintf (stderr, "\nIRQ number for the WSS mode of MAD16/Mozart ?\n"
"Valid numbers are: 7, 9(=2), 10 and 11.\n"
"The default value is 11.\n"
@@ -1244,7 +1306,7 @@
fprintf (stderr, " MAD16 WSS IRQ set to %d\n", num);
printf ("#define MAD16_IRQ %d\n", num);
- fprintf (stderr, "\nWSS DMA number for MAD16/Mozart?\n"
+ fprintf (stderr, "\nWSS DMA (playback) number for MAD16/Mozart?\n"
"Valid values are 0, 1 and 3.\n"
"The default value is 3\n"
"Enter the value: ");
@@ -1258,12 +1320,29 @@
fprintf (stderr, "\nMAD16/WSS DMA set to %d\n", num);
printf ("#define MAD16_DMA %d\n", num);
- fprintf (stderr, "\nMIDI (MPU-401) I/O address for the MAD16 card?\n"
- "(MPU401 is not supported by Mozart and 82C928)\n"
+ num = (num == 0) ? 1 : 0;
+
+ fprintf (stderr, "\nMAD16/Mozart supports full duplex mode if the\n"
+ "card has a suitable codec chip (CS423x or AD1845).\n"
+ "This mode requires another DMA channel (DMA%d)\n"
+ "Do you want to enable this mode? (n/y)", num);
+
+ if (think_positively (0))
+ {
+ fprintf (stderr, "\nMAD16/WSS capture DMA set to %d\n", num);
+ printf ("#define MAD16_DMA2 %d\n", num);
+ }
+ else
+ printf ("#define MAD16_DMA2 -1\n");
+
+
+ fprintf (stderr, "\nMIDI (MPU-401/SB) I/O address for the MAD16 card?\n"
"(This is the second MIDI port in TB Tropez)\n"
- "The factory default is 330 (use 0 to disable)\n"
"Other possible values are 330, 320, 310 and 300\n"
- "Enter the MPU I/O base: ");
+ "For 82C928 and Mozart you may use any nonzero value\n"
+ "since the driver ignores this setting.\n"
+ "The factory default is 330 (use 0 to disable)\n"
+ "Enter the MIDI I/O base: ");
num = ask_value ("%x", 0x330);
if (num == 0)
@@ -1288,7 +1367,6 @@
printf ("#define MAD16_MPU_IRQ %d\n", num);
}
}
-#endif
if (selected_options & B (OPT_AUDIO))
{
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this