Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Nov 1999 16:04:33 +0100
From:      Ollivier Robert <roberto@eurocontrol.fr>
To:        FreeBSD Current Users' list <freebsd-current@FreeBSD.ORG>
Subject:   Panic when playing sound [LONG]
Message-ID:  <19991115160433.F53356@caerdonn.eurocontrol.fr>

next in thread | raw e-mail | index | archive | help
I just got a new machine, an HP Kayak/XA with a PIII/500, 256 MB of RAM and 
2x 9 GB of disk. It has a builtin sound card on the motherboard,
apparently a soundblaster clone of some sort on the ISA bus.

FreeBSD Audio Driver (newpcm) Nov 15 1999 14:52:14
Installed devices:
pcm0: <SoundBlaster Pro 3.2> at io 0x220 irq 5 drq 0:1 (1/1 channels duplex)
                             ^^^^
(do I have to worry here ?)

I have current sources from a few days ago and configured newpcm as
follow. The card is recognised at boot time w/o problem.

Everytime I try to use mpg123 to play some music, the machine panic with
"unaligned write 1522, 4". Note that using

device pcm0     at isa0 port 0x220 irq 5 drq 1 flags 0x10

OR

device pcm0     at isa? port ? irq 5 drq 1 flags 0x10

doesn't make any difference.

Here are the registers:

cs           0x8
ds           0xc0f10010
es           0x10
fs           0xc0e80010
ss           0x10
eax          0x12
ecx          0x780
ebx          0xc022cb8f (db_lengths+0x1d7)
edx          0xc0227278 (ac97recdevs+0x654)
esp          0xcccddd8c
ebp          0xcccddd94
esi          0x100
edi          0xc0cfea00
efl          0x246

panic: unaligned write 1522, 4
panic: from debugger

dumping to dev #da/0x20001, offset 524288
dump 256 255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240 239 238
 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220 219 218
 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200 199 198
 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180 179 178
 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160 159 158
 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140 139 138
 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118
 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100 99 98 9
7 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 
70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44
 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 1
7 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 
---
#0  boot (howto=260) at ../../kern/kern_shutdown.c:273
273                     dumppcb.pcb_cr3 = rcr3();
(kgdb) 
(kgdb) where
#0  boot (howto=260) at ../../kern/kern_shutdown.c:273
#1  0xc0145605 in panic (fmt=0xc0212a54 "from debugger")
    at ../../kern/kern_shutdown.c:523
#2  0xc012dd49 in db_panic (addr=-1071747841, have_addr=0, count=-1, 
    modif=0xcccddc44 "") at ../../ddb/db_command.c:433
#3  0xc012dce9 in db_command (last_cmdp=0xc0239c5c, cmd_table=0xc0239abc, 
    aux_cmd_tablep=0xc0251e40) at ../../ddb/db_command.c:333
#4  0xc012ddae in db_command_loop () at ../../ddb/db_command.c:455
#5  0xc012fe33 in db_trap (type=3, code=0) at ../../ddb/db_trap.c:71
#6  0xc01e6abc in kdb_trap (type=3, code=0, regs=0xcccddd4c)
    at ../../i386/i386/db_interface.c:157
#7  0xc01f276c in trap (frame={tf_fs = -1058537456, tf_es = 16, 
      tf_ds = -1057947632, tf_edi = -1060115968, tf_esi = 256, 
      tf_ebp = -858923628, tf_isp = -858923656, tf_ebx = -1071484296, 
      tf_edx = -1071461489, tf_ecx = 1920, tf_eax = 18, tf_trapno = 3, 
      tf_err = 0, tf_eip = -1071747841, tf_cs = 8, tf_eflags = 582, 
      tf_esp = -1071461505, tf_ss = -1071555773}) at ../../i386/i386/trap.c:533
#8  0xc01e6cff in Debugger (msg=0xc0215b43 "panic") at machine/cpufunc.h:64
#9  0xc01455fc in panic (fmt=0xc0227278 "unaligned write %d, %d")
    at ../../kern/kern_shutdown.c:521
#10 0xc01cddba in chn_write (c=0xc0cfea00, buf=0xcccddee8)
    at ../../dev/pcm/channel.c:286
#11 0xc01cce8b in dsp_write (d=0xc0ce8600, chan=0, buf=0xcccddee8, flag=1)
    at ../../dev/pcm/dsp.c:201
#12 0xc01cc311 in sndwrite (i_dev=0xc0cff600, buf=0xcccddee8, flag=1)
    at ../../dev/pcm/sound.c:320
#13 0xc01786ad in spec_write (ap=0xcccdde98)
    at ../../miscfs/specfs/spec_vnops.c:284
#14 0xc01aefe8 in ufsspec_write (ap=0xcccdde98)
    at ../../ufs/ufs/ufs_vnops.c:1863
#15 0xc01af4dd in ufs_vnoperatespec (ap=0xcccdde98)
    at ../../ufs/ufs/ufs_vnops.c:2318
#16 0xc0174c79 in vn_write (fp=0xc0e65f00, uio=0xcccddee8, cred=0xc0f03400, 
    flags=0, p=0xcb8e0880) at vnode_if.h:359
#17 0xc0152a95 in dofilewrite (p=0xcb8e0880, fp=0xc0e65f00, fd=4, 
    buf=0x8085000, nbyte=16384, offset=-1, flags=0) at ../../sys/file.h:156
#18 0xc015299b in write (p=0xcb8e0880, uap=0xcccddf80)
    at ../../kern/sys_generic.c:297
#19 0xc01f3075 in syscall (frame={tf_fs = 47, tf_es = 47, tf_ds = 47, 
      tf_edi = 134660960, tf_esi = 134732384, tf_ebp = 13, 
      tf_isp = -858923052, tf_ebx = -1077953876, tf_edx = 134732548, 
      tf_ecx = 0, tf_eax = 4, tf_trapno = 0, tf_err = 2, tf_eip = 671916088, 
      tf_cs = 31, tf_eflags = 659, tf_esp = -1077955668, tf_ss = 47})
    at ../../i386/i386/trap.c:1057
#20 0xc01e73b6 in Xint0x80_syscall ()
Cannot access memory at address 0xd.
(kgdb) up
#10 0xc01cddba in chn_write (c=0xc0cfea00, buf=0xcccddee8)
    at ../../dev/pcm/channel.c:286
286                     if (l & a) panic("unaligned write %d, %d", l, a + 1);
(kgdb) list
281                             ret = 0;
282                             continue;
283                     }
284                     /* ensure we always have a whole number of samples */
285                     l = min(b->fl, b->bufsize - b->fp);
286                     if (l & a) panic("unaligned write %d, %d", l, a + 1);
287                     l &= ~a;
288                     w = c->feeder->feed(c->feeder, b->buf + b->fp, l, buf);
289                     if (w == 0) panic("no feed");
290                     s = spltty();
(kgdb) print l
$1 = 0
(kgdb) print a
$2 = 3
(kgdb) 

I put my kernel config file and boot messages below.

-=-=-
#
# nCAERDONN - mode modular CAERDONN
#
#       $Id: //depot/caerdonn/kernel/CAERDONN#3 $

machine         i386
cpu             I686_CPU
ident           CAERDONN
maxusers        32

options         INET                    #InterNETworking
options         FFS                     #Berkeley Fast Filesystem
options         FFS_ROOT                #Berkeley Fast Filesystem
options         COMPAT_43               #Compatible with BSD 4.3 [KEEP THIS!]
options         UCONSOLE                #Allow users to grab the console

options         IPX

options         USER_LDT                #allow user-level control of i386 ldt
options         CLK_USE_TSC_CALIBRATION

options         SYSVSHM
options         SYSVSEM
options         SYSVMSG
options         SHMMAXPGS=1024

options         SOFTUPDATES

options         P1003_1B
options         _KPOSIX_PRIORITY_SCHEDULING
options         _KPOSIX_VERSION=199309L

options         DDB

controller      isa0
controller      pci0

#device fxp0
device lnc0

controller      fdc0    at isa? port IO_FD1 irq 6 drq 2
device          fd0     at fdc0 drive 0

#controller     wdc0    at isa? port IO_WD1 irq 14
#disk           wd0     at wdc0 drive 0
#disk           wd1     at wdc0 drive 1

controller      wdc1    at isa? port IO_WD2 irq 15
#disk           wd2     at wdc1 drive 0
#disk           wd3     at wdc1 drive 1

device          wcd0            #IDE CD-ROM

# A single entry for any of these controllers (ncr, ahb, ahc) is sufficient
# for any number of installed devices.
controller      sym0

controller      scbus0 at sym0
device          da0 at scbus0 target 0
device          da1 at scbus0 target 1
device          da2 at scbus0 target 2
device          da3 at scbus0 target 3

device          sa0 at scbus0 target 5
device          cd0     

device          pass0           #CAM passthrough driver

controller      atkbdc0 at isa? port IO_KBD
device          atkbd0  at atkbdc? irq 1
device          psm0    at atkbdc? irq 12                                      
device          vga0    at isa? port ? conflicts
device          sc0     at isa?

pseudo-device   splash

device          npx0    at nexus? port IO_NPX irq 13

device          sio0    at isa? port IO_COM1 irq 4
device          sio1    at isa? port IO_COM2 irq 3

controller      ppbus0
controller      ppc0    at isa? port ? irq 7
device          lpt0    at ppbus?
device          plip0   at ppbus?
device          ppi0    at ppbus?

controller pnp0
device pcm0     at isa? port ? irq 5 drq 1 flags 0x10

pseudo-device   loop
pseudo-device   ether
pseudo-device   tun     2
pseudo-device   pty     64
pseudo-device   gzip            # Exec gzipped a.out's
pseudo-device   bpf     4
pseudo-device   snp     4

options         KTRACE          #kernel tracing

controller      uhci0
controller      ohci0
controller      usb0
device          ugen0
device          uhid0
-=-=-

-=-=-
Copyright (c) 1992-1999 The FreeBSD Project.
Copyright (c) 1982, 1986, 1989, 1991, 1993
	The Regents of the University of California. All rights reserved.
FreeBSD 4.0-CURRENT #1: Mon Nov 15 15:03:46 CET 1999
    roberto@thendara.eurocontrol.fr:/src/src/sys/compile/CAERDONN
Timecounter "i8254"  frequency 1193182 Hz
Timecounter "TSC"  frequency 498747334 Hz
CPU: Pentium III/Xeon (498.75-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x673  Stepping = 3
  Features=0x383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,XMM>
real memory  = 268435456 (262144K bytes)
avail memory = 257675264 (251636K bytes)
Preloaded elf kernel "kernel" at 0xc02b3000.
Pentium Pro MTRR support enabled
npx0: <math processor> on motherboard
npx0: INT 16 interface
pcib0: <Intel 82443BX (440 BX) host to PCI bridge> on motherboard
pci0: <PCI bus> on pcib0
pcib1: <Intel 82443BX (440 BX) PCI-PCI (AGP) bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
vga-pci0: <VGA-compatible display device> irq 9 at device 0.0 on pci1
isab0: <Intel 82371AB PCI to ISA bridge> at device 7.0 on pci0
isa0: <ISA bus> on isab0
chip1: <Intel PIIX4 IDE controller> at device 7.1 on pci0
uhci0: <Intel 82371AB/EB (PIIX4) USB controller> irq 11 at device 7.2 on pci0
usb0: <Intel 82371AB/EB (PIIX4) USB controller> on uhci0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
chip2: <Intel 82371AB Power management controller> at device 7.3 on pci0
pcib2: <PCI to PCI bridge (vendor=1011 device=0024)> at device 19.0 on pci0
pci2: <PCI bus> on pcib2
sym0: <875> irq 9 at device 4.0 on pci2
sym0: Symbios NVRAM, ID 7, Fast-20, parity checking
sym0: open drain IRQ line driver, using on-chip SRAM
lnc0: <PCNet/PCI Ethernet adapter> irq 9 at device 5.0 on pci2
lnc0: PCnet-FAST+ address 00:10:83:35:20:9d
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
wdc1 at port 0x170-0x177 irq 15 on isa0
wdc1: unit 0 (atapi): <HITACHI CDR-8435/0010>, removable, accel, dma, iordis
wcd0: drive speed 5512KB/sec, 128KB cache
wcd0: supported read types: CD-R, CD-RW, CD-DA, packet track
wcd0: Audio: play, 255 volume levels
wcd0: Mechanism: ejectable tray
wcd0: Medium: no/blank disc inside, unlocked
atkbdc0: <keyboard controller (i8042)> at port 0x60-0x6f on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model IntelliMouse, device ID 3
vga0: <Generic ISA VGA> at port 0x3b0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> on isa0
sc0: VGA <16 virtual consoles, flags=0x200>
sio0 at port 0x3f8-0x3ff irq 4 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
ppc0 at port 0x378-0x37f irq 7 on isa0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/8 bytes threshold
plip0: <PLIP network interface> on ppbus 0
lpt0: <generic printer> on ppbus 0
lpt0: Interrupt-driven port
ppi0: <generic parallel i/o> on ppbus 0
pcm0: <SoundBlaster Pro 3.2> at irq 5 drq 1 flags 0x10 on isa0
Waiting 2 seconds for SCSI devices to settle
sym0: Downloading SCSI SCRIPTS.
(noperiph:sym0:0:-1:-1): SCSI bus reset delivered.
Creating DISK da0
Creating DISK da1
Mounting root from ufs:/dev/da0s1a
da0 at sym0 bus 0 target 0 lun 0
da0: <QUANTUM ATLAS IV 9 WLS 0707> Fixed Direct Access SCSI-3 device 
da0: 40.000MB/s transfers (20.000MHz, offset 16, 16bit), Tagged Queueing Enabled
da0: 8683MB (17783240 512 byte sectors: 255H 63S/T 1106C)
da1 at sym0 bus 0 target 1 lun 0
da1: <SEAGATE ST39140W 1444> Fixed Direct Access SCSI-2 device 
da1: 40.000MB/s transfers (20.000MHz, offset 15, 16bit), Tagged Queueing Enabled
da1: 8683MB (17783240 512 byte sectors: 255H 63S/T 1106C)
WARNING: / was not properly dismounted
vinum: loaded
vinum: reading configuration from /dev/da0s1g
vinum: updating configuration from /dev/da1s1h
lnc0: Device timeout -- Resetting
-=-=-
-- 
Ollivier ROBERT -=- Eurocontrol EEC/TEC -=- Ollivier.Robert@eurocontrol.fr
The Postman hits! The Postman hits! You have new mail.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991115160433.F53356>