audio: refine the period size for raw playback
For raw playback, the buffer size needs to equal to the
ring buffer size. AoC changes the buffer size to 16384 bytes,
but it cannot be divisible by 48(1ms frames with 48000 sample rate).
Use the period size(frame couts) from configuration file.
Bug: 194398677
Test: OboeTester->TEST OUTPUT
Change-Id: I07f0cb7d5904e4e3ef78b9a15d31590fdd5a9087
diff --git a/audio/oriole/config/audio_platform_configuration.xml b/audio/oriole/config/audio_platform_configuration.xml
index ba3e0a9..bea265e 100644
--- a/audio/oriole/config/audio_platform_configuration.xml
+++ b/audio/oriole/config/audio_platform_configuration.xml
@@ -172,8 +172,8 @@
</input_backend_cfg_mic_mapping>
<usecase_attr>
- <!-- for output with AUDIO_OUTPUT_FLAG_RAW, 40 * 1ms buffer with 32-bit -->
- <usecase id="UC_RAW_PLAYBACK" dev1="23" dyn_path="true" dsp_vol="false" mmap="true" period="1" period_num="40"/>
+ <!-- for output with AUDIO_OUTPUT_FLAG_RAW, 32 periods * 64 frames(around 1.3ms) * 2ch * 4(s32) = 16384 bytes -->
+ <usecase id="UC_RAW_PLAYBACK" dev1="23" dyn_path="true" dsp_vol="false" mmap="true" period="64" period_num="32"/>
<!-- for output with AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST, 4 * 10ms buffer -->
<usecase id="UC_LOW_LATENCY_PLAYBACK" dev1="1" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
<!-- for output with AUDIO_OUTPUT_FLAG_MMAP_NOIRQ, 80 periods * 48 frames/period(=1ms w/ 48k sample rate) * 4 bytes/frame = 15360 bytes -->
diff --git a/audio/raven/config/audio_platform_configuration.xml b/audio/raven/config/audio_platform_configuration.xml
index ba3e0a9..bea265e 100644
--- a/audio/raven/config/audio_platform_configuration.xml
+++ b/audio/raven/config/audio_platform_configuration.xml
@@ -172,8 +172,8 @@
</input_backend_cfg_mic_mapping>
<usecase_attr>
- <!-- for output with AUDIO_OUTPUT_FLAG_RAW, 40 * 1ms buffer with 32-bit -->
- <usecase id="UC_RAW_PLAYBACK" dev1="23" dyn_path="true" dsp_vol="false" mmap="true" period="1" period_num="40"/>
+ <!-- for output with AUDIO_OUTPUT_FLAG_RAW, 32 periods * 64 frames(around 1.3ms) * 2ch * 4(s32) = 16384 bytes -->
+ <usecase id="UC_RAW_PLAYBACK" dev1="23" dyn_path="true" dsp_vol="false" mmap="true" period="64" period_num="32"/>
<!-- for output with AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST, 4 * 10ms buffer -->
<usecase id="UC_LOW_LATENCY_PLAYBACK" dev1="1" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
<!-- for output with AUDIO_OUTPUT_FLAG_MMAP_NOIRQ, 80 periods * 48 frames/period(=1ms w/ 48k sample rate) * 4 bytes/frame = 15360 bytes -->
diff --git a/audio/slider/config/audio_platform_configuration.xml b/audio/slider/config/audio_platform_configuration.xml
index 68acee6..1a42336 100644
--- a/audio/slider/config/audio_platform_configuration.xml
+++ b/audio/slider/config/audio_platform_configuration.xml
@@ -110,8 +110,8 @@
</input_backend_cfg_mic_mapping>
<usecase_attr>
- <!-- for output with AUDIO_OUTPUT_FLAG_RAW, 40 * 1ms buffer with 32-bit -->
- <usecase id="UC_RAW_PLAYBACK" dev1="23" dyn_path="true" dsp_vol="false" mmap="true" period="1" period_num="40"/>
+ <!-- for output with AUDIO_OUTPUT_FLAG_RAW, 32 periods * 64 frames(around 1.3ms) * 2ch * 4(s32) = 16384 bytes -->
+ <usecase id="UC_RAW_PLAYBACK" dev1="23" dyn_path="true" dsp_vol="false" mmap="true" period="64" period_num="32"/>
<!-- for output with AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST, 4 * 10ms buffer -->
<usecase id="UC_LOW_LATENCY_PLAYBACK" dev1="1" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
<!-- for output with AUDIO_OUTPUT_FLAG_MMAP_NOIRQ, 80 periods * 48 frames/period(=1ms w/ 48k sample rate) * 4 bytes/frame = 15360 bytes -->
diff --git a/audio/whitefin/config/audio_platform_configuration.xml b/audio/whitefin/config/audio_platform_configuration.xml
index 68acee6..1a42336 100644
--- a/audio/whitefin/config/audio_platform_configuration.xml
+++ b/audio/whitefin/config/audio_platform_configuration.xml
@@ -110,8 +110,8 @@
</input_backend_cfg_mic_mapping>
<usecase_attr>
- <!-- for output with AUDIO_OUTPUT_FLAG_RAW, 40 * 1ms buffer with 32-bit -->
- <usecase id="UC_RAW_PLAYBACK" dev1="23" dyn_path="true" dsp_vol="false" mmap="true" period="1" period_num="40"/>
+ <!-- for output with AUDIO_OUTPUT_FLAG_RAW, 32 periods * 64 frames(around 1.3ms) * 2ch * 4(s32) = 16384 bytes -->
+ <usecase id="UC_RAW_PLAYBACK" dev1="23" dyn_path="true" dsp_vol="false" mmap="true" period="64" period_num="32"/>
<!-- for output with AUDIO_OUTPUT_FLAG_PRIMARY|AUDIO_OUTPUT_FLAG_FAST, 4 * 10ms buffer -->
<usecase id="UC_LOW_LATENCY_PLAYBACK" dev1="1" dyn_path="true" dsp_vol="false" mmap="false" period="10" period_num="4"/>
<!-- for output with AUDIO_OUTPUT_FLAG_MMAP_NOIRQ, 80 periods * 48 frames/period(=1ms w/ 48k sample rate) * 4 bytes/frame = 15360 bytes -->