Help To Debug Intel HDA

From AlsaProject
Revision as of 09:42, 1 June 2011 by Perex (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

For Users

Troubleshooting

Mixer configuration

First of all, try fiddling with the mixer settings on alsamixer. Don't forget about:

  • Checking all alsamixer tabs using the Tab key
  • You can switching mute/unmute using the M key
  • On the "Capture" tab, you can change the capture source setting using the spacebar

'model' parameter

Sometimes the support for your system (or a similar one) is available on the driver, but the right system model wasn't detected by the driver. You can try different values for the model parameter for the snd-hda-intel module (see HD-Audio-Models.txt) and see if some of them fix your problem.

If this works, please report this problem, providing the relevant information.

Try a newer alsa version

If everything else fails, you can check if a newer ALSA version fixes your problem.

(TODO: pointer to article about how to get a newer ALSA version running)

Try a lowlevel GUI tool to control your codec

The HDA-Analyzer python utility to find and debug the problem.

Reporting problems

Almost all problems are related to the specific codec configuration. When reporting problems, please provide contents of:

  • /proc/asound/card*/codec#* files
  • Output of lspci -vvnn, at least the part corresponding to the Intel HDA device

At best, run alsa-info.sh script [1] and give the output information. If you post to ML or bugzilla, it's helpful to attach the generated file via alsa-info.sh --no-upload option.

For Developers

Fetch the Intel HDA specification, you will need it.

Also look at Documentation/sound/alsa/HD-Audio.txt in the kernel tree. This contains some detailed information for development/debugging HD-audio driver. The on-line documents are found in the link section below.

Basic HDA Intel Concepts

The snd-hda-intel driver speak to codecs through the the Intel HDA bus. Each codec has many widgets inside it, and the driver can send messages (called verbs) to them to change their settings. Each widget may collect audio input from other widgets, and may their output may be sent to other widgets. The driver may probe the codec and know exactly how the widgets are wired inside the codec. The /proc/asound/card*/codec#* file contains this information.

Commonly found types of widgets:

  • Pin Complexes are input and/or output interfaces to the outside world. They normally correspond to real audio jacks, speakers or microphones on the machine
  • Audio Input/Output, ADC, or DAC are the interface between the codec and the HDA bus. This is where ALSA sends/consumes the audio streams to/from
  • Selectors and Mixers allow the driver to combine and/or select audio input coming from multiple widgets

Each widget may contain amplifiers on its inputs or outputs. The amplifiers may be controlled by the driver to change audio volume and unmute/mute audio input or output. The mixer controls seen on alsamixer normally correspond to an specific amplifier on an specific widget inside the codec.

Common sources of problems

Normally problems are on the patch_*.c files, that are codec-specific. The codec-specific code normally have to do four things:

  • Correctly detect which system model is being used, based on PCI IDs or other information
  • Correctly initialize the widges inside the codec
  • Correctly tell hda-intel to use the right Audio ADC/DAC node as source for the PCM streams that will be registered with ALSA
  • Correctly tell hda-intel which amplifiers inside the codec will be controlled by the mixer controls registered with ALSA
Model detection

The driver needs to detect the system model, so that it knows how the audio is wired on the system, especially the audio input/outputs from the codec to the external world.

Initialization

Normally the drivers have 'init verbs' tables for each model. You will want to look up the HDA Intel specification to understand what they do.

PCM stream registration

The driver needs to register audio streams with alsa, that will be used for recording and playback. Most of this task is done by the hda-intel core code, but the codec-specific driver needs to tell hda-intel what are the NIDs of the ADC and DAC widgets for each audio stream.

Mixer registration

The driver normally register mixer controls with alsa. Normally this task is done by the hda-intel core code, but the codec-specific code needs to tell hda-intel which amplifiers inside the code chip will be controled by the mixer controls.

Other codec- or model-specific stuff
  • Speaker auto-muting when headphones are plugged
  • Possibly other stuff...

Links

Custom Search
Personal tools
Namespaces

Variants
Actions
Navigation
wiki
Toolbox