From owner-freebsd-multimedia@FreeBSD.ORG Thu Dec 15 07:00:45 2005 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org 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 38B2316A41F for ; Thu, 15 Dec 2005 07:00:45 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id C6FCE43D76 for ; Thu, 15 Dec 2005 07:00:14 +0000 (GMT) (envelope-from pyunyh@gmail.com) Received: by zproxy.gmail.com with SMTP id 8so297716nzo for ; Wed, 14 Dec 2005 23:00:13 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:from:to:cc:subject:message-id:reply-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent; b=a8eBJ9cEqE9aoWohVI5kNHen9Fgkk4P5etiS8weHVpbdkFx7eSCr2eHT6qCZUMnDvtAaISAubBipTM88BL5XkJ/U6L1m3LUHkCq9yMPxbTWBtDoonotMzEIgFMbkaf1xZHJxmym0RP46tr6S2Qtjzj4Wa9qDzeZhBQSZRHwF1Jw= Received: by 10.37.2.15 with SMTP id e15mr1574384nzi; Wed, 14 Dec 2005 23:00:13 -0800 (PST) Received: from michelle.rndsoft.co.kr ( [211.32.202.217]) by mx.gmail.com with ESMTP id c12sm2202530nzc.2005.12.14.23.00.12; Wed, 14 Dec 2005 23:00:13 -0800 (PST) Received: from michelle.rndsoft.co.kr (localhost.rndsoft.co.kr [127.0.0.1]) by michelle.rndsoft.co.kr (8.13.5/8.13.5) with ESMTP id jBF70R12015437 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 15 Dec 2005 16:00:27 +0900 (KST) (envelope-from pyunyh@gmail.com) Received: (from yongari@localhost) by michelle.rndsoft.co.kr (8.13.5/8.13.5/Submit) id jBF70RIP015436; Thu, 15 Dec 2005 16:00:27 +0900 (KST) (envelope-from pyunyh@gmail.com) Date: Thu, 15 Dec 2005 16:00:27 +0900 From: Pyun YongHyeon To: Timothy Smith Message-ID: <20051215070026.GE14073@rndsoft.co.kr> References: <43A01AAE.1050603@open-networks.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="OXfL5xGRrasGEqWY" Content-Disposition: inline In-Reply-To: <43A01AAE.1050603@open-networks.net> User-Agent: Mutt/1.4.2.1i Cc: freebsd-multimedia@freebsd.org Subject: Re: asus mobo, poor sound quality X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Dec 2005 07:00:45 -0000 --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Dec 14, 2005 at 11:14:22PM +1000, Timothy Smith wrote: > hi i have an asus p4s800-mx with an onboard adi 1888 audio, i load it > with kldload snd_driver, loads fine, here is the output of the sound device > > %cat /dev/sndstat > FreeBSD Audio Driver (newpcm) > Installed devices: > pcm0: at io 0x9400, 0x9000 irq 18 bufsz 16384 kld snd_ich > (1p/1r/0v channels duplex default) > > it works alright, but the sound quality is really bad, crackly and > muffled bass. i know it's not my speakers or my setup because it works > perfectly on my windows system which sits right beside the bsd system. > it is definately the freebsd driver. > > so, is there some way i can fix this or is freebsd totally gimped with > this chip? it's supposed to be ac97 compatable. > It seems that Linux has a workaround for SiS 7012. How about this patch(generated against HEAD)? -- Regards, Pyun YongHyeon --OXfL5xGRrasGEqWY Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="ich.sis.patch" --- sys/dev/sound/pci/ich.c.orig Mon Nov 21 12:37:43 2005 +++ sys/dev/sound/pci/ich.c Thu Dec 15 15:57:01 2005 @@ -146,7 +146,7 @@ device_t dev; int hasvra, hasvrm, hasmic; unsigned int chnum, bufsz; - int sample_size, swap_reg; + int sample_size, sts_reg; struct resource *nambar, *nabmbar, *irq; int regtype, nambarid, nabmbarid, irqid; @@ -511,9 +511,7 @@ if ((ch->imask & gs) == 0) continue; gs &= ~ch->imask; - st = ich_rd(sc, ch->regbase + - (sc->swap_reg ? ICH_REG_X_PICB : ICH_REG_X_SR), - 2); + st = ich_rd(sc, ch->regbase + sc->sts_reg, 2); st &= ICH_X_SR_FIFOE | ICH_X_SR_BCIS | ICH_X_SR_LVBCI; if (st & (ICH_X_SR_BCIS | ICH_X_SR_LVBCI)) { /* block complete - update buffer */ @@ -538,9 +536,7 @@ } /* clear status bit */ - ich_wr(sc, ch->regbase + - (sc->swap_reg ? ICH_REG_X_PICB : ICH_REG_X_SR), - st, 2); + ich_wr(sc, ch->regbase + sc->sts_reg, st, 2); } ICH_UNLOCK(sc); if (gs != 0) { @@ -710,6 +706,12 @@ return ENOSPC; } + if (sc->vendor == SIS_VENDORID && sc->devid == SIS_7012) { + /* unmute output, from Linux */ + ich_wr(sc, ICH_REG_SIS_CR, + ich_rd(sc, ICH_REG_SIS_CR, 2) | ICH_SIS_CR_UNMUTE, 2); + } + return 0; } @@ -757,10 +759,13 @@ * There really should be a general "quirks" mechanism. */ if (vendor == SIS_VENDORID && devid == SIS_7012) { - sc->swap_reg = 1; + sc->sts_reg = ICH_REG_X_PICB; sc->sample_size = 1; + /* unmute output, from Linux */ + ich_wr(sc, ICH_REG_SIS_CR, + ich_rd(sc, ICH_REG_SIS_CR, 2) | ICH_SIS_CR_UNMUTE, 2); } else { - sc->swap_reg = 0; + sc->sts_reg = ICH_REG_X_SR; sc->sample_size = 2; } --- sys/dev/sound/pci/ich.h.orig Sat Apr 30 14:31:15 2005 +++ sys/dev/sound/pci/ich.h Thu Dec 15 15:46:41 2005 @@ -53,6 +53,10 @@ #define ICH_REG_GLOB_STA 0x30 #define ICH_REG_ACC_SEMA 0x34 +/* SiS register, from Linux */ +#define ICH_REG_SIS_CR 0x4c +#define ICH_SIS_CR_UNMUTE 0x01 + /* Status Register Values */ #define ICH_X_SR_DCH 0x0001 #define ICH_X_SR_CELV 0x0002 --OXfL5xGRrasGEqWY--