[alsa-devel] [RFC 00/11] ASoC: hdac: Add hdac generic driver

Takashi Iwai tiwai at suse.de
Mon Jun 27 09:05:47 CEST 2016


On Mon, 27 Jun 2016 05:47:53 +0200,
Subhransu S. Prusty wrote:
> 
> HDA devices generically can be modelled with DAPM in ASoC. This
> series adds a framework in ASoC to model HDA devices. HDA widgets
> are enumerated and one or multiple DAPM widget(s) are created.
> Connection list is queried for each widget to identify the
> connection between two endpoints and modelled using DAPM graph.
> 
> Set of event handlers are defined for each widget type. Based on
> DAPM events required verbs are sent to program codec.
> 
> Finally a function is exported to query for the device endpoint
> configuration to create machine controls.

Well...  This is really a hard way to go.  The generic codec support
is good, but only if it can cover most of stuff.  That is, you'll have
to think of the exceptions from the beginning, because the majority of
HD-audio devices are exceptional, i.e. don't follow the standard
strictly.  As a generic hint, I would recommend the following:

- Try lots of different codecs and pin configurations.
  At best, write an emulator and process on it, and check the
  robustness and the correctness of your code.
  For example, the old AD1984A is one of the beasts that gives you a
  hell of complex routes.  Also the recent Cirrus codecs gives you
  tons of I/O pins.

- Think how to remap the pins and other setups in general.
  This is one of the most important keys.  Writing the generic code is
  only to solve a tip of iceberg.  The most difficult part is to adapt
  the generic code to the real machine configurations.

- Think how to handle the vendor-specific codes.
  Majority of machines have the own code due to the headset, EAPD,
  digital mic or LED controls, as well as the non-standard jack
  detection.


Takashi

> 
> Hardik T Shah (1):
>   ASoC: Add dai_ops to set the stream tag.
> 
> Subhransu S. Prusty (10):
>   ALSA: hdac: Add codec helper library
>   ALSA: hda - Add macro to test pin widget's input capability
>   ASoC: hdac: Add a generic hdac driver framework
>   ASoC: hdac: Create DAPM model for HDA widgets
>   ASoC: dapm: Create API to add a single route element
>   ASoC: hdac: Build DAPM graph by querying through widget connection
>     list
>   ASoC: hdac: Register widget event handlers
>   ALSA: hda - macro to get default config device of pin widgets
>   ASoC: dapm: Export snd_soc_dapm_new_control
>   ASoC: hdac: Export API to create machine controls
> 
>  include/sound/hdaudio.h         |    1 +
>  include/sound/soc-dai.h         |   12 +
>  include/sound/soc-dapm.h        |    5 +
>  sound/hda/ext/Makefile          |    3 +-
>  sound/hda/ext/hdac_codec.c      |  188 +++++
>  sound/hda/ext/hdac_codec.h      |   52 ++
>  sound/hda/local.h               |   13 +
>  sound/soc/codecs/Kconfig        |    5 +
>  sound/soc/codecs/Makefile       |    2 +
>  sound/soc/codecs/hdac_generic.c | 1561 +++++++++++++++++++++++++++++++++++++++
>  sound/soc/codecs/hdac_generic.h |   31 +
>  sound/soc/soc-core.c            |   35 +
>  sound/soc/soc-dapm.c            |   22 +
>  13 files changed, 1929 insertions(+), 1 deletion(-)
>  create mode 100644 sound/hda/ext/hdac_codec.c
>  create mode 100644 sound/hda/ext/hdac_codec.h
>  create mode 100644 sound/soc/codecs/hdac_generic.c
>  create mode 100644 sound/soc/codecs/hdac_generic.h
> 
> -- 
> 1.9.1
> 


More information about the Alsa-devel mailing list