diff --git a/hal/audio_extn/audio_defs.h b/hal/audio_extn/audio_defs.h
index 0e1848e..a0b1949 100644
--- a/hal/audio_extn/audio_defs.h
+++ b/hal/audio_extn/audio_defs.h
@@ -306,4 +306,12 @@
     AUDIO_EXTN_PARAM_LICENSE_PARAMS,
 } audio_extn_param_id;
 
+typedef union {
+    struct audio_out_render_window_param render_window_params;
+} audio_extn_loopback_param_payload;
+
+typedef enum {
+    AUDIO_EXTN_PARAM_LOOPBACK_RENDER_WINDOW /* PARAM to set render window */
+} audio_extn_loopback_param_id;
+
 #endif /* AUDIO_DEFS_H */
diff --git a/hal/audio_extn/audio_extn.c b/hal/audio_extn/audio_extn.c
index c6c0924..3eee428 100755
--- a/hal/audio_extn/audio_extn.c
+++ b/hal/audio_extn/audio_extn.c
@@ -1478,6 +1478,33 @@
     return ret;
 }
 
+#ifdef AUDIO_HW_LOOPBACK_ENABLED
+int audio_extn_hw_loopback_set_param_data(audio_patch_handle_t handle,
+                                          audio_extn_loopback_param_id param_id,
+                                          audio_extn_loopback_param_payload *payload) {
+    int ret = -EINVAL;
+
+    if (!payload) {
+        ALOGE("%s:: Invalid Param",__func__);
+        return ret;
+    }
+
+    ALOGD("%d: %s: param id is %d\n", __LINE__, __func__, param_id);
+
+    switch(param_id) {
+        case AUDIO_EXTN_PARAM_LOOPBACK_RENDER_WINDOW:
+            ret = audio_extn_hw_loopback_set_render_window(handle, payload);
+            break;
+        default:
+            ALOGE("%s: unsupported param id %d", __func__, param_id);
+            break;
+    }
+
+    return ret;
+}
+#endif
+
+
 /* API to get playback stream specific config parameters */
 int audio_extn_out_get_param_data(struct stream_out *out,
                              audio_extn_param_id param_id,
diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h
index 6ec07b3..e158b0a 100644
--- a/hal/audio_extn/audio_extn.h
+++ b/hal/audio_extn/audio_extn.h
@@ -999,6 +999,14 @@
                                     const struct audio_port_config *config);
 int audio_extn_hw_loopback_get_audio_port(struct audio_hw_device *dev,
                                     struct audio_port *port_in);
+
+int audio_extn_hw_loopback_set_param_data(audio_patch_handle_t handle,
+                                          audio_extn_loopback_param_id param_id,
+                                          audio_extn_loopback_param_payload *payload);
+
+int audio_extn_hw_loopback_set_render_window(audio_patch_handle_t handle,
+                                             struct audio_out_render_window_param *render_window);
+
 int audio_extn_hw_loopback_init(struct audio_device *adev);
 void audio_extn_hw_loopback_deinit(struct audio_device *adev);
 #else
@@ -1026,6 +1034,18 @@
 {
     return -ENOSYS;
 }
+static int __unused audio_extn_hw_loopback_set_param_data(audio_patch_handle_t handle __unused,
+                                               audio_extn_loopback_param_id param_id __unused,
+                                               audio_extn_loopback_param_payload *payload __unused)
+{
+    return -ENOSYS;
+}
+
+static int __unused audio_extn_hw_loopback_set_render_window(audio_patch_handle_t handle __unused,
+                                     struct audio_out_render_window_param *render_window __unused)
+{
+    return -ENOSYS;
+}
 static int __unused audio_extn_hw_loopback_init(struct audio_device *adev __unused)
 {
     return -ENOSYS;
diff --git a/hal/audio_extn/hw_loopback.c b/hal/audio_extn/hw_loopback.c
index 990a283..7516717 100644
--- a/hal/audio_extn/hw_loopback.c
+++ b/hal/audio_extn/hw_loopback.c
@@ -357,6 +357,78 @@
     return 0;
 }
 
+#ifdef SNDRV_COMPRESS_RENDER_WINDOW
+static loopback_patch_t *get_active_loopback_patch(audio_patch_handle_t handle)
+{
+    int n = 0;
+    int patch_index = -1;
+    loopback_patch_t *active_loopback_patch = NULL;
+
+    for (n=0; n < MAX_NUM_PATCHES; n++) {
+        if (audio_loopback_mod->patch_db.num_patches > 0) {
+            if (audio_loopback_mod->patch_db.loopback_patch[n].patch_handle_id == handle) {
+                patch_index = n;
+                break;
+            }
+        } else {
+            ALOGE("%s, No active audio loopback patch", __func__);
+            return active_loopback_patch;
+        }
+    }
+
+    if ((patch_index > -1) && (patch_index < MAX_NUM_PATCHES))
+        active_loopback_patch = &(audio_loopback_mod->patch_db.loopback_patch[
+                                patch_index]);
+    else
+        ALOGE("%s, Requested Patch handle does not exist", __func__);
+
+    return active_loopback_patch;
+}
+
+int audio_extn_hw_loopback_set_render_window(audio_patch_handle_t handle,
+                      struct audio_out_render_window_param *render_window)
+{
+    struct snd_compr_metadata metadata = {0};
+    int ret = 0;
+    loopback_patch_t *active_loopback_patch = get_active_loopback_patch(handle);
+
+    if (active_loopback_patch == NULL) {
+        ALOGE("%s: Invalid patch handle", __func__);
+        ret = -EINVAL;
+        goto exit;
+    }
+
+    if (render_window == NULL) {
+        ALOGE("%s: Invalid render_window", __func__);
+        ret = -EINVAL;
+        goto exit;
+    }
+
+    metadata.key = SNDRV_COMPRESS_RENDER_WINDOW;
+    /*render window start value */
+    metadata.value[0] = 0xFFFFFFFF & render_window->render_ws; /* lsb */
+    metadata.value[1] = \
+            (0xFFFFFFFF00000000 & render_window->render_ws) >> 32; /* msb*/
+    /*render window end value */
+    metadata.value[2] = 0xFFFFFFFF & render_window->render_we; /* lsb */
+    metadata.value[3] = \
+            (0xFFFFFFFF00000000 & render_window->render_we) >> 32; /* msb*/
+
+    ret = compress_set_metadata(active_loopback_patch->sink_stream, &metadata);
+
+exit:
+    return ret;
+}
+#else
+int audio_extn_hw_loopback_set_render_window(struct audio_hw_device *dev,
+                      audio_patch_handle_t handle __unused,
+                      struct audio_out_render_window_param *render_window __unused)
+{
+    ALOGD("%s:: configuring render window not supported", __func__);
+    return 0;
+}
+#endif
+
 #if defined SNDRV_COMPRESS_LATENCY_MODE
 static void transcode_loopback_util_set_latency_mode(
                              loopback_patch_t *active_loopback_patch,
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index bd3fa7c..198d871 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -990,7 +990,14 @@
         if (usecase->id == USECASE_AUDIO_PLAYBACK_VOIP) {
             usecase->stream.out->app_type_cfg.sample_rate = usecase->stream.out->sample_rate;
         } else if (usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER) {
-            usecase->stream.out->app_type_cfg.sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
+            if (platform_spkr_use_default_sample_rate(adev->platform)) {
+                 usecase->stream.out->app_type_cfg.sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
+            } else {
+                 platform_check_and_update_copp_sample_rate(adev->platform, snd_device,
+                                      usecase->stream.out->sample_rate,
+                                      &usecase->stream.out->app_type_cfg.sample_rate);
+            }
+
         } else if ((snd_device == SND_DEVICE_OUT_HDMI ||
                     snd_device == SND_DEVICE_OUT_USB_HEADSET ||
                     snd_device == SND_DEVICE_OUT_DISPLAY_PORT) &&
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index cb2d786..ac4233d 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2125,11 +2125,18 @@
             if (out_snd_device == SND_DEVICE_NONE) {
                 out_snd_device = platform_get_output_snd_device(adev->platform,
                                             usecase->stream.out);
-                if (usecase->stream.out == adev->primary_output &&
-                        adev->active_input &&
-                        out_snd_device != usecase->out_snd_device) {
-                    select_devices(adev, adev->active_input->usecase);
-                }
+                   voip_usecase = get_usecase_from_list(adev, USECASE_AUDIO_PLAYBACK_VOIP);
+                   if (voip_usecase == NULL && adev->primary_output && !adev->primary_output->standby)
+                       voip_usecase = get_usecase_from_list(adev, adev->primary_output->usecase);
+
+                   if ((usecase->stream.out != NULL &&
+                        voip_usecase != NULL &&
+                        usecase->stream.out->usecase == voip_usecase->id) &&
+                       adev->active_input &&
+                       adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION &&
+                       out_snd_device != usecase->out_snd_device) {
+                       select_devices(adev, adev->active_input->usecase);
+                   }
             }
         } else if (usecase->type == PCM_CAPTURE) {
             if (usecase->stream.in == NULL) {
@@ -2143,9 +2150,12 @@
                 if (adev->active_input &&
                     (adev->active_input->source == AUDIO_SOURCE_VOICE_COMMUNICATION ||
                     (adev->mode == AUDIO_MODE_IN_COMMUNICATION &&
-                     adev->active_input->source == AUDIO_SOURCE_MIC)) &&
-                     adev->primary_output && !adev->primary_output->standby) {
-                    out_device = adev->primary_output->devices;
+                     adev->active_input->source == AUDIO_SOURCE_MIC))) {
+                    voip_usecase = get_usecase_from_list(adev, USECASE_AUDIO_PLAYBACK_VOIP);
+                    if (voip_usecase != NULL && voip_usecase->stream.out != NULL)
+                        out_device = voip_usecase->stream.out->devices;
+                    else if (adev->primary_output && !adev->primary_output->standby)
+                        out_device = adev->primary_output->devices;
                     platform_set_echo_reference(adev, false, AUDIO_DEVICE_NONE);
                 } else if (usecase->id == USECASE_AUDIO_RECORD_AFE_PROXY) {
                     out_device = AUDIO_DEVICE_OUT_TELEPHONY_TX;
@@ -3309,6 +3319,8 @@
                                     int channel_count,
                                     bool is_low_latency)
 {
+    int i = 0;
+    size_t frame_size = 0;
     size_t size = 0;
 
     if (check_input_parameters(sample_rate, format, channel_count) != 0)
@@ -3318,15 +3330,23 @@
     if (is_low_latency)
         size = configured_low_latency_capture_period_size;
 
-    size *= audio_bytes_per_sample(format) * channel_count;
+    frame_size = audio_bytes_per_sample(format) * channel_count;
+    size *= frame_size;
 
-    /* make sure the size is multiple of 32 bytes
+    /* make sure the size is multiple of 32 bytes and additionally multiple of
+     * the frame_size (required for 24bit samples and non-power-of-2 channel counts)
      * At 48 kHz mono 16-bit PCM:
      *  5.000 ms = 240 frames = 15*16*1*2 = 480, a whole multiple of 32 (15)
      *  3.333 ms = 160 frames = 10*16*1*2 = 320, a whole multiple of 32 (10)
+     *
+     *  The loop reaches result within 32 iterations, as initial size is
+     *  already a multiple of frame_size
      */
-    size += 0x1f;
-    size &= ~0x1f;
+    for (i=0; i<32; i++) {
+        if ((size & 0x1f) == 0)
+            break;
+        size += frame_size;
+    }
 
     return size;
 }
@@ -4502,6 +4522,15 @@
                 audio_format_t dst_format = out->hal_op_format;
                 audio_format_t src_format = out->hal_ip_format;
 
+                /* prevent division-by-zero */
+                uint32_t bitwidth_src = format_to_bitwidth_table[src_format];
+                uint32_t bitwidth_dst = format_to_bitwidth_table[dst_format];
+                if ((bitwidth_src == 0) || (bitwidth_dst == 0)) {
+                    ALOGE("%s: Error bitwidth == 0", __func__);
+                    ATRACE_END();
+                    return -EINVAL;
+                }
+
                 uint32_t frames = bytes / format_to_bitwidth_table[src_format];
                 uint32_t bytes_to_write = frames * format_to_bitwidth_table[dst_format];
 
@@ -4642,10 +4671,18 @@
             out->standby = true;
         }
         out_on_error(&out->stream.common);
-        if (!(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD))
-            usleep((uint64_t)bytes * 1000000 / audio_stream_out_frame_size(stream) /
-                            out_get_sample_rate(&out->stream.common));
+        if (!(out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)) {
+            /* prevent division-by-zero */
+            uint32_t stream_size = audio_stream_out_frame_size(stream);
+            uint32_t srate = out_get_sample_rate(&out->stream.common);
 
+            if ((stream_size == 0) || (srate == 0)) {
+                ALOGE("%s: stream_size= %d, srate = %d", __func__, stream_size, srate);
+                ATRACE_END();
+                return -EINVAL;
+             }
+             usleep((uint64_t)bytes * 1000000 / stream_size / srate);
+        }
         if (audio_extn_passthru_is_passthrough_stream(out)) {
                 ALOGE("%s: write error, ret = %zd", __func__, ret);
                 ATRACE_END();
@@ -7079,6 +7116,13 @@
                                             config->format,
                                             channel_count,
                                             is_low_latency);
+            /* prevent division-by-zero */
+            if (frame_size == 0) {
+                ALOGE("%s: Error frame_size==0", __func__);
+                ret = -EINVAL;
+                goto err_open;
+            }
+
             in->config.period_size = buffer_size / frame_size;
 
             if (in->source == AUDIO_SOURCE_VOICE_COMMUNICATION) {
diff --git a/hal/audio_hw_extn_api.c b/hal/audio_hw_extn_api.c
index f5e0659..310b537 100644
--- a/hal/audio_hw_extn_api.c
+++ b/hal/audio_hw_extn_api.c
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
+* Copyright (c) 2016-2017, 2018, The Linux Foundation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
@@ -423,6 +423,19 @@
     return ret;
 }
 
+int qahwi_loopback_set_param_data(audio_patch_handle_t handle,
+                                  audio_extn_loopback_param_id param_id,
+                                  void *payload) {
+    int ret = 0;
+
+    ret = audio_extn_hw_loopback_set_param_data(
+                                             handle,
+                                             param_id,
+                                             (audio_extn_loopback_param_payload *)payload);
+
+    return ret;
+}
+
 void qahwi_init(hw_device_t *device)
 {
     struct audio_device *adev = (struct audio_device *) device;
diff --git a/hal/edid.h b/hal/edid.h
index da5c592..f920a82 100644
--- a/hal/edid.h
+++ b/hal/edid.h
@@ -57,6 +57,27 @@
 #define PCM_CHANNEL_FRC  14  /* Front right of center.                        */
 #define PCM_CHANNEL_RLC  15  /* Rear left of center.                          */
 #define PCM_CHANNEL_RRC  16  /* Rear right of center.                         */
+#define PCM_CHANNEL_LFE2 17  /* Second low frequency channel.                 */
+#define PCM_CHANNEL_SL   18  /* Side left channel.                            */
+#define PCM_CHANNEL_SR   19  /* Side right channel.                           */
+#define PCM_CHANNEL_TFL  20  /* Top front left channel.                       */
+#define PCM_CHANNEL_LVH  20  /* Left vertical height channel.                 */
+#define PCM_CHANNEL_TFR  21  /* Top front right channel.                      */
+#define PCM_CHANNEL_RVH  21  /* Right vertical height channel.                */
+#define PCM_CHANNEL_TC   22  /* Top center channel.                           */
+#define PCM_CHANNEL_TBL  23  /* Top back left channel.                        */
+#define PCM_CHANNEL_TBR  24  /* Top back right channel.                       */
+#define PCM_CHANNEL_TSL  25  /* Top side left channel.                        */
+#define PCM_CHANNEL_TSR  26  /* Top side right channel.                       */
+#define PCM_CHANNEL_TBC  27  /* Top back center channel.                      */
+#define PCM_CHANNEL_BFC  28  /* Bottom front center channel.                  */
+#define PCM_CHANNEL_BFL  29  /* Bottom front left channel.                    */
+#define PCM_CHANNEL_BFR  30  /* Bottom front right channel.                   */
+#define PCM_CHANNEL_LW   31  /* Left wide channel.                            */
+#define PCM_CHANNEL_RW   32  /* Right wide channel.                           */
+#define PCM_CHANNEL_LSD  33  /* Left side direct channel.                     */
+#define PCM_CHANNEL_RSD  34  /* Right side direct channel.                    */
+
 
 #define MAX_HDMI_CHANNEL_CNT 8
 
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
old mode 100755
new mode 100644
index 82fafc7..68ffd56
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -298,6 +298,7 @@
     struct acdb_init_data_v4 acdb_init_data;
     bool use_generic_handset;
     struct  spkr_device_chmap *spkr_ch_map;
+    bool use_sprk_default_sample_rate;
 };
 
 struct  spkr_device_chmap {
@@ -2290,6 +2291,7 @@
     my_data->hw_dep_fd = -1;
     my_data->mono_speaker = SPKR_1;
     my_data->spkr_ch_map = NULL;
+    my_data->use_sprk_default_sample_rate = true;
 
     be_dai_name_table = NULL;
 
@@ -2831,6 +2833,9 @@
     /* free acdb_meta_key_list */
     platform_release_acdb_metainfo_key(platform);
 
+    if (my_data->acdb_deallocate)
+        my_data->acdb_deallocate();
+
     free(platform);
     /* deinit usb */
     audio_extn_usb_deinit();
@@ -4688,6 +4693,16 @@
               (mode == AUDIO_MODE_IN_COMMUNICATION)) {
         if (out_device & AUDIO_DEVICE_OUT_SPEAKER)
             in_device = AUDIO_DEVICE_IN_BACK_MIC;
+        else if (out_device & AUDIO_DEVICE_OUT_EARPIECE)
+            in_device = AUDIO_DEVICE_IN_BUILTIN_MIC;
+        else if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET)
+            in_device = AUDIO_DEVICE_IN_WIRED_HEADSET;
+        else if (out_device & AUDIO_DEVICE_OUT_USB_DEVICE)
+             in_device = AUDIO_DEVICE_IN_USB_DEVICE;
+
+        in_device = ((out_device == AUDIO_DEVICE_NONE) ?
+                      AUDIO_DEVICE_IN_BUILTIN_MIC : in_device) & ~AUDIO_DEVICE_BIT_IN;
+
         if (adev->active_input) {
             snd_device = get_snd_device_for_voice_comm(my_data, out_device, in_device);
         }
@@ -7385,6 +7400,11 @@
     platform_get_edid_info(platform);
 }
 
+bool platform_spkr_use_default_sample_rate(void *platform) {
+    struct platform_data *my_data = (struct platform_data *)platform;
+    return my_data->use_sprk_default_sample_rate;
+}
+
 void platform_invalidate_backend_config(void * platform,snd_device_t snd_device)
 {
     struct platform_data *my_data = (struct platform_data *)platform;
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 128a458..0766311 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -65,6 +65,7 @@
 #define MIXER_XML_PATH_I2S "/etc/mixer_paths_i2s.xml"
 #define PLATFORM_INFO_XML_PATH_I2S "/etc/audio_platform_info_extcodec.xml"
 #define PLATFORM_INFO_XML_PATH_WSA  "/etc/audio_platform_info_wsa.xml"
+#define PLATFORM_INFO_XML_PATH_TDM  "/etc/audio_platform_info_tdm.xml"
 #else
 #define MIXER_XML_BASE_STRING "/vendor/etc/mixer_paths"
 #define MIXER_XML_DEFAULT_PATH "/vendor/etc/mixer_paths.xml"
@@ -76,6 +77,7 @@
 #define MIXER_XML_PATH_I2S "/vendor/etc/mixer_paths_i2s.xml"
 #define PLATFORM_INFO_XML_PATH_I2S "/vendor/etc/audio_platform_info_i2s.xml"
 #define PLATFORM_INFO_XML_PATH_WSA  "/vendor/etc/audio_platform_info_wsa.xml"
+#define PLATFORM_INFO_XML_PATH_TDM  "/vendor/etc/audio_platform_info_tdm.xml"
 #endif
 
 #include <linux/msm_audio.h>
@@ -276,6 +278,7 @@
     struct acdb_init_data_v4 acdb_init_data;
     bool use_generic_handset;
     struct  spkr_device_chmap *spkr_ch_map;
+    bool use_sprk_default_sample_rate;
 };
 
 struct  spkr_device_chmap {
@@ -2096,7 +2099,7 @@
     my_data->mono_speaker = SPKR_1;
     my_data->speaker_lr_swap = false;
     my_data->spkr_ch_map = NULL;
-
+    my_data->use_sprk_default_sample_rate = true;
     be_dai_name_table = NULL;
 
     property_get("ro.vendor.audio.sdk.fluencetype", my_data->fluence_cap, "");
@@ -2177,11 +2180,23 @@
     else if (!strncmp(snd_card_name, "qcs405-wsa-snd-card",
                sizeof("qcs405-wsa-snd-card")))
         platform_info_init(PLATFORM_INFO_XML_PATH_WSA, my_data, PLATFORM);
+    else if (!strncmp(snd_card_name, "qcs405-tdm-snd-card",
+               sizeof("qcs405-tdm-snd-card")))
+        platform_info_init(PLATFORM_INFO_XML_PATH_TDM, my_data, PLATFORM);
     else if (my_data->is_internal_codec)
         platform_info_init(PLATFORM_INFO_XML_PATH_INTCODEC, my_data, PLATFORM);
     else
         platform_info_init(PLATFORM_INFO_XML_PATH, my_data, PLATFORM);
 
+    /* CSRA devices support multiple sample rates via I2S at spkr out */
+    if (!strncmp(snd_card_name, "qcs405-csra", strlen("qcs405-csra"))) {
+        ALOGE("%s: soundcard: %s supports multiple sample rates", __func__, snd_card_name);
+        my_data->use_sprk_default_sample_rate = false;
+    } else {
+        my_data->use_sprk_default_sample_rate = true;
+        ALOGE("%s: soundcard: %s supports only default sample rate", __func__, snd_card_name);
+    }
+
     my_data->voice_feature_set = VOICE_FEATURE_SET_DEFAULT;
     my_data->acdb_handle = dlopen(LIB_ACDB_LOADER, RTLD_NOW);
     if (my_data->acdb_handle == NULL) {
@@ -2437,11 +2452,18 @@
 
     } else {
         if (!strncmp(snd_card_name, "qcs405", strlen("qcs405"))) {
-            my_data->current_backend_cfg[DEFAULT_CODEC_BACKEND].bitwidth_mixer_ctl =
-                strdup("WSA_CDC_DMA_RX_0 Format");
-            my_data->current_backend_cfg[DEFAULT_CODEC_BACKEND].samplerate_mixer_ctl =
-                strdup("WSA_CDC_DMA_RX_0 SampleRate");
 
+            if (!strncmp(snd_card_name, "qcs405-csra", strlen("qcs405-csra"))) {
+               my_data->current_backend_cfg[DEFAULT_CODEC_BACKEND].bitwidth_mixer_ctl =
+                   strdup("PRIM_MI2S_RX Format");
+               my_data->current_backend_cfg[DEFAULT_CODEC_BACKEND].samplerate_mixer_ctl =
+                   strdup("PRIM_MI2S_RX SampleRate");
+            } else {
+               my_data->current_backend_cfg[DEFAULT_CODEC_BACKEND].bitwidth_mixer_ctl =
+                   strdup("WSA_CDC_DMA_RX_0 Format");
+               my_data->current_backend_cfg[DEFAULT_CODEC_BACKEND].samplerate_mixer_ctl =
+                   strdup("WSA_CDC_DMA_RX_0 SampleRate");
+            }
             my_data->current_backend_cfg[DEFAULT_CODEC_TX_BACKEND].bitwidth_mixer_ctl =
                 strdup("VA_CDC_DMA_TX_0 Format");
             my_data->current_backend_cfg[DEFAULT_CODEC_TX_BACKEND].samplerate_mixer_ctl =
@@ -2672,6 +2694,9 @@
     /* free acdb_meta_key_list */
     platform_release_acdb_metainfo_key(platform);
 
+    if (my_data->acdb_deallocate)
+        my_data->acdb_deallocate();
+
     free(platform);
     /* deinit usb */
     audio_extn_usb_deinit();
@@ -4524,6 +4549,16 @@
               (mode == AUDIO_MODE_IN_COMMUNICATION)) {
         if (out_device & AUDIO_DEVICE_OUT_SPEAKER)
             in_device = AUDIO_DEVICE_IN_BACK_MIC;
+        else if (out_device & AUDIO_DEVICE_OUT_EARPIECE)
+            in_device = AUDIO_DEVICE_IN_BUILTIN_MIC;
+        else if (out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET)
+            in_device = AUDIO_DEVICE_IN_WIRED_HEADSET;
+        else if (out_device & AUDIO_DEVICE_OUT_USB_DEVICE)
+            in_device = AUDIO_DEVICE_IN_USB_DEVICE;
+
+        in_device = ((out_device == AUDIO_DEVICE_NONE) ?
+                      AUDIO_DEVICE_IN_BUILTIN_MIC : in_device) & ~AUDIO_DEVICE_BIT_IN;
+
         if (adev->active_input) {
             snd_device = get_snd_device_for_voice_comm(my_data, out_device, in_device);
         }
@@ -6278,9 +6313,15 @@
             bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH;
             ALOGD("%s:becf: afe: reset to default bitwidth %d", __func__, bit_width);
         }
-        sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
-        ALOGD("%s:becf: afe: playback on codec device not supporting native playback set "
+        /*
+         * In case of CSRA speaker out, all sample rates are supported, so
+         *  check platform here
+         */
+        if (platform_spkr_use_default_sample_rate(adev->platform)) {
+            sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
+            ALOGD("%s:becf: afe: playback on codec device not supporting native playback set "
             "default Sample Rate(48k)", __func__);
+        }
     }
 
     if (backend_idx == USB_AUDIO_RX_BACKEND) {
@@ -6951,6 +6992,40 @@
                 channel_map[6] = PCM_CHANNEL_LS;
                 channel_map[7] = PCM_CHANNEL_RS;
                 break;
+           case 12:
+                /* AUDIO_CHANNEL_OUT_7POINT1POINT4 */
+                channel_map[0] = PCM_CHANNEL_FL;
+                channel_map[1] = PCM_CHANNEL_FR;
+                channel_map[2] = PCM_CHANNEL_FC;
+                channel_map[3] = PCM_CHANNEL_LFE;
+                channel_map[4] = PCM_CHANNEL_LB;
+                channel_map[5] = PCM_CHANNEL_RB;
+                channel_map[6] = PCM_CHANNEL_LS;
+                channel_map[7] = PCM_CHANNEL_RS;
+                channel_map[8] = PCM_CHANNEL_TFL;
+                channel_map[9] = PCM_CHANNEL_TFR;
+                channel_map[10] = PCM_CHANNEL_TSL;
+                channel_map[11] = PCM_CHANNEL_TSR;
+                break;
+          case 16:
+                /* 16 channels */
+                channel_map[0] = PCM_CHANNEL_FL;
+                channel_map[1] = PCM_CHANNEL_FR;
+                channel_map[2] = PCM_CHANNEL_FC;
+                channel_map[3] = PCM_CHANNEL_LFE;
+                channel_map[4] = PCM_CHANNEL_LB;
+                channel_map[5] = PCM_CHANNEL_RB;
+                channel_map[6] = PCM_CHANNEL_LS;
+                channel_map[7] = PCM_CHANNEL_RS;
+                channel_map[8] = PCM_CHANNEL_TFL;
+                channel_map[9] = PCM_CHANNEL_TFR;
+                channel_map[10] = PCM_CHANNEL_TSL;
+                channel_map[11] = PCM_CHANNEL_TSR;
+                channel_map[12] = PCM_CHANNEL_FLC;
+                channel_map[13] = PCM_CHANNEL_FRC;
+                channel_map[14] = PCM_CHANNEL_RLC;
+                channel_map[15] = PCM_CHANNEL_RRC;
+                break;
             default:
                 ALOGE("unsupported channels %d for setting channel map", channels);
                 return -1;
@@ -7075,12 +7150,21 @@
     struct mixer_ctl *ctl;
     char mixer_ctl_name[44] = {0}; // max length of name is 44 as defined
     int ret;
-    unsigned int i;
-    long set_values[FCC_8] = {0};
+    unsigned int i=0, n=0;
+    long set_values[AUDIO_MAX_DSP_CHANNELS];
     struct platform_data *my_data = (struct platform_data *)platform;
     struct audio_device *adev = my_data->adev;
     ALOGV("%s channel_count:%d",__func__, ch_count);
-    if (NULL == ch_map || (ch_count < 1) || (ch_count > FCC_8)) {
+
+    /*
+     * FIXME:
+     * Currently the channel mask in audio.h is limited to 30 channels,
+     * (=AUDIO_CHANNEL_COUNT_MAX), whereas the mixer controls already
+     * allow up to AUDIO_MAX_DSP_CHANNELS channels as per final requirement.
+     * Until channel mask definition is not changed from a uint32_t value
+     * to something else, a sanity check is needed here.
+     */
+    if (NULL == ch_map || (ch_count < 1) || (ch_count > AUDIO_CHANNEL_COUNT_MAX)) {
         ALOGE("%s: Invalid channel mapping or channel count value", __func__);
         return -EINVAL;
     }
@@ -7098,12 +7182,34 @@
     ALOGD("%s mixer_ctl_name:%s", __func__, mixer_ctl_name);
 
     ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
+
     if (!ctl) {
         ALOGE("%s: Could not get ctl for mixer cmd - %s",
               __func__, mixer_ctl_name);
         return -EINVAL;
     }
-    for (i = 0; i < (unsigned int)ch_count; i++) {
+
+    /* find out how many values the control can set */
+    n = mixer_ctl_get_num_values(ctl);
+
+    if (n != ch_count)
+        ALOGV("%s chcnt %d != mixerctl elem size %d",__func__, ch_count, n);
+
+    if (n < ch_count) {
+        ALOGE("%s chcnt %d > mixerctl elem size %d",__func__, ch_count, n);
+        return -EINVAL;
+    }
+
+    if (n > AUDIO_MAX_DSP_CHANNELS) {
+        ALOGE("%s mixerctl elem size %d > AUDIO_MAX_DSP_CHANNELS %d",__func__, n, AUDIO_MAX_DSP_CHANNELS);
+        return -EINVAL;
+    }
+
+    /* initialize all set_values to zero */
+    memset (set_values, 0, sizeof(set_values));
+
+    /* copy only as many values as corresponding mixer_ctrl allows */
+    for (i = 0; i < ch_count; i++) {
         set_values[i] = ch_map[i];
     }
 
@@ -7111,7 +7217,8 @@
         set_values[0], set_values[1], set_values[2], set_values[3], set_values[4],
         set_values[5], set_values[6], set_values[7], ch_count);
 
-    ret = mixer_ctl_set_array(ctl, set_values, ARRAY_SIZE(set_values));
+    ret = mixer_ctl_set_array(ctl, set_values, n);
+
     if (ret < 0) {
         ALOGE("%s: Could not set ctl, error:%d ch_count:%d",
               __func__, ret, ch_count);
@@ -7276,6 +7383,11 @@
     return 0;
 }
 
+bool platform_spkr_use_default_sample_rate(void *platform) {
+    struct platform_data *my_data = (struct platform_data *)platform;
+    return my_data->use_sprk_default_sample_rate;
+}
+
 int platform_set_edid_channels_configuration(void *platform, int channels) {
 
     struct platform_data *my_data = (struct platform_data *)platform;
diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h
index c8ddaec..e1f433c 100644
--- a/hal/msm8974/platform.h
+++ b/hal/msm8974/platform.h
@@ -280,6 +280,8 @@
 
 #define AUDIO_PARAMETER_KEY_TRUE_32_BIT "true_32_bit"
 
+#define AUDIO_MAX_DSP_CHANNELS 32
+
 #define ALL_SESSION_VSID                0xFFFFFFFF
 #define DEFAULT_MUTE_RAMP_DURATION_MS   20
 #define DEFAULT_VOLUME_RAMP_DURATION_MS 20
diff --git a/hal/platform_api.h b/hal/platform_api.h
old mode 100755
new mode 100644
index 09c69de..1563673
--- a/hal/platform_api.h
+++ b/hal/platform_api.h
@@ -218,6 +218,7 @@
                                        snd_device_t snd_device,
                                        struct mix_matrix_params mm_params);
 int platform_set_edid_channels_configuration(void *platform, int channels);
+bool platform_spkr_use_default_sample_rate(void *platform);
 unsigned char platform_map_to_edid_format(int format);
 bool platform_is_edid_supported_format(void *platform, int format);
 bool platform_is_edid_supported_sample_rate(void *platform, int sample_rate);
diff --git a/hdmi_in_test/Makefile.am b/hdmi_in_test/Makefile.am
index 34e4ff5..eb74d21 100644
--- a/hdmi_in_test/Makefile.am
+++ b/hdmi_in_test/Makefile.am
@@ -1,9 +1,17 @@
 
 ACLOCAL_AMFLAGS = -I m4
 bin_PROGRAMS = hdmi_in_test
+bin_PROGRAMS += fmt_change_test
 pkgconfigdir = $(libdir)/pkgconfig
 
+REC_INCLUDES = -I $(top_srcdir)/qahw_api/inc
+REC_INCLUDES += -I $(top_srcdir)/qahw/inc
+
 hdmi_in_test_SOURCES = src/hdmi_in_event_test.c
 hdmi_in_test_CFLAGS  = $(CFLAGS) -Wno-sign-compare -Werror
 hdmi_in_test_LDADD = -llog -lpthread
 
+fmt_change_test_SOURCES = src/fmt_change_test.c
+fmt_change_test_CFLAGS  = $(CFLAGS) -Wno-sign-compare -Werror $(REC_INCLUDES)
+fmt_change_test_LDADD = -llog -lpthread ../qahw_api/libqahw.la
+
diff --git a/hdmi_in_test/src/fmt_change_test.c b/hdmi_in_test/src/fmt_change_test.c
new file mode 100644
index 0000000..6651c6d
--- /dev/null
+++ b/hdmi_in_test/src/fmt_change_test.c
@@ -0,0 +1,811 @@
+/*
+ * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
+ * Not a Contribution.
+ *
+ * Copyright (C) 2015 The Android Open Source Project *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* Test app to capture event updates from kernel */
+/*#define LOG_NDEBUG 0*/
+#include <getopt.h>
+#include <fcntl.h>
+#include <linux/netlink.h>
+#include <pthread.h>
+#include <poll.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/prctl.h>
+#include <sys/stat.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <utils/Log.h>
+#include <signal.h>
+#include <errno.h>
+#include "qahw_api.h"
+#include "qahw_defs.h"
+
+/* add local define to prevent compilation errors on other platforms */
+#ifndef AUDIO_DEVICE_IN_HDMI_ARC
+#define AUDIO_DEVICE_IN_HDMI_ARC (AUDIO_DEVICE_BIT_IN | 0x8000000)
+#endif
+
+static int sock_event_fd = -1;
+
+void *context = NULL;
+FILE * log_file = NULL;
+volatile bool stop_test = false;
+volatile bool stop_record = false;
+volatile bool record_active = false;
+
+#define HDMI_SYS_PATH "/sys/devices/platform/soc/78b7000.i2c/i2c-3/3-0064/"
+const char hdmi_in_audio_sys_path[] = HDMI_SYS_PATH "link_on0";
+const char hdmi_in_power_on_sys_path[] = HDMI_SYS_PATH "power_on";
+const char hdmi_in_audio_path_sys_path[] = HDMI_SYS_PATH "audio_path";
+const char hdmi_in_arc_enable_sys_path[] = HDMI_SYS_PATH "arc_enable";
+
+const char hdmi_in_audio_state_sys_path[] = HDMI_SYS_PATH "audio_state";
+const char hdmi_in_audio_format_sys_path[] = HDMI_SYS_PATH "audio_format";
+const char hdmi_in_audio_sample_rate_sys_path[] = HDMI_SYS_PATH "audio_rate";
+const char hdmi_in_audio_layout_sys_path[] = HDMI_SYS_PATH "audio_layout";
+
+#define SPDIF_SYS_PATH "/sys/devices/platform/soc/soc:qcom,msm-dai-q6-spdif-pri-tx/"
+const char spdif_in_audio_state_sys_path[] = SPDIF_SYS_PATH "audio_state";
+const char spdif_in_audio_format_sys_path[] = SPDIF_SYS_PATH "audio_format";
+const char spdif_in_audio_sample_rate_sys_path[] = SPDIF_SYS_PATH "audio_rate";
+
+#define SPDIF_ARC_SYS_PATH "/sys/devices/platform/soc/soc:qcom,msm-dai-q6-spdif-sec-tx/"
+const char spdif_arc_in_audio_state_sys_path[] = SPDIF_ARC_SYS_PATH "audio_state";
+const char spdif_arc_in_audio_format_sys_path[] = SPDIF_ARC_SYS_PATH "audio_format";
+const char spdif_arc_in_audio_sample_rate_sys_path[] = SPDIF_ARC_SYS_PATH "audio_rate";
+
+#define ID_RIFF 0x46464952
+#define ID_WAVE 0x45564157
+#define ID_FMT  0x20746d66
+#define ID_DATA 0x61746164
+
+#define FORMAT_PCM 1
+
+struct wav_header {
+    uint32_t riff_id;
+    uint32_t riff_sz;
+    uint32_t riff_fmt;
+    uint32_t fmt_id;
+    uint32_t fmt_sz;
+    uint16_t audio_format;
+    uint16_t num_channels;
+    uint32_t sample_rate;
+    uint32_t byte_rate;       /* sample_rate * num_channels * bps / 8 */
+    uint16_t block_align;     /* num_channels * bps / 8 */
+    uint16_t bits_per_sample;
+    uint32_t data_id;
+    uint32_t data_sz;
+};
+
+struct test_data {
+    qahw_module_handle_t *qahw_mod_handle;
+    audio_io_handle_t handle;
+    audio_devices_t input_device;
+    double record_length;
+    int rec_cnt;
+
+    char *audio_fmt_chg_text;
+    int audio_fmt_chg_len;
+    pthread_t record_th;
+    pthread_t poll_event_th;
+    pthread_attr_t poll_event_attr;
+
+    int bit_width;
+    audio_input_flags_t flags;
+    audio_config_t config;
+    audio_source_t source;
+
+    int spdif_audio_state;
+    int spdif_audio_mode;
+    int spdif_sample_rate;
+    int spdif_num_channels;
+
+    int hdmi_power_on;
+    int hdmi_audio_path;
+    int hdmi_arc_enable;
+
+    int hdmi_audio_state;
+    int hdmi_audio_mode;
+    int hdmi_audio_layout;
+    int hdmi_sample_rate;
+    int hdmi_num_channels;
+
+    int spdif_arc_audio_state;
+    int spdif_arc_audio_mode;
+    int spdif_arc_sample_rate;
+    int spdif_arc_num_channels;
+
+    audio_devices_t new_input_device;
+
+    audio_devices_t act_input_device; /* HDMI might use I2S and SPDIF */
+
+    int act_audio_state;    /* audio active */
+    int act_audio_mode;     /* 0=LPCM, 1=Compr */
+    int act_sample_rate;    /* transmission sample rate */
+    int act_num_channels;   /* transmission channels */
+};
+
+struct test_data tdata;
+
+void stop_signal_handler(int signal)
+{
+   stop_test = true;
+}
+
+void *start_input(void *thread_param) {
+    int rc = 0, ret = 0, count = 0;
+    ssize_t bytes_read = -1;
+    char file_name[256] = "/data/rec";
+    int data_sz = 0, name_len = strlen(file_name);
+    qahw_in_buffer_t in_buf;
+
+    qahw_module_handle_t *qahw_mod_handle = tdata.qahw_mod_handle;
+
+    /* convert/check params before use */
+    tdata.config.sample_rate = tdata.act_sample_rate;
+
+    if (tdata.act_audio_mode) {
+        tdata.config.format = AUDIO_FORMAT_IEC61937;
+        tdata.flags = QAHW_INPUT_FLAG_COMPRESS | QAHW_INPUT_FLAG_PASSTHROUGH;
+    } else {
+        if (tdata.bit_width == 32)
+            tdata.config.format = AUDIO_FORMAT_PCM_8_24_BIT;
+        else if (tdata.bit_width == 24)
+            tdata.config.format = AUDIO_FORMAT_PCM_24_BIT_PACKED;
+        else
+            tdata.config.format = AUDIO_FORMAT_PCM_16_BIT;
+        tdata.flags = 0;
+    }
+
+    switch (tdata.act_num_channels) {
+    case 2:
+        tdata.config.channel_mask = AUDIO_CHANNEL_IN_STEREO;
+        break;
+    case 8:
+        tdata.config.channel_mask = AUDIO_CHANNEL_INDEX_MASK_8;
+        break;
+    default:
+        fprintf(log_file,
+            "ERROR :::: channel count %d not supported\n",
+            tdata.act_num_channels);
+        pthread_exit(0);
+    }
+    tdata.config.frame_count = 0;
+
+    /* Open audio input stream */
+    qahw_stream_handle_t* in_handle = NULL;
+
+    rc = qahw_open_input_stream(qahw_mod_handle, tdata.handle,
+        tdata.act_input_device, &tdata.config, &in_handle, tdata.flags,
+        "input_stream", tdata.source);
+    if (rc) {
+        fprintf(log_file,
+            "ERROR :::: Could not open input stream, handle(%d)\n",
+            tdata.handle);
+        pthread_exit(0);
+    }
+
+    /* Get buffer size to get upper bound on data to read from the HAL */
+    size_t buffer_size = qahw_in_get_buffer_size(in_handle);
+    char *buffer = (char *) calloc(1, buffer_size);
+    size_t written_size;
+    if (buffer == NULL) {
+        fprintf(log_file, "calloc failed!!, handle(%d)\n", tdata.handle);
+        pthread_exit(0);
+    }
+
+    fprintf(log_file, " input opened, buffer  %p, size %zu, handle(%d)\n", buffer,
+        buffer_size, tdata.handle);
+
+    /* set profile for the recording session */
+    qahw_in_set_parameters(in_handle, "audio_stream_profile=record_unprocessed");
+
+    if (audio_is_linear_pcm(tdata.config.format))
+        snprintf(file_name + name_len, sizeof(file_name) - name_len, "%d.wav",
+            tdata.rec_cnt);
+    else
+        snprintf(file_name + name_len, sizeof(file_name) - name_len, "%d.raw",
+            tdata.rec_cnt);
+
+    tdata.rec_cnt++;
+
+    FILE *fd = fopen(file_name, "w");
+    if (fd == NULL) {
+        fprintf(log_file, "File open failed\n");
+        free(buffer);
+        pthread_exit(0);
+    }
+
+    int bps = 16;
+
+    switch (tdata.config.format) {
+    case AUDIO_FORMAT_PCM_24_BIT_PACKED:
+        bps = 24;
+        break;
+    case AUDIO_FORMAT_PCM_8_24_BIT:
+    case AUDIO_FORMAT_PCM_32_BIT:
+        bps = 32;
+        break;
+    case AUDIO_FORMAT_PCM_16_BIT:
+    default:
+        bps = 16;
+    }
+
+    struct wav_header hdr;
+    hdr.riff_id = ID_RIFF;
+    hdr.riff_sz = 0;
+    hdr.riff_fmt = ID_WAVE;
+    hdr.fmt_id = ID_FMT;
+    hdr.fmt_sz = 16;
+    hdr.audio_format = FORMAT_PCM;
+    hdr.num_channels = tdata.act_num_channels;
+    hdr.sample_rate = tdata.config.sample_rate;
+    hdr.byte_rate = hdr.sample_rate * hdr.num_channels * (bps / 8);
+    hdr.block_align = hdr.num_channels * (bps / 8);
+    hdr.bits_per_sample = bps;
+    hdr.data_id = ID_DATA;
+    hdr.data_sz = 0;
+    if (audio_is_linear_pcm(tdata.config.format))
+        fwrite(&hdr, 1, sizeof(hdr), fd);
+
+    memset(&in_buf, 0, sizeof(qahw_in_buffer_t));
+    while (true && !stop_record) {
+        in_buf.buffer = buffer;
+        in_buf.bytes = buffer_size;
+        bytes_read = qahw_in_read(in_handle, &in_buf);
+
+        written_size = fwrite(in_buf.buffer, 1, bytes_read, fd);
+        if (written_size < bytes_read) {
+            printf("Error in fwrite(%d)=%s\n", ferror(fd),
+                strerror(ferror(fd)));
+            break;
+        }
+        data_sz += bytes_read;
+    }
+
+    if (audio_is_linear_pcm(tdata.config.format)) {
+        /* update lengths in header */
+        hdr.data_sz = data_sz;
+        hdr.riff_sz = data_sz + 44 - 8;
+        fseek(fd, 0, SEEK_SET);
+        fwrite(&hdr, 1, sizeof(hdr), fd);
+    }
+    free(buffer);
+    fclose(fd);
+    fd = NULL;
+
+    fprintf(log_file, " closing input, handle(%d), written %d bytes", tdata.handle, data_sz);
+
+    /* Close input stream and device. */
+    rc = qahw_in_standby(in_handle);
+    if (rc) {
+        fprintf(log_file, "in standby failed %d, handle(%d)\n", rc,
+            tdata.handle);
+    }
+
+    rc = qahw_close_input_stream(in_handle);
+    if (rc) {
+        fprintf(log_file, "could not close input stream %d, handle(%d)\n", rc,
+            tdata.handle);
+    }
+
+    fprintf(log_file,
+        "\n\n The audio recording has been saved to %s.\n"
+        "The audio data has the  following characteristics:\n Sample rate: %i\n Format: %d\n "
+        "Num channels: %i, handle(%d)\n\n", file_name,
+        tdata.config.sample_rate, tdata.config.format, tdata.act_num_channels,
+        tdata.handle);
+
+    return NULL;
+}
+
+void start_rec_thread(void)
+{
+    int ret = 0;
+
+    stop_record = false;
+    record_active = true;
+
+    fprintf(log_file, "\n Create record thread \n");
+    ret = pthread_create(&tdata.record_th, NULL, start_input, (void *)&tdata);
+    if (ret) {
+        fprintf(log_file, " Failed to create record thread\n");
+        exit(1);
+   }
+}
+
+void stop_rec_thread(void)
+{
+    if (record_active) {
+        record_active = false;
+        stop_record = true;
+        fprintf(log_file, "\n Stop record thread \n");
+        pthread_join(tdata.record_th, NULL);
+    }
+}
+
+
+void read_data_from_fd(const char* path, int *value)
+{
+    int fd = -1;
+    char buf[16];
+    int ret;
+
+    fd = open(path, O_RDONLY, 0);
+    if (fd < 0) {
+        ALOGE("Unable open fd for file %s", path);
+        return;
+    }
+
+    ret = read(fd, buf, 15);
+    if (ret < 0) {
+        ALOGE("File %s Data is empty", path);
+        close(fd);
+        return;
+    }
+
+    buf[ret] = '\0';
+    *value = atoi(buf);
+    close(fd);
+}
+
+void get_input_status()
+{
+    switch (tdata.input_device) {
+    case AUDIO_DEVICE_IN_SPDIF:
+        read_data_from_fd(spdif_in_audio_state_sys_path, &tdata.spdif_audio_state);
+        read_data_from_fd(spdif_in_audio_format_sys_path, &tdata.spdif_audio_mode);
+        read_data_from_fd(spdif_in_audio_sample_rate_sys_path, &tdata.spdif_sample_rate);
+        tdata.spdif_num_channels = 2;
+        tdata.new_input_device = AUDIO_DEVICE_IN_SPDIF;
+
+        fprintf(log_file, "spdif audio_state: %d, audio_format: %d, sample_rate: %d, num_channels: %d\n",
+            tdata.spdif_audio_state, tdata.spdif_audio_mode, tdata.spdif_sample_rate, tdata.spdif_num_channels);
+        break;
+    case AUDIO_DEVICE_IN_HDMI:
+        read_data_from_fd(hdmi_in_power_on_sys_path, &tdata.hdmi_power_on);
+        read_data_from_fd(hdmi_in_audio_path_sys_path, &tdata.hdmi_audio_path);
+        read_data_from_fd(hdmi_in_arc_enable_sys_path, &tdata.hdmi_arc_enable);
+
+        read_data_from_fd(hdmi_in_audio_state_sys_path, &tdata.hdmi_audio_state);
+        read_data_from_fd(hdmi_in_audio_format_sys_path, &tdata.hdmi_audio_mode);
+        read_data_from_fd(hdmi_in_audio_sample_rate_sys_path, &tdata.hdmi_sample_rate);
+        read_data_from_fd(hdmi_in_audio_layout_sys_path, &tdata.hdmi_audio_layout);
+        if (tdata.hdmi_audio_layout)
+            tdata.hdmi_num_channels = 8;
+        else
+            tdata.hdmi_num_channels = 2;
+        /* todo: read ch_count, ch_alloc */
+
+        read_data_from_fd(spdif_arc_in_audio_state_sys_path, &tdata.spdif_arc_audio_state);
+        read_data_from_fd(spdif_arc_in_audio_format_sys_path, &tdata.spdif_arc_audio_mode);
+        read_data_from_fd(spdif_arc_in_audio_sample_rate_sys_path, &tdata.spdif_arc_sample_rate);
+        tdata.spdif_arc_num_channels = 2;
+
+        if (tdata.hdmi_arc_enable ||
+            (tdata.hdmi_audio_state && (tdata.hdmi_audio_layout == 0) && tdata.hdmi_audio_mode)) {
+            tdata.new_input_device = AUDIO_DEVICE_IN_HDMI_ARC;
+            fprintf(log_file, "hdmi audio interface SPDIF_ARC\n");
+        } else {
+            tdata.new_input_device = AUDIO_DEVICE_IN_HDMI;
+            fprintf(log_file, "hdmi audio interface MI2S\n");
+        }
+
+        fprintf(log_file, "hdmi audio_state: %d, audio_format: %d, sample_rate: %d, num_channels: %d\n",
+            tdata.hdmi_audio_state, tdata.hdmi_audio_mode, tdata.hdmi_sample_rate, tdata.hdmi_num_channels);
+        fprintf(log_file, "arc  audio_state: %d, audio_format: %d, sample_rate: %d, num_channels: %d\n",
+            tdata.spdif_arc_audio_state, tdata.spdif_arc_audio_mode, tdata.spdif_arc_sample_rate, tdata.spdif_arc_num_channels);
+        break;
+    }
+}
+
+void input_restart_check(void)
+{
+    get_input_status();
+
+    switch (tdata.input_device) {
+    case AUDIO_DEVICE_IN_SPDIF:
+        if ((tdata.act_input_device != tdata.new_input_device) ||
+            (tdata.spdif_audio_state == 2)) {
+            fprintf(log_file, "old       audio_state: %d, audio_format: %d, rate: %d, channels: %d\n",
+                tdata.act_audio_state, tdata.act_audio_mode,
+                tdata.act_sample_rate, tdata.act_num_channels);
+            fprintf(log_file, "new spdif audio_state: %d, audio_format: %d, rate: %d, channels: %d\n",
+                tdata.spdif_audio_state, tdata.spdif_audio_mode,
+                tdata.spdif_sample_rate, tdata.spdif_num_channels);
+
+            stop_rec_thread();
+
+            tdata.act_input_device = AUDIO_DEVICE_IN_SPDIF;
+            tdata.act_audio_state = 1;
+            tdata.act_audio_mode = tdata.spdif_audio_mode;
+            tdata.act_sample_rate = tdata.spdif_sample_rate;
+            tdata.act_num_channels = tdata.spdif_num_channels;
+
+            start_rec_thread();
+        }
+        break;
+    case AUDIO_DEVICE_IN_HDMI:
+        if (tdata.act_input_device != tdata.new_input_device) {
+            stop_rec_thread();
+
+            if (tdata.new_input_device == AUDIO_DEVICE_IN_HDMI) {
+                fprintf(log_file, "old      audio_state: %d, audio_format: %d, rate: %d, channels: %d\n",
+                    tdata.act_audio_state, tdata.act_audio_mode,
+                    tdata.act_sample_rate, tdata.act_num_channels);
+                fprintf(log_file, "new hdmi audio_state: %d, audio_format: %d, rate: %d, channels: %d\n",
+                    tdata.hdmi_audio_state, tdata.hdmi_audio_mode,
+                    tdata.hdmi_sample_rate, tdata.hdmi_num_channels);
+
+                tdata.act_input_device = AUDIO_DEVICE_IN_HDMI;
+                tdata.act_audio_state = tdata.hdmi_audio_state;
+                tdata.act_audio_mode = tdata.hdmi_audio_mode;
+                tdata.act_sample_rate = tdata.hdmi_sample_rate;
+                tdata.act_num_channels = tdata.hdmi_num_channels;
+
+                if (tdata.hdmi_audio_state)
+                    start_rec_thread();
+            } else {
+                tdata.act_input_device = AUDIO_DEVICE_IN_HDMI_ARC;
+                if (tdata.hdmi_arc_enable) {
+                    fprintf(log_file, "old     audio_state: %d, audio_format: %d, rate: %d, channels: %d\n",
+                        tdata.act_audio_state, tdata.act_audio_mode,
+                        tdata.act_sample_rate, tdata.act_num_channels);
+                    fprintf(log_file, "new arc audio_state: %d, audio_format: %d, rate: %d, channels: %d\n",
+                        tdata.spdif_arc_audio_state, tdata.spdif_arc_audio_mode,
+                        tdata.spdif_arc_sample_rate, tdata.spdif_arc_num_channels);
+
+                    tdata.act_audio_state = 1;
+                    tdata.act_audio_mode = tdata.spdif_arc_audio_mode;
+                    tdata.act_sample_rate = tdata.spdif_arc_sample_rate;
+                    tdata.act_num_channels = tdata.spdif_arc_num_channels;
+                } else {
+                    fprintf(log_file, "old      audio_state: %d, audio_format: %d, rate: %d, channels: %d\n",
+                        tdata.act_audio_state, tdata.act_audio_mode,
+                        tdata.act_sample_rate, tdata.act_num_channels);
+                    fprintf(log_file, "new arc (from hdmi) audio_state: %d, audio_format: %d, rate: %d, channels: %d\n",
+                        tdata.hdmi_audio_state, tdata.hdmi_audio_mode,
+                        tdata.hdmi_sample_rate, tdata.hdmi_num_channels);
+
+                    tdata.act_audio_state = 1;
+                    tdata.act_audio_mode = tdata.hdmi_audio_mode;
+                    tdata.act_sample_rate = tdata.hdmi_sample_rate;
+                    tdata.act_num_channels = tdata.hdmi_num_channels;
+                }
+                start_rec_thread();
+            }
+        } else { /* check for change on same audio device */
+            if (tdata.new_input_device == AUDIO_DEVICE_IN_HDMI) {
+                if ((tdata.act_audio_state != tdata.hdmi_audio_state) ||
+                    (tdata.act_audio_mode != tdata.hdmi_audio_mode) ||
+                    (tdata.act_sample_rate != tdata.hdmi_sample_rate) ||
+                    (tdata.act_num_channels != tdata.hdmi_num_channels)) {
+
+                    fprintf(log_file, "old      audio_state: %d, audio_format: %d, rate: %d, channels: %d\n",
+                        tdata.act_audio_state, tdata.act_audio_mode,
+                        tdata.act_sample_rate, tdata.act_num_channels);
+                    fprintf(log_file, "new hdmi audio_state: %d, audio_format: %d, rate: %d, channels: %d\n",
+                        tdata.hdmi_audio_state, tdata.hdmi_audio_mode,
+                        tdata.hdmi_sample_rate, tdata.hdmi_num_channels);
+
+                    stop_rec_thread();
+
+                    tdata.act_audio_state = tdata.hdmi_audio_state;
+                    tdata.act_audio_mode = tdata.hdmi_audio_mode;
+                    tdata.act_sample_rate = tdata.hdmi_sample_rate;
+                    tdata.act_num_channels = tdata.hdmi_num_channels;
+
+                    if (tdata.hdmi_audio_state)
+                        start_rec_thread();
+                    }
+            } else {
+                if (tdata.spdif_arc_audio_state == 2) {
+                    fprintf(log_file, "old     audio_state: %d, audio_format: %d, rate: %d, channels: %d\n",
+                        tdata.act_audio_state, tdata.act_audio_mode,
+                        tdata.act_sample_rate, tdata.act_num_channels);
+                    fprintf(log_file, "new arc audio_state: %d, audio_format: %d, rate: %d, channels: %d\n",
+                        tdata.spdif_arc_audio_state, tdata.spdif_arc_audio_mode,
+                        tdata.spdif_arc_sample_rate, tdata.spdif_arc_num_channels);
+
+                    stop_rec_thread();
+
+                    tdata.act_audio_state = 1;
+                    tdata.act_audio_mode = tdata.spdif_arc_audio_mode;
+                    tdata.act_sample_rate = tdata.spdif_arc_sample_rate;
+                    tdata.act_num_channels = tdata.spdif_arc_num_channels;
+
+                    start_rec_thread();
+                }
+            }
+        }
+        break;
+    }
+}
+
+int poll_event_init()
+{
+    struct sockaddr_nl sock_addr;
+    int sz = (64*1024);
+    int soc;
+
+    memset(&sock_addr, 0, sizeof(sock_addr));
+    sock_addr.nl_family = AF_NETLINK;
+    sock_addr.nl_pid = getpid();
+    sock_addr.nl_groups = 0xffffffff;
+
+    soc = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_KOBJECT_UEVENT);
+    if (soc < 0) {
+        return 0;
+    }
+
+    setsockopt(soc, SOL_SOCKET, SO_RCVBUFFORCE, &sz, sizeof(sz));
+
+    if (bind(soc, (struct sockaddr*) &sock_addr, sizeof(sock_addr)) < 0) {
+        close(soc);
+        return 0;
+    }
+
+    sock_event_fd = soc;
+
+    return (soc > 0);
+}
+
+void* listen_uevent()
+{
+    char buffer[64*1024];
+    struct pollfd fds;
+    int i, count;
+    int j;
+    char *dev_path = NULL;
+    char *switch_state = NULL;
+    char *switch_name = NULL;
+    int audio_changed;
+
+    input_restart_check();
+
+    while(!stop_test) {
+
+        fds.fd = sock_event_fd;
+        fds.events = POLLIN;
+        fds.revents = 0;
+        i = poll(&fds, 1, 5); /* wait 5 msec */
+
+        if (i > 0 && (fds.revents & POLLIN)) {
+            count = recv(sock_event_fd, buffer, (64*1024), 0 );
+            if (count > 0) {
+                buffer[count] = '\0';
+                audio_changed = 0;
+                j = 0;
+                while(j < count) {
+                    if (strncmp(&buffer[j], "DEVPATH=", 8) == 0) {
+                        dev_path = &buffer[j+8];
+                        j += 8;
+                        continue;
+                    } else if (tdata.input_device == AUDIO_DEVICE_IN_SPDIF) {
+                        if (strncmp(&buffer[j], "PRI_SPDIF_TX=MEDIA_CONFIG_CHANGE", strlen("PRI_SPDIF_TX=MEDIA_CONFIG_CHANGE")) == 0) {
+                            audio_changed = 1;
+                            ALOGI("AUDIO CHANGE EVENT: %s\n", &buffer[j]);
+                            j += strlen("PRI_SPDIF_TX=MEDIA_CONFIG_CHANGE");
+                            continue;
+                        }
+                    } else if (tdata.input_device == AUDIO_DEVICE_IN_HDMI) {
+                        if (strncmp(&buffer[j], "EP92EVT_AUDIO=MEDIA_CONFIG_CHANGE", strlen("EP92EVT_AUDIO=MEDIA_CONFIG_CHANGE")) == 0) {
+                            audio_changed = 1;
+                            ALOGI("AUDIO CHANGE EVENT: %s\n", &buffer[j]);
+                            j += strlen("EP92EVT_AUDIO=MEDIA_CONFIG_CHANGE");
+                            continue;
+                        } else if (strncmp(&buffer[j], "SEC_SPDIF_TX=MEDIA_CONFIG_CHANGE", strlen("SEC_SPDIF_TX=MEDIA_CONFIG_CHANGE")) == 0) {
+                            audio_changed = 1;
+                            ALOGI("AUDIO CHANGE EVENT: %s\n", &buffer[j]);
+                            j += strlen("SEC_SPDIF_TX=MEDIA_CONFIG_CHANGE");
+                            continue;
+                        } else if (strncmp(&buffer[j], "EP92EVT_", 8) == 0) {
+                            ALOGI("EVENT: %s\n", &buffer[j]);
+                            j += 8;
+                            continue;
+                        }
+                    }
+                    j++;
+                }
+
+                if (audio_changed)
+                    input_restart_check();
+            }
+        } else {
+            ALOGV("NO Data\n");
+        }
+    }
+
+    stop_rec_thread();
+}
+
+void fill_default_params(struct test_data *tdata) {
+    memset(tdata, 0, sizeof(struct test_data));
+
+    tdata->input_device = AUDIO_DEVICE_IN_SPDIF;
+    tdata->bit_width = 24;
+    tdata->source = AUDIO_SOURCE_UNPROCESSED;
+    tdata->record_length = 8 /*sec*/;
+
+    tdata->handle = 0x99A;
+}
+
+void usage() {
+    printf(" \n Command \n");
+    printf(" \n fmt_change_test <options>\n");
+    printf(" \n Options\n");
+    printf(" -d  --device <int>                 - see system/media/audio/include/system/audio.h for device values\n");
+    printf("                                      spdif_in 2147549184, hdmi_in 2147483680\n");
+    printf("                                      Optional Argument and Default value is spdif_in\n\n");
+    printf(" -b  --bits  <int>                  - Bitwidth in PCM mode (16, 24 or 32), Default is 24\n\n");
+    printf(" -F  --flags  <int>                 - Integer value of flags to be used for opening input stream\n\n");
+    printf(" -t  --recording-time <in seconds>  - Time duration for the recording\n\n");
+    printf(" -l  --log-file <FILEPATH>          - File path for debug msg, to print\n");
+    printf("                                      on console use stdout or 1 \n\n");
+    printf(" -h  --help                         - Show this help\n\n");
+    printf(" \n Examples \n");
+    printf(" hdmi_in_event_test                          -> start a recording stream with default configurations\n\n");
+    printf(" hdmi_in_event_test -d 2147483680 -t 20      -> start a recording session, with device hdmi_in,\n");
+    printf("                                                record data for 20 secs.\n\n");
+}
+
+static void qti_audio_server_death_notify_cb(void *ctxt) {
+    fprintf(log_file, "qas died\n");
+    fprintf(stderr, "qas died\n");
+    stop_test = true;
+    stop_record = true;
+}
+
+int main(int argc, char* argv[])
+{
+    qahw_module_handle_t *qahw_mod_handle;
+    const  char *mod_name = "audio.primary";
+
+    char log_filename[256] = "stdout";
+    int i;
+    int ret = -1;
+
+    log_file = stdout;
+    fill_default_params(&tdata);
+    struct option long_options[] = {
+        /* These options set a flag. */
+        {"device",          required_argument,    0, 'd'},
+        {"bits",            required_argument,    0, 'b'},
+        {"flags",           required_argument,    0, 'F'},
+        {"recording-time",  required_argument,    0, 't'},
+        {"log-file",        required_argument,    0, 'l'},
+        {"help",            no_argument,          0, 'h'},
+        {0, 0, 0, 0}
+    };
+
+    int opt = 0;
+    int option_index = 0;
+    while ((opt = getopt_long(argc,
+                              argv,
+                              "-d:b:F:t:l:h",
+                              long_options,
+                              &option_index)) != -1) {
+            switch (opt) {
+            case 'd':
+                tdata.input_device = atoll(optarg);
+                break;
+            case 'b':
+                tdata.bit_width = atoll(optarg);
+                break;
+            case 'F':
+                tdata.flags = atoll(optarg);
+                break;
+            case 't':
+                tdata.record_length = atoi(optarg);
+                break;
+            case 'l':
+                snprintf(log_filename, sizeof(log_filename), "%s", optarg);
+                break;
+            case 'h':
+                usage();
+                return 0;
+                break;
+         }
+    }
+    fprintf(log_file, "registering qas callback");
+    qahw_register_qas_death_notify_cb((audio_error_callback)qti_audio_server_death_notify_cb, context);
+
+    switch (tdata.input_device) {
+    case AUDIO_DEVICE_IN_SPDIF:
+        break;
+    case AUDIO_DEVICE_IN_HDMI:
+        break;
+    default:
+        fprintf(log_file, "device %d not supported\n", tdata.input_device);
+        return -1;
+    }
+
+    switch (tdata.bit_width) {
+    case 16:
+    case 24:
+    case 32:
+        break;
+    default:
+        fprintf(log_file, "bitwidth %d not supported\n", tdata.bit_width);
+        return -1;
+    }
+
+    qahw_mod_handle = qahw_load_module(mod_name);
+    if(qahw_mod_handle == NULL) {
+        fprintf(log_file, " qahw_load_module failed");
+        return -1;
+    }
+    fprintf(log_file, " Starting audio recording test. \n");
+    if (strcasecmp(log_filename, "stdout") && strcasecmp(log_filename, "1")) {
+        if ((log_file = fopen(log_filename,"wb"))== NULL) {
+            fprintf(stderr, "Cannot open log file %s\n", log_filename);
+            /* continue to log to std out */
+            log_file = stdout;
+        }
+    }
+
+    tdata.qahw_mod_handle = qahw_mod_handle;
+
+    /* Register the SIGINT to close the App properly */
+    if (signal(SIGINT, stop_signal_handler) == SIG_ERR)
+        fprintf(log_file, "Failed to register SIGINT:%d\n", errno);
+
+    /* Register the SIGTERM to close the App properly */
+    if (signal(SIGTERM, stop_signal_handler) == SIG_ERR)
+        fprintf(log_file, "Failed to register SIGTERM:%d\n", errno);
+
+    time_t start_time = time(0);
+    double time_elapsed = 0;
+
+    pthread_attr_init(&tdata.poll_event_attr);
+    pthread_attr_setdetachstate(&tdata.poll_event_attr, PTHREAD_CREATE_JOINABLE);
+    poll_event_init();
+    pthread_create(&tdata.poll_event_th, &tdata.poll_event_attr,
+                       (void *) listen_uevent, NULL);
+
+    while(true && !stop_test) {
+        time_elapsed = difftime(time(0), start_time);
+        if (tdata.record_length && (time_elapsed > tdata.record_length)) {
+            fprintf(log_file, "\n Test completed.\n");
+            stop_test = true;
+            break;
+        }
+    }
+
+    fprintf(log_file, "\n Stop test \n");
+
+    pthread_join(tdata.poll_event_th, NULL);
+
+    fprintf(log_file, "\n Unload HAL\n");
+
+    ret = qahw_unload_module(qahw_mod_handle);
+    if (ret) {
+        fprintf(log_file, "could not unload hal %d\n", ret);
+    }
+
+    fprintf(log_file, "Done with hal record test\n");
+    if (log_file != stdout) {
+        if (log_file) {
+          fclose(log_file);
+          log_file = NULL;
+        }
+    }
+
+    return 0;
+}
diff --git a/post_proc/Android.mk b/post_proc/Android.mk
index 5da769c..4441ab0 100644
--- a/post_proc/Android.mk
+++ b/post_proc/Android.mk
@@ -39,6 +39,10 @@
     LOCAL_SRC_FILES += asphere.c
 endif
 
+ifeq ($(strip $(AUDIO_FEATURE_ENABLED_INSTANCE_ID)), true)
+    LOCAL_CFLAGS += -DINSTANCE_ID_ENABLED
+endif
+
 LOCAL_CFLAGS+= -O2 -fvisibility=hidden
 
 ifneq ($(strip $(AUDIO_FEATURE_DISABLED_DTS_EAGLE)),true)
@@ -110,10 +114,6 @@
 LOCAL_CFLAGS += -DHW_ACC_HPX
 endif
 
-ifeq ($(strip $(AUDIO_FEATURE_ENABLED_INSTANCE_ID)), true)
-    LOCAL_CFLAGS += -DINSTANCE_ID_ENABLED
-endif
-
 LOCAL_MODULE:= libhwacceffectswrapper
 LOCAL_VENDOR_MODULE := true
 
diff --git a/post_proc/bass_boost.c b/post_proc/bass_boost.c
index 68cd46f..02c68d4 100644
--- a/post_proc/bass_boost.c
+++ b/post_proc/bass_boost.c
@@ -32,6 +32,8 @@
 #include "effect_api.h"
 #include "bass_boost.h"
 
+#define BASSBOOST_MAX_LATENCY 30
+
 /* Offload bassboost UUID: 2c4a8c24-1581-487f-94f6-0002a5d5c51b */
 const effect_descriptor_t bassboost_descriptor = {
         {0x0634f220, 0xddd4, 0x11db, 0xa0fc, { 0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b }},
@@ -101,6 +103,11 @@
            p->status = -EINVAL;
         p->vsize = sizeof(int16_t);
         break;
+    case BASSBOOST_PARAM_LATENCY:
+        if (p->vsize < sizeof(uint32_t))
+           p->status = -EINVAL;
+        p->vsize = sizeof(uint32_t);
+        break;
     default:
         p->status = -EINVAL;
     }
@@ -127,6 +134,10 @@
             *(int16_t *)value = 0;
         break;
 
+    case BASSBOOST_PARAM_LATENCY:
+        *(uint32_t *)value = BASSBOOST_MAX_LATENCY;
+        break;
+
     default:
         p->status = -EINVAL;
         break;
diff --git a/post_proc/bass_boost.h b/post_proc/bass_boost.h
index 8bf51d3..ff674d4 100644
--- a/post_proc/bass_boost.h
+++ b/post_proc/bass_boost.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2015, 2018, The Linux Foundation. All rights reserved.
  * Not a Contribution.
  *
  * Copyright (C) 2013 The Android Open Source Project
@@ -20,6 +20,8 @@
 #ifndef OFFLOAD_EFFECT_BASS_BOOST_H_
 #define OFFLOAD_EFFECT_BASS_BOOST_H_
 
+#define BASSBOOST_PARAM_LATENCY 0x80000000
+
 #include "bundle.h"
 
 enum {
diff --git a/post_proc/equalizer.c b/post_proc/equalizer.c
index c1c1303..479f848 100644
--- a/post_proc/equalizer.c
+++ b/post_proc/equalizer.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2014, 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, 2017-2018, The Linux Foundation. All rights reserved.
  * Not a Contribution.
  *
  * Copyright (C) 2013 The Android Open Source Project
@@ -29,6 +29,8 @@
 #include "effect_api.h"
 #include "equalizer.h"
 
+#define EQUALIZER_MAX_LATENCY 0
+
 /* Offload equalizer UUID: a0dac280-401c-11e3-9379-0002a5d5c51b */
 const effect_descriptor_t equalizer_descriptor = {
         {0x0bed4300, 0xddd6, 0x11db, 0x8f34, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}}, // type
@@ -253,6 +255,12 @@
         p->vsize = (2 + NUM_EQ_BANDS) * sizeof(uint16_t);
         break;
 
+    case EQ_PARAM_LATENCY:
+        if (p->vsize < sizeof(uint32_t))
+           p->status = -EINVAL;
+        p->vsize = sizeof(uint32_t);
+        break;
+
     default:
         p->status = -EINVAL;
     }
@@ -352,6 +360,10 @@
         }
     } break;
 
+    case EQ_PARAM_LATENCY:
+        *(uint32_t *)value = EQUALIZER_MAX_LATENCY;
+        break;
+
     default:
         p->status = -EINVAL;
         break;
diff --git a/post_proc/equalizer.h b/post_proc/equalizer.h
index 7fec058..2cd06c2 100644
--- a/post_proc/equalizer.h
+++ b/post_proc/equalizer.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, 2018, The Linux Foundation. All rights reserved.
  * Not a Contribution.
  *
  * Copyright (C) 2013 The Android Open Source Project
@@ -26,6 +26,8 @@
 #define INVALID_PRESET		 -2
 #define PRESET_CUSTOM		 -1
 
+#define EQ_PARAM_LATENCY 0x80000000
+
 extern const effect_descriptor_t equalizer_descriptor;
 
 typedef struct equalizer_context_s {
diff --git a/post_proc/reverb.c b/post_proc/reverb.c
index e97b651..a0a0441 100644
--- a/post_proc/reverb.c
+++ b/post_proc/reverb.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 - 2014, 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013 - 2014, 2017-2018, The Linux Foundation. All rights reserved.
  * Not a Contribution.
  *
  * Copyright (C) 2013 The Android Open Source Project
@@ -30,6 +30,8 @@
 #include "effect_api.h"
 #include "reverb.h"
 
+#define REVERB_MAX_LATENCY 100
+
 /* Offload auxiliary environmental reverb UUID: 79a18026-18fd-4185-8233-0002a5d5c51b */
 const effect_descriptor_t aux_env_reverb_descriptor = {
         { 0xc2e5d5f0, 0x94bd, 0x4763, 0x9cac, { 0x4e, 0x23, 0x4d, 0x06, 0x83, 0x9e } },
@@ -522,6 +524,11 @@
            p->status = -EINVAL;
         p->vsize = sizeof(reverb_settings_t);
         break;
+    case REVERB_PARAM_LATENCY:
+        if (p->vsize < sizeof(uint32_t))
+            return -EINVAL;
+        p->vsize = sizeof(uint32_t);
+        break;
     default:
         p->status = -EINVAL;
     }
@@ -575,6 +582,9 @@
         reverb_settings->diffusion = reverb_get_diffusion(reverb_ctxt);
         reverb_settings->density = reverb_get_density(reverb_ctxt);
         break;
+    case REVERB_PARAM_LATENCY:
+        *(uint16_t *)value = REVERB_MAX_LATENCY;
+        break;
     default:
         p->status = -EINVAL;
         break;
diff --git a/post_proc/reverb.h b/post_proc/reverb.h
index 3bdd9af..cc11c46 100644
--- a/post_proc/reverb.h
+++ b/post_proc/reverb.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, 2018, The Linux Foundation. All rights reserved.
  * Not a Contribution.
  *
  * Copyright (C) 2013 The Android Open Source Project
@@ -24,6 +24,8 @@
 
 #define REVERB_DEFAULT_PRESET REVERB_PRESET_NONE
 
+#define REVERB_PARAM_LATENCY 0x80000000
+
 extern const effect_descriptor_t aux_env_reverb_descriptor;
 extern const effect_descriptor_t ins_env_reverb_descriptor;
 extern const effect_descriptor_t aux_preset_reverb_descriptor;
diff --git a/post_proc/virtualizer.c b/post_proc/virtualizer.c
index dfa7691..578cf0b 100644
--- a/post_proc/virtualizer.c
+++ b/post_proc/virtualizer.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2015, 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2015, 2017-2018, The Linux Foundation. All rights reserved.
  * Not a Contribution.
  *
  * Copyright (C) 2013 The Android Open Source Project
@@ -29,6 +29,8 @@
 #include "effect_api.h"
 #include "virtualizer.h"
 
+#define VIRUALIZER_MAX_LATENCY 30
+
 /* Offload Virtualizer UUID: 509a4498-561a-4bea-b3b1-0002a5d5c51b */
 const effect_descriptor_t virtualizer_descriptor = {
         {0x37cc2c00, 0xdddd, 0x11db, 0x8577, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}},
@@ -304,6 +306,11 @@
            p->status = -EINVAL;
         p->vsize = sizeof(uint32_t);
         break;
+    case VIRTUALIZER_PARAM_LATENCY:
+        if (p->vsize < sizeof(uint32_t))
+            p->status = -EINVAL;
+        p->vsize = sizeof(uint32_t);
+        break;
     default:
         p->status = -EINVAL;
     }
@@ -347,6 +354,10 @@
         *(uint32_t *)value  = (uint32_t) virtualizer_get_virtualization_mode(virt_ctxt);
         break;
 
+    case VIRTUALIZER_PARAM_LATENCY:
+        *(uint32_t *)value = VIRUALIZER_MAX_LATENCY;
+        break;
+
     default:
         p->status = -EINVAL;
         break;
diff --git a/post_proc/virtualizer.h b/post_proc/virtualizer.h
index 904a0c6..c0e6a87 100644
--- a/post_proc/virtualizer.h
+++ b/post_proc/virtualizer.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2015, 2018, The Linux Foundation. All rights reserved.
  * Not a Contribution.
  *
  * Copyright (C) 2013 The Android Open Source Project
@@ -20,6 +20,8 @@
 #ifndef OFFLOAD_VIRTUALIZER_H_
 #define OFFLOAD_VIRTUALIZER_H_
 
+#define VIRTUALIZER_PARAM_LATENCY 0x80000000
+
 #include "bundle.h"
 
 extern const effect_descriptor_t virtualizer_descriptor;
diff --git a/qahw/inc/qahw.h b/qahw/inc/qahw.h
index e91fd00..dd5b403 100644
--- a/qahw/inc/qahw.h
+++ b/qahw/inc/qahw.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
  * Not a Contribution.
  *
  * Copyright (C) 2011 The Android Open Source Project *
@@ -463,6 +463,13 @@
 /* Release an audio patch */
 int qahw_release_audio_patch_l(qahw_module_handle_t *hw_module,
                         audio_patch_handle_t handle);
+
+/* API to set loopback stream specific config parameters. */
+int qahw_loopback_set_param_data_l(qahw_module_handle_t *hw_module,
+                                   audio_patch_handle_t handle,
+                                   qahw_loopback_param_id param_id,
+                                   qahw_loopback_param_payload *payload);
+
 /* Fills the list of supported attributes for a given audio port.
  * As input, "port" contains the information (type, role, address etc...)
  * needed by the HAL to identify the port.
diff --git a/qahw/inc/qahw_defs.h b/qahw/inc/qahw_defs.h
index 4e7faff..755553b 100644
--- a/qahw/inc/qahw_defs.h
+++ b/qahw/inc/qahw_defs.h
@@ -417,6 +417,14 @@
     QAHW_PARAM_LICENSE_PARAMS,
 } qahw_param_id;
 
+typedef union {
+    struct qahw_out_render_window_param render_window_params;
+} qahw_loopback_param_payload;
+
+typedef enum {
+    QAHW_PARAM_LOOPBACK_RENDER_WINDOW /* PARAM to set render window */
+} qahw_loopback_param_id;
+
 __END_DECLS
 
 #endif  // QTI_AUDIO_HAL_DEFS_H
diff --git a/qahw/src/qahw.c b/qahw/src/qahw.c
index 0c00158..126f794 100644
--- a/qahw/src/qahw.c
+++ b/qahw/src/qahw.c
@@ -69,6 +69,10 @@
                                       qahw_param_id param_id,
                                       qahw_param_payload *payload);
 
+typedef int (*qahwi_loopback_set_param_data_t)(audio_patch_handle_t patch_handle,
+                                               qahw_param_id param_id,
+                                               qahw_param_payload *payload);
+
 typedef struct {
     audio_hw_device_t *audio_device;
     char module_name[MAX_MODULE_NAME_LENGTH];
@@ -80,6 +84,7 @@
     const hw_module_t* module;
     qahwi_get_param_data_t qahwi_get_param_data;
     qahwi_set_param_data_t qahwi_set_param_data;
+    qahwi_loopback_set_param_data_t qahwi_loopback_set_param_data;
 } qahw_module_t;
 
 typedef struct {
@@ -1438,6 +1443,34 @@
      return ret;
 }
 
+int qahw_loopback_set_param_data_l(qahw_module_handle_t *hw_module,
+                                   audio_patch_handle_t handle,
+                                   qahw_loopback_param_id param_id,
+                                   qahw_loopback_param_payload *payload)
+
+{
+    int ret = -EINVAL;
+    qahw_module_t *qahw_module = (qahw_module_t *)hw_module;
+
+    if (!payload) {
+        ALOGE("%s:: invalid param", __func__);
+        goto exit;
+    }
+
+    if (qahw_module->qahwi_loopback_set_param_data) {
+        ret = qahw_module->qahwi_loopback_set_param_data(handle,
+                                                         param_id,
+                                                         (void *)payload);
+    } else {
+        ret = -ENOSYS;
+        ALOGE("%s not supported\n", __func__);
+    }
+
+exit:
+    return ret;
+
+}
+
 /* Fills the list of supported attributes for a given audio port.
  * As input, "port" contains the information (type, role, address etc...)
  * needed by the HAL to identify the port.
@@ -1889,6 +1922,12 @@
     if (!qahw_module->qahwi_set_param_data)
          ALOGD("%s::qahwi_set_param_data api is not defined\n",__func__);
 
+    qahw_module->qahwi_loopback_set_param_data = (qahwi_loopback_set_param_data_t)
+                                                  dlsym(module->dso,
+                                                  "qahwi_loopback_set_param_data");
+    if (!qahw_module->qahwi_loopback_set_param_data)
+         ALOGD("%s::qahwi_loopback_set_param_data api is not defined\n", __func__);
+
     if (!qahw_list_count)
         list_init(&qahw_module_list);
     qahw_list_count++;
diff --git a/qahw_api/inc/qahw_api.h b/qahw_api/inc/qahw_api.h
index 0aa3c79..823c6bb 100644
--- a/qahw_api/inc/qahw_api.h
+++ b/qahw_api/inc/qahw_api.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
  * Not a Contribution.
  *
  * Copyright (C) 2011 The Android Open Source Project *
@@ -459,6 +459,13 @@
 /* Release an audio patch */
 int qahw_release_audio_patch(qahw_module_handle_t *hw_module,
                         audio_patch_handle_t handle);
+
+/* API to set loopback stream specific config parameters */
+int qahw_loopback_set_param_data(qahw_module_handle_t *hw_module,
+                                 audio_patch_handle_t handle,
+                                 qahw_loopback_param_id param_id,
+                                 qahw_loopback_param_payload *payload);
+
 /* Fills the list of supported attributes for a given audio port.
  * As input, "port" contains the information (type, role, address etc...)
  * needed by the HAL to identify the port.
diff --git a/qahw_api/inc/qahw_defs.h b/qahw_api/inc/qahw_defs.h
index c6d42ca..7c01c57 100644
--- a/qahw_api/inc/qahw_defs.h
+++ b/qahw_api/inc/qahw_defs.h
@@ -399,6 +399,15 @@
     QAHW_PARAM_LICENSE_PARAMS,
 } qahw_param_id;
 
+
+typedef union {
+    struct qahw_out_render_window_param render_window_params;
+} qahw_loopback_param_payload;
+
+typedef enum {
+    QAHW_PARAM_LOOPBACK_RENDER_WINDOW /* PARAM to set render window */
+} qahw_loopback_param_id;
+
 __END_DECLS
 
 #endif  // QTI_AUDIO_HAL_DEFS_H
diff --git a/qahw_api/inc/qahw_effect_bassboost.h b/qahw_api/inc/qahw_effect_bassboost.h
index 2ca8409..b397f21 100644
--- a/qahw_api/inc/qahw_effect_bassboost.h
+++ b/qahw_api/inc/qahw_effect_bassboost.h
@@ -40,7 +40,9 @@
 typedef enum
 {
     BASSBOOST_PARAM_STRENGTH_SUPPORTED,
-    BASSBOOST_PARAM_STRENGTH
+    BASSBOOST_PARAM_STRENGTH,
+    BASSBOOST_PARAM_LATENCY = 0x80000000 // Internal paramter specific to qahw.
+                                         // Used to get latency introduced by bassboost effect.
 } qahw_bassboost_params;
 
 #ifdef __cplusplus
diff --git a/qahw_api/inc/qahw_effect_environmentalreverb.h b/qahw_api/inc/qahw_effect_environmentalreverb.h
index a47eb28..61ef39e 100644
--- a/qahw_api/inc/qahw_effect_environmentalreverb.h
+++ b/qahw_api/inc/qahw_effect_environmentalreverb.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
  * Not a Contribution.
  *
  * Copyright (C) 2011 The Android Open Source Project
@@ -22,7 +22,7 @@
 
 #include <qahw_effect_api.h>
 
-#if __cplusplus
+#ifdef __cplusplus
 extern "C" {
 #endif
 
@@ -55,7 +55,9 @@
     REVERB_PARAM_DIFFUSION,             // in permilles,    range 0 to 1000
     REVERB_PARAM_DENSITY,               // in permilles,    range 0 to 1000
     REVERB_PARAM_PROPERTIES,
-    REVERB_PARAM_BYPASS
+    REVERB_PARAM_BYPASS,
+    REVERB_PARAM_LATENCY = 0x80000000   // Internal paramter specific to qahw.
+                                        // Used to get latency introduced by reverb effect.
 } qahw_env_reverb_params;
 
 //qahw_reverb_settings is equal to SLEnvironmentalReverbSettings defined in OpenSL ES specification.
@@ -73,7 +75,7 @@
 } __attribute__((packed)) qahw_reverb_settings;
 
 
-#if __cplusplus
+#ifdef __cplusplus
 }  // extern "C"
 #endif
 
diff --git a/qahw_api/inc/qahw_effect_equalizer.h b/qahw_api/inc/qahw_effect_equalizer.h
index fd71c4c..e4d6c5b 100644
--- a/qahw_api/inc/qahw_effect_equalizer.h
+++ b/qahw_api/inc/qahw_effect_equalizer.h
@@ -50,7 +50,9 @@
     EQ_PARAM_CUR_PRESET,            // Gets/Sets the current preset.
     EQ_PARAM_GET_NUM_OF_PRESETS,    // Gets the total number of presets the equalizer supports.
     EQ_PARAM_GET_PRESET_NAME,       // Gets the preset name based on the index.
-    EQ_PARAM_PROPERTIES             // Gets/Sets all parameters at a time.
+    EQ_PARAM_PROPERTIES,            // Gets/Sets all parameters at a time.
+    EQ_PARAM_LATENCY = 0x80000000   // Internal paramter specific to qahw.
+                                    // Used to get latency introduced by equalizer effect.
 } qahw_equalizer_params;
 
 enum
diff --git a/qahw_api/inc/qahw_effect_virtualizer.h b/qahw_api/inc/qahw_effect_virtualizer.h
index 5ff95ce..481f0ef 100644
--- a/qahw_api/inc/qahw_effect_virtualizer.h
+++ b/qahw_api/inc/qahw_effect_virtualizer.h
@@ -75,7 +75,10 @@
     //                                   AUDIO_DEVICE_NONE when not virtualizing
     //   status     int -EINVAL if an error occurred
     //                  0       if the output value is successfully retrieved
-    VIRTUALIZER_PARAM_VIRTUALIZATION_MODE
+    VIRTUALIZER_PARAM_VIRTUALIZATION_MODE,
+    // Internal paramter specific to qahw.
+    // Used to get latency introduced by virtuaizer effect.
+    VIRTUALIZER_PARAM_LATENCY = 0x80000000
 } qahw_virtualizer_params;
 
 #ifdef __cplusplus
diff --git a/qahw_api/src/qahw_api.cpp b/qahw_api/src/qahw_api.cpp
index cbd9041..f1c75f4 100644
--- a/qahw_api/src/qahw_api.cpp
+++ b/qahw_api/src/qahw_api.cpp
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2016-2017, The Linux Foundation. All rights reserved.
+* Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
@@ -915,6 +915,15 @@
     }
 }
 
+int qahw_loopback_set_param_data(qahw_module_handle_t *hw_module __unused,
+                                 audio_patch_handle_t handle __unused,
+                                 qahw_loopback_param_id param_id __unused,
+                                 qahw_loopback_param_payload *payload __unused)
+{
+    ALOGD("%d:%s", __LINE__, __func__);
+    return -ENOSYS;
+}
+
 int qahw_get_audio_port(qahw_module_handle_t *hw_module,
                       struct audio_port *port)
 {
@@ -1699,6 +1708,15 @@
     return qahw_release_audio_patch_l(hw_module, handle);
 }
 
+int qahw_loopback_set_param_data(qahw_module_handle_t *hw_module,
+                                 audio_patch_handle_t handle,
+                                 qahw_loopback_param_id param_id,
+                                 qahw_loopback_param_payload *payload)
+{
+    ALOGV("%d:%s\n", __LINE__, __func__);
+    return qahw_loopback_set_param_data_l(hw_module, handle, param_id, payload);
+}
+
 int qahw_get_audio_port(qahw_module_handle_t *hw_module,
                       struct audio_port *port)
 {
diff --git a/qahw_api/test/qahw_playback_test.c b/qahw_api/test/qahw_playback_test.c
index 253d59e..556f520 100644
--- a/qahw_api/test/qahw_playback_test.c
+++ b/qahw_api/test/qahw_playback_test.c
@@ -2571,6 +2571,7 @@
         fprintf(log_file, "stream %d: Output Flags:%d\n", stream->stream_index, stream->flags);
         fprintf(log_file, "stream %d: Sample Rate:%d\n", stream->stream_index, stream->config.offload_info.sample_rate);
         fprintf(log_file, "stream %d: Channels:%d\n", stream->stream_index, stream->channels);
+        fprintf(log_file, "stream %d: Channel Mask:%x\n", stream->stream_index, stream->config.channel_mask);
         fprintf(log_file, "stream %d: Bitwidth:%d\n", stream->stream_index, stream->config.offload_info.bit_width);
         fprintf(log_file, "stream %d: AAC Format Type:%d\n", stream->stream_index, stream->aac_fmt_type);
         fprintf(log_file, "stream %d: Kvpair Values:%s\n", stream->stream_index, stream->kvpair_values);
