alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Katsuhiro Suzuki <katsuhiro@katsuster.net>
Cc: alsa-devel@alsa-project.org, Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel] [PATCH] SoC: simple-card-utils: set 0Hz to sysclk when shutdown
Date: 09 Sep 2019 09:31:28 +0900	[thread overview]
Message-ID: <87woei5mzj.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <20190907174501.19833-1-katsuhiro@katsuster.net>


Hi Katsuhiro

> This patch set 0Hz to sysclk when shutdown the card.
> 
> Some codecs set rate constraints that derives from sysclk. This
> mechanism works correctly if machine drivers give fixed frequency.
> 
> But simple-audio and audio-graph card set variable clock rate if
> 'mclk-fs' property exists. In this case, rate constraints will go
> bad scenario. For example a codec accepts three limited rates
> (mclk / 256, mclk / 384, mclk / 512).
> 
> Bad scenario as follows (mclk-fs = 256):
>    - Initialize sysclk by correct value (Ex. 12.288MHz)
>      - Codec set constraints of PCM rate by sysclk
>        48kHz (1/256), 32kHz (1/384), 24kHz (1/512)
>    - Play 48kHz sound, it's acceptable
>    - Sysclk is not changed
> 
>    - Play 32kHz sound, it's acceptable
>    - Set sysclk to 8.192MHz (= fs * mclk-fs = 32k * 256)
>      - Codec set constraints of PCM rate by sysclk
>        32kHz (1/256), 21.33kHz (1/384), 16kHz (1/512)
> 
>    - Play 48kHz again, but it's NOT acceptable because constraints
>      do not allow 48kHz
> 
> So codecs treat 0Hz sysclk as signal of applying no constraints to
> avoid this problem.
> 
> Signed-off-by: Katsuhiro Suzuki <katsuhiro@katsuster.net>
> ---

I'm not 100% understand your issue.
.hw_params (= set mclk/sysclk) is not called in bad case ??
Or it is called but Codec driver ignores it somehow ??

Thank you for your help !!
Best regards
---
Kuninori Morimoto
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  reply	other threads:[~2019-09-09  0:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-07 17:45 [alsa-devel] [PATCH] SoC: simple-card-utils: set 0Hz to sysclk when shutdown Katsuhiro Suzuki
2019-09-09  0:31 ` Kuninori Morimoto [this message]
2019-09-09  2:49   ` Katsuhiro Suzuki
2019-09-09  3:54     ` Kuninori Morimoto
2019-09-09 10:07 ` [alsa-devel] Applied "SoC: simple-card-utils: set 0Hz to sysclk when shutdown" to the asoc tree 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=87woei5mzj.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=katsuhiro@katsuster.net \
    --cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).