Skip to content

Enhance HDA support in SOF #990

Closed
Closed

Description

@wenqingfu

This is a meta issue to track the task of overhauling what has been done in Intel legacy HDA driver and HDAC library, to make sure they are in the right place so that SOF driver can share.

FYI list: @plbossart @libinyang @zhuyingjiang

Current task list, in rough priority order:

  • move to common HDMI codec and remove use of HDAC-HDMI ( [enhancement] Use snd-hda-codec-hdmi for SOF HDMI/DP support #1123 )
  • remove unnecessary ifdefs, low hanging (ASoC: SOF: Intel: hda: refine resume with init chip #1020 and related)
    - remove any clearly duplicated code paths where same code is replicated for HDA and non-HDA
  • forced codec mask to driver probe (ASoC: SOF: Intel: add codec_mask module parameter #1551)
  • refine HDA codec read/write functions in SOF (refine the code of read/write HDA registers  #941)
  • remove duplicated code blocks to call HDAC -> replace with a single function
    - many occurrences, for example to clear a link DMA allocation
  • use SOF utilities for register polling in SOF HDA code
    - many occurrences of this
  • review all SKL quirks in azx_bus_init() and make sure they are implemented in SOF
  • add logic to program LCTL in case clocks are not set up -> moved to HDA: LCTL manual setup #2715
    - patch "ALSA: hda - set intel audio clock to a proper value" in DSP legacy driver
  • rework soc/intel/ to work without built-time conditional code for CONFIG_SND_SOC_SOF_HDA
    - big ticket item, needs design-work to figure out best approach forward
    - figure out a better way to separate cases where HDAC is used versus I2S codec cases
    - now the number of #ifdefs within function bodies is too high in sof/intel/hda*.c leading to hard-to-understand and maintain code
  • robustness improvements to handle HDA codec error at probe
    - in current driver, if e.g. HDMI probe fail, whole card registration fails
    - driver should be more robust, and a failure of one codec should not leave all audio functionality disabled
  • HDaudio: need to check if codec module is available (HDaudio: need to check if codec module is available #285)

Future items (bin list), not covered by this #990 :

  • "patch" parameter support -> moved to HDA: "patch" parameter support #2714
    - legacy driver allows to load custom initialization verbs from a file, this is not supported in SOF
  • HDA beep mode support, codec->beep_mode is always HDA_BEEP_MODE_OFF with SOF
  • revisit content and interface of hdac library
    - big ticket item, affects all users of hdac, so will need a lot of coordination
    - the sound/hda/ library is used by many entities now in ALSA, and different clients are using different subsets of the library, yet the in hdac library everything is in the same one interface (hdaudio.h and hdaudio_ext.h files)
    - maybe a non-issue in the end, but warrants a a closer look now with SOF merged
  • multiple external HDA codecs support in generic machine driver -> moved to HDA: multiple external codec support #2716
    - generic driver can handle multiple codecs on the bus

Activity

  1. self-assigned this
    on Jun 14, 2019
  2. kv2019i commented on Nov 4, 2019

    @kv2019i
    Collaborator

    #1123 implemented and marked closed in the list

  3. kv2019i commented on Nov 27, 2019

    @kv2019i
    Collaborator

    Forced codec mask to driver probe implemented via #1551

  4. kv2019i commented on Dec 11, 2019

    @kv2019i
    Collaborator

    Added new items for "multiple HDA codecs support to generic machine driver"

  5. kv2019i commented on Jan 15, 2020

    @kv2019i
    Collaborator

    Added task for @libinyang 's patch for LCTL programming. This is not currently done by SOF HDA code. Related upstream patch "ALSA: hda - set intel audio clock to a proper value"

  6. plbossart commented on May 27, 2020

    @plbossart
    Member

    @kv2019i is there anything left to do here?

  7. kv2019i commented on May 29, 2020

    @kv2019i
    Collaborator

    @plbossart wrote:

    @kv2019i is there anything left to do here?

    There are still tasks on the original list. I agree this is a bit of a neverending story. As I continue to learn more about HDA and all the implementation quirks, I keep also learning about gaps on the SOF side (like the generic codec support). With that, I think we have all the major gaps closed, but e.g. for reuse, there's still a lot to do.

    For my own bookkeeping, I'd like to keep this open.

  8. kv2019i commented on Jun 3, 2020

    @kv2019i
    Collaborator

    Support for HDA "model" parameter was recently added to SOF. This was clearly a very important feature to port over from legacy drive, so I did a review of snd-hda-intel and updated the todo-list with remaining missing options. The most useful options not available in SOF are "patch" and "beep-mode". Added to todo-list.

  9. plbossart commented on Jan 22, 2021

    @plbossart
    Member

    @kv2019i anything missing here or can we close and open newer bugs as needed?

  10. kv2019i commented on Jan 22, 2021

    @kv2019i
    Collaborator

    It's true @plbossart that progress on this has been slow for a long time now, and this has turned into a laundry list of TODO items in the SOF HDA code. So the question is whether we want to keep tickets like these open even if they can stay open potentially for many years. Some of the items are nice-to-have, but for instance "patch" support would enable new devices to use SOF. I don't really mind, I can keep the list in my private books as well and file the most notable items as separate and more well-defined tickets.

  11. plbossart commented on Jan 22, 2021

    @plbossart
    Member

    @kv2019i I would prefer keeping only issues whose status is clear and self-explanatory. When we have issues that have dragged on for more than one year, no one knows what's left to do.

    My recommendation is close and re-open with a subset that makes sense.

  12. kv2019i commented on Jan 26, 2021

    @kv2019i
    Collaborator

    @plbossart Ack, will do.

  13. kv2019i commented on Jan 26, 2021

    @kv2019i
    Collaborator

    New items:

    Rest of the todo items put on hold. Closing the item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions