I didn't get my microphone and front panel speaker work for quite a long time on Fedora 12. My Intel S975XBX2 motherboard has in-build audio of HDA (High Definition Audio) standard. The audio codec is SigmaTel STAC9227, as shown when i run the command "cat /proc/asound/card0/codec#2". I read several forum posts in different websites, tried to remove pulseaudio related tools, compiled ALSA driver with hda-intel support as instructed at http://www.alsa-project.org/main/ind...dule-hda-intel
. But nothing did work. I read somewhere, probably in Linux Kernel documentation for ALSA, that most microphone problems are just wrong connections of pins. I also read that HDA Analyzer from http://www.alsa-project.org/main/index.php/HDA_Analyzer
can help fix this issue. So, i downloaded it; but when i did run it, the list of "Nodes" made me all more confused. After some failed attempts to search for alternatives in forum posts, i finally took the plunge and downloaded and read Intel High Defintion Audio Specification from http://www.intel.com/content/dam/doc...cification.pdf
. Reading the specification landed me inside the audio controller and finally that "Pin" thing became clear.
As per HDA specification, HD audio controller communicates with external devices like microphone, speaker, headphone through one or more codecs. Each codec communicates with those external devices through collection of "Pin". On the other hand. each codec communicates with audio controller through Audio In/Out Converter. These Converters and Pins , inside a codec, talk to each other using "Widgets" like Audio Selector(Multiplexer, Amplifier) or other Pins. All these converters, pins, widgets are generally termed as "Node". Hence, in HDA Analyzer GUI, all the items under card-0->codec-2 are shown as Nodes. So, when you hear sound in speaker, the signal flow is Controller->Audio Out Converter->Widget->Pin and when you record sound the signal flow is Pin->Widget->Audio In Converter->Controller.
The list of nodes in my case were, -
Node[0x02] to Node[0x05] - AUD_OUT (4)
Node[0x06] - VENDOR
Node[0x07] to Node[0x09] - AUD_IN (3)
Node[0x0a] to Node[0x12] - PIN (9)
Node[0x13] - VENDOR
Node[0x14] - VENDOR
Node[0x15] to Node[0x1d] - AUD_SEL (9)
Node[0x1e] - AUD_OUT
Node[0x1f] - VENDOR
Node[0x20] - AUD_IN
Node[0x21] to Node[0x22] - PIN (2)
Node[0x23] - Beep
Node[0x24] - VOL_KNB
You can see visually how these nodes are connected to each other by clicking "Graph" button. As my first problem was with microphone, i looked at Audio In Converter or AUD_IN nodes. For example, take the first AUD_IN node, 0x07. It was connected to Audio Selector (AUD_SEL) 0x1b, as seen in "Connection List" parameter, which i saw when i clicked "Node[0x07] AUD_IN" from the tree view. Again, that "Node[0x1b] AUD_SEL" was connected to Audio Selector (AUD_SEL) 0x18. And "Node[0x18] AUD_SEL" was connected to Audio Selector (AUD_SEL) 0x15. That last AUD_SEL 0x15 has several "Pin Complex" or just Pins, in its connection list. So far the path of interconnection was, AUD_IN(0x07)->AUD_SEL(0x1b)->AUD_SEL(0x18)->AUD_SEL(0x15). Now, the first item of the connection list of last AUD_SEL 0x15 was "Pin Complex [0x0e]". This "Node[0x0e] Pin" was showing following "Config Default", -
Jack Connection: Jack
Jack type: Speaker
Jack location: Ext
Jack location2: Rear
Jack Connection: 1/8
Jack Color: Pink
Now, from the technical specification of motherboard S975XBX2, i knew that Pink color hole at the bank panel was for "Mic In/Retasking Jack". Also, in the "Widget Control" of "Node[0x0e] Pin" the "Out" checkbox was ticked. That means that Pin or Mic In was enabled as Line Out not Line In. In other words, it was marked to play audio not to capture it. So, i removed the tick from "Out", instead ticked on "In" check box. Then i went back to "Node[0x15] AUD_SEL" and selected "Pin Complex [0x0e]" in the connection list. But nothing happened, no recording was there. Then i recallled (from some forum posts) that you may need to increase amplifier gain. So, i tried to increase value of the two sliders, present next to Val and Val in "Node[0x15] AUD_SEL"'s Node Editor window. But still the same. Then, i don't know why, but i went back to Node Editor Window of "Node[0x0e] Pin" and inside "Widget Control" pane, i set VREF to 50. And the microphone finally captured my voice, i was never so happy to hear my voice
To test the sound recording i used Jack audio server. First, i opened QjackCtl, started Jack server. Then opened the "Connections" window by clicking "Connect" button of QjackCtl interface. On that "Connections" window, i connected system->capture_1 to system->playback_1 and system->capture_2 to system->playback_2.
With this setting i tried those above tweaking on HDA Analyzer and finally heard my loud voice.
Then i experimented with several options shown therein and the front panel speaker also became alive along with front panel microphone.
For panel speaker, i ticked on "Out" in "Widget Control" pane on the Node Editor window of "Node[0x0a] Pin", becasue its "Config Default" was showing that,
Jack Connection: Jack
Jack type: HP Out
Jack location: Ext
Jack location2: Front
Jack Connection: 1/8
Jack Color: Green
And from S975XBX2 technical speification, i knew that front panel had "Line Out/Restasking Jack" hole in green color. But still the audio volume as not high. In the Node Editor of "Node[0x0a] Pin", it was shown to be connected with "Audio Output[0x03]". So, i went to Node Editor of "Node[0x03] AUD_OUT" and draw the sliders next to two "Mute" text to the end to give them 127 value. And then my ears felt the joy of loud drum beats
To enable the front panel microphone, i didn't have to do much. The "Node[0x0b] Pin", the pin for front panel microphone, was correctly configured. When in "Node[0x15] AUD_SEL", i selected "Pin Complex [0x0b]" (which was actually default configuration in my machine), and raised the sliders next to Val and Val to 2, then the audio capture worked.
But, the change of setting made through HDA Analyzer, does not maintain itself on reboot. Fortunately, HDA Analyzer, had "Exp" (Export) facility. But it didn't work initially for me. At the time of this writing, i found that /dev/shm/hda_Analyzer/hda_codec.py (downloaded by HDA Analyzer) file contains calls to set_vol_knb function at 2 places,( line 790 and line 834), but the containing class HDANode doesn't have any function of such name. May be the developers were working on some recent issues. I didn't think it would be wise to disturb them for such trivial things, and just commented out those two lines. Then "Exp" button worked. It showed the full script which can be run manually or automatically during boot to make the changes in the audio controller. But, the exported script only shows the difference between the present setting and last changed setting. So, if you open and close the Analyzer multiple times and try the export, you will not see the total difference of settings from the original default setting of the audio controller, as set by the controller or bios itself. The "Exp" generated script has two parts. The upper part is same for every export, it just accesses the /dev/snd/hwC0D2 file. The lower part contains the script to make the changes of settings. So, i made a blank file, copied the common upper part, then ran the Analyzer several times as i was experimenting with different options of the nodes. Whenever some settings worked, i just clicked "Exp" button, copied the lower part and appended it to that file. So, didn't have to worry if i had closed Analyzer.
Finally, i copied that all containing file as /etc/hda_audio_setting.py, then opened up /etc/rc.d/rc.local file and appended the line "python /etc/hda_audio_setting.py". So, on next reboot, i didn't have to run HDA Analyzer again and i was a happy man