hal: cirrus_playback: fix issue with calibration
The latest calibration result struct in the algorithm library does not
contain atemp (ambient temperature), and the current RX feedback path
has 8 channels.
Bug: 71645808
Test: Run cirrus_sp_status
Calibration:
Left Calibration is done, Left R=6.978233 ohms
Cal temp = 23 c degree
Right Calibration is done, Right R=7.764715 ohms
Cal temp = 23 c degree
*******************************************************
Current Left Re. = 6.981808 ohms
Current Left Temp. = 23.128071 c degree
Current Left Exc. M. = 6001
Current Right Re. = 7.796174 ohms
Current Right Temp. = 24.012878 c degree
Current Right Exc. M. = 6001
*******************************************************
Change-Id: I1aa34f91eb0e1ba3096f7da2a112a8402c49b863
Signed-off-by: David Lin <dtwlin@google.com>
diff --git a/hal/audio_extn/cirrus_playback.c b/hal/audio_extn/cirrus_playback.c
index 5e46767..cd9e90a 100644
--- a/hal/audio_extn/cirrus_playback.c
+++ b/hal/audio_extn/cirrus_playback.c
@@ -62,7 +62,6 @@
int32_t status_r;
int32_t checksum_r;
int32_t z_r;
- int32_t atemp;
};
/* Payload struct for setting the RX and TX use cases */
@@ -74,7 +73,6 @@
int32_t status_r;
int32_t checksum_r;
int32_t z_r;
- int32_t atemp;
};
#define CRUS_SP_FILE "/dev/msm_cirrus_playback"
@@ -125,11 +123,11 @@
};
static struct pcm_config pcm_config_cirrus_rx = {
- .channels = 2,
+ .channels = 8,
.rate = 48000,
- .period_size = 256,
+ .period_size = 320,
.period_count = 4,
- .format = PCM_FORMAT_S16_LE,
+ .format = PCM_FORMAT_S32_LE,
.start_threshold = 0,
.stop_threshold = INT_MAX,
.avail_min = 0,
@@ -226,18 +224,6 @@
goto exit;
}
- property_get("vendor.audio.cirrus_spkr.cal.store_calib_data", value, "none");
- if (!strncmp("true", value, 4)) {
- store_calib_data = true;
- property_get("vendor.audio.cirrus_spkr.cal.atemp", value, "0");
- if(atoi(value) > 0)
- result.atemp = atoi(value);
- else
- result.atemp = CRUS_SP_DEFAULT_AMBIENT_TEMP;
- } else {
- result.atemp = CRUS_SP_DEFAULT_AMBIENT_TEMP;
- }
-
if(store_calib_data) {
cal_file = fopen(CRUS_CAL_FILE, "wb");
if (!cal_file) {