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

Commit 1a32f5e7 authored by justinweng's avatar justinweng
Browse files

audio: hal: do not convert zoom value in audio hal



Bug: 125191693
Test: set parameters successfully

Change-Id: Idcc0944fac882a0204fe2ac7f9210a6524c61a44
Signed-off-by: default avatarjustinweng <justinweng@google.com>
parent c69dce07
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@
#include <resolv.h>

#define AUDIOZOOM_PRESET_FILE "/vendor/etc/audiozoom.xml"
#define MIN_BUFSIZE 8

typedef struct qdsp_audiozoom_cfg {
    uint32_t             topo_id;
@@ -190,8 +189,9 @@ static int audio_extn_audiozoom_set_microphone_field_dimension_zoom(
{
    struct audio_device *adev = in->dev;
    struct str_parms *parms = str_parms_create();
    uint8_t value[MIN_BUFSIZE] = {0};
    char data[MIN_BUFSIZE * 2] = {0};
    /* The encoding process in b64_ntop represents 24-bit groups of input bits
       as output strings of 4 encoded characters. */
    char data[((sizeof(zoom) + 2) / 3) * 4 + 1] = {0};
    int32_t ret;

    if (zoom > 1.0 || zoom < 0)
@@ -208,10 +208,7 @@ static int audio_extn_audiozoom_set_microphone_field_dimension_zoom(
    str_parms_add_int(parms, "cal_instanceid", qdsp_audiozoom.instance_id);
    str_parms_add_int(parms, "cal_paramid", qdsp_audiozoom.zoom_param_id);

    zoom *= 255;
    value[0] = (uint8_t) zoom; /* Valid value is 0 to 255 */

    ret = b64_ntop(value, sizeof(value), data, sizeof(data));
    ret = b64_ntop((uint8_t*)&zoom, sizeof(zoom), data, sizeof(data));
    if (ret > 0) {
        str_parms_add_str(parms, "cal_data", data);