From owner-freebsd-multimedia Tue Sep 2 12:29:01 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id MAA22899 for multimedia-outgoing; Tue, 2 Sep 1997 12:29:01 -0700 (PDT) Received: from ic4.ic.dk (qmailr@globip89.image.dk [194.234.57.89]) by hub.freebsd.org (8.8.7/8.8.7) with SMTP id MAA22890 for ; Tue, 2 Sep 1997 12:28:48 -0700 (PDT) Received: (qmail 1899 invoked from network); 2 Sep 1997 19:20:38 -0000 Received: from ic1.ic.dk (193.88.65.12) by ic4.ic.dk with SMTP; 2 Sep 1997 19:20:38 -0000 Received: from jblhome by ic1.ic.dk with UUCP id AA27681 (5.65c8/IDA-1.4.4j for multimedia@FreeBSD.ORG); Tue, 2 Sep 1997 21:22:20 +0200 Received: (from jacob@localhost) by pippin.jblhome.ping.dk (8.8.7/8.7.3) id VAA00508; Tue, 2 Sep 1997 21:07:45 +0200 (CEST) To: multimedia@FreeBSD.ORG Subject: Unsuccesful attempt at SB16PNP and no PNP bios; what am I doing wrong? References: <199708291556.RAA01672@labinfo.iet.unipi.it> From: Jacob Bohn Lorensen Date: 02 Sep 1997 21:07:44 +0200 In-Reply-To: Luigi Rizzo's message of Fri, 29 Aug 1997 17:56:15 +0200 (MET DST) Message-Id: <87lo1flekf.fsf@pippin.jblhome.ping.dk> Lines: 384 X-Mailer: Gnus v5.3/Emacs 19.34 X-Charset: ISO_8859-1 X-Char-Esc: 29 Sender: owner-freebsd-multimedia@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk Luigi Rizzo writes: > Another snap of the sound code at > > http://www.iet.unipi.it/~luigi/snd970829.tgz > ftp://www.iet.unipi.it/pub/snd970829.tgz I have had a go at this one, thinking that now, at last, may be the time when my sound card can be of some use to me. I am running FreeBSD src-cur-3027. As I have an old 486 motherboard, with no plug&play bios, it was the lines - the parameters for the PnP device(s) will be read from the [...] if you have a broken (or no) PnP bios your only chance is to patch the pnp attach code in the driver for your card (ad1848.c, sb_dsp.c, clones.c) and write there the parameters you want; in the README file that really got me interested. So, I went ahead with sb_dsp.c. in the function sb16pnp_attach, I inserted the following lines (marked with +) read_pnp_parms ( &d , 0 ) ; + d.irq[0] = 7; + d.drq[0] = 3; d.drq[1] = 5; + d.port[0] = 0x220; d.port[1] = 0x330; d.port[2] = 0x388; dev->id_iobase = d.port[0]; write_pnp_parms ( &d , 0 , 1); [Information from pnpinfo attached at the end of the e-mail]. I have also tried other legal combinations (irq 5). It seems that both isa_dmastatus() and isa_dmastop() have been checked into src-cur-3027, so I did not need to patch isa.c, only autoconf.c, files.i386 and of course, copying pnp.c and pnp.h. I inserted these two lines in my kernel config file: controller pnp0 device pcm0 at isa? port? tty irq 7 drq 1 vector pcmintr The kernel compiles and boots just fine, and it even looks as if some of the stuff is actually working. Here are my boot messages: ----- Boot messages ------ Copyright (c) 1992-1997 FreeBSD Inc. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. FreeBSD 3.0-CURRENT #0: Tue Sep 2 20:14:31 CEST 1997 jacob@pippin.jblhome.ping.dk:/usr/local/jblhome/src/test/sys/compile/Pippin-pnp CPU: AMD Am5x86 Write-Through (486-class CPU) Origin = "AuthenticAMD" Id = 0x4e4 Stepping=4 Features=0x1 real memory = 33554432 (32768K bytes) avail memory = 30334976 (29624K bytes) DEVFS: ready for devices ahc0: at 0x1c00-0x1cff irq 11 on eisa0 slot 1 ahc0: aic7770 <= Rev C, Single Channel, SCSI Id=7, 4 SCBs ahc0: waiting for scsi devices to settle scbus0 at ahc0 bus 0 sd0 at scbus0 target 0 lun 0 sd0: type 0 fixed SCSI 2 sd0: Direct-Access 1034MB (2118144 512 byte sectors) sd1 at scbus0 target 1 lun 0 sd1: type 0 fixed SCSI 2 sd1: Direct-Access 3067MB (6281856 512 byte sectors) st0 at scbus0 target 4 lun 0 st0: type 1 removable SCSI 2 st0: Sequential-Access density code 0x13, drive empty cd0 at scbus0 target 5 lun 0 cd0: type 5 removable SCSI 2 cd0: CD-ROM cd present [185627 x 2048 byte records] Probing for devices on PCI bus 0: chip0: rev 0x01 on pci0.16.0 vga0: rev 0x00 int a irq 10 on pci0.19.0 Probing for PnP devices: CSN 1 Vendor ID: CTL002b [0x2b008c0e] Serial 0x100a44e4 port 0x0220 0x0330 0x0388 0x0000 irq 7:0 drq 3:5 pcm1 (SB16pnp sn 0x100a44e4) at 0x220 irq 7 drq 3 flags 0x15 id 15 Probing for devices on the ISA bus: sc0 at 0x60-0x6f irq 1 on motherboard sc0: VGA color <16 virtual consoles, flags=0x0> sio0 at 0x3f8-0x3ff irq 4 on isa sio0: type 16450 sio1 at 0x2f8-0x2ff irq 3 on isa sio1: type 8250 lpt0 at 0x378-0x37f on isa pcm0 at 0xffff irq 7 drq 1 mem 0x0 flags 0x0 en 1 confl 0 mss_probe: no address supplied, try default 0x530 mss_detect error, busy still set (0xff) sb_probe: no address supplied, try defaults (0x220,0x240) device at 0x220 already attached as unit 1 pcm0 not found fdc0 at 0x3f0-0x3f7 irq 6 drq 2 on isa fdc0: NEC 72065B fd0: 1.44MB 3.5in 1 3C5x9 board(s) on ISA found at 0x300 ep0 at 0x300-0x30f irq 10 on isa ep0: aui/utp/bnc[*BNC*] address 00:20:af:c0:cb:17 npx0 on motherboard npx0: INT 16 interface DEVFS: ready to run ------------------------------------------------------ (This is from warm reboot, as the card seems to have remembered its previous configuration. Cold reboots have the line "port 0x0000 0x0000 0x0000 ...") after the "CSN 1 Vendor ID: ..." line. Now, my questions are . Why is the card attached as pcm1 ? . After ./MAKEDEV snd1, if I try to use /dev/audio1 (i.a. cat a random file to /dev/audio1) etc., I get messages like default ioctl snd1 subdev 4 fn 0x402c7413 fail default ioctl snd1 subdev 4 fn 0x402c7413 fail got sbintr for unit 1, flags 0x00000461 default ioctl snd1 subdev 4 fn 0x402c7413 fail default ioctl snd1 subdev 4 fn 0x402c7413 fail got sbintr for unit 1, flags 0x00000461 default ioctl snd1 subdev 4 fn 0x402c7413 fail default ioctl snd1 subdev 4 fn 0x402c7413 fail in the syslog. Am I doing something totally wrong, here? Shouldn't this work? Is there no way to get a PNP card working under FreeBSD when I have no PNP bios? Thanks for your time, Jacob. ---- Output from pnpinfo (taken from FreeBSD-pnp distribution) ---- Checking for Plug-n-Play devices... Trying Read_Port at 203 Trying Read_Port at 243 Card assigned CSN #1 Board Vendor ID: CTL002b Board Serial Number: 100a44e4 PnP Version: 1.0 Vendor Version: 32 Device Description: Creative SB16 PnP Logical Device ID: CTL0031 (31008c0e) Device Description: Audio Start Dependent Function Good Configuration IRQ: 5 DMA: 0 1 DMA: 8-bit only DMA: Device is not a bus master DMA: May execute in count by byte mode DMA: May not execute in count by word mode DMA: Compatibility mode DMA: 5 DMA: 16-bit only DMA: Device is not a bus master DMA: May not execute in count by byte mode DMA: May execute in count by word mode DMA: Compatibility mode Device decodes the full 16-bit ISA address I/O Range maximum address: 0x220 I/O Range maximum address: 0x220 I/O alignment for minimum: 1 I/O length: 16 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x330 I/O Range maximum address: 0x330 I/O alignment for minimum: 1 I/O length: 2 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x388 I/O Range maximum address: 0x388 I/O alignment for minimum: 1 I/O length: 4 Start Dependent Function Acceptable Configuration IRQ: 5 7 10 DMA: 0 1 3 DMA: 8-bit only DMA: Device is not a bus master DMA: May execute in count by byte mode DMA: May not execute in count by word mode DMA: Compatibility mode DMA: 5 6 7 DMA: 16-bit only DMA: Device is not a bus master DMA: May not execute in count by byte mode DMA: May execute in count by word mode DMA: Compatibility mode Device decodes the full 16-bit ISA address I/O Range maximum address: 0x220 I/O Range maximum address: 0x280 I/O alignment for minimum: 32 I/O length: 16 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x300 I/O Range maximum address: 0x330 I/O alignment for minimum: 48 I/O length: 2 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x388 I/O Range maximum address: 0x388 I/O alignment for minimum: 1 I/O length: 4 Start Dependent Function Acceptable Configuration IRQ: 5 7 10 DMA: 0 1 3 DMA: 8-bit only DMA: Device is not a bus master DMA: May execute in count by byte mode DMA: May not execute in count by word mode DMA: Compatibility mode DMA: 5 6 7 DMA: 16-bit only DMA: Device is not a bus master DMA: May not execute in count by byte mode DMA: May execute in count by word mode DMA: Compatibility mode Device decodes the full 16-bit ISA address I/O Range maximum address: 0x220 I/O Range maximum address: 0x280 I/O alignment for minimum: 32 I/O length: 16 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x300 I/O Range maximum address: 0x330 I/O alignment for minimum: 48 I/O length: 2 Start Dependent Function Sub-optimal Configuration IRQ: 5 7 10 DMA: 0 1 3 DMA: 8-bit only DMA: Device is not a bus master DMA: May execute in count by byte mode DMA: May not execute in count by word mode DMA: Compatibility mode DMA: 5 6 7 DMA: 16-bit only DMA: Device is not a bus master DMA: May not execute in count by byte mode DMA: May execute in count by word mode DMA: Compatibility mode Device decodes the full 16-bit ISA address I/O Range maximum address: 0x220 I/O Range maximum address: 0x280 I/O alignment for minimum: 32 I/O length: 16 Start Dependent Function Sub-optimal Configuration IRQ: 5 7 10 DMA: 0 1 3 DMA: 8-bit only DMA: Device is not a bus master DMA: May execute in count by byte mode DMA: May not execute in count by word mode DMA: Compatibility mode Device decodes the full 16-bit ISA address I/O Range maximum address: 0x220 I/O Range maximum address: 0x280 I/O alignment for minimum: 32 I/O length: 16 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x300 I/O Range maximum address: 0x330 I/O alignment for minimum: 48 I/O length: 2 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x388 I/O Range maximum address: 0x388 I/O alignment for minimum: 1 I/O length: 4 Start Dependent Function Sub-optimal Configuration IRQ: 5 7 10 DMA: 0 1 3 DMA: 8-bit only DMA: Device is not a bus master DMA: May execute in count by byte mode DMA: May not execute in count by word mode DMA: Compatibility mode Device decodes the full 16-bit ISA address I/O Range maximum address: 0x220 I/O Range maximum address: 0x280 I/O alignment for minimum: 32 I/O length: 16 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x300 I/O Range maximum address: 0x330 I/O alignment for minimum: 48 I/O length: 2 Start Dependent Function Sub-optimal Configuration IRQ: 5 7 10 11 DMA: 0 1 3 DMA: 8-bit only DMA: Device is not a bus master DMA: May execute in count by byte mode DMA: May not execute in count by word mode DMA: Compatibility mode Device decodes the full 16-bit ISA address I/O Range maximum address: 0x220 I/O Range maximum address: 0x280 I/O alignment for minimum: 32 I/O length: 16 End Dependent Function Logical Device ID: CTL2011 (11208c0e) Compatible Device ID: PNP0600 (0006d041) Device Description: IDE Start Dependent Function Good Configuration IRQ: 10 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x168 I/O Range maximum address: 0x168 I/O alignment for minimum: 1 I/O length: 8 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x36e I/O Range maximum address: 0x36e I/O alignment for minimum: 1 I/O length: 2 Start Dependent Function Acceptable Configuration IRQ: 11 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x1e8 I/O Range maximum address: 0x1e8 I/O alignment for minimum: 1 I/O length: 8 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x3ee I/O Range maximum address: 0x3ee I/O alignment for minimum: 1 I/O length: 2 Start Dependent Function Acceptable Configuration IRQ: 10 11 15 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x180 I/O Range maximum address: 0x1b8 I/O alignment for minimum: 8 I/O length: 8 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x306 I/O Range maximum address: 0x33e I/O alignment for minimum: 8 I/O length: 2 Start Dependent Function Sub-optimal Configuration IRQ: 15 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x170 I/O Range maximum address: 0x170 I/O alignment for minimum: 1 I/O length: 8 Device decodes the full 16-bit ISA address I/O Range maximum address: 0x376 I/O Range maximum address: 0x376 I/O alignment for minimum: 1 I/O length: 1 End Dependent Function Logical Device ID: CTL0051 (51008c0e) Device Description: StereoEnhance Device decodes the full 16-bit ISA address I/O Range maximum address: 0x100 I/O Range maximum address: 0x138 I/O alignment for minimum: 8 I/O length: 1 Logical Device ID: CTL7001 (01708c0e) Device Description: Game Device decodes the full 16-bit ISA address I/O Range maximum address: 0x200 I/O Range maximum address: 0x200 I/O alignment for minimum: 1 I/O length: 8 End Tag ---------------------------------------------------------------------