From owner-freebsd-ports Mon Dec 18 10:50:17 2000 From owner-freebsd-ports@FreeBSD.ORG Mon Dec 18 10:50:12 2000 Return-Path: Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 7700A37B69C for ; Mon, 18 Dec 2000 10:50:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id eBIIo1E15705; Mon, 18 Dec 2000 10:50:01 -0800 (PST) (envelope-from gnats) Resent-Date: Mon, 18 Dec 2000 10:50:01 -0800 (PST) Resent-Message-Id: <200012181850.eBIIo1E15705@freefall.freebsd.org> Resent-From: gnats-admin@FreeBSD.org (GNATS Management) Resent-To: freebsd-ports@FreeBSD.org Resent-Reply-To: gnats-admin@FreeBSD.org, O.Hodson@cs.ucl.ac.uk Received: from adelie.btinteractive.net (host212-140-200-211.btinteractive.net [212.140.200.211]) by hub.freebsd.org (Postfix) with ESMTP id 31D9537B402 for ; Mon, 18 Dec 2000 10:47:11 -0800 (PST) Received: (from oh@localhost) by adelie.btinteractive.net (8.11.1/8.11.1) id eBIIkw218048; Mon, 18 Dec 2000 18:46:58 GMT (envelope-from oh) Message-Id: <200012181846.eBIIkw218048@adelie.btinteractive.net> Date: Mon, 18 Dec 2000 18:46:58 GMT From: oh@btinternet.com Sender: oh@adelie.btinteractive.net Reply-To: O.Hodson@cs.ucl.ac.uk To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: ports/23618: update port: mbone/vat to (better) support newpcm Resent-Sender: gnats@FreeBSD.org Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 23618 >Category: ports >Synopsis: Updates for newpcm duplex probing and AC97-like mixers. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon Dec 18 10:50:01 PST 2000 >Closed-Date: >Last-Modified: >Originator: Orion Hodson >Release: FreeBSD 4.2-RELEASE i386 >Organization: >Environment: Machine running newpcm. >Description: The existing code detects full-duplex cards as half-duplex under newpcm. It also assumes SB-style mixer input, most new cards are AC97 style. >How-To-Repeat: >Fix: Patch enclosed that updates full duplex probing to work properly with newpcm and adds RECLEV to input gain fn for AC97 style mixers. Thanks - Orion. diff -urN vat-orig/files/patch-ak vat/files/patch-ak --- vat-orig/files/patch-ak Thu Jan 1 01:00:00 1970 +++ vat/files/patch-ak Mon Dec 18 18:23:23 2000 @@ -0,0 +1,44 @@ +--- audio-voxware-pre-oh-patch.cc Mon Dec 18 17:24:46 2000 ++++ audio-voxware.cc Mon Dec 18 18:18:31 2000 +@@ -251,13 +251,26 @@ + int + VoxWare::HalfDuplex() const + { +- int i; +- if (is_half_duplex) { ++ int i, probed_duplex = 0; ++ ++ /* newpcm style */ ++#ifdef SNDCTL_DSP_GETCAPS ++ ioctl(fd, SNDCTL_DSP_GETCAPS, &i); ++ probed_duplex |= (i & DSP_CAP_DUPLEX); ++#endif /* SNDCTL_DSP_GETCAPS */ ++ ++ /* pcm style */ ++#ifdef SNDCTL_DSP_GETFMTS ++ ioctl(fd, SNDCTL_DSP_GETFMTS, &i); ++ probed_duplex |= (i & AFMT_FULLDUPLEX); ++#endif /* SNDCTL_DSP_GETFMTS */ ++ ++ if (is_half_duplex || (probed_duplex == 0)) { + fprintf(stderr, "HalfDuplex returns 1\n"); + return 1 ; + } +- ioctl(fd, SNDCTL_DSP_GETFMTS, &i); +- return (i & AFMT_FULLDUPLEX) ? 0 : 1 ; ++ ++ return 0; + } + + void VoxWare::Release() +@@ -399,7 +412,9 @@ + printf("failed to set mic volume \n"); + break; + } +- if (ioctl(fd, MIXER_WRITE(SOUND_MIXER_IGAIN), &foo) == -1) ++ /* IGAIN tends to be found on SB-like mixers, RECLEV on AC97 */ ++ if ((ioctl(fd, MIXER_WRITE(SOUND_MIXER_IGAIN), &foo) == -1) && ++ (ioctl(fd, MIXER_WRITE(SOUND_MIXER_RECLEV), &foo) == -1)) + printf("failed set input line volume \n"); + rgain = level; + } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message