diff -c --recursive /tmp/sound/Readme sound/Readme *** /tmp/sound/Readme Fri Jul 15 13:05:20 1994 --- sound/Readme Tue Jul 19 00:13:21 1994 *************** *** 12,20 **** there are some new features required by a popular application. In addition there is also support for the GUS MAX and the 16 bit sampling option of GUS. - Also the Windows Sound System stuff is there but may not - work yet (may work with some WSS compatible cards). ********* IMPORTANT ***************************************** Linux 1.0 or later is required to by this driver version. --- 12,20 ---- there are some new features required by a popular application. In addition there is also support for the GUS MAX and the 16 bit sampling option of GUS. + The MSS/WSS support works now. At least with SG NX Pro 16. + ********* IMPORTANT ***************************************** Linux 1.0 or later is required to by this driver version. *************** *** 65,70 **** --- 65,71 ---- Markus Aroharju and Risto Kankkunen Major contributions to the mixer support of GUS v3.7. + Hunyue Yau Mixer support for SG NX Pro. Marc Hoffman PSS support. Regards, diff -c --recursive /tmp/sound/ad1848.c sound/ad1848.c *** /tmp/sound/ad1848.c Fri Jul 15 15:22:05 1994 --- sound/ad1848.c Mon Jul 18 20:25:35 1994 *************** *** 903,918 **** int probe_ms_sound (struct address_info *hw_config) { - int config_port = hw_config->io_base + 0, version_port = hw_config->io_base + 3; - if ((INB (hw_config->io_base + 3) & 0x04) == 0) return 0; /* WSS ID test failed */ if (hw_config->irq > 11) ! return; ! if (hw_config->dma > 3 || hw_config->dma == 2) ! return; return ad1848_detect (hw_config->io_base + 4); } --- 903,916 ---- int probe_ms_sound (struct address_info *hw_config) { if ((INB (hw_config->io_base + 3) & 0x04) == 0) return 0; /* WSS ID test failed */ if (hw_config->irq > 11) ! return 0; ! if (hw_config->dma != 0 && hw_config->dma != 1 && hw_config->dma != 3) ! return 0; return ad1848_detect (hw_config->io_base + 4); } *************** *** 920,929 **** long attach_ms_sound (long mem_start, struct address_info *hw_config) { ! static unsigned char interrupt_bits[11] = {-1, -1, -1, -1, -1, -1, -1, 0x08, -1, 0x10, 0x18, 0x20}; char bits; int config_port = hw_config->io_base + 0, version_port = hw_config->io_base + 3; if (!ad1848_detect (hw_config->io_base + 4)) --- 918,929 ---- long attach_ms_sound (long mem_start, struct address_info *hw_config) { ! static unsigned char interrupt_bits[12] = {-1, -1, -1, -1, -1, -1, -1, 0x08, -1, 0x10, 0x18, 0x20}; char bits; + static unsigned char dma_bits[4] = {1, 2, 0, 3}; + int config_port = hw_config->io_base + 0, version_port = hw_config->io_base + 3; if (!ad1848_detect (hw_config->io_base + 4)) *************** *** 941,947 **** if ((INB (version_port) & 0x40) == 0) printk ("[IRQ?]"); ! OUTB (bits | hw_config->dma, config_port); /* Write IRQ+DMA setup */ ad1848_init ("MS Sound System", hw_config->io_base + 4, hw_config->irq, --- 941,947 ---- if ((INB (version_port) & 0x40) == 0) printk ("[IRQ?]"); ! OUTB (bits | dma_bits[hw_config->dma], config_port); /* Write IRQ+DMA setup */ ad1848_init ("MS Sound System", hw_config->io_base + 4, hw_config->irq, diff -c --recursive /tmp/sound/configure.c sound/configure.c *** /tmp/sound/configure.c Fri Jul 15 15:22:05 1994 --- sound/configure.c Tue Jul 19 00:02:34 1994 *************** *** 322,327 **** --- 322,334 ---- } } + if (selected_options & B (OPT_SBPRO)) + { + fprintf(stderr, "Do you want support for the mixer of SG NX Pro ? "); + if (think_positively (0)) + printf("#define __SGNXPRO__\n"); + } + if (selected_options & B (OPT_SB16)) selected_options |= B (OPT_SBPRO); *************** *** 333,339 **** "if you wish to emulate the soundblaster and you have a DSPxxx.LD.\n" "then you must include the LD in the kernel.\n" "(do you wish to include a LD) ? "); ! if (think_positively (1)) { char path[512]; --- 340,346 ---- "if you wish to emulate the soundblaster and you have a DSPxxx.LD.\n" "then you must include the LD in the kernel.\n" "(do you wish to include a LD) ? "); ! if (think_positively (0)) { char path[512]; diff -c --recursive /tmp/sound/dev_table.h sound/dev_table.h *** /tmp/sound/dev_table.h Tue Jul 12 23:18:12 1994 --- sound/dev_table.h Mon Jul 18 20:52:22 1994 *************** *** 278,283 **** --- 278,286 ---- #endif #ifndef EXCLUDE_MSS {SNDCARD_MSS, {MSS_BASE, MSS_IRQ, MSS_DMA}, SND_DEFAULT_ENABLE}, + # ifdef MSS2_BASE + {SNDCARD_MSS, {MSS2_BASE, MSS2_IRQ, MSS2_DMA}, SND_DEFAULT_ENABLE}, + # endif #endif #if !defined(EXCLUDE_UART6850) && !defined(EXCLUDE_MIDI) diff -c --recursive /tmp/sound/makefile sound/makefile *** /tmp/sound/makefile Fri Jul 15 13:09:24 1994 --- sound/makefile Tue Jul 19 00:10:45 1994 *************** *** 5,11 **** # # ! VERSION = 2.90 TARGET_OS = linux USRINCDIR = /usr/include --- 5,11 ---- # # ! VERSION = 2.90-2 TARGET_OS = linux USRINCDIR = /usr/include diff -c --recursive /tmp/sound/makefile.freebsd sound/makefile.freebsd *** /tmp/sound/makefile.freebsd Fri Jul 15 13:09:19 1994 --- sound/makefile.freebsd Tue Jul 19 00:10:50 1994 *************** *** 9,15 **** # # ! VERSION = 2.90 TARGET_OS = freebsd HOSTCC = gcc --- 9,15 ---- # # ! VERSION = 2.90-2 TARGET_OS = freebsd HOSTCC = gcc diff -c --recursive /tmp/sound/makefile.linux sound/makefile.linux *** /tmp/sound/makefile.linux Fri Jul 15 13:09:24 1994 --- sound/makefile.linux Tue Jul 19 00:10:45 1994 *************** *** 5,11 **** # # ! VERSION = 2.90 TARGET_OS = linux USRINCDIR = /usr/include --- 5,11 ---- # # ! VERSION = 2.90-2 TARGET_OS = linux USRINCDIR = /usr/include diff -c --recursive /tmp/sound/makefile.sco sound/makefile.sco *** /tmp/sound/makefile.sco Fri Jul 15 13:09:31 1994 --- sound/makefile.sco Tue Jul 19 00:11:01 1994 *************** *** 2,8 **** # Makefile for the sound card driver, on SCO UNIX # ! VERSION = 2.90 TARGET_OS = sco HOSTCC = cc --- 2,8 ---- # Makefile for the sound card driver, on SCO UNIX # ! VERSION = 2.90-2 TARGET_OS = sco HOSTCC = cc diff -c --recursive /tmp/sound/makefile.svr4.2 sound/makefile.svr4.2 *** /tmp/sound/makefile.svr4.2 Fri Jul 15 13:09:37 1994 --- sound/makefile.svr4.2 Tue Jul 19 00:11:05 1994 *************** *** 2,8 **** # Makefile for the sound card driver, on SVR4.2 UNIX # ! VERSION = 2.90 TARGET_OS = SVR4.2 TARGET_ID = SVR4.2/SVR4.2.cf --- 2,8 ---- # Makefile for the sound card driver, on SVR4.2 UNIX # ! VERSION = 2.90-2 TARGET_OS = SVR4.2 TARGET_ID = SVR4.2/SVR4.2.cf diff -c --recursive /tmp/sound/sb_dsp.c sound/sb_dsp.c *** /tmp/sound/sb_dsp.c Fri Jul 15 15:22:12 1994 --- sound/sb_dsp.c Mon Jul 18 23:56:16 1994 *************** *** 1,9 **** /* * sound/sb_dsp.c * ! * The low level driver for the SoundBlaster DSP chip. * ! * Copyright by Hannu Savolainen 1993 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are --- 1,9 ---- /* * sound/sb_dsp.c * ! * The low level driver for the SoundBlaster DSP chip (SB1.0 to 2.1, SB Pro). * ! * Copyright by Hannu Savolainen 1994 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are *************** *** 25,30 **** --- 25,34 ---- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * Modified: + * Hunyue Yau Jan 6 1994 + * Added code to support Sound Galaxy NX Pro + * */ #include "sound_config.h" *************** *** 756,761 **** --- 760,766 ---- sb_dsp_init (long mem_start, struct address_info *hw_config) { int i; + int mixer_type = 0; sbc_major = sbc_minor = 0; sb_dsp_command (0xe1); /* *************** *** 786,792 **** #ifndef EXCLUDE_SBPRO if (sbc_major >= 3) ! sb_mixer_init (sbc_major); #endif #ifndef EXCLUDE_YM8312 --- 791,797 ---- #ifndef EXCLUDE_SBPRO if (sbc_major >= 3) ! mixer_type = sb_mixer_init (sbc_major); #endif #ifndef EXCLUDE_YM8312 *************** *** 799,805 **** if (sbc_major >= 3) { #ifndef SCO ! sprintf (sb_dsp_operations.name, "SoundBlaster Pro %d.%d", sbc_major, sbc_minor); #endif } else --- 804,819 ---- if (sbc_major >= 3) { #ifndef SCO ! # ifdef __SGNXPRO__ ! if (mixer_type == 2) ! { ! sprintf (sb_dsp_operations.name, "Sound Galaxy NX Pro %d.%d", sbc_major, sbc_minor); ! } ! else ! # endif ! { ! sprintf (sb_dsp_operations.name, "SoundBlaster Pro %d.%d", sbc_major, sbc_minor); ! } #endif } else diff -c --recursive /tmp/sound/sb_mixer.c sound/sb_mixer.c *** /tmp/sound/sb_mixer.c Fri Jul 15 15:22:12 1994 --- sound/sb_mixer.c Mon Jul 18 23:56:20 1994 *************** *** 4,10 **** * * The low level mixer driver for the SoundBlaster Pro and SB16 cards. * ! * Copyright by Hannu Savolainen 1993 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are --- 4,10 ---- * * The low level mixer driver for the SoundBlaster Pro and SB16 cards. * ! * Copyright by Hannu Savolainen 1994 * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are *************** *** 26,31 **** --- 26,35 ---- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * + * Modified: + * Hunyue Yau Jan 6 1994 + * Added code to support the Sound Galaxy NX Pro mixer. + * */ #include "sound_config.h" *************** *** 91,99 **** --- 95,115 ---- | (mode ? STEREO_DAC : MONO_DAC))); } + /* + * Returns: + * 0 No mixer detected. + * 1 Only a plain Sound Blaster Pro style mixer detected. + * 2 The Sound Galaxy NX Pro mixer detected. + */ static int detect_mixer (void) { + #ifdef __SGNXPRO__ + int oldbass, oldtreble; + + #endif + int retcode = 1; + /* * Detect the mixer by changing parameters of two volume channels. If the * values read back match with the values written, the mixer is there (is *************** *** 109,115 **** if (sb_getmixer (VOC_VOL) != 0x33) return 0; ! return 1; } static void --- 125,154 ---- if (sb_getmixer (VOC_VOL) != 0x33) return 0; ! #ifdef __SGNXPRO__ ! /* Attempt to detect the SG NX Pro by check for valid bass/treble ! * registers. ! */ ! oldbass = sb_getmixer (BASS_LVL); ! oldtreble = sb_getmixer (TREBLE_LVL); ! ! sb_setmixer (BASS_LVL, 0xaa); ! sb_setmixer (TREBLE_LVL, 0x55); ! ! if ((sb_getmixer (BASS_LVL) != 0xaa) || ! (sb_getmixer (TREBLE_LVL) != 0x55)) ! { ! retcode = 1; /* 1 == Only SB Pro detected */ ! } ! else ! retcode = 2; /* 2 == SG NX Pro detected */ ! /* Restore register in either case since SG NX Pro has EEPROM with ! * 'preferred' values stored. ! */ ! sb_setmixer (BASS_LVL, oldbass); ! sb_setmixer (TREBLE_LVL, oldtreble); ! #endif ! return retcode; } static void *************** *** 350,366 **** set_recmask (SOUND_MASK_MIC); } ! void sb_mixer_init (int major_model) { ! sb_setmixer (0x00, 0); /* ! * Reset mixer ! */ ! if (!detect_mixer ()) ! return; /* ! * No mixer. Why? ! */ mixer_initialized = 1; mixer_model = major_model; --- 389,411 ---- set_recmask (SOUND_MASK_MIC); } ! /* ! * Returns a code depending on whether a SG NX Pro was detected. ! * 1 == Plain SB Pro ! * 2 == SG NX Pro detected. ! * 3 == SB16 ! * ! * Used to update message. ! */ ! int sb_mixer_init (int major_model) { ! int mixer_type = 0; ! sb_setmixer (0x00, 0); /* Reset mixer */ ! ! if (!(mixer_type = detect_mixer ())) ! return 0; /* No mixer. Why? */ mixer_initialized = 1; mixer_model = major_model; *************** *** 369,377 **** { case 3: mixer_caps = SOUND_CAP_EXCL_INPUT; ! supported_devices = SBPRO_MIXER_DEVICES; ! supported_rec_devices = SBPRO_RECORDING_DEVICES; ! iomap = &sbpro_mix; break; case 4: --- 414,434 ---- { case 3: mixer_caps = SOUND_CAP_EXCL_INPUT; ! #ifdef __SGNXPRO__ ! if (mixer_type == 2) /* A SGNXPRO was detected */ ! { ! supported_devices = SGNXPRO_MIXER_DEVICES; ! supported_rec_devices = SGNXPRO_RECORDING_DEVICES; ! iomap = &sgnxpro_mix; ! } ! else ! #endif ! { ! supported_devices = SBPRO_MIXER_DEVICES; ! supported_rec_devices = SBPRO_RECORDING_DEVICES; ! iomap = &sbpro_mix; ! mixer_type = 1; ! } break; case 4: *************** *** 379,394 **** supported_devices = SB16_MIXER_DEVICES; supported_rec_devices = SB16_RECORDING_DEVICES; iomap = &sb16_mix; break; default: printk ("SB Warning: Unsupported mixer type\n"); ! return; } if (num_mixers < MAX_MIXER_DEV) mixer_devs[num_mixers++] = &sb_mixer_operations; sb_mixer_reset (); } #endif --- 436,453 ---- supported_devices = SB16_MIXER_DEVICES; supported_rec_devices = SB16_RECORDING_DEVICES; iomap = &sb16_mix; + mixer_type = 3; break; default: printk ("SB Warning: Unsupported mixer type\n"); ! return 0; } if (num_mixers < MAX_MIXER_DEV) mixer_devs[num_mixers++] = &sb_mixer_operations; sb_mixer_reset (); + return mixer_type; } #endif diff -c --recursive /tmp/sound/sb_mixer.h sound/sb_mixer.h *** /tmp/sound/sb_mixer.h Thu Jul 7 22:55:37 1994 --- sound/sb_mixer.h Tue Jul 19 00:19:58 1994 *************** *** 24,36 **** --- 24,52 ---- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * Modified: + * Hunyue Yau Jan 6 1994 + * Added defines for the Sound Galaxy NX Pro mixer. * */ + #define SBPRO_RECORDING_DEVICES (SOUND_MASK_LINE | SOUND_MASK_MIC | SOUND_MASK_CD) + /* Same as SB Pro, unless I find otherwise */ + #define SGNXPRO_RECORDING_DEVICES SBPRO_RECORDING_DEVICES + #define SBPRO_MIXER_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_PCM | SOUND_MASK_LINE | SOUND_MASK_MIC | \ SOUND_MASK_CD | SOUND_MASK_VOLUME) + /* SG NX Pro has treble and bass settings on the mixer. The 'speaker' + * channel is the COVOX/DisneySoundSource emulation volume control + * on the mixer. It does NOT control speaker volume. Should have own + * mask eventually? + */ + #define SGNXPRO_MIXER_DEVICES (SBPRO_MIXER_DEVICES|SOUND_MASK_BASS| \ + SOUND_MASK_TREBLE|SOUND_MASK_SPEAKER ) + #define SB16_RECORDING_DEVICES (SOUND_MASK_SYNTH | SOUND_MASK_LINE | SOUND_MASK_MIC | \ SOUND_MASK_CD) *************** *** 62,67 **** --- 78,90 ---- #define IRQ_STAT 0x82 #define OPSW 0x3c + /* + * Additional registers on the SG NX Pro + */ + #define COVOX_VOL 0x42 + #define TREBLE_LVL 0x44 + #define BASS_LVL 0x46 + #define FREQ_HI (1 << 3)/* Use High-frequency ANFI filters */ #define FREQ_LOW 0 /* Use Low-frequency ANFI filters */ #define FILT_ON 0 /* Yes, 0 to turn it on, 1 for off */ *************** *** 107,112 **** --- 130,152 ---- MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0), MIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0) }; + + #ifdef __SGNXPRO__ + mixer_tab sgnxpro_mix = { + MIX_ENT(SOUND_MIXER_VOLUME, 0x22, 7, 4, 0x22, 3, 4), + MIX_ENT(SOUND_MIXER_BASS, 0x46, 2, 3, 0x00, 0, 0), + MIX_ENT(SOUND_MIXER_TREBLE, 0x44, 2, 3, 0x00, 0, 0), + MIX_ENT(SOUND_MIXER_SYNTH, 0x26, 7, 4, 0x26, 3, 4), + MIX_ENT(SOUND_MIXER_PCM, 0x04, 7, 4, 0x04, 3, 4), + MIX_ENT(SOUND_MIXER_SPEAKER, 0x42, 2, 3, 0x00, 0, 0), + MIX_ENT(SOUND_MIXER_LINE, 0x2e, 7, 4, 0x2e, 3, 4), + MIX_ENT(SOUND_MIXER_MIC, 0x0a, 2, 3, 0x00, 0, 0), + MIX_ENT(SOUND_MIXER_CD, 0x28, 7, 4, 0x28, 3, 4), + MIX_ENT(SOUND_MIXER_IMIX, 0x00, 0, 0, 0x00, 0, 0), + MIX_ENT(SOUND_MIXER_ALTPCM, 0x00, 0, 0, 0x00, 0, 0), + MIX_ENT(SOUND_MIXER_RECLEV, 0x00, 0, 0, 0x00, 0, 0) + }; + #endif mixer_tab sb16_mix = { MIX_ENT(SOUND_MIXER_VOLUME, 0x30, 7, 5, 0x31, 7, 5), diff -c --recursive /tmp/sound/sound_calls.h sound/sound_calls.h *** /tmp/sound/sound_calls.h Fri Jul 15 12:58:36 1994 --- sound/sound_calls.h Mon Jul 18 23:53:20 1994 *************** *** 140,146 **** void sb_setmixer (unsigned int port, unsigned int value); int sb_getmixer (unsigned int port); void sb_mixer_set_stereo(int mode); ! void sb_mixer_init(int major_model); /* From opl3.c */ int opl3_detect (int ioaddr); --- 140,146 ---- void sb_setmixer (unsigned int port, unsigned int value); int sb_getmixer (unsigned int port); void sb_mixer_set_stereo(int mode); ! int sb_mixer_init(int major_model); /* From opl3.c */ int opl3_detect (int ioaddr); diff -c --recursive /tmp/sound/sound_config.h sound/sound_config.h *** /tmp/sound/sound_config.h Tue Jul 12 17:30:51 1994 --- sound/sound_config.h Mon Jul 18 21:18:15 1994 *************** *** 180,186 **** * In v3.0 it's /dev/sndproc but this could be a temporary solution. */ ! #define SND_NDEVS 64 /* Number of supported devices */ #define SND_DEV_CTL 0 /* Control port /dev/mixer */ #define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM synthesizer and MIDI output) */ --- 180,186 ---- * In v3.0 it's /dev/sndproc but this could be a temporary solution. */ ! #define SND_NDEVS 256 /* Number of supported devices */ #define SND_DEV_CTL 0 /* Control port /dev/mixer */ #define SND_DEV_SEQ 1 /* Sequencer output /dev/sequencer (FM synthesizer and MIDI output) */ *************** *** 199,205 **** #define ON 1 #define OFF 0 ! #define MAX_AUDIO_DEV 4 #define MAX_MIXER_DEV 2 #define MAX_SYNTH_DEV 3 #define MAX_MIDI_DEV 6 --- 199,205 ---- #define ON 1 #define OFF 0 ! #define MAX_AUDIO_DEV 5 #define MAX_MIXER_DEV 2 #define MAX_SYNTH_DEV 3 #define MAX_MIDI_DEV 6