CRAS: dev_stream - Start APM before getting post process format

Commit e40063e75 adds apm_list start/stop APIs to protect
APM access by multiple threads. However that introduces
dependency to cras_rstream_post_processing_format() which
needs to be called after cras_apm_list_start_apm().

That causes a bug on platforms where input HW channels
don't exactly match the real used channels, e.g hatch,
so when post CRAS APM samples are copied to stream they
becomes corrupted.

BUG=b:175170979
TEST=Manual enable system AEC by editing board.ini on hatch
Launch appr.tc?debug=loopback to verify the audio
output is not corrupted.

Change-Id: I31f6b39bcc1ef2b064e0b1a03d9a7a5b1d4ec355
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/adhd/+/2583682
Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
Commit-Queue: Hsinyu Chao <hychao@chromium.org>
Tested-by: Hsinyu Chao <hychao@chromium.org>
1 file changed