All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jean-Francois Moine <moinejf@free.fr>
To: Takashi Iwai <tiwai@suse.de>, Jassi Brar <jassi.brar@samsung.com>
Cc: alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	Jason Cooper <jason@lakedaemon.net>
Subject: Re: KNOT / CONTINUOUS (was: [PATCH] ASoC: kirkwood: Fix invalid SPDIF format)
Date: Tue, 26 Nov 2013 20:09:16 +0100	[thread overview]
Message-ID: <20131126200916.47a45929@armhf> (raw)
In-Reply-To: <s5h8uwba2gv.wl%tiwai@suse.de>

On Tue, 26 Nov 2013 11:20:48 +0100
Takashi Iwai <tiwai@suse.de> wrote:

> Not against the patch itself, but just found looking through it:
> 
> > @@ -493,7 +497,7 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = {
> >  		.rates = SNDRV_PCM_RATE_8000_192000 |
> >  			 SNDRV_PCM_RATE_CONTINUOUS |
> >  			 SNDRV_PCM_RATE_KNOT,
> 
> Setting both CONTINUOUS and KNOT doesn't make sense.

Hi Takashi,

I understand 'continuous', but I could not find any clear definition of
'knot'. May you explain what is its purpose?

BTW, if you may help me, while looking for SNDRV_PCM_RATE_KNOT,
I found this sequence in soc-pcm.c:

	if (codec_stream->rates
		& (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
		hw->rates |= cpu_stream->rates;
	if (cpu_stream->rates
		& (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
		hw->rates |= codec_stream->rates;

and it seems related to the problem I have:

- the cpu dai (kirkwood i2s) may generate any continuous rate
  8000..192000 as shown in the patch.

- the HDMI transmitter (tda998x) accepts either i2s or s/pdif audio
  input at any continuous rate, but when getting audio from s/pdif, the
  lowest rate is 22.06kHz.

In the associated codec, if I define:

	.rates = SNDRV_PCM_RATE_22050 |
		SNDRV_PCM_RATE_32000 |
		...
		SNDRV_PCM_RATE_192000 |
		SNDRV_PCM_RATE_CONTINUOUS,

audio works fine with streams at 33.075kHz (the kirkwood clock is
exactly 33.075kHz). But when I want a stream at 7850Hz, the kirkwood
i2s driver gets a clock at 8000Hz and the tda998x cannot do audio
output.

Otherwise, removing SNDRV_PCM_RATE_CONTINUOUS in the codec, I can hear
the 7850Hz stream which is converted to 22.05 kHz by vlc, but when I
want a stream at 33.075kHz, vlc converts it to 32kHz.

So, with the commit d9ad6296ec3b4a55b "ASoC: PCM_RATE: Check for KNOT
and CONTINUOUS flags", I cannot get the exact clock I want.

Do you know the reason of this patch, and, if it must stay, is there
any possible bypass?

Thanks.

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

WARNING: multiple messages have this Message-ID (diff)
From: moinejf@free.fr (Jean-Francois Moine)
To: linux-arm-kernel@lists.infradead.org
Subject: KNOT / CONTINUOUS (was: [PATCH] ASoC: kirkwood: Fix invalid SPDIF format)
Date: Tue, 26 Nov 2013 20:09:16 +0100	[thread overview]
Message-ID: <20131126200916.47a45929@armhf> (raw)
In-Reply-To: <s5h8uwba2gv.wl%tiwai@suse.de>

On Tue, 26 Nov 2013 11:20:48 +0100
Takashi Iwai <tiwai@suse.de> wrote:

> Not against the patch itself, but just found looking through it:
> 
> > @@ -493,7 +497,7 @@ static struct snd_soc_dai_driver kirkwood_i2s_dai_extclk[2] = {
> >  		.rates = SNDRV_PCM_RATE_8000_192000 |
> >  			 SNDRV_PCM_RATE_CONTINUOUS |
> >  			 SNDRV_PCM_RATE_KNOT,
> 
> Setting both CONTINUOUS and KNOT doesn't make sense.

Hi Takashi,

I understand 'continuous', but I could not find any clear definition of
'knot'. May you explain what is its purpose?

BTW, if you may help me, while looking for SNDRV_PCM_RATE_KNOT,
I found this sequence in soc-pcm.c:

	if (codec_stream->rates
		& (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
		hw->rates |= cpu_stream->rates;
	if (cpu_stream->rates
		& (SNDRV_PCM_RATE_KNOT | SNDRV_PCM_RATE_CONTINUOUS))
		hw->rates |= codec_stream->rates;

and it seems related to the problem I have:

- the cpu dai (kirkwood i2s) may generate any continuous rate
  8000..192000 as shown in the patch.

- the HDMI transmitter (tda998x) accepts either i2s or s/pdif audio
  input at any continuous rate, but when getting audio from s/pdif, the
  lowest rate is 22.06kHz.

In the associated codec, if I define:

	.rates = SNDRV_PCM_RATE_22050 |
		SNDRV_PCM_RATE_32000 |
		...
		SNDRV_PCM_RATE_192000 |
		SNDRV_PCM_RATE_CONTINUOUS,

audio works fine with streams at 33.075kHz (the kirkwood clock is
exactly 33.075kHz). But when I want a stream at 7850Hz, the kirkwood
i2s driver gets a clock at 8000Hz and the tda998x cannot do audio
output.

Otherwise, removing SNDRV_PCM_RATE_CONTINUOUS in the codec, I can hear
the 7850Hz stream which is converted to 22.05 kHz by vlc, but when I
want a stream at 33.075kHz, vlc converts it to 32kHz.

So, with the commit d9ad6296ec3b4a55b "ASoC: PCM_RATE: Check for KNOT
and CONTINUOUS flags", I cannot get the exact clock I want.

Do you know the reason of this patch, and, if it must stay, is there
any possible bypass?

Thanks.

-- 
Ken ar c'henta?	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

  reply	other threads:[~2013-11-26 19:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26  9:41 [PATCH] ASoC: kirkwood: Fix invalid SPDIF format Jean-Francois Moine
2013-11-26  9:41 ` Jean-Francois Moine
2013-11-26 10:20 ` Takashi Iwai
2013-11-26 10:20   ` [alsa-devel] " Takashi Iwai
2013-11-26 19:09   ` Jean-Francois Moine [this message]
2013-11-26 19:09     ` KNOT / CONTINUOUS (was: [PATCH] ASoC: kirkwood: Fix invalid SPDIF format) Jean-Francois Moine
2013-11-26 19:32     ` Russell King - ARM Linux
2013-11-26 19:32       ` Russell King - ARM Linux
2013-11-26 19:37     ` KNOT / CONTINUOUS Lars-Peter Clausen
2013-11-26 19:37       ` [alsa-devel] " Lars-Peter Clausen
2013-11-26 20:27       ` Lars-Peter Clausen
2013-11-26 20:27         ` [alsa-devel] " Lars-Peter Clausen
2013-11-27  7:16       ` Takashi Iwai
2013-11-27  7:16         ` [alsa-devel] " Takashi Iwai
2013-11-27 16:48 ` [PATCH] ASoC: kirkwood: Fix invalid SPDIF format Mark Brown
2013-11-27 16:48   ` Mark Brown

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=20131126200916.47a45929@armhf \
    --to=moinejf@free.fr \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=jason@lakedaemon.net \
    --cc=jassi.brar@samsung.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --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 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.