Hi Team,
We have two audio codecs in our design:
Both the codecs up and running individually/Separately i.e if we integrate one codec driver in the code at a time, it works.
Facing below issue :
After integrating both the codecs in same code, audio data (system sound, Media sound) is coming out only on the External codec (TLV320AIC3104). We Tested using VLC player.
But if I play any wav file using tinyplay filename.wav -D 1 command, then we can hear audio from Internal codec.
Where, -D 1 – Specifically telling Device 1 (Which is Internal codec 3100) to play wav file.
As per our requirement, Internal codec should be used for only notification and alarm ringtone and External codec for other media sound.
Please find latest update on Audio Routing:
We have integrated "supported_out_devices": ["line"]. Which is inbuild sink present in the configuration file.
Device Folder changes:
+++ b/common/audio-json/tlv320aic31xx_config.json
@@ -1,6 +1,6 @@
{
"driver_name": "tlv320aic31xx-Codec",
- "supported_out_devices": ["speaker"],
+ "supported_out_devices": ["line"],
"support_lpa": 1,
+++ b/imx8m/evk_8mm/audio_policy_configuration.xml
@@ -21,7 +21,7 @@
<module name="primary" halVersion="2.0">
<attachedDevices>
<item>Speaker</item>
+ <item>Line-Out</item>
</attachedDevices>
<defaultOutputDevice>Speaker</defaultOutputDevice>
<mixPorts>
</devicePort>
<devicePort tagName="Line-Out" type="AUDIO_DEVICE_OUT_LINE" role="sink">
</devicePort>
With above changes, We can observe that Audio routed to External as well as Internal codec. Without doing any changes in FW, we are getting below output.
Internal Codec - Media, Call , System Sound.
External Codec – Notification , Ring and Alarm sound.
It looks like Internal codec is following the type AUDIO_DEVICE_OUT_LINE.
When we are trying to route the respective streams (Streams are mapped to particular strategy) from framework side through Engine.cpp [frameworks/av/services/audiopolicy/enginedefault/src/Engine.cpp – File responsible for Audio routing] we are getting all the audio outputs from only one codec at a time.
Could you please help with some suggestions to implement above use case.