vig sega az predi imah takava karta OPT16 mad nali :))) dr
pata kat pitash napishi za kakvo pitash :))
i s tozi help shte ti tragne 100% procheti vnimatelno i
napravi kakto pishe tam i shte stane
uspeh s chakalaka
Configuring a Plug-and-Play (PnP) OPTi931-based card for
Linux
This is how I configured my PnP OPTi931-based sound card in
Linux 2.1.9x. These instructions should work for all newer
releases of Linux too.
[Note: You may also like to consult David Rees' OPTi931
Mini-HOWTO. Apparently my non-inclusion of Mr Donald M
Burns' name as the author of the ad1848_mixer_reroute.c
program also raised some hackles (sorry, folks!), so please
be aware that he is the original author of the program.]
To continue, the information here includes:
* Output from /proc/sndstat after the card is configured
and running properly (you should see something like this
eventually!)
* Excerpt from /usr/src/linux/.config (for configuring
your kernel)
* Contents of /etc/isapnp.conf (for setting up the PnP
card)
* Extract from /etc/conf.modules for auto-setup of
sound
* Source code for /sbin/ad1848_mixer_reroute, to be
compiled and installed:
o Copy it to a file (say,
/tmp/ad1848_mixer_reroute.c)
o cd /tmp
o gcc -o ad1848_mixer_reroute
ad1848_mixer_reroute.c
o mv ad1848_mixer_reroute /sbin
The sequence of steps you have to follow is:
* Reconfigure your kernel using my supplied
/usr/src/linux/.config excerpt as an example.
* Reboot with the new kernel
* Install the given isapnp.conf in /etc (assuming you're
not already using isapnp. If you are, you'll have to include
parts of my isapnp.conf in yours)
* Run isapnp and make sure that your sound card is
getting recognised and initialised (isapnp has a verbose
option)
* Install /sbin/ad1848_mixer_reroute following the
directions given above
* Add my conf.modules excerpt to your /etc/conf.modules
* Run depmod -a
* Run modprobe sound
* Check with /proc/sndstat that your sound has been
initialised properly
* Play some music :-)
/proc/sndstat
OSS/Free:3.8s2++-971130
Load type: Driver loaded as a module
Kernel: Linux dontpanic 2.1.129 #8 SMP Wed Nov 25 11:34:59
IST 1998 i486
Config options: 0
Installed drivers:
Card config:
Audio devices:
0: MAD16 WSS (82C930) (DUPLEX)
Synth devices:
Midi devices:
0: Mad16/Mozart
Timers:
0: System clock
Mixers:
0: MAD16 WSS (82C930)
Excerpt from /usr/src/linux/.config
CONFIG_SOUND=m
# CONFIG_SOUND_ES1370 is not set
# CONFIG_SOUND_ES1371 is not set
# CONFIG_SOUND_SONICVIBES is not set
# CONFIG_SOUND_MSNDCLAS is not set
# CONFIG_SOUND_MSNDPIN is not set
CONFIG_SOUND_OSS=m
# CONFIG_SOUND_PAS is not set
CONFIG_SOUND_SB=m
CONFIG_SOUND_ADLIB=m
# CONFIG_SOUND_GUS is not set
# CONFIG_SOUND_MPU401 is not set
# CONFIG_SOUND_PSS is not set
CONFIG_SOUND_MSS=m
# CONFIG_SOUND_SSCAPE is not set
# CONFIG_SOUND_TRIX is not set
CONFIG_SOUND_MAD16=m
# CONFIG_MAD16_OLDCARD is not set
# CONFIG_SOUND_WAVEFRONT is not set
# CONFIG_SOUND_CS4232 is not set
CONFIG_SOUND_OPL3SA2=m
# CONFIG_SOUND_MAUI is not set
# CONFIG_SOUND_SGALAXY is not set
# CONFIG_SOUND_OPL3SA1 is not set
# CONFIG_SOUND_SOFTOSS is not set
CONFIG_SOUND_YM3812=m
# CONFIG_SOUND_VMIDI is not set
# CONFIG_SOUND_UART6850 is not set
/etc/isapnp.conf
# $Id: pnpdump.c,v 1.10 1997/07/14 22:30:47 fox Exp $
# This is free software, see the sources for details.
# This software has NO WARRANTY, use at your OWN RISK
#
# For details of this file format, see isapnp.conf(5)
#
# For latest information on isapnp and pnpdump see:
# http://www.roestock.demon.co.uk/isapnptools/
#
# Compiler flags: -DREALTIME
#
# Trying port address 0203
# Board 1 has serial identifier 74 ff ff ff ff 31 09 14 3e
# (DEBUG)
(READPORT 0x0203)
(ISOLATE)
(IDENTIFY *)
# Card 1: (serial identifier 74 ff ff ff ff 31 09 14 3e)
# OPT0931 Serial No -1 [checksum 74]
# Version 1.0, Vendor version 0.0
# ANSI string -->TeleVideo Audio<--
#
# Logical device id PNP0600
#
# Edit the entries below to uncomment out the configuration
required.
# Note that only the first value of any range is given, this
may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy
(CONFIGURE OPT0931/-1 (LD 0
# ANSI string -->IDE CD<--
# Multiple choice time, choose one only !
# Start dependent functions: priority acceptable
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x036e
# Maximum IO base address 0x0376
# IO base alignment 8 bytes
# Number of IO addresses required: 2
# (IO 0 (BASE 0x036e))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0168
# Maximum IO base address 0x0170
# IO base alignment 8 bytes
# Number of IO addresses required: 8
# (IO 1 (BASE 0x0168))
# IRQ 10 or 15.
# High true, edge sensitive interrupt (by
default)
# (INT 0 (IRQ 10 (MODE +E)))
# Start dependent functions: priority acceptable
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x03ee
# Maximum IO base address 0x03f6
# IO base alignment 8 bytes
# Number of IO addresses required: 2
# (IO 0 (BASE 0x03ee))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x01e8
# Maximum IO base address 0x01f0
# IO base alignment 8 bytes
# Number of IO addresses required: 8
# (IO 1 (BASE 0x01e8))
# IRQ 11.
# High true, edge sensitive interrupt (by
default)
# (INT 0 (IRQ 11 (MODE +E)))
# Start dependent functions: priority acceptable
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x036e
# Maximum IO base address 0x03fe
# IO base alignment 8 bytes
# Number of IO addresses required: 2
# (IO 0 (BASE 0x036e))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0168
# Maximum IO base address 0x01f8
# IO base alignment 8 bytes
# Number of IO addresses required: 8
# (IO 1 (BASE 0x0168))
# IRQ 5, 7, 9, 10, 11 or 15.
# High true, edge sensitive interrupt (by
default)
# (INT 0 (IRQ 5 (MODE +E)))
# End dependent functions
# (ACT Y)
))
#
# Logical device id OPT9310
#
# Edit the entries below to uncomment out the configuration
required.
# Note that only the first value of any range is given, this
may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy
(CONFIGURE OPT0931/-1 (LD 1
# ANSI string -->Audio System<--
# Multiple choice time, choose one only !
# Start dependent functions: priority acceptable
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0534
# Maximum IO base address 0x0608
# IO base alignment 212 bytes
# Number of IO addresses required: 4
# (IO 0 (BASE 0x0534))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0380
# Maximum IO base address 0x03f0
# IO base alignment 16 bytes
# Number of IO addresses required: 12
# (IO 1 (BASE 0x0380))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0220
# Maximum IO base address 0x0240
# IO base alignment 32 bytes
# Number of IO addresses required: 16
# (IO 2 (BASE 0x0220))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0e0d
# Maximum IO base address 0x0e0d
# IO base alignment 1 bytes
# Number of IO addresses required: 3
# (IO 3 (BASE 0x0e0d))
# IRQ 5, 7 or 10.
# High true, edge sensitive interrupt (by
default)
# (INT 0 (IRQ 5 (MODE +E)))
# First DMA channel 1 or 3.
# 8 bit DMA only
# Logical device is not a bus master
# DMA may execute in count by byte mode
# DMA may not execute in count by word mode
# DMA channel speed type F
# (DMA 0 (CHANNEL 1))
# Next DMA channel 0, 1 or 3.
# 8 bit DMA only
# Logical device is not a bus master
# DMA may execute in count by byte mode
# DMA may not execute in count by word mode
# DMA channel speed type F
# (DMA 1 (CHANNEL 0))
# Start dependent functions: priority acceptable
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0534
# Maximum IO base address 0x0608
# IO base alignment 212 bytes
# Number of IO addresses required: 4
# (IO 0 (BASE 0x0534))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0380
# Maximum IO base address 0x03f0
# IO base alignment 16 bytes
# Number of IO addresses required: 12
# (IO 1 (BASE 0x0380))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0220
# Maximum IO base address 0x0240
# IO base alignment 32 bytes
# Number of IO addresses required: 16
# (IO 2 (BASE 0x0220))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0e8d
# Maximum IO base address 0x0e8d
# IO base alignment 1 bytes
# Number of IO addresses required: 3
# (IO 3 (BASE 0x0e8d))
# IRQ 5, 7 or 10.
# High true, edge sensitive interrupt (by
default)
# (INT 0 (IRQ 5 (MODE +E)))
# First DMA channel 1 or 3.
# 8 bit DMA only
# Logical device is not a bus master
# DMA may execute in count by byte mode
# DMA may not execute in count by word mode
# DMA channel speed type F
# (DMA 0 (CHANNEL 1))
# Next DMA channel 0, 1 or 3.
# 8 bit DMA only
# Logical device is not a bus master
# DMA may execute in count by byte mode
# DMA may not execute in count by word mode
# DMA channel speed type F
# (DMA 1 (CHANNEL 0))
# Start dependent functions: priority acceptable
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0534
# Maximum IO base address 0x0ff0
# IO base alignment 4 bytes
# Number of IO addresses required: 4
# (IO 0 (BASE 0x0534))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0380
# Maximum IO base address 0x03f0
# IO base alignment 16 bytes
# Number of IO addresses required: 12
# (IO 1 (BASE 0x0380))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0220
# Maximum IO base address 0x0240
# IO base alignment 32 bytes
# Number of IO addresses required: 16
# (IO 2 (BASE 0x0220))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0f8d
# Maximum IO base address 0x0f8d
# IO base alignment 1 bytes
# Number of IO addresses required: 16
# (IO 3 (BASE 0x0f8d))
# IRQ 5, 7 or 10.
# High true, edge sensitive interrupt (by
default)
# (INT 0 (IRQ 5 (MODE +E)))
# First DMA channel 0, 1 or 3.
# 8 bit DMA only
# Logical device is not a bus master
# DMA may execute in count by byte mode
# DMA may not execute in count by word mode
# DMA channel speed type F
# (DMA 0 (CHANNEL 0))
# Start dependent functions: priority acceptable
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0534
# Maximum IO base address 0x0ff0
# IO base alignment 4 bytes
# Number of IO addresses required: 4
# (IO 0 (BASE 0x0534))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0380
# Maximum IO base address 0x03f0
# IO base alignment 16 bytes
# Number of IO addresses required: 12
# (IO 1 (BASE 0x0380))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0220
# Maximum IO base address 0x0240
# IO base alignment 32 bytes
# Number of IO addresses required: 16
# (IO 2 (BASE 0x0220))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0f0d
# Maximum IO base address 0x0f0d
# IO base alignment 1 bytes
# Number of IO addresses required: 16
# (IO 3 (BASE 0x0f0d))
# IRQ 5, 7 or 10.
# High true, edge sensitive interrupt (by
default)
# (INT 0 (IRQ 5 (MODE +E)))
# First DMA channel 0, 1 or 3.
# 8 bit DMA only
# Logical device is not a bus master
# DMA may execute in count by byte mode
# DMA may not execute in count by word mode
# DMA channel speed type F
# (DMA 0 (CHANNEL 0))
# Start dependent functions: priority acceptable
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0534
# Maximum IO base address 0x0ff0
# IO base alignment 4 bytes
# Number of IO addresses required: 4
(IO 0 (BASE 0x0534))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0380
# Maximum IO base address 0x03f0
# IO base alignment 16 bytes
# Number of IO addresses required: 12
(IO 1 (BASE 0x0380))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0220
# Maximum IO base address 0x0240
# IO base alignment 32 bytes
# Number of IO addresses required: 16
(IO 2 (BASE 0x0220))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0e0d
# Maximum IO base address 0x0fed
# IO base alignment 32 bytes
# Number of IO addresses required: 3
(IO 3 (BASE 0x0e0d))
# IRQ 5, 7, 9, 10 or 11.
# High true, edge sensitive interrupt (by
default)
(INT 0 (IRQ 5 (MODE +E)))
# First DMA channel 1 or 3.
# 8 bit DMA only
# Logical device is not a bus master
# DMA may execute in count by byte mode
# DMA may not execute in count by word mode
# DMA channel speed type F
(DMA 0 (CHANNEL 1))
# Next DMA channel 0, 1 or 3.
# 8 bit DMA only
# Logical device is not a bus master
# DMA may execute in count by byte mode
# DMA may not execute in count by word mode
# DMA channel speed type F
(DMA 1 (CHANNEL 0))
# End dependent functions
(ACT Y)
))
#
# Logical device id PNPb02f
#
# Edit the entries below to uncomment out the configuration
required.
# Note that only the first value of any range is given, this
may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy
(CONFIGURE OPT0931/-1 (LD 2
# ANSI string -->Game Port<--
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0200
# Maximum IO base address 0x0207
# IO base alignment 1 bytes
# Number of IO addresses required: 1
(IO 0 (BASE 0x0200))
(ACT Y)
))
#
# Logical device id OPT0002
#
# Edit the entries below to uncomment out the configuration
required.
# Note that only the first value of any range is given, this
may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy
(CONFIGURE OPT0931/-1 (LD 3
# ANSI string -->MPU401<--
# Multiple choice time, choose one only !
# Start dependent functions: priority acceptable
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0330
# Maximum IO base address 0x0330
# IO base alignment 1 bytes
# Number of IO addresses required: 2
# (IO 0 (BASE 0x0330))
# Start dependent functions: priority acceptable
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0300
# Maximum IO base address 0x0330
# IO base alignment 16 bytes
# Number of IO addresses required: 2
(IO 0 (BASE 0x0300))
# Start dependent functions: priority acceptable
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0300
# Maximum IO base address 0x0330
# IO base alignment 16 bytes
# Number of IO addresses required: 2
# (IO 0 (BASE 0x0300))
# IRQ 5, 7, 9 or 10.
# High true, edge sensitive interrupt (by
default)
(INT 0 (IRQ 5 (MODE +E)))
# End dependent functions
(ACT Y)
))
# End tag... Checksum 0x00 (OK)
# Returns all cards to the "Wait for Key" state
(WAITFORKEY)
Excerpt from /etc/conf.modules
alias char-major-14 mad16
alias audio mad16
alias sound mad16
alias mixer0 mad16
alias audio0 mad16
alias midi0 mad16
alias synth0 opl3
options sb mad16=1
options mad16 irq=9 dma=0 dma16=1 io=0x530 joystick=0
cdtype=0 mpu_io=0x300 mpu_irq=5
post-install mad16 /sbin/ad1848_mixer_reroute 14 8 15 3 16
6
options opl3 io=0x388
ad1848_mixer_reroute.c
#include <stdio.h>
#include <fcntl.h>
#include <linux/soundcard.h>
static char *mixer_names[SOUND_MIXER_NRDEVICES] =
SOUND_DEVICE_LABELS;
int
main(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;
}
|