Bugs with azalia

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bugs with azalia

Aurélien-6
Hi,

I've got a C-media 9880 audio control, compatible with the High Audio
Definition.

The azalia driver doesn't recognize the sound card probably. This small
patch corrects the problem (with another bug):

--- azalia.c Fri Jul 21 22:41:51 2006
+++ new_azalia.c Fri Sep  1 21:46:34 2006
@@ -1485,7 +1485,6 @@
  return err;
  this->d.audio.bits_rates = result;
  }
- this->d.audio.bits_rates = result;
  } else {
  this->d.audio.encodings =
     codec->w[codec->audiofunc].d.audio.encodings;
@@ -1900,7 +1899,7 @@
  break;
  }
  if (j == codec->formats[i].frequency_type) {
- printf("didn't find Record rate\n",
+ printf("didn't find Record rate %u\n",
     r->sample_rate);
  return (EINVAL);
  }

However, after a card initialization, the audioctl command crashes the
kernel:

kernel: integer divide fault trap, code=0
Stopped at      audiogetinfo+0x202:     idivl   0xa8(%edi),%eax
ddb> trace
audiogetinfo(d2b37000,d2d01b00,0,0,0) at audiogetinfo+0x202
audio_ioctl(2ac0,40884115,d2d01b00,3,da48a880) at audio_ioctl+0x265
audioioctl(2ac0,40884115,d2d01b00,3,da48a880) at audioioctl+0xb3
spec_ioctl(ec7b6d58,0,d6aff000,1,d2aeef04) at spec_ioctl+0x3f
spec_vnoperate(ec7b6d58,1000,ec7b6d80,d0427b76,d0710500) at
spec_vnoperate+0x16
VOP_IOCTL(da5ac618,40884115,d2d01b00,3,da65d280,da48a880,ec7b6e20,d2d01600)
at VOP_IOCTL+0x40
vn_ioctl(da503740,40884115,d2d01b00,da48a880,da4451a0) at vn_ioctl+0xd0
sys_ioctl(da48a880,ec7b6f68,ec7b6f58,ffffffff,92) at sys_ioctl+0x125
syscall() at syscall+0x2ea
--- syscall (number 54) ---
0x2b703b1:

In the audiogetinfo function, sc->sc_pr.blksize is null and generate a
divide per zero:
   ai->blocksize = sc->sc_pr.blksize;
   ai->hiwat = sc->sc_pr.usedhigh / sc->sc_pr.blksize;
   ai->lowat = sc->sc_pr.usedlow / sc->sc_pr.blksize;

Full dmesg:

OpenBSD 4.0-beta (GENERIC) #1: Sun Aug 31 19:26:08 CEST 2006
    [hidden email]:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Pentium(R) 4 CPU 3.00GHz ("GenuineIntel" 686-class) 3.04 GHz
cpu0:
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLU
SH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,SBF,SSE3,MWAIT,DS-CPL,EST,CNXT-ID,CX1
6
cpu0: EST: strange msr value 0x00000f2d00000f2d
real mem  = 2146725888 (2096412K)
avail mem = 1950142464 (1904436K)
using 4256 buffers containing 107438080 bytes (104920K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(00) BIOS, date 10/12/05, BIOS32 rev. 0 @ 0xf0010,
SMBIOS rev. 2.3 @ 0xf04d0 (77 entries)
bios0: ASUSTeK Computer INC. P5AD2-Deluxe
apm0 at bios0: Power Management spec V1.2
apm0: AC on, battery charge unknown
apm0: flags 30102 dobusy 0 doidle 1
pcibios0 at bios0: rev 2.1 @ 0xf0000/0x10000
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xf8220/336 (19 entries)
pcibios0: PCI Interrupt Router at 000:31:0 ("Intel 82801FB LPC" rev 0x00)
pcibios0: PCI bus #4 is the last bus
bios0: ROM list: 0xc0000/0xba00
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "Intel 82925X MCH Host" rev 0x04
ppb0 at pci0 dev 1 function 0 "Intel 82925X PCIE" rev 0x04
pci1 at ppb0 bus 4
vga1 at pci1 dev 0 function 0 "NVIDIA Quadro FX 330" rev 0xa2
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
azalia0 at pci0 dev 27 function 0 "Intel 82801FB HD Audio" rev 0x03: irq 11
azalia0: host: High Definition Audio rev. 1.0
azalia0: codec: CMedia CMI9880 (rev. 0.2), HDA version 0.9
audio0 at azalia0
ppb1 at pci0 dev 28 function 0 "Intel 82801FB PCIE" rev 0x03
pci2 at ppb1 bus 3
ppb2 at pci0 dev 28 function 1 "Intel 82801FB PCIE" rev 0x03
pci3 at ppb2 bus 2
mskc0 at pci3 dev 0 function 0 "Marvell Yukon 88E8053" rev 0x15, Marvell
Yukon-2 EC rev. A2 (0x1): irq 10
msk0 at mskc0 port A, address 00:11:2f:d9:12:34
eephy0 at msk0 phy 0: Marvell 88E1111 Gigabit PHY, rev. 2
uhci0 at pci0 dev 29 function 0 "Intel 82801FB USB" rev 0x03: irq 5
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 29 function 1 "Intel 82801FB USB" rev 0x03: irq 7
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 29 function 2 "Intel 82801FB USB" rev 0x03: irq 3
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
uhci3 at pci0 dev 29 function 3 "Intel 82801FB USB" rev 0x03: irq 11
usb3 at uhci3: USB revision 1.0
uhub3 at usb3
uhub3: Intel UHCI root hub, rev 1.00/1.00, addr 1
uhub3: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 29 function 7 "Intel 82801FB USB" rev 0x03: irq 5
usb4 at ehci0: USB revision 2.0
uhub4 at usb4
uhub4: Intel EHCI root hub, rev 2.00/1.00, addr 1
uhub4: 8 ports with 8 removable, self powered
ppb3 at pci0 dev 30 function 0 "Intel 82801BA AGP" rev 0xd3
pci4 at ppb3 bus 1
"TI TSB43AB22 FireWire" rev 0x00 at pci4 dev 3 function 0 not configured
bktr0 at pci4 dev 9 function 0 "Brooktree BT848" rev 0x12: irq 10
bktr0: Pinnacle/Miro TV, Temic PAL tuner.
rl0 at pci4 dev 10 function 0 "Realtek 8139" rev 0x10: irq 11, address
00:30:84:3c:74:9f
rlphy0 at rl0 phy 0: RTL internal PHY
ichpcib0 at pci0 dev 31 function 0 "Intel 82801FB LPC" rev 0x03: PM disabled
pciide0 at pci0 dev 31 function 1 "Intel 82801FB IDE" rev 0x03: DMA, channel
0 configured to compatibility, channel 1 configured to compatibility
pciide0: channel 0 disabled (no drives)
pciide0: channel 1 disabled (no drives)
pciide1 at pci0 dev 31 function 2 "Intel 82801FR SATA" rev 0x03: DMA,
channel 0 wired to native-PCI, channel 1 wired to native-PCI
pciide1: using irq 7 for native-PCI interrupt
wd0 at pciide1 channel 0 drive 0: <HDS722525VLSA80>
wd0: 16-sector PIO, LBA48, 238475MB, 488397168 sectors
wd0(pciide1:0:0): using PIO mode 4, Ultra-DMA mode 5
atapiscsi0 at pciide1 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <PLEXTOR, DVDR PX-755A, 1.05> SCSI0 5/cdrom
removable
cd0(pciide1:1:0): using PIO mode 4
ichiic0 at pci0 dev 31 function 3 "Intel 82801FB SMBus" rev 0x03: irq 7
iic0 at ichiic0
lm1 at iic0 addr 0x2f: W83791SD
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
spkr0 at pcppi0
lm0 at isa0 port 0x290/8: unknown Winbond chip (ID 0x88)
npx0 at isa0 port 0xf0/16: using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
biomask ffed netmask ffed ttymask ffef
pctr: user-level cycle counter enabled
umass0 at uhub4 port 6 configuration 1 interface 0
umass0: MITSUMI ---, rev 2.00/2.49, addr 2
umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2 targets
uhidev0 at uhub1 port 1 configuration 1 interface 0
uhidev0: CHICONY Compaq USB Keyboard, rev 1.10/1.05, addr 2, iclass 3/1
ukbd0 at uhidev0: 8 modifier keys, 6 key codes
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
uhidev1 at uhub1 port 1 configuration 1 interface 1
uhidev1: CHICONY Compaq USB Keyboard, rev 1.10/1.05, addr 2, iclass 3/0
uhidev1: 2 report ids
uhid0 at uhidev1 reportid 1: input=5, output=0, feature=0
uhid1 at uhidev1 reportid 2: input=5, output=0, feature=4
uhidev2 at uhub1 port 2 configuration 1 interface 0
uhidev2: Logitech USB-PS/2 Optical Mouse, rev 2.00/11.10, addr 3, iclass 3/1
ums0 at uhidev2: 3 buttons and Z dir.
wsmouse0 at ums0 mux 0
dkcsum: wd0 matches BIOS drive 0x80
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302