snd_ich and Microphone

Hi,
I'm a french user and my english isn't very good.

I'm on FreeBSD 8 and I can't make work my microphone.
My sound card is okay, I can listen music without any problems.
But when i'm calling someone with skype, my microphone doesn't works. When I use a native FreeBSD application to record, it's doesn't works too.

Code:
# kldstat
Id Refs Address    Size     Name
 1   19 0xc0400000 b6dfe0   kernel
 2    2 0xc0f6e000 2d8e4    linux.ko
 3    1 0xc0f9c000 7224     snd_ich.ko
 4    2 0xc0fa4000 567c0    sound.ko
 5    1 0xc0ffb000 8e9eac   nvidia.ko
 6    1 0xc6af4000 3000     daemon_saver.ko
Code:
#/usr/sbin/mixer
Mixer vol      is currently set to  75:75
Mixer pcm      is currently set to  75:75
Mixer speaker  is currently set to  75:75
Mixer line     is currently set to  75:75
Mixer mic      is currently set to  70:70
Mixer cd       is currently set to  75:75
Mixer rec      is currently set to  70:70
Mixer igain    is currently set to  77:77
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

I hope someone can help me.

Bye.
 
you haven't provided any info about your matherboard, and soundracd.... no dmesg... what do you expect us to say?

snd_ich on my ABIT AS8 motherboard with buildin ac97 soundracd works good (bough input/output)
 
Sorry. My motherboard is an Asus p4p800. The soundcar is a AD1985 integrated on the motherboard.

I've tried
echo "dev.pcm.0.vchans.play=4" >> /boot/loader.conf
Then sysctl dev.pcm.0.vchans.play=4
and sysctl dev.pcm.0.vchans.play=4 return :
Code:
# sysctl dev.pcm.0.vchans.play=4
sysctl: unknown oid 'dev.pcm.0.vchans.play'

dmesg return :
Code:
FreeBSD 8.0-RELEASE #0: Sat Nov 21 15:48:17 UTC 2009
    root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Intel(R) Pentium(R) 4 CPU 2.40GHz (2398.86-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0xf27  Stepping = 7
  Features=0xbfebfbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CLFLUSH,DTS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE>
  Features2=0x4400<CNXT-ID,xTPR>
real memory  = 2147483648 (2048 MB)
avail memory = 2077675520 (1981 MB)
ACPI APIC Table: <A M I  OEMAPIC >
ioapic0 <Version 2.0> irqs 0-23 on motherboard
kbd1 at kbdmux0
acpi0: <A M I OEMXSDT> on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
acpi0: reservation of 0, a0000 (3) failed
acpi0: reservation of 100000, 7fef0000 (3) failed
Timecounter "ACPI-safe" frequency 3579545 Hz quality 850
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
agp0: <Intel 82865 host to AGP bridge> on hostb0
pcib1: <ACPI PCI-PCI bridge> at device 1.0 on pci0
pci1: <ACPI PCI bus> on pcib1
vgapci0: <VGA-compatible display> mem 0xfa000000-0xfaffffff,0xd0000000-0xdfffffff,0xf9000000-0xf9ffffff irq 16 at device 0.0 on pci1
nvidia0: <Unknown> on vgapci0
vgapci0: child nvidia0 requested pci_enable_busmaster
vgapci0: child nvidia0 requested pci_enable_io
vgapci0: child nvidia0 requested pci_enable_io
nvidia0: [GIANT-LOCKED]
nvidia0: [ITHREAD]
uhci0: <Intel 82801EB (ICH5) USB controller USB-A> port 0xd480-0xd49f irq 16 at device 29.0 on pci0
uhci0: [ITHREAD]
uhci0: LegSup = 0x2030
usbus0: <Intel 82801EB (ICH5) USB controller USB-A> on uhci0
uhci1: <Intel 82801EB (ICH5) USB controller USB-B> port 0xd800-0xd81f irq 19 at device 29.1 on pci0
uhci1: [ITHREAD]
uhci1: LegSup = 0x2030
usbus1: <Intel 82801EB (ICH5) USB controller USB-B> on uhci1
uhci2: <Intel 82801EB (ICH5) USB controller USB-C> port 0xd880-0xd89f irq 18 at device 29.2 on pci0
uhci2: [ITHREAD]
uhci2: LegSup = 0x2030
usbus2: <Intel 82801EB (ICH5) USB controller USB-C> on uhci2
uhci3: <Intel 82801EB (ICH5) USB controller USB-D> port 0xdc00-0xdc1f irq 16 at device 29.3 on pci0
uhci3: [ITHREAD]
uhci3: LegSup = 0x2030
usbus3: <Intel 82801EB (ICH5) USB controller USB-D> on uhci3
ehci0: <Intel 82801EB/R (ICH5) USB 2.0 controller> mem 0xf8fffc00-0xf8ffffff irq 23 at device 29.7 on pci0
ehci0: [ITHREAD]
usbus4: EHCI version 1.0
usbus4: <Intel 82801EB/R (ICH5) USB 2.0 controller> on ehci0
pcib2: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci2: <ACPI PCI bus> on pcib2
fwohci0: <VIA Fire II (VT6306)> port 0xec00-0xec7f mem 0xfbfff800-0xfbffffff irq 20 at device 3.0 on pci2
fwohci0: [ITHREAD]
fwohci0: OHCI version 1.0 (ROM=1)
fwohci0: No. of Isochronous channels is 8.
fwohci0: EUI64 00:e0:18:00:00:4c:16:2c
fwohci0: Phy 1394a available S400, 3 ports.
fwohci0: Link S400, max_rec 2048 bytes.
firewire0: <IEEE1394(FireWire) bus> on fwohci0
dcons_crom0: <dcons configuration ROM> on firewire0
dcons_crom0: bus_addr 0x1f14000
fwe0: <Ethernet over FireWire> on firewire0
if_fwe0: Fake Ethernet address: 02:e0:18:4c:16:2c
fwe0: Ethernet address: 02:e0:18:4c:16:2c
fwip0: <IP over FireWire> on firewire0
fwip0: Firewire address: 00:e0:18:00:00:4c:16:2c @ 0xfffe00000000, S400, maxrec 2048
fwohci0: Initiate bus reset
fwohci0: fwohci_intr_core: BUS reset
fwohci0: fwohci_intr_core: node_id=0x00000000, SelfID Count=1, CYCLEMASTER mode
skc0: <3Com 3C940 Gigabit Ethernet> port 0xe800-0xe8ff mem 0xfbff8000-0xfbffbfff irq 22 at device 5.0 on pci2
skc0: 3Com Gigabit LOM (3C940) rev. (0x1)
sk0: <Marvell Semiconductor, Inc. Yukon> on skc0
sk0: Ethernet address: 00:0e:a6:54:c0:2a
miibus0: <MII bus> on sk0
e1000phy0: <Marvell 88E1011 Gigabit PHY> PHY 0 on miibus0
e1000phy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, 1000baseT-FDX, auto
skc0: [ITHREAD]
isab0: <PCI-ISA bridge> at device 31.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <Intel ICH5 UDMA100 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xfc00-0xfc0f at device 31.1 on pci0
ata0: <ATA channel 0> on atapci0
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci0
ata1: [ITHREAD]
atapci1: <Intel ICH5 SATA150 controller> port 0xcc00-0xcc07,0xc880-0xc883,0xc800-0xc807,0xc480-0xc483,0xc400-0xc40f irq 18 at device 31.2 on pci0
atapci1: [ITHREAD]
ata2: <ATA channel 0> on atapci1
ata2: [ITHREAD]
ata3: <ATA channel 1> on atapci1
ata3: [ITHREAD]
pci0: <serial bus, SMBus> at device 31.3 (no driver attached)
pcm0: <Intel ICH5 (82801EB)> port 0xd000-0xd0ff,0xd400-0xd43f mem 0xf8fff800-0xf8fff9ff,0xf8fff400-0xf8fff4ff irq 17 at device 31.5 on pci0
pcm0: [ITHREAD]
pcm0: <Analog Devices AD1985 AC97 Codec>
acpi_button0: <Power Button> on acpi0
atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: [FILTER]
uart1: <16550 or compatible> port 0x2f8-0x2ff irq 3 on acpi0
uart1: [FILTER]
ppc0: <Parallel port> port 0x378-0x37f,0x778-0x77b irq 7 drq 3 on acpi0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/9 bytes threshold
ppc0: [ITHREAD]
ppbus0: <Parallel port bus> on ppc0
plip0: <PLIP network interface> on ppbus0
plip0: [ITHREAD]
lpt0: <Printer> on ppbus0
lpt0: [ITHREAD]
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
cpu0: <ACPI CPU> on acpi0
p4tcc0: <CPU Frequency Thermal Control> on cpu0
pmtimer0 on isa0
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
Timecounter "TSC" frequency 2398856048 Hz quality 800
Timecounters tick every 1.000 msec
firewire0: 1 nodes, maxhop <= 0 cable IRM irm(0)  (me) 
firewire0: bus manager 0 
usbus0: 12Mbps Full Speed USB v1.0
usbus1: 12Mbps Full Speed USB v1.0
usbus2: 12Mbps Full Speed USB v1.0
usbus3: 12Mbps Full Speed USB v1.0
usbus4: 480Mbps High Speed USB v2.0
ad4: 238475MB <HDT722525DLA380 V44OA9BA> at ata2-master SATA150
ugen0.1: <Intel> at usbus0
uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0
ugen1.1: <Intel> at usbus1
uhub1: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
ugen2.1: <Intel> at usbus2
uhub2: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus2
ugen3.1: <Intel> at usbus3
uhub3: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3
ugen4.1: <Intel> at usbus4
uhub4: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus4
ad6: 238475MB <HDT722525DLA380 V44OA9BA> at ata3-master SATA150
GEOM: ad4s1: geometry does not match label (255h,63s != 16h,63s).
ar0: 476949MB <Intel MatrixRAID RAID0 (stripe 128 KB)> status: READY
ar0: disk0 READY using ad4 at ata2-master
ar0: disk1 READY using ad6 at ata3-master
Root mount waiting for: usbus4 usbus3 usbus2 usbus1 usbus0
uhub0: 2 ports with 2 removable, self powered
uhub1: 2 ports with 2 removable, self powered
uhub2: 2 ports with 2 removable, self powered
uhub3: 2 ports with 2 removable, self powered
Root mount waiting for: usbus4
Root mount waiting for: usbus4
Root mount waiting for: usbus4
uhub4: 8 ports with 8 removable, self powered
Trying to mount root from ufs:/dev/ar0s1a
ugen1.2: <GTech> at usbus1
ums0: <GTech Wireless Mouse, class 0/0, rev 1.10/0.01, addr 2> on usbus1
ums0: 5 buttons and [XYZ] coordinates ID=1
sk0: link state changed to UP
NVRM: detected agp.ko, aborting NVIDIA AGP setup!
NVRM: Xid (0001:00): 62
 
I saw someone reporting success when switching from the kernel loadable module to including that module in the actual kernel (by adding device snd_ich to the kernel configuration and rebuilding the kernel). Maybe something to try if all else fails.
 
Thanks for the tip.
To add a module on my kernel I add
Code:
device snd_ich
to the config file of /usr/src/sys/i386/conf/GENERIC
and I type
Code:
make buildkernel KERNCONF=GENERIC
and
Code:
make installkernel KERNCONF=GENERIC

Thanks for your help :)
 
you allso need to add device sound, it is required by all snd_* devices
I suggest you rename kernel, to some other name....

otherwise next time, when someone asks you to show output of uname -a everytone will think that you use generic kernel, when actually you use custom one
 
Sorry to ask for your help again, but I have a problem I have never had before. I've installed the SRC but when i'm trying to compile the kernel
Code:
make buildkernel KERNCONF=GENERIC
return :
Code:
make: don't know how to make buildkernel. Stop
 
Thanks for your help, i'm downloading the SRC via csup.
I've a question, What is the difference between a load module and the same module build in a custom kernel ?
I don't like do a thing without uderstanding it :)
 
There should be any difference.... but who knows....
execpt that some things you can't load (there simply aren't created modules)

I like to compile my custom kernel, to get dir of options/devices, that I don't use. This way I create smaller kernel. For me this is also good because I boot from flash, and the smaller kernel, the faster it'll load.
 
Thank you for the answer :)
After installing the kernel I've to delete the line on /boot/loader.conf wich load the module, is that righ ?
Sorry for my stupid question, but it's my first step on FreeBSD. I've use Debian for 5 years, and I'm a litte lost right now on FreeBSD :D
 
The compilation is taking a long time. I'll go sleep (I'm french, we are near midnight :D). Tomorow I'll try with the new kernel and I'll tell here if it's working.
In any case, thanks you very much for the help and for your rapids answers.
 
I've compiled a new Kernel and the microphone still doesn't work. I've delete the module line on /boot/loader.conf, I can listen music (like before) but I can't use microphone.
 
So, I maybe found a way to solve the problem.
I've to use that :
Code:
--- sys/dev/sound/pcm/ac97.c.releng70	2007-10-30 03:47:47.000000000 +0900
+++ sys/dev/sound/pcm/ac97.c	2008-07-28 18:29:02.000000000 +0900
@@ -141,8 +141,8 @@
 	{ 0x41445370, 0x00, 0, "AD1980",	ad198x_patch },
 	{ 0x41445372, 0x00, 0, "AD1981A",	0 },
 	{ 0x41445374, 0x00, 0, "AD1981B",	ad1981b_patch },
-	{ 0x41445375, 0x00, 0, "AD1985",	ad198x_patch },
-	{ 0x41445378, 0x00, 0, "AD1986",	ad198x_patch },
+	{ 0x41445375, 0x00, 0, "AD1985",	ad1985_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-07-29 13:00:04.000000000 +0900
@@ -44,6 +44,9 @@
 
 void ad198x_patch(struct ac97_info* codec)
 {
+	/*
+	 * Swap the aim of the LINE_OUT and SURR_OUT/HP_OUT pins.
+	 */
 	switch (ac97_getsubvendor(codec)) {
 	case 0x11931043:	/* Not for ASUS A9T (probably else too). */
 		break;
@@ -69,6 +72,68 @@
 	}
 }
 
+void ad1985_patch(struct ac97_info* codec)
+{
+	/*
+	 * Swap the aim of the LINE_OUT and SURR_OUT/HP_OUT pins.
+	 * Disable outputs of the LINE_OUT and CENTER_OUT/LFE_OUT pins.
+	 * Select the CENTER_OUT/LFE_OUT pins as the MIC inputs.
+	 * Enable the stereo microphone mode.
+	 *
+	 * Set the voltage of the VREFOUT pin.
+	 */
+	switch (ac97_getsubvendor(codec)) {
+	case 0x80f31043:	/* ASUS P4P800 Deluxe (SE) */
+		ac97_wrcd(codec, 0x76, ac97_rdcd(codec, 0x76) | 0x0420);
+		ac97_wrcd(codec, 0x76, ac97_rdcd(codec, 0x76) | 0x1800);
+		ac97_wrcd(codec, 0x74, ac97_rdcd(codec, 0x74) | 0x0200);
+		ac97_wrcd(codec, 0x76, ac97_rdcd(codec, 0x76) | 0x0040);
+
+		/*
+		 * 0x0 = 2.25V (default)
+		 * 0x1 = High-Z
+		 * 0x2 = 3.7V
+		 * 0x3 = 0V
+		 */
+		ac97_wrcd(codec, 0x76, (ac97_rdcd(codec, 0x76) & ~0xc)
+		    | 0x0 << 2);
+		break;
+	default:
+		break;
+	}
+}
+
+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);
+
+		/*
+		 * 0x0 = High-Z (default)
+		 * 0x1 = 2.25V
+		 * 0x2 = 0V
+		 * 0x4 = 3.70V
+		 */
+		ac97_wrcd(codec, 0x70, (ac97_rdcd(codec, 0x70) & ~0x1c)
+		    | 0x1 << 2);
+		break;
+	default:
+		break;
+	}
+}
+
 void cmi9739_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-07-28 18:29:21.000000000 +0900
@@ -31,5 +31,7 @@
 void ad1886_patch(struct ac97_info*);
 void ad198x_patch(struct ac97_info*);
 void ad1981b_patch(struct ac97_info*);
+void ad1985_patch(struct ac97_info*);
+void ad1986_patch(struct ac97_info*);
 void cmi9739_patch(struct ac97_info*);
 void alc655_patch(struct ac97_info*);

(Found here : http://lists.freebsd.org/pipermail/freebsd-multimedia/2008-July/008850.html)

Sorry to make multi-post, I can't edit my post :)
But i don't know what it is, ans dont know how use this.
 
hmm, i got another idea, you can try to install OSS from ports, but you need to read about this before you do.... I've never done this, but maybe it'll work better
 
I've installed OSS, It's working (To make OSS work i've back to GENERIC Kernel).
I think the microphone is working (I'm note sure).
Code:
# mixer
Mixer vol      is currently set to  75:75
Mixer pcm      is currently set to  75:75
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 igain    is currently set to  75:75
Mixer line1    is currently set to  32:32
Mixer phin     is currently set to   0:0
Mixer phout    is currently set to  75:75
Mixer video    is currently set to   0:0
Recording source: line
But, mixer set recording source to "line". How can I switch to mic ?
 
I've set the microphone with "mixer -S =rec mic".
And when I calling echo123 on skype, I can hear myself, It's Working !!!
But, there is a little problem, (I hope, the last one :D).
The sound is very vry weak. I've looking on the internet, but I have'nt font any information about how increase the volume of that microphone. Any Idea ? :)
Thanks a lot !
 
Back
Top