Problem recording, using <SiS 7012>

WATANABE Kazuhiro CQG00620 at nifty.ne.jp
Sat Jun 28 15:08:24 UTC 2008


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 at nifty.ne.jp)


More information about the freebsd-multimedia mailing list