mbox series

[v4,0/9] adapt SOF to use snd-hda-codec-hdmi

Message ID 20190912142200.8031-1-kai.vehmanen@linux.intel.com (mailing list archive)
Headers show
Series adapt SOF to use snd-hda-codec-hdmi | expand

Message

Kai Vehmanen Sept. 12, 2019, 2:21 p.m. UTC
Hi all,

here's the 4th round for this series that adapts SOF to use
snd-hda-codec-hdmi (patch_hdmi.c) codec driver instead of hdac_hdmi
(soc/codecs/hdac_hdmi.c). The primary goal is to unify the HDMI codec
implementation between DSP and non-DSP HDA configurations, offer same
interface to user-space and reduce maintenance load for all.

v4 changes:
- Change order of patches to not break bisect (Pierre's feedback).
- Improve the explanation in commit message for
  mst_no_extra_pcms, patch 1. (Pierre's feedback).
- Fix errors in PCM constraints for HDMI (Pierre's feedback).
- Fix an issue on Ice Lake platforms (patch 3).

Feature and testing info:
 - Tested on multiple Intel platforms supported by SOF.
 - Tested with ALSA console tools as well as with Pulseaudio.
      - requires Pulseaudio 12.x or newer, see
        https://lists.freedesktop.org/archives/pulseaudio-discuss/2019-August/031358.html
 - HDMI, DP, DP-MST with multi-monitor use-scenarios work ok.
 - New feature for SOF: ELD /proc fs works just like in
   DSP-less mode.
 - New feature for SOF: jack detection works out-of-the-box
   with Pulseaudio (no need for card specific UCM for HDMI)

Kai Vehmanen (9):
  ALSA: hda/hdmi - implement mst_no_extra_pcms flag
  ASoC: hdac_hda: add support for HDMI/DP as a HDA codec
  ASoC: Intel: skl-hda-dsp-generic: use snd-hda-codec-hdmi
  ASoC: Intel: skl-hda-dsp-generic: fix include guard name
  ASoC: SOF: Intel: add support for snd-hda-codec-hdmi
  ASoC: Intel: bxt-da7219-max98357a: common hdmi codec support
  ASoC: Intel: glk_rt5682_max98357a: common hdmi codec support
  ASoC: intel: sof_rt5682: common hdmi codec support
  ASoC: Intel: bxt_rt298: common hdmi codec support

 include/sound/hda_codec.h                     |   1 +
 include/sound/soc-acpi.h                      |   2 +
 sound/pci/hda/patch_hdmi.c                    |  19 +++-
 sound/soc/codecs/hdac_hda.c                   | 100 +++++++++++++++---
 sound/soc/codecs/hdac_hda.h                   |  12 ++-
 sound/soc/intel/boards/bxt_da7219_max98357a.c |  11 ++
 sound/soc/intel/boards/bxt_rt298.c            |  11 ++
 sound/soc/intel/boards/glk_rt5682_max98357a.c |  11 ++
 sound/soc/intel/boards/hda_dsp_common.h       |  93 ++++++++++++++++
 sound/soc/intel/boards/skl_hda_dsp_common.c   |  10 +-
 sound/soc/intel/boards/skl_hda_dsp_common.h   |  27 ++++-
 sound/soc/intel/boards/skl_hda_dsp_generic.c  |   1 +
 sound/soc/intel/boards/sof_rt5682.c           |  11 ++
 sound/soc/sof/intel/Kconfig                   |  10 ++
 sound/soc/sof/intel/hda-codec.c               |  19 +++-
 sound/soc/sof/intel/hda.c                     |   6 ++
 sound/soc/sof/intel/hda.h                     |   6 +-
 17 files changed, 323 insertions(+), 27 deletions(-)
 create mode 100644 sound/soc/intel/boards/hda_dsp_common.h

Comments

Pierre-Louis Bossart Sept. 16, 2019, 3:59 p.m. UTC | #1
On 9/12/19 9:21 AM, Kai Vehmanen wrote:
> Hi all,
> 
> here's the 4th round for this series that adapts SOF to use
> snd-hda-codec-hdmi (patch_hdmi.c) codec driver instead of hdac_hdmi
> (soc/codecs/hdac_hdmi.c). The primary goal is to unify the HDMI codec
> implementation between DSP and non-DSP HDA configurations, offer same
> interface to user-space and reduce maintenance load for all.

The series looks good to me so

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

I would recommend that we have a matching change for the Skylake driver 
and validation that both SOF and cAVS/SST drivers can operate with this 
mode set. Our goal is still to have coexistence between the two drivers 
in a single build/distro, e.g. cAVS for SKL/KBL/APL and SOF for newer 
platforms. This can be done in a follow-up patch but it needs to be done 
before distros start selecting this common HDMI mode.

The other concern I have is that we have other changes coming for 
soc-acpi and machine drivers to deal with SoundWire, so it'd be nice to 
have the changes mirrored between Mark and Takashi trees e.g. with the 
merge of a fixed branch.

> 
> v4 changes:
> - Change order of patches to not break bisect (Pierre's feedback).
> - Improve the explanation in commit message for
>    mst_no_extra_pcms, patch 1. (Pierre's feedback).
> - Fix errors in PCM constraints for HDMI (Pierre's feedback).
> - Fix an issue on Ice Lake platforms (patch 3).
> 
> Feature and testing info:
>   - Tested on multiple Intel platforms supported by SOF.
>   - Tested with ALSA console tools as well as with Pulseaudio.
>        - requires Pulseaudio 12.x or newer, see
>          https://lists.freedesktop.org/archives/pulseaudio-discuss/2019-August/031358.html
>   - HDMI, DP, DP-MST with multi-monitor use-scenarios work ok.
>   - New feature for SOF: ELD /proc fs works just like in
>     DSP-less mode.
>   - New feature for SOF: jack detection works out-of-the-box
>     with Pulseaudio (no need for card specific UCM for HDMI)
> 
> Kai Vehmanen (9):
>    ALSA: hda/hdmi - implement mst_no_extra_pcms flag
>    ASoC: hdac_hda: add support for HDMI/DP as a HDA codec
>    ASoC: Intel: skl-hda-dsp-generic: use snd-hda-codec-hdmi
>    ASoC: Intel: skl-hda-dsp-generic: fix include guard name
>    ASoC: SOF: Intel: add support for snd-hda-codec-hdmi
>    ASoC: Intel: bxt-da7219-max98357a: common hdmi codec support
>    ASoC: Intel: glk_rt5682_max98357a: common hdmi codec support
>    ASoC: intel: sof_rt5682: common hdmi codec support
>    ASoC: Intel: bxt_rt298: common hdmi codec support
> 
>   include/sound/hda_codec.h                     |   1 +
>   include/sound/soc-acpi.h                      |   2 +
>   sound/pci/hda/patch_hdmi.c                    |  19 +++-
>   sound/soc/codecs/hdac_hda.c                   | 100 +++++++++++++++---
>   sound/soc/codecs/hdac_hda.h                   |  12 ++-
>   sound/soc/intel/boards/bxt_da7219_max98357a.c |  11 ++
>   sound/soc/intel/boards/bxt_rt298.c            |  11 ++
>   sound/soc/intel/boards/glk_rt5682_max98357a.c |  11 ++
>   sound/soc/intel/boards/hda_dsp_common.h       |  93 ++++++++++++++++
>   sound/soc/intel/boards/skl_hda_dsp_common.c   |  10 +-
>   sound/soc/intel/boards/skl_hda_dsp_common.h   |  27 ++++-
>   sound/soc/intel/boards/skl_hda_dsp_generic.c  |   1 +
>   sound/soc/intel/boards/sof_rt5682.c           |  11 ++
>   sound/soc/sof/intel/Kconfig                   |  10 ++
>   sound/soc/sof/intel/hda-codec.c               |  19 +++-
>   sound/soc/sof/intel/hda.c                     |   6 ++
>   sound/soc/sof/intel/hda.h                     |   6 +-
>   17 files changed, 323 insertions(+), 27 deletions(-)
>   create mode 100644 sound/soc/intel/boards/hda_dsp_common.h
>
Takashi Iwai Sept. 16, 2019, 7:36 p.m. UTC | #2
On Mon, 16 Sep 2019 17:59:06 +0200,
Pierre-Louis Bossart wrote:
> 
> On 9/12/19 9:21 AM, Kai Vehmanen wrote:
> > Hi all,
> >
> > here's the 4th round for this series that adapts SOF to use
> > snd-hda-codec-hdmi (patch_hdmi.c) codec driver instead of hdac_hdmi
> > (soc/codecs/hdac_hdmi.c). The primary goal is to unify the HDMI codec
> > implementation between DSP and non-DSP HDA configurations, offer same
> > interface to user-space and reduce maintenance load for all.
> 
> The series looks good to me so
> 
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> 
> I would recommend that we have a matching change for the Skylake
> driver and validation that both SOF and cAVS/SST drivers can operate
> with this mode set. Our goal is still to have coexistence between the
> two drivers in a single build/distro, e.g. cAVS for SKL/KBL/APL and
> SOF for newer platforms. This can be done in a follow-up patch but it
> needs to be done before distros start selecting this common HDMI mode.
> 
> The other concern I have is that we have other changes coming for
> soc-acpi and machine drivers to deal with SoundWire, so it'd be nice
> to have the changes mirrored between Mark and Takashi trees e.g. with
> the merge of a fixed branch.

In general it's already a bit too late to merge for 5.4, so the whole
series will be after that, at most, hence we still have enough time :)


Takashi
Pierre-Louis Bossart Sept. 16, 2019, 8:01 p.m. UTC | #3
On 9/16/19 2:36 PM, Takashi Iwai wrote:
> On Mon, 16 Sep 2019 17:59:06 +0200,
> Pierre-Louis Bossart wrote:
>>
>> On 9/12/19 9:21 AM, Kai Vehmanen wrote:
>>> Hi all,
>>>
>>> here's the 4th round for this series that adapts SOF to use
>>> snd-hda-codec-hdmi (patch_hdmi.c) codec driver instead of hdac_hdmi
>>> (soc/codecs/hdac_hdmi.c). The primary goal is to unify the HDMI codec
>>> implementation between DSP and non-DSP HDA configurations, offer same
>>> interface to user-space and reduce maintenance load for all.
>>
>> The series looks good to me so
>>
>> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
>>
>> I would recommend that we have a matching change for the Skylake
>> driver and validation that both SOF and cAVS/SST drivers can operate
>> with this mode set. Our goal is still to have coexistence between the
>> two drivers in a single build/distro, e.g. cAVS for SKL/KBL/APL and
>> SOF for newer platforms. This can be done in a follow-up patch but it
>> needs to be done before distros start selecting this common HDMI mode.
>>
>> The other concern I have is that we have other changes coming for
>> soc-acpi and machine drivers to deal with SoundWire, so it'd be nice
>> to have the changes mirrored between Mark and Takashi trees e.g. with
>> the merge of a fixed branch.
> 
> In general it's already a bit too late to merge for 5.4, so the whole
> series will be after that, at most, hence we still have enough time :)

yes indeed, this was just to let you know we'll need extra work to 
synchronize between you/Mark/Vinod, not to rush things through.
Kai Vehmanen Sept. 17, 2019, 11:32 a.m. UTC | #4
Hi,

On Mon, 16 Sep 2019, Pierre-Louis Bossart wrote:

> The series looks good to me so
> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

thank you Pierre and Takashi for the reviews!

> I would recommend that we have a matching change for the Skylake driver and
> validation that both SOF and cAVS/SST drivers can operate with this mode set.
> Our goal is still to have coexistence between the two drivers in a single
> build/distro, e.g. cAVS for SKL/KBL/APL and SOF for newer platforms. This can
> be done in a follow-up patch but it needs to be done before distros start
> selecting this common HDMI mode.

The current patchset actually does allow that. You can select the common 
HDMI codec in kernel config, build both SOF and SST drivers and based on
runtime selection of the platform, either SOF with patch_hdmi.c will be 
used or SST with hdac-hdmi. This is achieved by setting the 
common-hdmi-codec mach-params flag in sof/intel/hda.c, so with SST 
drivers, this will never be set.

To change SST to use patch_hdmi.c as well, is a bigger effort. There 
are more (and much older) platforms impacted by the alsa mixer name 
changes. I'm not sure whether this is worth the trouble. But open to 
ideas here.

Br, Kai
Kai Vehmanen Sept. 17, 2019, 2:32 p.m. UTC | #5
Hi,

On Mon, 16 Sep 2019, Takashi Iwai wrote:
> In general it's already a bit too late to merge for 5.4, so the whole
> series will be after that, at most, hence we still have enough time :)

actually, Takashi, please hold merging this series, for a few days at 
least. I got a report about a race between powering up display and the 
codec probe with this patchset, which I'm debugging now. I'll follow-up to 
this thread once I have rootcaused this.

Br, Kai
Pierre-Louis Bossart Sept. 17, 2019, 2:38 p.m. UTC | #6
On 9/17/19 6:32 AM, Kai Vehmanen wrote:
> Hi,
> 
> On Mon, 16 Sep 2019, Pierre-Louis Bossart wrote:
> 
>> The series looks good to me so
>> Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
> 
> thank you Pierre and Takashi for the reviews!
> 
>> I would recommend that we have a matching change for the Skylake driver and
>> validation that both SOF and cAVS/SST drivers can operate with this mode set.
>> Our goal is still to have coexistence between the two drivers in a single
>> build/distro, e.g. cAVS for SKL/KBL/APL and SOF for newer platforms. This can
>> be done in a follow-up patch but it needs to be done before distros start
>> selecting this common HDMI mode.
> 
> The current patchset actually does allow that. You can select the common
> HDMI codec in kernel config, build both SOF and SST drivers and based on
> runtime selection of the platform, either SOF with patch_hdmi.c will be
> used or SST with hdac-hdmi. This is achieved by setting the
> common-hdmi-codec mach-params flag in sof/intel/hda.c, so with SST
> drivers, this will never be set.
> 
> To change SST to use patch_hdmi.c as well, is a bigger effort. There
> are more (and much older) platforms impacted by the alsa mixer name
> changes. I'm not sure whether this is worth the trouble. But open to
> ideas here.

If the i915 interface was set in stone yes we could probably leave the 
Skylake driver alone. But there are changes from time to time and bug 
fixes that will require Intel to work on two parts of the tree, so 
really wondering if we shouldn't just move to this common mode across 
the board and remove hdac_hdmi.c. it doesn't need to be done at once but 
it's not that crazy to aim for the next kernel release.