Platform: IMX8M Custom Board
OS: Android 11
Kernel: 5.10.9-678025-gbccc0b2805b7-dirty
Codec: SGTL5000
Problem: Default Sound Audio Output with Line-Out
My problem is about changing default android stream value to lineout. I have successfully play a .wav file by usind tinyplay command. So the codec is working correctly. But when ı play a example video by using gallery app which is am start -n com.android.gallery3d/.app.MovieActivity -d example.mp4, video opened on my lvds screen but ı did not hear voice from lineout. There is no any sound. As you know, we should hear a voice while we trying change alarm sound or notification sound. But there is no any sound when ı click any sound effect on settings. So, problem is in android os itself.
When ı google about this, ı have seen that there is a conf file which is named audio_policy_configuration.xml, ı have changed defaultOutputDevice as lineout as it shown below.
<audioPolicyConfiguration version="1.0" xmlns:xi="http://www.w3.org/2001/XInclude">
<globalConfiguration speaker_drc_enabled="true"/>
<modules>
<module name="primary" halVersion="2.0">
<attachedDevices>
<item>Speaker</item>
<item>Built-In Mic</item>
<item>Line-Out</item>
</attachedDevices>
<defaultOutputDevice>Line-Out</defaultOutputDevice> <!-- Topkarag it was Speaker Before-->
So when ı build according to this configuraiton, and write the image into sd card, if ı am using dcss-lvds image(which is not working as lineout), ı do not see line routing by checking it dumpsys audio command. But when ı the same issue by using hdmi image, dumsys audio log comes with line routing as ı need. I have realized that when there is a sound card which is named "imx-audio-hdmi", audio routing will be working correctly. But in dcss-lvds image, even ı have enabled imx-audio-hdmi in .dts file, there is no any sound card which is name "imx-audio-hdmi" and audiorouting is not working. Audio service giving error in logcat also, ı have attached.
Where can it be problem ? Is there any other configuration parameter except audio_policy_configuration.xml ? Why ı must have imx-audio-hdmi in android for doing this routing correctly ?
Attached file zip contents explanations:
audio_policy_configuration.txt: My configuration
dmesg hdmi image .txt: Dmesg log for hdmi image
dumpsys audio_hdmi.txt: Audio service log for hdmi image
dmesg dcss-lvds image.txt : Dmesg for dcss-lvds image. There is no imx-audio-hdmi sound card.
dumpsys audio dcss-lvds.txt: audio service log for dcss lvds image. Check there is no any routing as devices.
logcat grep Audio.txt: Logcat output for audio. There are several messages repeating itself.
Hello,
Our Android documentation in page 42 also mentions that the audio routing is done in audio_policy_configuration.xml as you mention.
Is the issue present if you use another application in audio routing?
Best regards.