mbox series

[v2,0/2] ASoC: meson: aiu: two fixes (for 5.16)

Message ID 20211206210804.2512999-1-martin.blumenstingl@googlemail.com (mailing list archive)
Headers show
Series ASoC: meson: aiu: two fixes (for 5.16) | expand

Message

Martin Blumenstingl Dec. 6, 2021, 9:08 p.m. UTC
In this series I am proposing two fixes for the "aiu" driver, used on
Amlogic Meson8, Meson8b, Meson8m2, GXBB, GXL and GXM SoCs.

The first patch is the result of me trying to understand the way how
we get the DMA buffer and address for the audio data. I'm not an expert
in terms of DMA. From what I understand we need to inform DMA core
about the limitations of the hardware. In case of AIU it's DMA address
registers only take 32 bits, so DMA core should be aware of this.

The second patch is what I could come up with to fix the infamous I2S
buffer underrun issue, also called the "machine gun noise" (MGN) bug.
After a lot of testing, debugging and comparing vendor code with the
upstream "aiu" driver I have come up with this fix. I have written down
my thoughts in the description of that patch. To be clear: these are my
thoughts, unfortunately I have no way of proving this other than asking
other people to test this patch (off-list I have already received
positive feedback along with confirmation that both 2-ch and 6-ch audio
are still working fine. Even with Kodi's menu - which is an easy way to
reproduce the MGN bug - sound output is fine with this patch).

@Mark, @Liam: It would be great if at least the second patch could be
queued as a fix for "for-5.16" as this solves a long standing buffer
underrun.
This issue is nasty because it can occur at any time and it can even
loop forever. Christian provided an example with the speakers on low
volume: [1]. Imagine the same sound on "medium" volume after playing
a movie.


Changes since v1 at [0]:
- Dropped a paragraph about FIFO IRQs from the second patch because
  Jerome has a valid point that this behavior can either mean that
  AIU_I2S_MISC is related to the FIFO or the FIFO consumer (= encoder)
- Add a bit of documentation explaining why we set the
  AIU_I2S_MISC_FORCE_LEFT_RIGHT bit (affects patch #2)
- Collect Christian's and Geraldo's Tested-by as well as Jerome's
  Acked-by for patch #2 (thanks to all three of you!)
- Cc linux-stable for the second patch
- Dropped RFC prefix


[0] https://chewitt.libreelec.tv/testing/wp2_audio_noise.mov
[1] https://patchwork.kernel.org/project/linux-amlogic/cover/20211205180816.2083864-1-martin.blumenstingl@googlemail.com/


Martin Blumenstingl (2):
  ASoC: meson: aiu: fifo: Add missing dma_coerce_mask_and_coherent()
  ASoC: meson: aiu: Move AIU_I2S_MISC hold setting to aiu-fifo-i2s

 sound/soc/meson/aiu-encoder-i2s.c | 33 -------------------------------
 sound/soc/meson/aiu-fifo-i2s.c    | 19 ++++++++++++++++++
 sound/soc/meson/aiu-fifo.c        |  6 ++++++
 3 files changed, 25 insertions(+), 33 deletions(-)

Comments

Mark Brown Dec. 15, 2021, 6:14 p.m. UTC | #1
On Mon, 6 Dec 2021 22:08:02 +0100, Martin Blumenstingl wrote:
> In this series I am proposing two fixes for the "aiu" driver, used on
> Amlogic Meson8, Meson8b, Meson8m2, GXBB, GXL and GXM SoCs.
> 
> The first patch is the result of me trying to understand the way how
> we get the DMA buffer and address for the audio data. I'm not an expert
> in terms of DMA. From what I understand we need to inform DMA core
> about the limitations of the hardware. In case of AIU it's DMA address
> registers only take 32 bits, so DMA core should be aware of this.
> 
> [...]

Applied to

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

Thanks!

[1/2] ASoC: meson: aiu: fifo: Add missing dma_coerce_mask_and_coherent()
      commit: 1bcd326631dc4faa3322d60b4fc45e8b3747993e
[2/2] ASoC: meson: aiu: Move AIU_I2S_MISC hold setting to aiu-fifo-i2s
      commit: ee907afb0c39a41ee74b862882cfe12820c74b98

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