Browse Source

asoc: Stream_open issue fix for gapless playback

msm_compr_trigger for next track is updated with
q6asm_stream_open_write_v5 depending on the
avcs_api_version.

Change-Id: I6b3862a7b8e0480fffdcddc2ff0949cf5399d7a6

Signed-off-by: Nidhisha Dhananjayan <[email protected]>
Nidhisha Dhananjayan 6 years ago
parent
commit
d84669e428
1 changed files with 12 additions and 3 deletions
  1. 12 3
      asoc/msm-compress-q6-v2.c

+ 12 - 3
asoc/msm-compress-q6-v2.c

@@ -2687,13 +2687,22 @@ static int msm_compr_trigger(struct snd_compr_stream *cstream, int cmd)
 
 		pr_debug("%s: open_write stream_id %d bits_per_sample %d",
 				__func__, stream_id, bits_per_sample);
-		rc = q6asm_stream_open_write_v4(prtd->audio_client,
+
+		if (q6core_get_avcs_api_version_per_service(
+					APRV2_IDS_SERVICE_ID_ADSP_ASM_V) >=
+					ADSP_ASM_API_VERSION_V2)
+			rc = q6asm_stream_open_write_v5(prtd->audio_client,
+				prtd->codec, bits_per_sample,
+				stream_id,
+				prtd->gapless_state.use_dsp_gapless_mode);
+		else
+			rc = q6asm_stream_open_write_v4(prtd->audio_client,
 				prtd->codec, bits_per_sample,
 				stream_id,
 				prtd->gapless_state.use_dsp_gapless_mode);
 		if (rc < 0) {
-			pr_err("%s: Session out open failed for gapless\n",
-				 __func__);
+			pr_err("%s: Session out open failed for gapless [%d]\n",
+				__func__, rc);
 			break;
 		}