linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geraldo Nascimento <geraldogabriel@gmail.com>
To: Christian Hewitt <christianshewitt@gmail.com>
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	alsa-devel@alsa-project.org, linux-amlogic@lists.infradead.org,
	lgirdwood@gmail.com, LKML <linux-kernel@vger.kernel.org>,
	tiwai@suse.com, broonie@kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [RFC PATCH v1 0/1] ASoC: meson: aiu: HDMI codec control questions and issues
Date: Sun, 3 Oct 2021 17:34:48 -0300	[thread overview]
Message-ID: <YVoT6PELmVxDUaH5@geday> (raw)
In-Reply-To: <494D4A30-F230-4B64-AFA9-319FFC4C69DA@gmail.com>

On Sun, Oct 03, 2021 at 11:00:15AM +0400, Christian Hewitt wrote:
> 
> > On 3 Oct 2021, at 9:13 am, Geraldo Nascimento <geraldogabriel@gmail.com> wrote:
> > 
> > On Sun, Oct 03, 2021 at 01:43:12AM +0200, Martin Blumenstingl wrote:
> >> Hello Jerome et al.,
> >> 
> >> on Amlogic Meson SoCs which use the AIU audio controller we have the
> >> so-called "machine gun noise" (MGN) issue, reproducible for example in
> >> Kodi. So far nobody was able to identify the cause of this issue. My
> >> idea was to at least narrow down the issue so we can categorize it. For
> >> that I wanted to get the SPDIF output from AIU to the HDMI controller
> >> working.
> >> 
> > 
> > Hi, Martin,
> > 
> > The MGN issue surely must be that one when using ALSA directly
> > (no dmix, no JACK, no Pulseaudio, no Pipewire, no nothing) and
> > when the track changes or we pause it, when it resumes we get 
> > noise instead of sound, correct?
> > 
> > If so, thanks for trying to track this down!
> > 
> > I bring it up because Googling it seems to head straight to a
> > Neil Armstrong post to linux-amlogic about what works and what
> > doesn't on linux-meson currently, and only if you dig deeper
> > you find a couple of reports apparently by the same person
> > about the "machine gun noise" thing.
> > 
> > It doesn't sound like a machine gun noise to me :)
> > 
> > More like brown noise, but anyway what I'd like to note to
> > everyone involved is that this one is a major dealbreaker.
> > Unless using JACK, Pulseaudio, Pipewire (?) or at least dmix
> > audio will degrade at the second song or when the user first
> > pauses and then resumes a stream, completely ruining the
> > experience.
> 
> 
> I’m the origin of most reports that Google will eventually
> discover. I was told elsewhere that this is known as MGN so
> I’ve described it as such, but that could be wrong. For
> clarity this is the noise (triggered, and with AVR volume
> deliberately right down) followed by some navigation in the
> Kodi GUI to change output:
> 
> https://chewitt.libreelec.tv/testing/wp2_audio_noise.mov
> 

Hi, Christian,

Thanks for the video.

> In the LibreELEC images I work on where this occurs it’s not
> something I associate with play/pause (although I can’t
> definitively rule it out) or second or third songs
> (not something that happens that often or predictably) but
> more when there’s a hard transition like starting or
> stopping playback. I hit it most with simple scrolling around
> in the Kodi GUI, although that could be because (due to this issue)
> I limit media playback testing on AIU devices. It’s particularly
> simple to trigger from the Kodi Settings > System > Audio page,
> just scroll around it for 10-30 seconds, which is handy because
> the only way to stop the noise is switching audio source (from
> anything to anything) on the same page.
> 
> CH.
> 

I wasn't able to reproduce the bug by simply scrolling around. On
the other hand, once I flipped the Send Low Volume Noise switch
to off, all hell broke loose!

This is one show-stopper bug, and I empathize to how particularly
nasty this must be for a "Just enough Linux for Kodi" approach.

But I also see Jerome Brunet has already clarified the subject in
response to Martin Blumenstingl's original post.

Thank you,
Geraldo Nascimento


> >> On Amlogic Meson GXBB/GXL/GXM SoCs a DesignWare HDMI TX controller is
> >> used. This has an SPDIF input but there's currently not driver for it.
> >> On Meson8/8b/8m2 SoCs I am working on a HDMI driver for the TransSwitch
> >> HDMI controller which - just like DesignWare HDMI TX - supports SPDIF
> >> and I2S inputs.
> >> I decided to add SPDIF support to the latter since the code from the
> >> vendor driver is much easier.
> >> 
> >> It took me a while to figure out why I would not get any audio output
> >> from AIU SPDIF to the HDMI controller - or from there to the sink.
> >> The "fix" for this issue is the RFC patch which is part of this series.
> >> Any feedback would be great as I am still new to the ASoC subsystem.
> >> 
> >> Another part I am still struggling with is the audio "routing" (due to
> >> lack of a better term - please correct me if this is not the right word
> >> to use for this case). I have the following description in my .dts:
> >> 	sound {
> >> 		compatible = "amlogic,gx-sound-card";
> >> 		model = "M8B-ODROID-C1";
> >> 
> >> 		assigned-clocks = <&clkc CLKID_MPLL0>,
> >> 				  <&clkc CLKID_MPLL1>;
> >> 		assigned-clock-rates = <294912000>,
> >> 				       <270950400>;
> >> 		dai-link-0 {
> >> 			sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
> >> 		};
> >> 
> >> 		dai-link-1 {
> >> 			sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>;
> >> 		};
> >> 
> >> 		dai-link-2 {
> >> 			sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
> >> 			dai-format = "i2s";
> >> 			mclk-fs = <256>;
> >> 
> >> 			codec-0 {
> >> 				sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
> >> 			};
> >> 		};
> >> 
> >> 		dai-link-3 {
> >> 			sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>;
> >> 
> >> 			codec-0 {
> >> 				sound-dai = <&aiu AIU_HDMI CTRL_PCM>;
> >> 			};
> >> 		};
> >> 
> >> 		dai-link-4 {
> >> 			sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
> >> 
> >> 			codec-0 {
> >> 				sound-dai = <&hdmi_tx>;
> >> 			};
> >> 		};
> >> 	};
> >> The driver for &hdmi_tx defines:
> >> 	struct hdmi_codec_pdata pdata = {
> >> 		.ops			= &txc_48352_hdmi_codec_ops,
> >> 		.i2s			= 1,
> >> 		.spdif			= 1,
> >> 		.max_i2s_channels	= 8,
> >> 		.data			= priv,
> >> 	};
> >> In hdmi_codec_ops.hw_params I always get fmt->fmt HDMI_I2S unless I
> >> remove all I2S references from the .dts snipped above (only then
> >> HDMI_SPDIF is detected). Based on the selection of the "HDMI Source"
> >> enum in aiu-codec-ctrl I was expecting the format to update as well.
> >> That unfortunately doesn't happen and I don't know how that can be
> >> achieved.
> >> 
> > 
> > Hm, that sounds weird. I hope you get the answers you are looking for.
> > 
> > Thanks,
> > Geraldo Nascimento
> > 
> >> 
> >> Best regards,
> >> Martin
> >> 
> >> 
> >> Martin Blumenstingl (1):
> >>  ASoC: meson: aiu: Fix HDMI codec control selection
> >> 
> >> sound/soc/meson/aiu-codec-ctrl.c  | 108 ++++++++++++++++++++++--------
> >> sound/soc/meson/aiu-encoder-i2s.c |   6 --
> >> 2 files changed, 80 insertions(+), 34 deletions(-)
> >> 
> >> -- 
> >> 2.33.0
> >> 
> > 
> 

  reply	other threads:[~2021-10-03 20:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-02 23:43 [RFC PATCH v1 0/1] ASoC: meson: aiu: HDMI codec control questions and issues Martin Blumenstingl
2021-10-02 23:43 ` [RFC PATCH v1 1/1] ASoC: meson: aiu: Fix HDMI codec control selection Martin Blumenstingl
2021-10-03  5:13 ` [RFC PATCH v1 0/1] ASoC: meson: aiu: HDMI codec control questions and issues Geraldo Nascimento
2021-10-03  7:00   ` Christian Hewitt
2021-10-03 20:34     ` Geraldo Nascimento [this message]
2021-10-04 11:18     ` Mark Brown
2021-10-03 15:57 ` Jerome Brunet
2021-10-03 19:17   ` Martin Blumenstingl
2021-10-03 19:20     ` Martin Blumenstingl
2021-10-04  8:13     ` Jerome Brunet
2021-10-04 21:17       ` Martin Blumenstingl
2021-10-05 21:31         ` Martin Blumenstingl
2021-10-04 12:23     ` Mark Brown
2021-10-03 23:11   ` Geraldo Nascimento

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YVoT6PELmVxDUaH5@geday \
    --to=geraldogabriel@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=christianshewitt@gmail.com \
    --cc=jbrunet@baylibre.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).