mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
ASoC: Cold start latency reduction
This patch parallelizes FE (front end) and BE (back end) when playback/capture path is set up. FE's and BE's which can be parallelized should be indicated in corresponding machine file. All the operations can be started asynchronously provided the usecase supports asynchronous operation. Parallelizing reduces the startup latency as both FE and BE operations run in parallel. Change-Id: I17e7e1c3d406713cc728ec262cfe388f7251f7de Signed-off-by: Walter Yang <[email protected]> Signed-off-by: Fred Oh <[email protected]> Signed-off-by: Banajit Goswami <[email protected]> Signed-off-by: Meng Wang <[email protected]>
This commit is contained in:
parent
567264c6cb
commit
7e80535774
5 changed files with 432 additions and 2 deletions
|
|
@ -71,6 +71,9 @@ struct snd_compr_stream {
|
|||
bool metadata_set;
|
||||
bool next_track;
|
||||
void *private_data;
|
||||
#ifdef CONFIG_AUDIO_QGKI
|
||||
struct snd_soc_pcm_runtime *be;
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -14,6 +14,9 @@
|
|||
|
||||
struct snd_soc_pcm_runtime;
|
||||
|
||||
#ifdef CONFIG_AUDIO_QGKI
|
||||
#define DPCM_MAX_BE_USERS 8
|
||||
#endif
|
||||
/*
|
||||
* Types of runtime_update to perform. e.g. originated from FE PCM ops
|
||||
* or audio route changes triggered by muxes/mixers.
|
||||
|
|
@ -83,6 +86,9 @@ struct snd_soc_dpcm {
|
|||
#ifdef CONFIG_DEBUG_FS
|
||||
struct dentry *debugfs_state;
|
||||
#endif
|
||||
#ifdef CONFIG_AUDIO_QGKI
|
||||
int stream;
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -162,8 +168,17 @@ void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream);
|
|||
void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream);
|
||||
int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream);
|
||||
int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int tream);
|
||||
#ifdef CONFIG_AUDIO_QGKI
|
||||
int dpcm_fe_dai_hw_params_be(struct snd_soc_pcm_runtime *fe,
|
||||
struct snd_soc_pcm_runtime *be, struct snd_pcm_hw_params *hw_params,
|
||||
int stream);
|
||||
#endif
|
||||
int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, int cmd);
|
||||
int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream);
|
||||
#ifdef CONFIG_AUDIO_QGKI
|
||||
int dpcm_fe_dai_prepare_be(struct snd_soc_pcm_runtime *fe,
|
||||
struct snd_soc_pcm_runtime *be, int stream);
|
||||
#endif
|
||||
int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir,
|
||||
int event);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,9 @@
|
|||
#include <linux/kernel.h>
|
||||
#include <linux/regmap.h>
|
||||
#include <linux/log2.h>
|
||||
#ifdef CONFIG_AUDIO_QGKI
|
||||
#include <linux/async.h>
|
||||
#endif
|
||||
#include <sound/core.h>
|
||||
#include <sound/pcm.h>
|
||||
#include <sound/compress_driver.h>
|
||||
|
|
@ -765,6 +768,16 @@ struct snd_soc_dai_link_component {
|
|||
const char *dai_name;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_AUDIO_QGKI
|
||||
enum snd_soc_async_ops {
|
||||
ASYNC_DPCM_SND_SOC_OPEN = 1 << 0,
|
||||
ASYNC_DPCM_SND_SOC_CLOSE = 1 << 1,
|
||||
ASYNC_DPCM_SND_SOC_PREPARE = 1 << 2,
|
||||
ASYNC_DPCM_SND_SOC_HW_PARAMS = 1 << 3,
|
||||
ASYNC_DPCM_SND_SOC_FREE = 1 << 4,
|
||||
};
|
||||
#endif
|
||||
|
||||
struct snd_soc_dai_link {
|
||||
/* config - must be set by machine driver */
|
||||
const char *name; /* Codec name */
|
||||
|
|
@ -865,6 +878,11 @@ struct snd_soc_dai_link {
|
|||
|
||||
struct list_head list; /* DAI link list of the soc card */
|
||||
struct snd_soc_dobj dobj; /* For topology */
|
||||
|
||||
#ifdef CONFIG_AUDIO_QGKI
|
||||
/* this value determines what all ops can be started asynchronously */
|
||||
enum snd_soc_async_ops async_ops;
|
||||
#endif
|
||||
};
|
||||
#define for_each_link_codecs(link, i, codec) \
|
||||
for ((i) = 0; \
|
||||
|
|
@ -1147,7 +1165,10 @@ struct snd_soc_pcm_runtime {
|
|||
struct snd_soc_dpcm_runtime dpcm[2];
|
||||
|
||||
long pmdown_time;
|
||||
|
||||
#ifdef CONFIG_AUDIO_QGKI
|
||||
/* err in case of ops failed */
|
||||
int err_ops;
|
||||
#endif
|
||||
/* runtime devices */
|
||||
struct snd_pcm *pcm;
|
||||
struct snd_compr *compr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue