From owner-freebsd-multimedia@FreeBSD.ORG Mon Jul 14 22:36:57 2003 Return-Path: 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 37F1237B401 for ; Mon, 14 Jul 2003 22:36:57 -0700 (PDT) Received: from freeman.4gh.net (washdc3-ar5-4-64-187-094.washdc3.elnk.dsl.genuity.net [4.64.187.94]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1684A43FBD for ; Mon, 14 Jul 2003 22:36:56 -0700 (PDT) (envelope-from stuartb@4gh.net) Received: from localhost (stuartb@localhost) by freeman.4gh.net (8.12.6/8.12.6) with ESMTP id h6F5aqTg074817; Tue, 15 Jul 2003 01:36:53 -0400 (EDT) (envelope-from stuartb@4gh.net) Date: Tue, 15 Jul 2003 01:36:52 -0400 (EDT) From: Stuart Barkley To: =?ISO-8859-1?Q?Joachim_Str=F6mbergson?= In-Reply-To: <3F131802.9040301@ludd.luth.se> Message-ID: <20030715005046.R74615@freeman.4gh.net> References: <3F131802.9040301@ludd.luth.se> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT cc: freebsd-multimedia@freebsd.org Subject: Re: Problems recording sound in FreeBSD 5.1 X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Jul 2003 05:36:57 -0000 On Mon, 14 Jul 2003 at 22:52 +0200, Joachim Strömbergson wrote: > Hardware wise, I've got an Asus A7V8X motherboard with built in AC97 > sound. I'm running FreeBSD 5.1 and KDE3. > > Is there ar simple way to directly verify that the mic input works? > Has anybody experienced similar problems? Anybody knows what might > be the problem? You should be able to bring up the microphone volume in the mixer and hear it in your speakers or headphones: % mixer mic 100 Setting the mixer mic to 100:100. % For recording from the microphone, I normally select the recording source with mixer and set the record level with the rec device: % mixer =rec mic mic 100 Setting the mixer mic to 100:100. Recording source: mic % As a test you can copy from /dev/audio to a file and vice-versa for playback: % cp /dev/audio test.au ^C [after several seconds of recording] % cp test.au /dev/audio % Are you sure you are going into a microphone input and not a line-in input? If you have a line-in input, are you able to record from that input when feeding it a signal from a cd player or something similar? Are you sure you are going into an input and not an output? I've seen some newer motherboards replace the line-in and microphone in jacks with output jacks for 5.1 sound systems. Two other things come to mind for AC97 recording: - AC97 specifies a control register bit which enables a 20dB microphone input gain. For the microphones I use, I seem to always need the boost. I apply the following patch (to 4.7, I'm not sure if it applies to 5.1 at all). --- ../src_dist/sys/dev/sound/pcm/ac97.c Mon Aug 26 20:25:55 2002 +++ ./sys/dev/sound/pcm/ac97.c Tue Jan 7 20:47:36 2003 @@ -332,6 +332,12 @@ int cur = rdcd(codec, e->reg); val |= cur & ~(max << e->ofs); } + /* stuartb: Enable 20dB mic channel gain boost */ + /* TODO: Add ioctl or something else to control this */ + /* Do ALL AC97 chips support this? */ + if (channel == SOUND_MIXER_MIC) + val |= 0x40; + } if (left == 0 && right == 0 && e->mute == 1) val = AC97_MUTE; - The AC97 specification also has support for an alternate mic input. I think this controls selection between a front panel and a rear panel microphone jack. You might need to set bit 0x0100 (MS) in the General Purpose Register 0x20. I have not created a patch for this function. If you have Windows XP or similar running on your system you can see these options as advanced setting on the microphone channel.