Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Dec 2005 16:00:27 +0900
From:      Pyun YongHyeon <pyunyh@gmail.com>
To:        Timothy Smith <timothy@open-networks.net>
Cc:        freebsd-multimedia@freebsd.org
Subject:   Re: asus mobo, poor sound quality
Message-ID:  <20051215070026.GE14073@rndsoft.co.kr>
In-Reply-To: <43A01AAE.1050603@open-networks.net>
References:  <43A01AAE.1050603@open-networks.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--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: <SiS 7012> 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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051215070026.GE14073>