From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: Jaroslav Kysela <perex@perex.cz>,
Ricard Wanderlof <ricardw@axis.com>,
alsa-devel <alsa-devel@alsa-project.org>
Subject: Re: Keeping the codec running at all times
Date: Wed, 6 May 2020 11:12:20 -0500 [thread overview]
Message-ID: <73594637-b978-aca8-e81e-be72a5075ae8@linux.intel.com> (raw)
In-Reply-To: <7a54134e-ce30-d7d5-bcf3-31269f1103f1@perex.cz>
>> In certain system-on-chip systems, with separate ADCs and DACs for
>> instance, the ADC could generate clocks for the DAC, where it not for the
>> fact that ALSA shuts down whatever device is not being used in order to
>> conserve power. Is it possible to instruct ALSA not to do this, i.e. once
>> a codec has been configured to operate at a given sample rate, it will
>> continue to do so, even after all streams have stopped.
>>
>> I suppose one way to do this would be to change the codec
>> set_bias_level()
>> callback so that the BIAS_OFF and BIAS_STANDBY cases don't do anything
>> but
>> leave the codec running. But it doesn't sound like a clean way of doing
>> this.
>>
>> Of course, one complication is that at system startup, before any capture
>> or playback operations have been attempted, ALSA doesn't know which
>> sample
>> rate should be configured, as there is no concept of a 'default sample
>> rate'; the sample rate is always set when a stream is opened.
>
> The driver may limit the available rates (thus it may be possible to set
> the one accepted rate via the module parameter or so which may be used
> for the codec initialization before an application uses the PCM device).
It's a valid request, some platforms want to avoid any glitches due to
clocks and require that they remain active, even if it means writing-off
power optimizations.
If your codec exposes a clock object then you could have e.g. a board or
machine driver configure the clock
(clk_get/clk_set_rate/clk_prepare_enable) and leave it on regardless of
the streaming usages. You would still need to make sure that the clock
rates are compatible with the hw_params when streaming does happen.
that's what e.g. was done for Intel to make sure the MCLK, BCLK and
FSYNC could be enabled even when the DSP was idle.
next prev parent reply other threads:[~2020-05-06 16:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 15:15 Keeping the codec running at all times Ricard Wanderlof
2020-05-06 15:40 ` Jaroslav Kysela
2020-05-06 16:12 ` Pierre-Louis Bossart [this message]
2020-05-07 16:28 ` Ricard Wanderlof
2020-05-07 16:35 ` Pierre-Louis Bossart
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=73594637-b978-aca8-e81e-be72a5075ae8@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=perex@perex.cz \
--cc=ricardw@axis.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 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.