All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: Intel: KMB: Fix random noise at the HDMI output
@ 2021-04-21  0:55 Sia Jee Heng
  2021-04-21 19:03 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Sia Jee Heng @ 2021-04-21  0:55 UTC (permalink / raw)
  To: alsa-devel; +Cc: broonie, tiwai, jee.heng.sia, pierre-louis.bossart

Random noise could be heard when playing audio to the HDMI output.
This is due to the IEC conversion is invoked in the external loop.
As a result, this additional loop takes up a lot of the processing
cycle.

hdmi_reformat_iec958() process the conversion using an internal loop,
it is safe to move it out from the external loop to avoid unnecessary
processing cycle been spent. Furthermore, ALSA IEC958 plugin works in
32bit format only.

Signed-off-by: Sia Jee Heng <jee.heng.sia@intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/intel/keembay/kmb_platform.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/keembay/kmb_platform.c b/sound/soc/intel/keembay/kmb_platform.c
index 0fd1e8f62c89..96741c7c0fba 100644
--- a/sound/soc/intel/keembay/kmb_platform.c
+++ b/sound/soc/intel/keembay/kmb_platform.c
@@ -105,14 +105,15 @@ static unsigned int kmb_pcm_tx_fn(struct kmb_i2s_info *kmb_i2s,
 	void *buf = runtime->dma_area;
 	int i;
 
+	if (kmb_i2s->iec958_fmt)
+		hdmi_reformat_iec958(runtime, kmb_i2s, tx_ptr);
+
 	/* KMB i2s uses two separate L/R FIFO */
 	for (i = 0; i < kmb_i2s->fifo_th; i++) {
 		if (kmb_i2s->config.data_width == 16) {
 			writel(((u16(*)[2])buf)[tx_ptr][0], i2s_base + LRBR_LTHR(0));
 			writel(((u16(*)[2])buf)[tx_ptr][1], i2s_base + RRBR_RTHR(0));
 		} else {
-			if (kmb_i2s->iec958_fmt)
-				hdmi_reformat_iec958(runtime, kmb_i2s, tx_ptr);
 			writel(((u32(*)[2])buf)[tx_ptr][0], i2s_base + LRBR_LTHR(0));
 			writel(((u32(*)[2])buf)[tx_ptr][1], i2s_base + RRBR_RTHR(0));
 		}

base-commit: bf05bf16c76bb44ab5156223e1e58e26dfe30a88
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: Intel: KMB: Fix random noise at the HDMI output
  2021-04-21  0:55 [PATCH] ASoC: Intel: KMB: Fix random noise at the HDMI output Sia Jee Heng
@ 2021-04-21 19:03 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2021-04-21 19:03 UTC (permalink / raw)
  To: alsa-devel, Sia Jee Heng; +Cc: Mark Brown, tiwai, pierre-louis.bossart

On Wed, 21 Apr 2021 08:55:46 +0800, Sia Jee Heng wrote:
> Random noise could be heard when playing audio to the HDMI output.
> This is due to the IEC conversion is invoked in the external loop.
> As a result, this additional loop takes up a lot of the processing
> cycle.
> 
> hdmi_reformat_iec958() process the conversion using an internal loop,
> it is safe to move it out from the external loop to avoid unnecessary
> processing cycle been spent. Furthermore, ALSA IEC958 plugin works in
> 32bit format only.

Applied to

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

Thanks!

[1/1] ASoC: Intel: KMB: Fix random noise at the HDMI output
      commit: 62bad12bceebd7d336ced4e44f408b702c151ba0

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-21 19:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21  0:55 [PATCH] ASoC: Intel: KMB: Fix random noise at the HDMI output Sia Jee Heng
2021-04-21 19:03 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.