# Microphone problem, Creative SB0880 X-Fi



## lkm (Aug 24, 2016)

Hello

I've got a recording problem in FreeBSD-10.3-RELEASE, with the Creative SB0880 X-Fi soundcard, with the following PCI info:

```
hdac2@pci0:2:0:0:       class=0x040300 card=0x00411102 chip=0x000b1102 rev=0x04 hdr=0x00.
```

The playback is fine.

While recording from the microphone from an application (such as Audacity, but other apps shows similar problem) the recorded sound is almost non-existent, although all mixer controls are at 100/100. I can see a little spike in the waveform (in Audacity) when I plug/unplug the microphone.

The microphone is plugged on a jack on the rear, this jack can function either as _Mic_, or as _Line-in_ (so-called "flexijack" feature).

I'm guessing that my problem is because the jack is incorrectly set as _Line-in_, because on Windows, if I manually set the jack mode to _Line-in_, I observe similar recording problems.

Verbose dmesg(1) extract is available here: http://pastebin.com/raw/U3XdLBUu

The devices before hdaa2/pcm7 are corresponding to sound devices integrated in the motherboard, I believe these are irrelevant as I'm not interested in using them.

Here is the output of `cat /dev/sndstat` : http://pastebin.com/raw/Y40UXYrs

Here are the mixer settings corresponding to the relevant device(s):

```
# mixer -f /dev/mixer7
Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to 100:100
Mixer line     is currently set to 100:100
Mixer rec      is currently set to 100:100
Recording source: line
# mixer -f /dev/mixer8
Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to 100:100
Mixer rec      is currently set to 100:100
Mixer dig1     is currently set to 100:100
Recording source: dig1
# mixer -f /dev/mixer9
Mixer mic      is currently set to 100:100
Mixer rec      is currently set to 100:100
Recording source: mic
#
```

The mic shown in device 9 corresponds to another jack (front mic, nid 20 I guess), unrelated to the current problem.

Here is the output of `sysctl dev.hdac.2.pindump=1` : http://pastebin.com/raw/fFXeBpsP

From the pin dump, I see that the jack where I plug my microphone corresponds to nid 19 :

```
hdaa2: 19 01813040 4  0  Line-in       Jack  1/8     Rear       Blue    0
hdaa2:     Caps: IN                  Sense: 0xffffffff (connected)
```

I know this is the correct nid because when I unplug the microphone, the pin dump shows _disconnected_ instead of _connected_ for the nid 19.

From the dmesg and from information found in snd_hda(4), I understand that the nid 19 should be accessible with the pcm7 device, therefore I ran `sysctl  hw.snd.default_unit=7`.

I've tried to put the following device hint:


```
hint.hdaa.2.nid19.config="device=Mic"
```

This hint successfully switches nid19 to device type _Mic_ (instead of _Line-in_) in the pin dump after a reboot, but has no effect on the recording.

I've searched (google etc) for any way to put this jack in _Mic_ mode, but without success.

To clarify: I don't actually need to switch between _Mic_ mode and _Line-in_ mode at runtime. Any solution to permanently force the jack in _Mic_ mode would be sufficient.

Any help would be greatly appreciated. Thank you in advance.

Regards,


----------



## shepper (Aug 24, 2016)

Before putting alot of effort into re-mapping the nids.  I would want to verify that the mic you are using has the appropriate contacts.  Older mics had two pins and older headphones 3 contacts.  The jacks for headphone/mic combinations I believe have 4 pins and the older mics will not work with newer 4-pin jacks.


----------



## lkm (Aug 25, 2016)

Hello shepper,

The mic has 2 pins, the connector is for the mic only (no mic/headphone combination on the same connector). However, the mic works fine under Windows (after I use the Creative tool to set the jack to _Mic_ mode), so I don't think this is a hardware problem.


----------



## shepper (Aug 26, 2016)

lkm said:


> I've tried to put the following device hint:
> 
> 
> ```
> ...



It is possible to invert jack-sensing logic.  From snd_hda(4)


> _hint.hdaa.%d.config_    Configures a range of possible audio function
> options.  Possible values are: ``eapdinv'',
> ``ivref'', ``ivref50'',    ``ivref80'',
> ``ivref100'', ``fixedrate'', ``forcestereo'',
> ...



This would fit the hardware symptoms you describe.


----------

