Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Caleb Crome <caleb@crome.org>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Cc: "Liam Girdwood" <liam.r.girdwood@linux.intel.com>,
	"Lu, Han" <han.lu@intel.com>, "Takashi Iwai" <tiwai@suse.de>,
	"Benoît Thébaudeau" <benoit.thebaudeau.dev@gmail.com>
Subject: Re: ASoC: multicodec: No matching channels with system with DACs and ADCs on same bus
Date: Tue, 10 Nov 2015 19:30:08 +0100	[thread overview]
Message-ID: <564237B0.70906@metafoo.de> (raw)
In-Reply-To: <CAG5mAdzz0ZnXx_t3+G+f5FuaqfxmfRfBW6_r3vcX2Rybb3LuYg@mail.gmail.com>

On 11/10/2015 06:12 PM, Caleb Crome wrote:
> Hi again,
>   I have a system that has separate DACs and ADCs, as opposed to
> bidirectional CODECS.
> 
> The ADCs have a snd_soc_dai_driver structure that have a .capture
> field defined with a .rates parameter, and the DACs have a
> snd_soc_dai_driver structure that have a .playback field defined with
> a .rates parameter.
> 
> However, the ADCs have no .playback.rates, and the DACs have no
> .capture.rates. Even though the ADC can record at a given rate and the
> DAC can play at that same rate, the soc_pcm_init_runtime_hw function
> calculates the rates in this loop:
> 
> ------------------------------
>     /* first calculate min/max only for CODECs in the DAI link */
>     for (i = 0; i < rtd->num_codecs; i++) {
>         codec_dai_drv = rtd->codec_dais[i]->driver;
>         if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
>             codec_stream = &codec_dai_drv->playback;
>         else
>             codec_stream = &codec_dai_drv->capture;
>         chan_min = max(chan_min, codec_stream->channels_min);
>         chan_max = min(chan_max, codec_stream->channels_max);
>         rate_min = max(rate_min, codec_stream->rate_min);
>         rate_max = min_not_zero(rate_max, codec_stream->rate_max);
>         formats &= codec_stream->formats;
>         rates = snd_pcm_rate_mask_intersect(codec_stream->rates, rates);
>     }
> ------------------------------
> 
> which can't work out that one side is play only and the other is
> record only, yet they do in fact have matching rates.  So, I get a "no
> matching channels" error.
[...]

Try the latest asoc/for-next kernel. There is a patch[1] that addresses the
issue.

- Lars

[1]
http://git.kernel.org/cgit/linux/kernel/git/broonie/sound.git/commit/sound/soc/soc-pcm.c?h=for-next&id=cde79035c6cf578dd33dfea3e39666efc27cbcf2

  parent reply	other threads:[~2015-11-10 18:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-10 17:12 ASoC: multicodec: No matching channels with system with DACs and ADCs on same bus Caleb Crome
2015-11-10 17:57 ` Liam Girdwood
2015-11-10 18:30 ` Lars-Peter Clausen [this message]
2015-11-10 21:33   ` Caleb Crome
2015-11-11  7:38 ` Ricard Wanderlof
2015-11-11 20:15   ` Caleb Crome

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=564237B0.70906@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=benoit.thebaudeau.dev@gmail.com \
    --cc=caleb@crome.org \
    --cc=han.lu@intel.com \
    --cc=liam.r.girdwood@linux.intel.com \
    --cc=tiwai@suse.de \
    /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