Date: Mon, 15 Dec 2003 17:18:06 -0600 (CST) From: pseniura@techie.com To: freebsd-questions@freebsd.org, freebsd-hardware@freebsd.org Cc: pseniura@techie.com Subject: Having problems with 'pcm' and on-board Crystal Sound Message-ID: <20031215231806.EEE945C0E@techpc04.okladot.state.ok.us>
next in thread | raw e-mail | index | archive | help
Hi everyone, I'm having some difficulties with on-board Crystal Audio in IBM's PC model 300PL (I know it's old, but that's what they gave me). I've been fighting this for many weeks. I've got three scenarios: (1) In order to have the 'snd_pcm' be able to see the chips at all, I must include it with the kernel via 'device pcm'. Then we get the following msg on the console every time an app wants to play some sound. Yes every time: >>>> pcm0:virtual:0: play interrupt timeout, channel dead <<<< (2) If I let the boot loader.conf bring in 'snd_pcm' before the kernel starts, it won't see the sound chips at all. (3) The OSS driver does see the chips and it does work. But then I must not do #1 above (when snd_pcm is compiled into the kernel, you cannot kldunload it to use OSS instead). I am tracking 5-Current via CTM, and src & ports are current as of this morning's bucket at the CTM FTP site. I have a bit of logging to show for each scenario: ------- (1) Compiling 'device pcm' into the kernel, we can see the chips get detected, as the dmesg shows: [...] Preloaded elf kernel "/boot/kernel/kernel" at 0xc0b66000. Preloaded elf module "/boot/modules/apm.ko" at 0xc0b66244. Preloaded elf module "/boot/nvidia/nvidia.ko" at 0xc0b662f0. Calibrating clock(s) ... i8254 clock: 1193181 Hz Timecounter "i8254" frequency 1193181 Hz quality 0 Calibrating TSC clock ... TSC clock: 448054427 Hz CPU: Pentium II/Pentium II Xeon/Celeron (448.05-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x652 Stepping = 2 Features=0x183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR> real memory = 402640896 (383 MB) Physical memory chunk(s): [...] mss_probe: no address given, try 0x530 mss_detect, busy still set (0xff) mss_probe: no address given, try 0x530 mss_detect, busy still set (0xff) mss_probe: no address given, try 0x530 mss_detect, busy still set (0xff) [...] Trying Read_Port at 203 CSC0100: start dependent (0) CSC0100: adding dma mask 0x2 CSC0100: adding dma mask 0x9 CSC0100: adding irq mask 0x20 CSC0100: adding io range 0x534-0x537, size=0x4, align=0x4 CSC0100: adding io range 0x388-0x38b, size=0x4, align=0x8 CSC0100: adding io range 0x220-0x22f, size=0x10, align=0x20 CSC0100: start dependent (1) CSC0100: adding dma mask 0xa CSC0100: adding dma mask 0xb CSC0100: adding irq mask 0x9aa0 CSC0100: adding io range 0x534-0xfff, size=0x4, align=0x4 CSC0100: adding io range 0x388-0x38b, size=0x4, align=0x8 CSC0100: adding io range 0x220-0x26f, size=0x10, align=0x20 CSC0100: start dependent (2) CSC0100: adding dma mask 0xb CSC0100: adding irq mask 0x9aa0 CSC0100: adding io range 0x534-0xfff, size=0x4, align=0x4 CSC0100: adding io range 0x388-0x3fb, size=0x4, align=0x8 CSC0100: adding io range 0x220-0x30f, size=0x10, align=0x20 CSC0100: end dependent CSC0110: adding io range 0x120-0xfe7, size=0x8, align=0x8 sc: sc0 already exists; skipping it isa_probe_children: disabling PnP devices isa_probe_children: probing non-PnP devices pmtimer0 on isa0 [...] isa_probe_children: probing PnP devices pcm0: <CS423x-PCI> at port 0x220-0x22f,0x388-0x38b,0x534-0x53b irq 5 drq 0,1 on isa0 pcm0: sndbuf_setmap 1fb000, 1000; 0xd7907000 -> 1fb000 pcm0: sndbuf_setmap 1fc000, 1000; 0xd7908000 -> 1fc000 unknown: <Disabled> failed to probe on isa0 unknown: <CTRL> failed to probe at port 0x120-0x127 on isa0 Device configuration finished. [...] and a 'cat /dev/sndstat' shows: >>>> FreeBSD Audio Driver (newpcm) Installed devices: pcm0: <CS423x-PCI> at io 0x534 irq 5 drq 1:0 bufsz 4096 (1p/1r/4v channels duplex default) [pcm0:record:0]: spd 0, fmt 0x00000000/0x00000008, flags 0x00000000, 0x00000000 interrupts 0, overruns 0, hfree 4096, sfree 0 {hardware} -> feeder_root(0x00000000) -> {userland} [pcm0:play:0]: spd 44100, fmt 0x10000010, flags 0x00001000, 0x00000000 interrupts 0, underruns 0, ready 0 {userland} -> feeder_vchan_s16(0x10000010) -> {hardware} pcm0:play:0[pcm0:virtual:0]: spd 22050/44100, fmt 0x00000010/0x10000010, flags 0x10000000, 0x00000010 interrupts 0, underruns 0, ready 0 {userland} -> feeder_root(0x00000010) -> feeder_monotostereo16(0x00000010 -> 0x10000010) -> feeder_rate(22050 -> 44100) -> {hardware} pcm0:play:0[pcm0:virtual:1]: spd 0, fmt 0x00000000/0x00000008, flags 0x10000000, 0x00000000 interrupts 0, underruns 0, ready 0 {userland} -> feeder_root(0x00000000) -> {hardware} pcm0:play:0[pcm0:virtual:2]: spd 0, fmt 0x00000000/0x00000008, flags 0x10000000, 0x00000000 interrupts 0, underruns 0, ready 0 {userland} -> feeder_root(0x00000000) -> {hardware} pcm0:play:0[pcm0:virtual:3]: spd 0, fmt 0x00000000/0x00000008, flags 0x10000000, 0x00000000 interrupts 0, underruns 0, ready 0 {userland} -> feeder_root(0x00000000) -> {hardware} File Versions: $FreeBSD: src/sys/dev/sound/isa/sbc.c,v 1.38 2003/02/07 14:05:33 nyan Exp $ $FreeBSD: src/sys/dev/sound/isa/sb8.c,v 1.73 2003/09/07 16:28:02 cg Exp $ $FreeBSD: src/sys/dev/sound/isa/sb16.c,v 1.80 2003/09/07 16:28:02 cg Exp $ $FreeBSD: src/sys/dev/sound/isa/mss.c,v 1.86 2003/09/07 16:28:02 cg Exp $ $FreeBSD: src/sys/dev/sound/isa/gusc.c,v 1.12 2001/08/23 11:30:50 cg Exp $ $FreeBSD: src/sys/dev/sound/isa/ess.c,v 1.27 2003/09/07 16:28:02 cg Exp $ $FreeBSD: src/sys/dev/sound/isa/es1888.c,v 1.10 2003/02/08 07:05:07 nyan Exp $ $FreeBSD: src/sys/dev/sound/isa/ad1816.c,v 1.29 2003/09/07 16:28:02 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/vchan.c,v 1.13 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/sound.c,v 1.85 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/sndstat.c,v 1.14 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/mixer.c,v 1.33 2003/11/11 05:38:28 scottl Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder_rate.c,v 1.10 2003/04/20 17:08:56 orion Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder_fmt.c,v 1.13 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder.c,v 1.32 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/fake.c,v 1.13 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/dsp.c,v 1.67 2003/11/11 05:38:28 scottl Exp $ $FreeBSD: src/sys/dev/sound/pcm/channel.c,v 1.92 2003/11/27 19:51:44 matk Exp $ $FreeBSD: src/sys/dev/sound/pcm/buffer.c,v 1.21 2003/11/27 19:51:44 matk Exp $ $FreeBSD: src/sys/dev/sound/pcm/ac97_patch.c,v 1.2 2003/08/21 15:44:55 orion Exp $ $FreeBSD: src/sys/dev/sound/pcm/ac97.c,v 1.49 2003/11/11 22:15:17 kuriyama Exp $ $FreeBSD: src/sys/dev/sound/pci/vibes.c,v 1.14 2003/08/22 07:04:11 imp Exp $ $FreeBSD: src/sys/dev/sound/pci/via82c686.c,v 1.27 2003/09/02 17:30:37 jhb Exp $ $FreeBSD: src/sys/dev/sound/pci/via8233.c,v 1.13 2003/09/02 17:30:37 jhb Exp $ $FreeBSD: src/sys/dev/sound/pci/t4dwave.c,v 1.40 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pci/solo.c,v 1.29 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pci/neomagic.c,v 1.30 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pci/maestro.c,v 1.21 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pci/ich.c,v 1.37 2003/09/15 21:16:47 njl Exp $ $FreeBSD: src/sys/dev/sound/pci/fm801.c,v 1.20 2003/09/02 17:30:37 jhb Exp $ $FreeBSD: src/sys/dev/sound/pci/es137x.c,v 1.48 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pci/emu10k1.c,v 1.41 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pci/ds1.c,v 1.36 2003/09/02 17:30:37 jhb Exp $ $FreeBSD: src/sys/dev/sound/pci/csapcm.c,v 1.27 2003/09/02 17:30:37 jhb Exp $ $FreeBSD: src/sys/dev/sound/pci/csa.c,v 1.27 2003/09/02 17:30:37 jhb Exp $ $FreeBSD: src/sys/dev/sound/pci/cs4281.c,v 1.17 2003/09/0 <<<< It is cut off here, exactly 4095 bytes (one less than bufsz above). But when an app wants to play some sound, the console shows: >>>> pcm0:virtual:0: play interrupt timeout, channel dead <<<< ------- (2) When the snd_pcm is kldload'd via loader.conf, the sound chips are missed. Here the dmesg shows: [...] Preloaded elf kernel "/boot/kernel/kernel" at 0xc0b08000. Preloaded elf module "/boot/modules/snd_pcm.ko" at 0xc0b08244. Preloaded elf module "/boot/nvidia/nvidia.ko" at 0xc0b082f4. Preloaded elf module "/boot/modules/acpi.ko" at 0xc0b083a0. Calibrating clock(s) ... i8254 clock: 1193184 Hz Timecounter "i8254" frequency 1193184 Hz quality 0 Calibrating TSC clock ... TSC clock: 448055025 Hz CPU: Pentium II/Pentium II Xeon/Celeron (448.06-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x652 Stepping = 2 Features=0x183f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR> real memory = 402640896 (383 MB) Physical memory chunk(s): 0x0000000000001000 - 0x000000000009efff, 647168 bytes (158 pages) 0x0000000000100000 - 0x00000000003fffff, 3145728 bytes (768 pages) 0x0000000000c26000 - 0x000000001790afff, 382619648 bytes (93413 pages) avail memory = 381300736 (363 MB) bios32: Found BIOS32 Service Directory header at 0xc00fd7f0 [...] Trying Read_Port at 203 CSC0100: start dependent (0) CSC0100: adding dma mask 0x2 CSC0100: adding dma mask 0x9 CSC0100: adding irq mask 0x20 CSC0100: adding io range 0x534-0x537, size=0x4, align=0x4 CSC0100: adding io range 0x388-0x38b, size=0x4, align=0x8 CSC0100: adding io range 0x220-0x22f, size=0x10, align=0x20 CSC0100: start dependent (1) CSC0100: adding dma mask 0xa CSC0100: adding dma mask 0xb CSC0100: adding irq mask 0x9aa0 CSC0100: adding io range 0x534-0xfff, size=0x4, align=0x4 CSC0100: adding io range 0x388-0x38b, size=0x4, align=0x8 CSC0100: adding io range 0x220-0x26f, size=0x10, align=0x20 CSC0100: start dependent (2) CSC0100: adding dma mask 0xb CSC0100: adding irq mask 0x9aa0 CSC0100: adding io range 0x534-0xfff, size=0x4, align=0x4 CSC0100: adding io range 0x388-0x3fb, size=0x4, align=0x8 CSC0100: adding io range 0x220-0x30f, size=0x10, align=0x20 CSC0100: end dependent CSC0110: adding io range 0x120-0xfe7, size=0x8, align=0x8 isa_probe_children: disabling PnP devices isa_probe_children: probing non-PnP devices pmtimer0 on isa0 sc0: <System console> on isa0 [...] isa_probe_children: probing PnP devices unknown: <WSS/SB> failed to probe at port 0x220-0x22f,0x388-0x38b,0x534-0x537 irq 11 drq 0,1 on isa0 unknown: <Disabled> failed to probe on isa0 unknown: <CTRL> failed to probe at port 0x120-0x127 on isa0 Device configuration finished. [...] Even tho the Crystal Audio is plug-&-play as can be seen above, the pcm driver missed its chance to detect the WSS/SB ports. Having the device.hints set for pcm0 does not help. Doing a kldload later does not help. There is a /dev/sndstat even tho 'pcm' didn't get registered. A 'cat /dev/sndstat' shows: >>>> FreeBSD Audio Driver (newpcm) Installed devices: File Versions: $FreeBSD: src/sys/dev/sound/isa/sndbuf_dma.c,v 1.2 2003/09/07 16:28:02 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/vchan.c,v 1.13 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/sound.c,v 1.85 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/sndstat.c,v 1.14 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/mixer.c,v 1.33 2003/11/11 05:38:28 scottl Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder_rate.c,v 1.10 2003/04/20 17:08:56 orion Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder_fmt.c,v 1.13 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder.c,v 1.32 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/fake.c,v 1.13 2003/09/07 16:28:03 cg Exp $ $FreeBSD: src/sys/dev/sound/pcm/dsp.c,v 1.67 2003/11/11 05:38:28 scottl Exp $ $FreeBSD: src/sys/dev/sound/pcm/channel.c,v 1.92 2003/11/27 19:51:44 matk Exp $ $FreeBSD: src/sys/dev/sound/pcm/buffer.c,v 1.21 2003/11/27 19:51:44 matk Exp $ $FreeBSD: src/sys/dev/sound/pcm/ac97_patch.c,v 1.2 2003/08/21 15:44:55 orion Exp $ $FreeBSD: src/sys/dev/sound/pcm/ac97.c,v 1.49 2003/11/11 22:15:17 kuriyama Exp $ <<<< and that's all. ------- (3) With OSS loaded, a 'cat /dev/sndstat' shows: >>>> OSS/FreeBSD 3.9.8b (C) 4Front Technologies 1996-2003 License serial number: E00000008 This Open Sound System copy is licensed for limited evaluation use only. You can order the permanent OSS license using the 'Order permanent OSS license' function of soundconf command. Alternatively use our ordering page at http://www.opensound.com/order.html. License will expire after: 12/2003 Drivers: ALL *** Activity time of this evaluation version is limited *** Kernel: FreeBSD 5.2-CURRENT #0: Tue Dec 9 13:28:57 CST 2003 root@techpc04.okladot.state.ok.us:/usr/obj/src/sys/IBM300NY Card config: Generic PnP support OPL-2/OPL-3 FM at 0x388 SoundPort at 0x534 irq 5 drq 1,0 Audio devices: 0: Crystal Audio (CS4236) (DUPLEX) 1: Shadow of audio device #0 (DUPLEX) 2: OSS Virtual Mixer v2.5 Playback CH #0 (GRC2) 3: OSS Virtual Mixer v2.5 Playback CH #1 (GRC2) 4: OSS Virtual Mixer v2.5 Playback CH #2 (GRC2) 5: OSS Virtual Mixer v2.5 Playback CH #3 (GRC2) Synth devices: 0: Yamaha OPL-3 1: OSS Virtual Synth v2.5 Midi devices: Timers: 0: System clock 1: SoftOSS Mixers: 0: Crystal Audio (CS4236) 1: Virtual Mixer <<<< The apps do work only for a while, of course, and a bit shaky at times. IBM's BIOS is the latest for this model 300PL. It does not let us set IRQs & ports for most things, only to 'disable' them for 'legacy' ISA cards. There are two PCI cards: nVidia/Vanta and Adaptec 2940UW (not U2W). Playing with the PnP settings does not help (10-vs-16 bit addrs, setting device node, etc.). Could someone direct me with what/how to debug this problem, please? I'm trying to show TPTB how we can use free software, but this sound problem is driving me crazy. (At home I'm a MacOSX user ;) .) And I won't be able to get a license for OSS. Thank you very much for any help whatsoever. -- Paul Seniura System Specialist State of Okla. D.O.T.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031215231806.EEE945C0E>