Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Jurgen Lambrecht <J.Lambrecht@televic.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Subject: Re: why error return in sound/soc/codecs/pcm3168a.c::pcm3168a_set_dai_fmt ?
Date: Mon, 1 Jul 2019 15:06:09 +0200	[thread overview]
Message-ID: <20190701130609.GB3692@piout.net> (raw)
In-Reply-To: <8e4d6674-0a5b-7063-534d-cea4e55056d5@televic.com>

Hello,

On 04/06/2019 06:37:48+0000, Jurgen Lambrecht wrote:
> Hi,
> 
> When following 
> https://bootlin.com/blog/eight-channels-audio-on-i-mx7-with-pcm3168/ I 
> get this error (from soc_core.c):
> 
> ... kernel: [    3.059634][   T15] pcm3168a 3-0039: ASoC: Failed to set 
> DAI format: -22
> 
> I could propose this patch (I get that printf when applying the patch)
> (all other errors in that file have a printf):
> 
> diff --git a/sound/soc/codecs/pcm3168a.c b/sound/soc/codecs/pcm3168a.c
> index 08d3fe192e65..75ccbb919902 100644
> --- a/sound/soc/codecs/pcm3168a.c
> +++ b/sound/soc/codecs/pcm3168a.c
> @@ -353,6 +353,7 @@ static int pcm3168a_set_dai_fmt(struct snd_soc_dai *dai,
>          case SND_SOC_DAIFMT_NB_NF:
>                  break;
>          default:
> +               dev_err(component->dev, "wrong INV_MASK\n");
>                  return -EINVAL;
>          }
> 
> But why does this code returns an error for code that has no effect?
> OK, it could be because SND_SOC_DAIFMT_INV_MASK must be 
> SND_SOC_DAIFMT_NB_NF. But then Alexandre's blog contains an error, 
> because the dac TDM sets frame-inversion in its dts (and it should not).
> 

While I'm pretty sure what is in the blog is working (it is deployed in
production), I remember there was something fishy with frame-inversion.
I unfortunately don't remember the specifics.

Honestly, I would think you can remove frame-inversion safely as the
codec is only supposed to support NB_NF.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      reply	other threads:[~2019-07-01 13:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-04  6:37 why error return in sound/soc/codecs/pcm3168a.c::pcm3168a_set_dai_fmt ? Jurgen Lambrecht
2019-07-01 13:06 ` Alexandre Belloni [this message]

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=20190701130609.GB3692@piout.net \
    --to=alexandre.belloni@bootlin.com \
    --cc=J.Lambrecht@televic.com \
    --cc=alsa-devel@alsa-project.org \
    /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