hal: Reduce debug logs

Remove or mute debug logs that are not necessary in debugging
usual audio HAL issues.

Change-Id: I832d9d95b6b24f64871524efbe65dd57850afd41
diff --git a/hal/audio_extn/audio_extn.c b/hal/audio_extn/audio_extn.c
index d53db94..783d37f 100644
--- a/hal/audio_extn/audio_extn.c
+++ b/hal/audio_extn/audio_extn.c
@@ -4038,7 +4038,7 @@
 void audio_extn_fm_get_parameters(struct str_parms *query, struct str_parms *reply)
 {
     if(audio_extn_fm_power_opt_enabled) {
-       ALOGD("%s: Enter", __func__);
+       ALOGV("%s: Enter", __func__);
        fm_get_parameters(query, reply);
     }
 }
@@ -4047,7 +4047,7 @@
                                   struct str_parms *parms)
 {
     if(audio_extn_fm_power_opt_enabled) {
-       ALOGD("%s: Enter", __func__);
+       ALOGV("%s: Enter", __func__);
        fm_set_parameters(adev, parms);
     }
 }
@@ -5626,7 +5626,7 @@
         return;
     } else {
         mixer_ctl_set_value(ctl, 0, value);
-        ALOGD("%s: mixer_value set %d", __func__, value);
+        ALOGV("%s: mixer_value set %d", __func__, value);
     }
     return;
 }
diff --git a/hal/audio_extn/device_utils.c b/hal/audio_extn/device_utils.c
index a0ee5b5..e1736ef 100644
--- a/hal/audio_extn/device_utils.c
+++ b/hal/audio_extn/device_utils.c
@@ -503,7 +503,6 @@
         goto done;
 
     if (type == AUDIO_DEVICE_NONE) {
-        ALOGE("%s: Invalid device: %#x", __func__, type);
         ret = -EINVAL;
         goto done;
     }
diff --git a/hal/audio_extn/hfp.c b/hal/audio_extn/hfp.c
index 3b084ae..bbdbfb5 100644
--- a/hal/audio_extn/hfp.c
+++ b/hal/audio_extn/hfp.c
@@ -545,7 +545,7 @@
     float vol;
     char value[32]={0};
 
-    ALOGD("%s: enter", __func__);
+    ALOGV("%s: enter", __func__);
 
     ret = str_parms_get_str(parms, AUDIO_PARAMETER_HFP_ENABLE, value,
                             sizeof(value));
diff --git a/hal/audio_extn/soundtrigger.c b/hal/audio_extn/soundtrigger.c
index 04f2268..52dd070 100644
--- a/hal/audio_extn/soundtrigger.c
+++ b/hal/audio_extn/soundtrigger.c
@@ -600,10 +600,8 @@
         uc_info->in_snd_device < SND_DEVICE_IN_END)) {
         if (is_same_as_st_device(uc_info->in_snd_device))
             update_device_list(&ev_info.device_info.devices, ST_DEVICE_HANDSET_MIC, "", true);
-    } else {
-        ALOGE("%s: invalid input device 0x%x, for event %d",
-                    __func__, uc_info->in_snd_device, event);
     }
+
     raise_event = platform_sound_trigger_usecase_needs_event(uc_info->id);
     ALOGD("%s: uc_info->id %d of type %d for Event %d, with Raise=%d",
         __func__, uc_info->id, uc_info->type, event, raise_event);
diff --git a/hal/audio_extn/spkr_protection.c b/hal/audio_extn/spkr_protection.c
index 8af4d80..6af81ca 100644
--- a/hal/audio_extn/spkr_protection.c
+++ b/hal/audio_extn/spkr_protection.c
@@ -2179,10 +2179,8 @@
     int err = 0;
     char value[MAX_STR_SIZE] = {0};
 
-    if (!handle.spkr_prot_enable) {
-        ALOGD("%s: Speaker protection disabled", __func__);
+    if (!handle.spkr_prot_enable)
         return -EINVAL;
-    }
 
     err = str_parms_get_str(query, AUDIO_PARAMETER_KEY_FBSP_GET_SPKR_CAL, value,
                                                           sizeof(value));
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index 5f10ca7..d396ae3 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -767,7 +767,8 @@
         else if (-ENOSYS == bw)
             bit_width = CODEC_BACKEND_DEFAULT_BIT_WIDTH;
         sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
-        ALOGI("%s Allowing 24 and above bits playback on speaker ONLY at default sampling rate", __func__);
+        ALOGV("%s Allowing 24 and above bits playback on speaker \
+                  ONLY at default sampling rate", __func__);
     }
 
     property_get("vendor.audio.playback.mch.downsample",value,"");
@@ -887,7 +888,7 @@
         *sample_rate = 16000;
         break;
     default:
-        ALOGD("%s:Not a BT SCO device, need not update sampling rate\n", __func__);
+        ALOGV("%s:Not a BT SCO device, need not update sampling rate\n", __func__);
         break;
     }
 }
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 0594b7b..5ee30c4 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -728,7 +728,7 @@
     if (stream_info != NULL)
         free(stream_info);
     pthread_mutex_unlock(&adev->lock);
-    ALOGD("%s: Added stream in io_streams_map with handle %d", __func__, handle);
+    ALOGV("%s: Added stream in io_streams_map with handle %d", __func__, handle);
     return 0;
 }
 
@@ -740,7 +740,7 @@
             hashmapRemove(adev->io_streams_map, (void *) (intptr_t) handle);
     if (s_info == NULL)
         goto done;
-    ALOGD("%s: Removed stream with handle %d", __func__, handle);
+    ALOGV("%s: Removed stream with handle %d", __func__, handle);
     patch_map_remove_l(adev, s_info->patch_handle);
     free(s_info);
 done:
@@ -994,15 +994,15 @@
                         if((new_backend_idx == HEADPHONE_BACKEND) &&
                                ((usecase_backend_idx == HEADPHONE_44_1_BACKEND) ||
                                (usecase_backend_idx == DSD_NATIVE_BACKEND))) {
-                            ALOGD("%s:DSD or native stream detected enabling asrcmode in hardware",
+                            ALOGV("%s:DSD or native stream detected enabling asrcmode in hardware",
                                   __func__);
                             enable_asrc_mode(adev);
                             break;
                         } else if(((new_backend_idx == HEADPHONE_44_1_BACKEND) ||
                                   (new_backend_idx == DSD_NATIVE_BACKEND)) &&
                                   (usecase_backend_idx == HEADPHONE_BACKEND)) {
-                            ALOGD("%s:48K stream detected, disabling and enabling it with asrcmode in hardware",
-                                  __func__);
+                            ALOGV("%s: 48K stream detected, disabling and enabling it \
+                                   with asrcmode in hardware", __func__);
                             disable_audio_route(adev, uc);
                             disable_snd_device(adev, uc->out_snd_device);
                             // Apply true-high-quality-mode if DSD or > 44.1KHz or >=24-bit
@@ -3067,7 +3067,7 @@
                                             &voip_out->app_type_cfg.gain[0]);
     }
 
-    ALOGD("%s: done",__func__);
+    ALOGV("%s: done",__func__);
 
     return status;
 }
@@ -3312,7 +3312,7 @@
 done_open:
     audio_streaming_hint_end();
     audio_extn_perf_lock_release(&adev->perf_lock_handle);
-    ALOGD("%s: exit", __func__);
+    ALOGV("%s: exit", __func__);
     enable_gcov();
     return ret;
 
@@ -4151,7 +4151,7 @@
     }
     audio_streaming_hint_end();
     audio_extn_perf_lock_release(&adev->perf_lock_handle);
-    ALOGD("%s: exit", __func__);
+    ALOGV("%s: exit", __func__);
 
     if (out->usecase == USECASE_AUDIO_PLAYBACK_ULL ||
         out->usecase == USECASE_AUDIO_PLAYBACK_MMAP) {
@@ -4582,7 +4582,7 @@
         pthread_mutex_unlock(&adev->lock);
     }
     pthread_mutex_unlock(&out->lock);
-    ALOGD("%s: exit", __func__);
+    ALOGV("%s: exit", __func__);
     return 0;
 }
 
@@ -4676,7 +4676,7 @@
         stop_output_stream(out);
         ATRACE_END();
     }
-    ALOGD("%s: exit", __func__);
+    ALOGV("%s: exit", __func__);
     return 0;
 }
 
@@ -6926,7 +6926,7 @@
     pthread_mutex_unlock(&adev->lock);
     pthread_mutex_unlock(&in->lock);
 
-    ALOGD("%s: exit: status(%d)", __func__, ret);
+    ALOGV("%s: exit: status(%d)", __func__, ret);
     return ret;
 }
 
@@ -8992,7 +8992,7 @@
         vr_audio_enabled = adev->vr_audio_mode_enabled;
         pthread_mutex_unlock(&adev->lock);
 
-        ALOGI("getting vr mode to %d", vr_audio_enabled);
+        ALOGV("getting vr mode to %d", vr_audio_enabled);
 
         if (vr_audio_enabled) {
             str_parms_add_str(reply, AUDIO_PARAMETER_KEY_VR_AUDIO_MODE,
@@ -9018,7 +9018,7 @@
     str_parms_destroy(query);
     str_parms_destroy(reply);
 
-    ALOGD("%s: exit: returns - %s", __func__, str);
+    ALOGV("%s: exit: returns - %s", __func__, str);
     return str;
 }
 
@@ -9900,7 +9900,7 @@
                  struct audio_patch_info *p_info,
                  patch_type_t patch_type, bool new_patch)
 {
-    ALOGD("%s: enter", __func__);
+    ALOGV("%s: enter", __func__);
 
     if (p_info == NULL) {
         ALOGE("%s: Invalid patch pointer", __func__);
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 0be37a4..c8d355f 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -3047,11 +3047,8 @@
     for (i = 0; i < SND_DEVICE_MAX; i++) {
         valid_hw_interface = false;
 
-        if (hw_interface_table[i] == NULL) {
-            ALOGW("%s: sound device %s has no hw interface set\n",
-                  __func__, platform_get_snd_device_name(i));
+        if (hw_interface_table[i] == NULL)
             continue;
-        }
 
         for (j = 0; j < max_be_dai_names; j++) {
             if (strcmp(hw_interface_table[i], be_dai_name_table[j].be_name)
@@ -3060,9 +3057,6 @@
                 break;
             }
         }
-        if (!valid_hw_interface)
-            ALOGD("%s: sound device %s does not have a valid hw interface set (disregard for combo devices) %s\n",
-                   __func__, platform_get_snd_device_name(i), hw_interface_table[i]);
     }
 
     goto done;
@@ -3490,13 +3484,10 @@
 #endif
 
     /* 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);
+    if (!strncmp(snd_card_name, "qcs405-csra", strlen("qcs405-csra")))
         my_data->use_sprk_default_sample_rate = false;
-    } else {
+    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);
@@ -4039,7 +4030,7 @@
             }
         }
     }
-    ALOGI("%s: no matching param with id %d ip_ch %d op_ch %d uc_id %d snd_dev %d",
+    ALOGV("%s: no matching param with id %d ip_ch %d op_ch %d uc_id %d snd_dev %d",
           __func__, info->id, info->ip_channels, info->op_channels,
           info->usecase_id[0], info->snd_device);
     return NULL;
@@ -4431,12 +4422,12 @@
                 platform_get_snd_device_name(snd_device2));
 
     if ((snd_device1 < SND_DEVICE_MIN) || (snd_device1 >= SND_DEVICE_OUT_END)) {
-        ALOGE("%s: Invalid snd_device = %s", __func__,
+        ALOGV("%s: Invalid snd_device1 = %s", __func__,
                 platform_get_snd_device_name(snd_device1));
         return false;
     }
     if ((snd_device2 < SND_DEVICE_MIN) || (snd_device2 >= SND_DEVICE_OUT_END)) {
-        ALOGE("%s: Invalid snd_device = %s", __func__,
+        ALOGV("%s: Invalid snd_device2 = %s", __func__,
                 platform_get_snd_device_name(snd_device2));
         return false;
     }
@@ -6118,7 +6109,7 @@
     }
 
 
-    ALOGD("%s: snd_device(%d) num devices(%d) new_snd_devices(%d)", __func__,
+    ALOGV("%s: snd_device(%d) num devices(%d) new_snd_devices(%d)", __func__,
         snd_device, *num_devices, *new_snd_devices);
 
     return ret;
@@ -8057,7 +8048,7 @@
           }
         }
         cal.acdb_dev_id = platform_get_snd_device_acdb_id(cal.snd_dev_id);
-        ALOGD("Setting audio calibration for snd_device(%d) acdb_id(%d)",
+        ALOGV("Setting audio calibration for snd_device(%d) acdb_id(%d)",
                 cal.snd_dev_id, cal.acdb_dev_id);
         if(cal.acdb_dev_id == -EINVAL) {
             ALOGE("[%s] Invalid acdb_device id %d for snd device id %d",
@@ -8812,7 +8803,8 @@
                 for (i = 0; i < sizeof(dsp_only_decoders_mime)/sizeof(dsp_only_decoders_mime[0]); i++) {
                     if (!strncmp(decoder_mime_type, dsp_only_decoders_mime[i],
                     strlen(dsp_only_decoders_mime[i]))) {
-                       ALOGD("Rejecting request for DSP only session from HAL during voice call/SSR state");
+                       ALOGV("Rejecting request for DSP only session from HAL \
+                              during voice call/SSR state");
                        isallowed = 0;
                        break;
                     }
@@ -10097,7 +10089,7 @@
          */
         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 "
+            ALOGV("%s:becf: afe: playback on codec device not supporting native playback set "
             "default Sample Rate(48k)", __func__);
         }
     }
diff --git a/hal/voice.c b/hal/voice.c
index 72c3372..034eaa0 100644
--- a/hal/voice.c
+++ b/hal/voice.c
@@ -435,7 +435,7 @@
     bool in_call_rec = false;
 
     if (!in) {
-       ALOGE("%s: input stream is NULL", __func__);
+       ALOGV("%s: input stream is NULL", __func__);
        return in_call_rec;
     }