asus mobo, poor sound quality
Pyun YongHyeon
pyunyh at gmail.com
Wed Dec 14 23:00:45 PST 2005
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
-------------- next part --------------
--- 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
More information about the freebsd-multimedia
mailing list