*BSD News Article 78508


Return to BSD News archive

Newsgroups: comp.unix.bsd.freebsd.misc
Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.mel.connect.com.au!news.mira.net.au!vic.news.telstra.net!act.news.telstra.net!psgrain!quack!quack.kfu.com!nsayer
From: nsayer@quack.kfu.com (Nick Sayer)
Subject: MWSS audio patch
Message-ID: <nzIuKB2@quack.kfu.com>
Sender: news@quack.kfu.com (0000-News(0000))
Organization: The Duck Pond public unix, +1 408 249 9630, log in as guest.
Date: Tue, 17 Sep 1996 20:34:44 UTC
Lines: 92

This is applicable to both 2.1.5-RELEASE and 2.2-960801-SNAP, since
so far as I can tell they both have the same audio support.

My Zenith notebook has a CS4231 audio chip in it. It is compatable
with the Microsoft Windows Sound System, generally, but there
appears to be some oddities that need to be addressed.

Some manufacturers (aparently not just Zenith) just stick the chip
on the bus and hardwire the IRQ with no additional support. My
evidence for this is twofold:

1. You have to comment out most of probe_ms_sound() to get sound
to work on the Zenith, but having done so sound works perfectly.

2. Solaris 2.x has made provisions for this situation:
From /platform/i86pc/kernel/drv/sbpro.conf:

>If your device has a "Microsoft Windows Sound System" compatibility
>register, the IRQ and DMA will be programmed from the entries below.
>The "type" property must be specified as "MWSS_AD184x".
>
>If your device has jumpers to select IRQ and/or DMA, or you have set
>them using a setup utility, your entry below must match that setting.
>The "type" property must be specified as "AD184x".

To get the audio to work on the Zentih, you specify AD184x instead
of MWSS_AD184x.

With that in mind, I feel a bit justified in suggesting that
provisions for this be made in /sys/i386/isa/sound/ad1848.c so
that we'll support the same set of devices as Solaris, at least:


*** ad1848.c.orig	Thu Jan 18 12:54:08 1996
--- ad1848.c	Tue Sep 17 13:22:33 1996
***************
*** 1391,1396 ****
--- 1391,1397 ----
      mad16init (hw_config->io_base);
  #endif
  
+ #ifndef PLAIN_AD1848
    if ((INB (hw_config->io_base + 3) & 0x3f) != 0x04 &&
        (INB (hw_config->io_base + 3) & 0x3f) != 0x00)
      {
***************
*** 1426,1431 ****
--- 1427,1433 ----
        printk ("MSS: Can't use IRQ%d with a 8 bit card/slot\n", hw_config->irq);
        return 0;
      }
+ #endif /* PLAIN_AD1848 */
  
    return ad1848_detect (hw_config->io_base + 4);
  }

Now I don't know how universal _this_ fix is -- it may be unique to the
Zenith for all I know -- but if I don't do this, then the speaker will
feed back into the mic and cause squealing when the audio is used.
The problem is that the default setup causes the mixer to set the IMIX
level to full blast instead of to 0 (the second field sets whether
or not to invert the value of that mixer channel). The IMIX channel
has the 'record monitor' signal on it. If folks other than owners of
Zenith laptops are getting squeal when using their CS4231, and other
folks aren't, then perhaps an #ifdef FIX_AD1848_FEEDBACK is in
order...?

*** ad1848_mixer.h.orig	Tue Nov 14 01:58:28 1995
--- ad1848_mixer.h	Tue Sep 17 13:23:26 1996
***************
*** 95,101 ****
  MIX_ENT(SOUND_MIXER_LINE,	18, 1, 0, 5,	19, 1, 0, 5),
  MIX_ENT(SOUND_MIXER_MIC,	 0, 1, 5, 1,	 1, 1, 5, 1),
  MIX_ENT(SOUND_MIXER_CD,	 	 2, 1, 0, 5,	 3, 1, 0, 5),
! MIX_ENT(SOUND_MIXER_IMIX,	13, 1, 2, 6,	 0, 0, 0, 0),
  MIX_ENT(SOUND_MIXER_ALTPCM,	 0, 0, 0, 0,	 0, 0, 0, 0),
  MIX_ENT(SOUND_MIXER_RECLEV,	 0, 0, 0, 0,	 0, 0, 0, 0),
  MIX_ENT(SOUND_MIXER_IGAIN,	 0, 0, 0, 4,	 1, 0, 0, 4),
--- 95,101 ----
  MIX_ENT(SOUND_MIXER_LINE,	18, 1, 0, 5,	19, 1, 0, 5),
  MIX_ENT(SOUND_MIXER_MIC,	 0, 1, 5, 1,	 1, 1, 5, 1),
  MIX_ENT(SOUND_MIXER_CD,	 	 2, 1, 0, 5,	 3, 1, 0, 5),
! MIX_ENT(SOUND_MIXER_IMIX,	13, 0, 2, 6,	 0, 0, 0, 0),
  MIX_ENT(SOUND_MIXER_ALTPCM,	 0, 0, 0, 0,	 0, 0, 0, 0),
  MIX_ENT(SOUND_MIXER_RECLEV,	 0, 0, 0, 0,	 0, 0, 0, 0),
  MIX_ENT(SOUND_MIXER_IGAIN,	 0, 0, 0, 4,	 1, 0, 0, 4),

-- 
Nick Sayer <nsayer@quack.kfu.com>  | "When you have to shoot, shoot.
N6QQQ @ N0ARY.#NORCAL.CA.USA.NOAM  | Don't talk."
+1 408 249 9630, log in as 'guest' | 
URL: http://www.kfu.com/~nsayer/   |        -- Tuco