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

Commit 02809689 authored by Ramu Gottipati's avatar Ramu Gottipati
Browse files

hal: Fix compilation errors

- To fix compilation errors, remove unused
  variable in codebase
- Fix KW issues by adding mutex unlock

Change-Id: I392f4abf53e07524ca28c4559271b153f4190b34
parent 08d82e72
Loading
Loading
Loading
Loading
+5 −6
Original line number Original line Diff line number Diff line
@@ -1107,7 +1107,7 @@ static bool a2dp_set_backend_cfg(uint8_t direction)
            break;
            break;
        }
        }


        ALOGD("%s: set afe dec channels =%d", __func__, channels);
        ALOGD("%s: set afe dec channels =%s", __func__, channels);
        ctrl_channels = mixer_get_ctl_by_name(a2dp.adev->mixer,
        ctrl_channels = mixer_get_ctl_by_name(a2dp.adev->mixer,
                                            MIXER_AFE_SINK_CHANNELS);
                                            MIXER_AFE_SINK_CHANNELS);
    } else {
    } else {
@@ -1122,7 +1122,7 @@ static bool a2dp_set_backend_cfg(uint8_t direction)
            break;
            break;
        }
        }


        ALOGD("%s: set afe enc channels =%d", __func__, channels);
        ALOGD("%s: set afe enc channels =%s", __func__, channels);
        ctrl_channels = mixer_get_ctl_by_name(a2dp.adev->mixer,
        ctrl_channels = mixer_get_ctl_by_name(a2dp.adev->mixer,
                                            MIXER_AFE_IN_CHANNELS);
                                            MIXER_AFE_IN_CHANNELS);
    }
    }
@@ -1131,7 +1131,7 @@ static bool a2dp_set_backend_cfg(uint8_t direction)
        ALOGE(" ERROR AFE channels mixer control not identified");
        ALOGE(" ERROR AFE channels mixer control not identified");
    } else {
    } else {
        if (mixer_ctl_set_enum_by_string(ctrl_channels, channels) != 0) {
        if (mixer_ctl_set_enum_by_string(ctrl_channels, channels) != 0) {
            ALOGE("%s: Failed to set AFE channels =%d", __func__, channels);
            ALOGE("%s: Failed to set AFE channels =%s", __func__, channels);
            is_configured = false;
            is_configured = false;
            goto fail;
            goto fail;
        }
        }
@@ -1406,7 +1406,6 @@ static bool configure_a2dp_sink_decoder_format()
    codec_t codec_type = CODEC_TYPE_INVALID;
    codec_t codec_type = CODEC_TYPE_INVALID;
    bool is_configured = false;
    bool is_configured = false;
    struct mixer_ctl *ctl_dec_data = NULL;
    struct mixer_ctl *ctl_dec_data = NULL;
    int ret = 0;


    if (!a2dp.audio_get_dec_config) {
    if (!a2dp.audio_get_dec_config) {
        ALOGE(" a2dp handle is not identified, ignoring a2dp decoder config");
        ALOGE(" a2dp handle is not identified, ignoring a2dp decoder config");
@@ -1520,7 +1519,7 @@ static int update_aptx_ad_dsp_config(struct aptx_ad_enc_cfg_t *aptx_dsp_cfg,
    }
    }


    memset(aptx_dsp_cfg, 0x0, sizeof(struct aptx_ad_enc_cfg_t));
    memset(aptx_dsp_cfg, 0x0, sizeof(struct aptx_ad_enc_cfg_t));
    aptx_dsp_cfg->custom_cfg.enc_format = ENC_MEDIA_FMT_APTX_AD;
    aptx_dsp_cfg->custom_cfg.enc_format = MEDIA_FMT_APTX_AD;




    aptx_dsp_cfg->aptx_ad_cfg.sampling_freq = aptx_bt_cfg->ad_cfg->sampling_rate;
    aptx_dsp_cfg->aptx_ad_cfg.sampling_freq = aptx_bt_cfg->ad_cfg->sampling_rate;
@@ -2163,7 +2162,7 @@ bool configure_a2dp_encoder_format()
              aptx_encoder_cfg.ad_cfg = (audio_aptx_ad_config *)codec_info;
              aptx_encoder_cfg.ad_cfg = (audio_aptx_ad_config *)codec_info;
              is_configured =
              is_configured =
                (configure_aptx_enc_format(&aptx_encoder_cfg) &&
                (configure_aptx_enc_format(&aptx_encoder_cfg) &&
                 configure_a2dp_source_decoder_format(ENC_MEDIA_FMT_APTX_AD));
                 configure_a2dp_source_decoder_format(MEDIA_FMT_APTX_AD));
            break;
            break;
#endif
#endif
        default:
        default:
+1 −1
Original line number Original line Diff line number Diff line
@@ -3482,7 +3482,6 @@ static size_t get_input_buffer_size(uint32_t sample_rate,
                                    int channel_count,
                                    int channel_count,
                                    bool is_low_latency)
                                    bool is_low_latency)
{
{
    int i = 0;
    size_t size = 0;
    size_t size = 0;
    uint32_t bytes_per_period_sample = 0;
    uint32_t bytes_per_period_sample = 0;


@@ -4703,6 +4702,7 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
                uint32_t bitwidth_dst = format_to_bitwidth_table[dst_format];
                uint32_t bitwidth_dst = format_to_bitwidth_table[dst_format];
                if ((bitwidth_src == 0) || (bitwidth_dst == 0)) {
                if ((bitwidth_src == 0) || (bitwidth_dst == 0)) {
                    ALOGE("%s: Error bitwidth == 0", __func__);
                    ALOGE("%s: Error bitwidth == 0", __func__);
                    pthread_mutex_unlock(&out->lock);
                    ATRACE_END();
                    ATRACE_END();
                    return -EINVAL;
                    return -EINVAL;
                }
                }
+1 −1
Original line number Original line Diff line number Diff line
@@ -7516,7 +7516,7 @@ int platform_set_channel_map(void *platform, int ch_count, char *ch_map, int snd
    struct mixer_ctl *ctl;
    struct mixer_ctl *ctl;
    char mixer_ctl_name[44] = {0}; // max length of name is 44 as defined
    char mixer_ctl_name[44] = {0}; // max length of name is 44 as defined
    int ret;
    int ret;
    unsigned int i=0, n=0;
    int i=0, n=0;
    long set_values[AUDIO_MAX_DSP_CHANNELS];
    long set_values[AUDIO_MAX_DSP_CHANNELS];
    struct platform_data *my_data = (struct platform_data *)platform;
    struct platform_data *my_data = (struct platform_data *)platform;
    struct audio_device *adev = my_data->adev;
    struct audio_device *adev = my_data->adev;