From owner-freebsd-multimedia@FreeBSD.ORG Thu Jun 7 16:03:41 2007 Return-Path: X-Original-To: freebsd-multimedia@freebsd.org Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 03E7A16A469 for ; Thu, 7 Jun 2007 16:03:41 +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 B5CC713C45B for ; Thu, 7 Jun 2007 16:03:40 +0000 (UTC) (envelope-from CQG00620@nifty.ne.jp) Received: from asahi-net.jp (i222206.ppp.asahi-net.or.jp [61.125.222.206]) by mail.asahi-net.or.jp (Postfix) with ESMTP id CBCBA2D4CF; Fri, 8 Jun 2007 01:03:36 +0900 (JST) Date: Fri, 08 Jun 2007 01:03:36 +0900 From: Watanabe Kazuhiro To: freebsd-multimedia In-Reply-To: <20070606172107.GA1475@ige.unicamp.br> References: <20070510115120.GB1716@ige.unicamp.br> <20070602124938.8F5123E054@mail.asahi-net.or.jp> <20070604140241.GA1474@ige.unicamp.br> <20070605145944.B750E3C23C@mail.asahi-net.or.jp> <20070605163410.GA1496@ige.unicamp.br> <20070606162049.995E53DFA5@mail.asahi-net.or.jp> <20070606172107.GA1475@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/20.7 (i386--freebsd) MULE/4.1 (AOI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Message-Id: <20070607160336.CBCBA2D4CF@mail.asahi-net.or.jp> Cc: 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: Thu, 07 Jun 2007 16:03:41 -0000 At Wed, 6 Jun 2007 14:21:07 -0300, Ricardo Campos Passanezi wrote: > On Thu, Jun 07, 2007 at 01:20:49AM +0900, Watanabe Kazuhiro wrote: > > > > It's the first patch. Try it. > > Just to be sure: I've rebuilt th kernel after applying the patches. Is > this the right path? > > Well, after this I've done some tests with xwave and by issuing "cat > /dev/dsp > test.au" and then "cat test.au >> /dev/dsp". > > Neither of them worked... I've read the ASUS P5SD2-X english manual. It describes about the rear audio panel jacks: Audio 2, 4, or 6-channel configulation ------------------------------------------------------------------------- Port Headset 4-channel 6-channel 2-channel ------------------------------------------------------------------------- Light Bule Line In Line In [1] Line in [1] Lime Line Out Front Speaker Out Front Speaker Out Pink Mic In Mic In Mic In [2] ------------------------------------------------------------------------- (P5SD2-X English Manual E2026 (E2026_P5SD2-X.pdf), p.35) And there are the manuals those are written in chinese. I saw those manuals today, and they have the same table. I'm not familiar with chinese, but I just understand that [1]s and [2] are "output". AD1986A can share line inputs pins and surround outputs pins, and center/lfe outputs pins and microphone input pins. So perhaps [1]s are "Surround Out", and [2] is "Center/Subwoofer Out". I've write a new patch attached below. Try it. Note that before apply this patch, you have to restore the patched files. > The output of mixer: > > # 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 0:0 > Mixer ogain is currently set to 50:50 > 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: mic > > > Do you need more info? Will you show me the output of "dmesg | grep pcm" and "pciconf -lv | grep pcm" ? Index: sys/dev/sound/pcm/ac97.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97.c,v retrieving revision 1.53.2.5 diff -u -r1.53.2.5 ac97.c --- sys/dev/sound/pcm/ac97.c 13 May 2007 20:53:39 -0000 1.53.2.5 +++ sys/dev/sound/pcm/ac97.c 6 Jun 2007 15:45:42 -0000 @@ -141,7 +141,7 @@ { 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 }, Index: sys/dev/sound/pcm/ac97_patch.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97_patch.c,v retrieving revision 1.3.2.2 diff -u -r1.3.2.2 ac97_patch.c --- sys/dev/sound/pcm/ac97_patch.c 26 Apr 2007 08:30:52 -0000 1.3.2.2 +++ sys/dev/sound/pcm/ac97_patch.c 7 Jun 2007 12:47:18 -0000 @@ -43,9 +43,30 @@ void ad198x_patch(struct ac97_info* codec) { + /* + * The mixer outputs drives the SURR_OUT and HP_OUT pins. + */ ac97_wrcd(codec, 0x76, ac97_rdcd(codec, 0x76) | 0x0420); } +void ad1986_patch(struct ac97_info* codec) +{ + ac97_wrcd(codec, 0x76, ac97_rdcd(codec, 0x76) | 0x0420); + + /* + * 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. + * + * XXX must be restricted only for particular models. + */ + 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); +} + void ad1981b_patch(struct ac97_info* codec) { /* Index: sys/dev/sound/pcm/ac97_patch.h =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/ac97_patch.h,v retrieving revision 1.3.2.2 diff -u -r1.3.2.2 ac97_patch.h --- sys/dev/sound/pcm/ac97_patch.h 26 Apr 2007 08:30:52 -0000 1.3.2.2 +++ sys/dev/sound/pcm/ac97_patch.h 6 Jun 2007 15:46:12 -0000 @@ -30,5 +30,6 @@ 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)