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

Commit 370dc6ce authored by Lakshman Chaluvaraju's avatar Lakshman Chaluvaraju Committed by Garmond Leung
Browse files

audio-hal: qahw_api: Adding changes to get dsp latency for KPI

Change-Id: If24f85d0bb864a65b3733b8e8c4c8744a241a8f3
parent 672001ff
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2347,7 +2347,7 @@ int main(int argc, char* argv[]) {
        qap_out_hal_handle = load_hal(stream->output_device);
        if (qap_out_hal_handle == NULL) {
            fprintf(stderr, "Failed log load HAL\n");
            return;
            goto exit;
        }

        file_name = (char*) check_for_playlist(kvp_string);
+2 −0
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@ int get_wav_header_length (FILE* file_stream);
#define qap_wrapper_get_cmd_string_from_arg_array(argc, argv, status)    (0)
#define qap_wrapper_start_stream (stream_data)                           (0)
#define is_qap_session_active(argc, argv, kvp_string)                    (0)
#define get_play_list(fp, stream_param, num_of_streams, kvp_str)         (0)
#define check_for_playlist(kvp_string)                                   (0)
#define start_playback_through_qap(kvp_string, num_of_streams,\
                                         qap_out_hal_handle_t)           (0)
@@ -169,6 +170,7 @@ char * qap_wrapper_get_cmd_string_from_arg_array(int argc, char * argv[], int *s
void *qap_wrapper_start_stream (void* stream_data);
void get_file_format(stream_config *stream_info);
bool is_qap_session_active(int argc, char* argv[], char *kvp_string);
void get_play_list(FILE *fp, stream_config (*stream_param)[], int *num_of_streams, char *kvp_str[]);
char* check_for_playlist(char *kvp_string);
int start_playback_through_qap(char * kvp_string, int num_of_streams,\
                                qahw_module_handle_t *qap_out_hal_handle_t);
+9 −0
Original line number Diff line number Diff line
@@ -108,6 +108,7 @@ double data_callback_st_arr[TIMESTAMP_ARRAY_SIZE];
bool has_system_input = false;
char session_kv_pairs[256];
bool stream_close = false;
uint32_t dsp_latency = 0;


static void update_combo_dev_kvpairs()
@@ -229,6 +230,8 @@ static void qap_wrapper_measure_kpi_values(double cold_start, double cold_stop)
    fprintf(stdout, "cold time latency %lf ms, avg cont time latency %lf ms,"
            "total cont time latency %f ms, total count %d\n",
            cold_time_latency, cont_time_latency, total_lat, cnt);
    if (dsp_latency)
        fprintf(stdout, "Dsp latency = %lu ms \n", dsp_latency);
}

static void qap_wrapper_read_frame_size_from_file(qap_audio_buffer_t *buffer, FILE *fp_framesize)
@@ -831,6 +834,8 @@ void qap_wrapper_session_callback(qap_session_handle_t session_handle __unused,
                                if (bytes_written == -1) {
                                    ALOGE("%s::%d write failed in hal", __func__, __LINE__);
                                }
                            if (kpi_mode && data_callback_count == 6)
                                dsp_latency = qahw_out_get_latency(qap_out_hdmi_handle);
                        }
                        if (kpi_mode && data_callback_count == 1) {
                             gettimeofday(&tcold_stop, NULL);
@@ -893,6 +898,8 @@ void qap_wrapper_session_callback(qap_session_handle_t session_handle __unused,
                                if (bytes_written == -1) {
                                    ALOGE("%s::%d write failed in hal", __func__, __LINE__);
                                }
                            if (kpi_mode && data_callback_count == 6)
                                dsp_latency = qahw_out_get_latency(qap_out_hp_handle);
                        }
                        if (kpi_mode && data_callback_count == 1) {
                             gettimeofday(&tcold_stop, NULL);
@@ -968,6 +975,8 @@ void qap_wrapper_session_callback(qap_session_handle_t session_handle __unused,
                                if (bytes_written == -1) {
                                    ALOGE("%s::%d write failed in hal", __func__, __LINE__);
                                }
                            if (kpi_mode && data_callback_count == 6)
                                dsp_latency = qahw_out_get_latency(qap_out_spk_handle);
                        }
                        if (kpi_mode && data_callback_count == 1) {
                             gettimeofday(&tcold_stop, NULL);