From owner-freebsd-multimedia@FreeBSD.ORG Sat Jun 28 15:08:24 2008 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0859910656B1 for ; Sat, 28 Jun 2008 15:08:24 +0000 (UTC) (envelope-from CQG00620@nifty.ne.jp) Received: from mail.asahi-net.or.jp (mail2.asahi-net.or.jp [202.224.39.198]) by mx1.freebsd.org (Postfix) with ESMTP id C01538FC0C for ; Sat, 28 Jun 2008 15:08:23 +0000 (UTC) (envelope-from CQG00620@nifty.ne.jp) Received: from asahi-net.jp (m036200.dynamic.ppp.asahi-net.or.jp [219.121.36.200]) by mail.asahi-net.or.jp (Postfix) with ESMTP id B42E35EBED; Sat, 28 Jun 2008 23:50:08 +0900 (JST) Date: Sat, 28 Jun 2008 23:50:07 +0900 From: WATANABE Kazuhiro To: Ricardo Campos Passanezi In-Reply-To: <20080624170530.GG2138@ige.unicamp.br> References: <20070605145944.B750E3C23C@mail.asahi-net.or.jp> <20070605163410.GA1496@ige.unicamp.br> <20070606162049.995E53DFA5@mail.asahi-net.or.jp> <20070606172107.GA1475@ige.unicamp.br> <20070607160336.CBCBA2D4CF@mail.asahi-net.or.jp> <20070611124008.GA1461@ige.unicamp.br> <20070611161051.EEA7F347C9@mail.asahi-net.or.jp> <20070611171712.GC1461@ige.unicamp.br> <20070612160223.2289B3AE18@mail.asahi-net.or.jp> <20070612184114.GB1474@ige.unicamp.br> <20080624170530.GG2138@ige.unicamp.br> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.7 Emacs/21.3 (i386--freebsd) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Message-Id: <20080628145009.B42E35EBED@mail.asahi-net.or.jp> Cc: freebsd-multimedia Subject: Re: Problem recording, using X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jun 2008 15:08:24 -0000 Hi, again. Cc'ed to freebsd-multimedia. At Tue, 24 Jun 2008 14:05:30 -0300, Ricardo Campos Passanezi wrote: > On Tue, Jun 12, 2007 at 03:41:14PM -0300, Ricardo Campos Passanezi wrote: > >On Wed, Jun 13, 2007 at 01:02:22AM +0900, Watanabe Kazuhiro wrote: > >> > > Hmmm... Can you record a sound with the PCM device from analog inputs > >> > > other than the microphone input (line, cd, etc.)? > > > >... > > > >> > >> For example, if you want to record a sound from an audio CD analog > >> output, try the following commands. In this procedure we choose > >> ports/audio/wavplay as a recording and playback software. > >> > >> $ mixer =rec cd # Select CD as an input source. > >> $ cdcontrol play # Start playback of the audio CD. > >> $ wavrec -S -s 44100 -b 16 -t 10 test.wav > >> # Record a sound (from the CD drive). > >> # Duration: 10 secs. > >> $ cdcontrol stop # Stop the CD. > >> $ wavplay test.wav # Play the test WAV file. > >> > >> Of course you have already to connect the analog audio cable from the > >> CD/DVD drive to the audio CD input pinhead. > >> > > > >With: > > > ># mixer > >Mixer vol is currently set to 75:75 > >Mixer pcm is currently set to 80:80 > >Mixer speaker is currently set to 75:75 > >Mixer line is currently set to 75:75 > >Mixer mic is currently set to 75:75 > >Mixer cd is currently set to 75:75 > >Mixer rec is currently set to 75:75 > >Mixer igain is currently set to 100:100 > >Mixer ogain is currently set to 0:0 > >Mixer line1 is currently set to 75:75 > >Mixer phin is currently set to 0:0 > >Mixer phout is currently set to 0:0 > >Recording source: cd > > > >It worked fine... > > Hello Watanabe. > > I've done the above and, as you can see in the previous email, it worked > fine (the recording using 'cd'). When I use 'mic' as recording source > I've no success. > > I'm using 7-STABLE right now. > > Can you still help me in this one? > > Sorry to bother... I have searched the web and found the useful page. Powering microphones http://www.epanorama.net/circuits/microphone_powering.html The author says "Most lavalier (tie-clip) microphones, consumer video camera microphones and microphones used with computer soundcards are electret microphones". If your microphone is an electret microphone, and its power is supplied via the mic's signal cable (generally called "plug-in power"), we have to supply the power to the signal cable. ***** Be careful to apply this patch. I believe that the patch is not so wrong. But I don't know whether the AD1986A's C/LFE VREFOUT pin is connected to the microphone jack correctly. So I cannot expect what is happen. --- sys/dev/sound/pcm/ac97.c.releng70 2007-10-30 03:47:47.000000000 +0900 +++ sys/dev/sound/pcm/ac97.c 2008-06-27 21:53:12.000000000 +0900 @@ -142,7 +142,7 @@ static struct ac97_codecid ac97codecid[] { 0x41445372, 0x00, 0, "AD1981A", 0 }, { 0x41445374, 0x00, 0, "AD1981B", ad1981b_patch }, { 0x41445375, 0x00, 0, "AD1985", ad198x_patch }, - { 0x41445378, 0x00, 0, "AD1986", ad198x_patch }, + { 0x41445378, 0x00, 0, "AD1986", ad1986_patch }, { 0x414b4d00, 0x00, 1, "AK4540", 0 }, { 0x414b4d01, 0x00, 1, "AK4542", 0 }, { 0x414b4d02, 0x00, 1, "AK4543", 0 }, --- sys/dev/sound/pcm/ac97_patch.c.releng70 2007-10-30 03:47:27.000000000 +0900 +++ sys/dev/sound/pcm/ac97_patch.c 2008-06-28 19:12:18.000000000 +0900 @@ -53,6 +53,31 @@ void ad198x_patch(struct ac97_info* code } } +void ad1986_patch(struct ac97_info* codec) +{ + /* + * Disable outputs of the SURR_OUT and CENTER_OUT/LFE_OUT pins. + * Select the SURR_OUT pins as the LINE_IN inputs. + * Select the CENTER_OUT/LFE_OUT pins as the MIC inputs. + * Enable the stereo microphone mode. + * + * Set the voltage of the C/LFE VREF_OUT pin. + */ + switch (ac97_getsubvendor(codec)) { + case 0x818f1043: /* ASUS P5SD2-X (SE) */ + ac97_wrcd(codec, 0x76, ac97_rdcd(codec, 0x76) | 0x1800); + ac97_wrcd(codec, 0x76, ac97_rdcd(codec, 0x76) | 0x0004); + ac97_wrcd(codec, 0x74, ac97_rdcd(codec, 0x74) | 0x0200); + ac97_wrcd(codec, 0x76, ac97_rdcd(codec, 0x76) | 0x0040); + + /* 0x4 = 2.25V, 0x8 = 0V, 0x10 = 3.70V */ + ac97_wrcd(codec, 0x70, ac97_rdcd(codec, 0x70) | 0x0004); + break; + default: + break; + } +} + void ad1981b_patch(struct ac97_info* codec) { /* --- sys/dev/sound/pcm/ac97_patch.h.releng70 2007-04-19 22:54:22.000000000 +0900 +++ sys/dev/sound/pcm/ac97_patch.h 2008-06-27 22:14:43.000000000 +0900 @@ -31,5 +31,6 @@ typedef void (*ac97_patch)(struct ac97_i void ad1886_patch(struct ac97_info*); void ad198x_patch(struct ac97_info*); void ad1981b_patch(struct ac97_info*); +void ad1986_patch(struct ac97_info*); void cmi9739_patch(struct ac97_info*); void alc655_patch(struct ac97_info*); --- WATANABE Kazuhiro (CQG00620@nifty.ne.jp)