From owner-freebsd-multimedia@FreeBSD.ORG Tue Apr 19 17:35:10 2005 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5013A16A4CE for ; Tue, 19 Apr 2005 17:35:10 +0000 (GMT) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23A8843D46 for ; Tue, 19 Apr 2005 17:35:09 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== Received: from mp-217-209-89.daxnet.no ([193.217.209.89] verified) by mailfe08.swip.net (CommuniGate Pro SMTP 4.2.9) with ESMTP id 148618655 for freebsd-multimedia@freebsd.org; Tue, 19 Apr 2005 19:35:06 +0200 From: Hans Petter Selasky To: FreeBSD Multimedia Date: Tue, 19 Apr 2005 20:36:11 +0200 User-Agent: KMail/1.7 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200504192036.12201.hselasky@c2i.net> Subject: Some bugs and patches X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: hselasky@c2i.net List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Apr 2005 17:35:10 -0000 Hi, Do I have to post a PR or can I just post patches like this to get it committed? 1) I have some problems with an old soundblaster-8 (original) *** sys/dev/sound/isa/sb8.c.ref Wed Oct 20 22:10:18 2004 --- sys/dev/sound/isa/sb8.c Wed Oct 20 22:20:09 2004 *************** *** 565,571 **** if (sb->bd_flags & BD_F_HISPEED) sb_reset_dsp(sb); else ! sb_cmd(sb, DSP_CMD_DMAEXIT_8); if (play) sb_cmd(sb, DSP_CMD_SPKOFF); /* speaker off */ --- 565,578 ---- if (sb->bd_flags & BD_F_HISPEED) sb_reset_dsp(sb); else ! { ! /* sb_cmd(sb, DSP_CMD_DMAEXIT_8); ! * NOTE: DSP_CMD_DMAEXIT_8 ! * does not work with old ! * soundblaster ! */ ! sb_reset_dsp(sb); ! } if (play) sb_cmd(sb, DSP_CMD_SPKOFF); /* speaker off */ 2) there is panic with the vibra16x when trying to record: *** sys/dev/sound/isa/sb16.c.ref Wed Oct 20 22:10:18 2004 --- sys/dev/sound/isa/sb16.c Mon Nov 22 17:56:05 2004 *************** *** 478,484 **** sb_intr(void *arg) { struct sb_info *sb = (struct sb_info *)arg; ! int reason = 3, c; /* * The Vibra16X has separate flags for 8 and 16 bit transfers, but --- 478,484 ---- sb_intr(void *arg) { struct sb_info *sb = (struct sb_info *)arg; ! int reason, c; /* * The Vibra16X has separate flags for 8 and 16 bit transfers, but *************** *** 554,561 **** sb_reset_dsp(sb); if (sb->bd_flags & BD_F_SB16X) { pprio = sb->pch.run? 1 : 0; ! sndbuf_dmasetup(sb->pch.buffer, pprio? sb->drq1 : NULL); sb->pch.dch = pprio? 1 : 0; sndbuf_dmasetup(sb->rch.buffer, pprio? sb->drq2 : sb->drq1); sb->rch.dch = pprio? 2 : 1; --- 554,562 ---- sb_reset_dsp(sb); if (sb->bd_flags & BD_F_SB16X) { + /* full-duplex doesn't work! */ pprio = sb->pch.run? 1 : 0; ! sndbuf_dmasetup(sb->pch.buffer, pprio? sb->drq1 : sb->drq2); sb->pch.dch = pprio? 1 : 0; sndbuf_dmasetup(sb->rch.buffer, pprio? sb->drq2 : sb->drq1); sb->rch.dch = pprio? 2 : 1; The vibra16X supports full duplex. I traced the Windows driver, and what is does is that it programs one DMA channel 8-bit, and the other 16-bit. There might be some kind of auto detection logic here, because it always uses 8-bit for playback, even if I play 16-bit sound ... 3) Missing PCI-ID: *** sbc.orig Wed Dec 25 21:34:52 2002 --- sbc.c Wed Dec 25 18:53:21 2002 *************** *** 251,256 **** --- 251,257 ---- {0x81167316, "ESS ES1681"}, /* ESS1681 */ {0x02017316, "ESS ES1688"}, /* ESS1688 */ + {0x68097316, "ESS ES1688"}, /* ESS1688 */ {0x68187316, "ESS ES1868"}, /* ESS1868 */ {0x03007316, "ESS ES1869"}, /* ESS1869 */ {0x69187316, "ESS ES1869"}, /* ESS1869 */ 4) There is a bug regarding the setting of the SIMPLEX flag (which is currently not working!) Several device drivers call "pcm_setflags" before "pcm_register". The problem is that "pcm_register" clears these flags. Maybe the device drivers should be changed, or maybe "pcm_register" should be changed. Here is my solution: In the file "pcm/sound.c" in the function "pcm_register()" "d->flags = 0;" should be changed into: /* d->flags = 0; should be cleared by allocator of softc; * cannot clear this field here, because several devices set * this flag before calling pcm_register() */ For example see sb8.c: pcm_setflags(dev, pcm_getflags(dev) | SD_F_SIMPLEX); 5) I have a problem with one of my soundcards. When I try to "cat /dev/dsp0.0", the samplerate is always 48000Hz instead of 8000Hz. Is this a bug in the driver? How can I fix it? pcm0: port 0x1c00-0x1cff,0x18c0-0x18ff mem 0xe0100c00-0xe0100dff,0xe0100800-0xe01008ff irq 10 at device 31.5 on pci0 pcm0: [GIANT-LOCKED] pcm0: 6) I have modified the sound driver so that it can be opened from within the kernel. This enables me to make a sound-bridge that moves data from an ISDN/telephony device to a sound device (full duplex). This works very well and the delay is very little. Are there any plans to make such support generic or what do you think? Yours HPS