Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c4a39fc authored by Ashish Jain's avatar Ashish Jain Committed by Gerrit - the friendly Code Review server
Browse files

ASoC: msm: Enable Media Format converter for all resampling usecases



With support of playback for native 384kHz, it is recommended to avoid
resampling in afe even for non fractional rates, hence enable media
format converter in all usecases whenever resampling is needed.

Change-Id: I94b9091b8349d6388fbe5c29eabe3666c86e5cce
Signed-off-by: default avatarAshish Jain <ashishj@codeaurora.org>
parent 46aa49c1
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -121,14 +121,14 @@ static int msm_routing_get_bit_width(unsigned int format)
	return bit_width;
}

static bool msm_is_fractional_resample_needed(int input_sr, int output_sr)
static bool msm_is_resample_needed(int input_sr, int output_sr)
{
	bool rc = false;

	if ((input_sr % output_sr != 0) && (output_sr % input_sr != 0))
	if (input_sr != output_sr)
		rc = true;

	pr_debug("performing fractional resample (%s) for copp rate (%d)afe rate (%d)",
	pr_debug("perform resampling (%s) for copp rate (%d)afe rate (%d)",
		(rc ? "oh yes" : "not really"),
		input_sr, output_sr);

@@ -901,7 +901,7 @@ int msm_pcm_routing_reg_phy_compr_stream(int fe_id, int perf_mode,
			set_bit(copp_idx,
				&session_copp_map[fe_id][session_type][i]);

			if (msm_is_fractional_resample_needed(
			if (msm_is_resample_needed(
				sample_rate,
				msm_bedais[i].sample_rate))
				adm_copp_mfc_cfg(
@@ -1057,7 +1057,7 @@ int msm_pcm_routing_reg_phy_stream(int fedai_id, int perf_mode,
			set_bit(copp_idx,
				&session_copp_map[fedai_id][session_type][i]);

			if (msm_is_fractional_resample_needed(
			if (msm_is_resample_needed(
				sample_rate,
				msm_bedais[i].sample_rate))
				adm_copp_mfc_cfg(
@@ -1284,7 +1284,7 @@ static void msm_pcm_routing_process_audio(u16 reg, u16 val, int set)
			set_bit(copp_idx,
				&session_copp_map[val][session_type][reg]);

			if (msm_is_fractional_resample_needed(
			if (msm_is_resample_needed(
				sample_rate,
				msm_bedais[reg].sample_rate))
				adm_copp_mfc_cfg(
@@ -10381,7 +10381,7 @@ static int msm_pcm_routing_prepare(struct snd_pcm_substream *substream)
			set_bit(copp_idx,
				&session_copp_map[i][session_type][be_id]);

			if (msm_is_fractional_resample_needed(
			if (msm_is_resample_needed(
				sample_rate,
				bedai->sample_rate))
				adm_copp_mfc_cfg(
+0 −2
Original line number Diff line number Diff line
@@ -2508,8 +2508,6 @@ void adm_copp_mfc_cfg(int port_id, int copp_idx, int dst_sample_rate)
	mfc_cfg.sampling_rate = dst_sample_rate;
	mfc_cfg.bits_per_sample =
		atomic_read(&this_adm.copp.bit_width[port_idx][copp_idx]);
	if (24 == mfc_cfg.bits_per_sample)
		mfc_cfg.bits_per_sample = 32;
	open.dev_num_channel = mfc_cfg.num_channels =
		atomic_read(&this_adm.copp.channels[port_idx][copp_idx]);