audio: correct setting sequence

Persist audio calibration delta data should be set
before sending audio calibration.

Bug: 127239681
Test: two scenarios
  - LR swap real time, LR swap offline
  - preset change real time, preset change offline
scenario#1
  1. playback and set preset with low volume
  2. reboot or kill audioserver
  3. playback again and current preset is loud setting
scenario#2
  1. playback and set loud or low volume preset
  2. pause and standby thread
  3. change volume to different preset setting (ex. low -> loud or loud -> low)
  4. resume playback and current preset is incorrect.

Change-Id: Idca3c617d03056b770dbfe8f4b9ab3080e200113
Signed-off-by: Jasmine Cha <chajasmine@google.com>
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 01ec998..4b85b21 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -649,6 +649,7 @@
     else
         snd_device = usecase->out_snd_device;
     audio_extn_utils_send_app_type_cfg(adev, usecase);
+    audio_extn_ma_set_device(usecase);
     audio_extn_utils_send_audio_calibration(adev, usecase);
 
     // we shouldn't truncate mixer_path
@@ -1714,8 +1715,6 @@
 
     enable_audio_route(adev, usecase);
 
-    audio_extn_ma_set_device(usecase);
-
     /* If input stream is already running the effect needs to be
        applied on the new input device that's being enabled here.  */
     if (in_snd_device != SND_DEVICE_NONE)