|
@@ -978,6 +978,7 @@ static int msm_compr_send_media_format_block(struct snd_compr_stream *cstream,
|
|
|
struct asm_ape_cfg ape_cfg;
|
|
|
struct asm_dsd_cfg dsd_cfg;
|
|
|
struct aptx_dec_bt_addr_cfg aptx_cfg;
|
|
|
+ struct asm_amrwbplus_cfg amrwbplus_cfg;
|
|
|
union snd_codec_options *codec_options;
|
|
|
|
|
|
int ret = 0;
|
|
@@ -1266,6 +1267,26 @@ static int msm_compr_send_media_format_block(struct snd_compr_stream *cstream,
|
|
|
__func__, ret);
|
|
|
}
|
|
|
break;
|
|
|
+ case FORMAT_AMRNB:
|
|
|
+ pr_debug("SND_AUDIOCODEC_AMR\n");
|
|
|
+ /* no media format block needed */
|
|
|
+ break;
|
|
|
+ case FORMAT_AMRWB:
|
|
|
+ pr_debug("SND_AUDIOCODEC_AMRWB\n");
|
|
|
+ /* no media format block needed */
|
|
|
+ break;
|
|
|
+ case FORMAT_AMR_WB_PLUS:
|
|
|
+ pr_debug("SND_AUDIOCODEC_AMRWBPLUS\n");
|
|
|
+ memset(&amrwbplus_cfg, 0x0, sizeof(struct asm_amrwbplus_cfg));
|
|
|
+ amrwbplus_cfg.amr_frame_fmt =
|
|
|
+ codec_options->amrwbplus.bit_stream_fmt;
|
|
|
+ ret = q6asm_media_format_block_amrwbplus(
|
|
|
+ prtd->audio_client,
|
|
|
+ &amrwbplus_cfg);
|
|
|
+ if (ret < 0)
|
|
|
+ pr_err("%s: CMD AMRWBPLUS Format block failed ret %d\n",
|
|
|
+ __func__, ret);
|
|
|
+ break;
|
|
|
default:
|
|
|
pr_debug("%s, unsupported format, skip", __func__);
|
|
|
break;
|
|
@@ -2193,6 +2214,24 @@ static int msm_compr_set_params(struct snd_compr_stream *cstream,
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
+ case SND_AUDIOCODEC_AMR: {
|
|
|
+ pr_debug("%s:SND_AUDIOCODEC_AMR\n", __func__);
|
|
|
+ prtd->codec = FORMAT_AMRNB;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ case SND_AUDIOCODEC_AMRWB: {
|
|
|
+ pr_debug("%s:SND_AUDIOCODEC_AMRWB\n", __func__);
|
|
|
+ prtd->codec = FORMAT_AMRWB;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ case SND_AUDIOCODEC_AMRWBPLUS: {
|
|
|
+ pr_debug("%s:SND_AUDIOCODEC_AMRWBPLUS\n", __func__);
|
|
|
+ prtd->codec = FORMAT_AMR_WB_PLUS;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
default:
|
|
|
pr_err("codec not supported, id =%d\n", params->codec.id);
|
|
|
return -EINVAL;
|
|
@@ -3267,6 +3306,9 @@ static int msm_compr_set_next_track_param(struct snd_compr_stream *cstream,
|
|
|
case FORMAT_VORBIS:
|
|
|
case FORMAT_ALAC:
|
|
|
case FORMAT_APE:
|
|
|
+ case FORMAT_AMRNB:
|
|
|
+ case FORMAT_AMRWB:
|
|
|
+ case FORMAT_AMR_WB_PLUS:
|
|
|
memcpy(&(prtd->gapless_state.codec_options),
|
|
|
codec_options,
|
|
|
sizeof(union snd_codec_options));
|
|
@@ -3641,6 +3683,9 @@ static int msm_compr_dec_params_put(struct snd_kcontrol *kcontrol,
|
|
|
case FORMAT_TRUEHD:
|
|
|
case FORMAT_IEC61937:
|
|
|
case FORMAT_APTX:
|
|
|
+ case FORMAT_AMRNB:
|
|
|
+ case FORMAT_AMRWB:
|
|
|
+ case FORMAT_AMR_WB_PLUS:
|
|
|
pr_debug("%s: no runtime parameters for codec: %d\n", __func__,
|
|
|
prtd->codec);
|
|
|
break;
|