mbox series

[v4,0/4] ASoC: SOF: Intel: power optimizations with HDaudio SPIB register

Message ID 20211119230852.206310-1-pierre-louis.bossart@linux.intel.com (mailing list archive)
Headers show
Series ASoC: SOF: Intel: power optimizations with HDaudio SPIB register | expand

Message

Pierre-Louis Bossart Nov. 19, 2021, 11:08 p.m. UTC
This patchset was initially provided in a larger series that was split
in two [1]. This part only provides support for the SPIB register
support, added on Intel platforms since Skylake (2015).

The use of the SPIB register helps reduce power consumption - though
to a smaller degree than DMI_L1. This hardware capability is however
incompatible with userspace-initiated rewinds typically used by
PulseAudio.

In the past (2015..2017) Intel suggested an API extension to let
applications disable rewinds. At the time the feedback was that such a
capability was too Intel-specific and SPIB remained unused except for
loading DSP code. We now see devices with smaller batteries being
released, and it's time to revisit Linux support for SPIB to extend
battery life.

In this update the rewinds are disabled via an opt-in kernel
parameter. In the previous reviews, there was consensus that a Kconfig
option was too complicated for distributions to set, and we are
missing a TBD API to expose such capabilities to user-space.

The debate on whether or not to use rewinds, and the impact of
disabling rewinds, will likely be closed when Intel releases the
'deep-buffer' support, currently under development [2][3]. With this
solution, rewinds will not be needed, ever. When an application deals
with content that is not latency-sensitive (e.g. music playback), it
will be able to reduce power consumption by selecting a different PCM
device with increased buffering capabilities.  Low-latency streams
will be handled by the 'regular' path. In other words, the impossible
compromise between power and latency will be handled with different
PCM devices/profiles for the same endpoint, and we can push the design
of capability negotiation to a later time when all the building blocks
(firmware topology, kernel, userspace) are ready - we still have
firmware xruns, DPCM race conditions to solve, and a need to describe
these alternate PCM devices with UCM using 'modifiers'.

[1] https://lore.kernel.org/alsa-devel/20210610205326.1176400-1-pierre-louis.bossart@linux.intel.com/
[2] https://github.com/thesofproject/linux/pull/3146
[3] https://github.com/thesofproject/sof/pull/4611

Changes since v3:
Added Takashi's Reviewed-by tags on patches 1 and 2
Used SYNC_APPLPTR instead of EXPLICIT_SYNC as suggested by Takashi
Added a missing .ack callback for IceLake

Changes since v2:
Added check on appl_ptr (Takashi)
Moved rewind detection to deal with SYNC_PTR (Takashi)

Pierre-Louis Bossart (2):
  ALSA: pcm: unconditionally check if appl_ptr is in 0..boundary range
  ALSA: pcm: introduce INFO_NO_REWINDS flag

Ranjani Sridharan (2):
  ASoC: SOF: pcm: add .ack callback support
  ASoC: SOF: Intel: add .ack support for HDaudio platforms

 include/uapi/sound/asound.h      |  2 +-
 sound/core/pcm_lib.c             | 17 +++++++++++++
 sound/soc/sof/intel/apl.c        |  1 +
 sound/soc/sof/intel/cnl.c        |  1 +
 sound/soc/sof/intel/hda-pcm.c    | 41 ++++++++++++++++++++++++++++++--
 sound/soc/sof/intel/hda-stream.c |  2 ++
 sound/soc/sof/intel/hda.h        |  1 +
 sound/soc/sof/intel/icl.c        |  1 +
 sound/soc/sof/intel/tgl.c        |  1 +
 sound/soc/sof/ops.h              | 10 ++++++++
 sound/soc/sof/pcm.c              |  9 +++++++
 sound/soc/sof/sof-priv.h         |  3 +++
 12 files changed, 86 insertions(+), 3 deletions(-)

Comments

Mark Brown Nov. 24, 2021, 5:36 p.m. UTC | #1
On Fri, 19 Nov 2021 17:08:48 -0600, Pierre-Louis Bossart wrote:
> This patchset was initially provided in a larger series that was split
> in two [1]. This part only provides support for the SPIB register
> support, added on Intel platforms since Skylake (2015).
> 
> The use of the SPIB register helps reduce power consumption - though
> to a smaller degree than DMI_L1. This hardware capability is however
> incompatible with userspace-initiated rewinds typically used by
> PulseAudio.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/4] ALSA: pcm: unconditionally check if appl_ptr is in 0..boundary range
      commit: 0e888a74e52db369e19aec908131cf171079b306
[2/4] ALSA: pcm: introduce INFO_NO_REWINDS flag
      commit: b456abe63f60ad93c83a526d33b71574bc32656c
[3/4] ASoC: SOF: pcm: add .ack callback support
      commit: 4a39ea3f07f14f21a6b97e78c972f71fc5761d3a
[4/4] ASoC: SOF: Intel: add .ack support for HDaudio platforms
      commit: 6c26b5054ce2b822856e32f1840d13f777c6f295

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark