⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 opti

📁 linux-2.6.15.6
💻
字号:
Support for the OPTi 82C931 chip--------------------------------Note: parts of this README file apply also to othercards that use the mad16 driver.Some items in this README file are based on featuresadded to the sound driver after Linux-2.1.91 was out.By the time of writing this I do not know which officialkernel release will include these features.Please do not report inconsistencies on older Linuxkernels.The OPTi 82C931 is supported in its non-PnP mode.Usually you do not need to set jumpers, etc. The sound driverwill check the card status and if it is required it willforce the card into a mode in which it can be programmed.If you have another OS installed on your computer it is recommendedthat Linux and the other OS use the same resources.Also, it is recommended that resources specified in /etc/modprobe.confand resources specified in /etc/isapnp.conf agree.Compiling the sound driver--------------------------I highly recommend that you build a modularized sound driver.This document does not cover a sound-driver which is built inthe kernel.Sound card support should be enabled as a module (chose m).Answer 'm' for  these items:  Generic OPL2/OPL3 FM synthesizer support		(CONFIG_SOUND_ADLIB)  Microsoft Sound System support			(CONFIG_SOUND_MSS)  Support for OPTi MAD16 and/or Mozart based cards	(CONFIG_SOUND_MAD16)  FM synthesizer (YM3812/OPL-3) support			(CONFIG_SOUND_YM3812)The configuration menu may ask for addresses, IRQ lines or DMAchannels. If the card is used as a module the module loadingoptions will override these values.For the OPTi 931 you can answer 'n' to:  Support MIDI in older MAD16 based cards (requires SB)	(CONFIG_SOUND_MAD16_OLDCARD)If you do need MIDI support in a Mozart or C928 based card youneed to answer 'm' to the above question. In that case you willalso need to answer 'm' to:  '100% Sound Blaster compatibles (SB16/32/64, ESS, Jazz16) support' (CONFIG_SOUND_SB)Go on and compile your kernel and modules. Install the modules. Run depmod -a.Using isapnptools-----------------In most systems with a PnP BIOS you do not need to use isapnp. Theinitialization provided by the BIOS is sufficient for the driverto pick up the card and continue initialization.If that fails, or if you have other PnP cards, you need to use isapnpto initialize the card.This was tested with isapnptools-1.11 but I recommend that you useisapnptools-1.13 (or newer). Run pnpdump to dump the informationabout your PnP cards. Then edit the resulting file and selectthe options of your choice. This file is normally installed as/etc/isapnp.conf.The driver has one limitation with respect to I/O port resources:IO3 base must be 0x0E0C.  Although isapnp allows other ports, thisaddress is hard-coded into the driver.Using kmod and autoloading the sound driver-------------------------------------------Comment: as of linux-2.1.90 kmod is replacing kerneld.The config file '/etc/modprobe.conf' is used as before.This is the sound part of my /etc/modprobe.conf file.Following that I will explain each line.alias mixer0 mad16alias audio0 mad16alias midi0  mad16alias synth0 opl3options sb mad16=1options mad16 irq=10 dma=0 dma16=1 io=0x530 joystick=1 cdtype=0options opl3 io=0x388install mad16 /sbin/modprobe -i mad16 && /sbin/ad1848_mixer_reroute 14 8 15 3 16 6If you have an MPU daughtercard or onboard MPU you will want to add to the"options mad16" line - eg options mad16 irq=5 dma=0 dma16=3 io=0x530 mpu_io=0x330 mpu_irq=9To set the I/O and IRQ of the MPU.Explain:alias mixer0 mad16alias audio0 mad16alias midi0  mad16alias synth0 opl3When any sound device is opened the kernel requests auto-loadingof char-major-14. There is a built-in alias that translates thisrequest to loading the main sound module.The sound module in its turn will request loading of a sub-driverfor mixer, audio, midi or synthesizer device. The first 3 aresupported by the mad16 driver. The synth device is supportedby the opl3 driver.There is currently no way to autoload the sound device driverif more than one card is installed.options sb mad16=1This is left for historical reasons. If you enable theconfig option 'Support MIDI in older MAD16 based cards (requires SB)'or if you use an older mad16 driver it will force loading of theSoundBlaster driver. This option tells the SB driver not to lookfor a SB card but to wait for the mad16 driver.options mad16 irq=10 dma=0 dma16=1 io=0x530 joystick=1 cdtype=0options opl3 io=0x388post-install mad16 /sbin/ad1848_mixer_reroute 14 8 15 3 16 6This sets resources and options for the mad16 and opl3 drivers.I use two DMA channels (only one is required) to enable full duplex.joystick=1 enables the joystick port. cdtype=0 disables the cd port.You can also set mpu_io and mpu_irq in the mad16 options for theuart401 driver.This tells modprobe to run /sbin/ad1848_mixer_reroute aftermad16 is successfully loaded and initialized. The sourcefor ad1848_mixer_reroute is appended to the end of this readmefile. It is impossible for the sound driver to know the actualconnections to the mixer. The 3 inputs intended for cd, synthand line-in are mapped to the generic inputs line1, line2 andline3. This program reroutes these mixer channels to theirright names (note the right mapping depends on the actual soundcard that you use).The numeric parameters mean: 14=line1 8=cd    - reroute line1 to the CD input. 15=line2 3=synth - reroute line2 to the synthesizer input. 16=line3 6=line  - reroute line3 to the line input.For reference on other input names look at the file/usr/include/linux/soundcard.h.Using a joystick-----------------You must enable a joystick in the mad16 options. (alsoin /etc/isapnp.conf if you use it).Tested with regular analog joysticks.A CDROM drive connected to the sound card-----------------------------------------The 82C931 chip has support only for secondary ATAPI cdrom.(cdtype=8). Loading the mad16 driver resets the C931 chipand if a cdrom was already mounted it may cause a completesystem hang. Do not use the sound card if you have an alternative.If you do use the sound card it is important that you loadthe mad16 driver (use "modprobe mad16" to prevent auto-unloading)before the cdrom is accessed the first time.Using the sound driver built-in to the kernel may help here, but...Most new systems have a PnP BIOS and also two IDE controllers.The IDE controller on the sound card may be needed only on oldersystems (which have only one IDE controller) but these systemsalso do not have a PnP BIOS - requiring isapnptools and a modularizeddriver.Known problems--------------1. See the section on "A CDROM drive connected to the sound card".2. On my system the codec cannot capture companded sound samples.   (eg., recording from /dev/audio). When any companded capture is   requested I get stereo-16 bit samples instead. Playback of   companded samples works well. Apparently this problem is not common   to all C931 based cards. I do not know how to identify cards that   have this problem.Source for ad1848_mixer_reroute.c---------------------------------#include <stdio.h>#include <fcntl.h>#include <linux/soundcard.h>static char *mixer_names[SOUND_MIXER_NRDEVICES] =	SOUND_DEVICE_LABELS;intmain(int argc, char **argv) {	int val, from, to;	int i, fd;	fd = open("/dev/mixer", O_RDWR);	if(fd < 0) {		perror("/dev/mixer");		return 1;	}	for(i = 2; i < argc; i += 2) {		from = atoi(argv[i-1]);		to = atoi(argv[i]);		if(to == SOUND_MIXER_NONE)			fprintf(stderr, "%s: turning off mixer %s\n",				argv[0], mixer_names[to]);		else			fprintf(stderr, "%s: rerouting mixer %s to %s\n",				argv[0], mixer_names[from], mixer_names[to]);		val = from << 8 | to;		if(ioctl(fd, SOUND_MIXER_PRIVATE2, &val)) {			perror("AD1848 mixer reroute");			return 1;		}	}	return 0;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -