Audio in aosp 12 is not working

After I flashed the aosp 12 artifact(compiled by myself) into Khadas VIM3, the board does booted into the luancher, but the audio is not working, following logs are repeatly output to logcat:

11-09 08:02:01.354   830  1134 W AudioManager: updateAudioPortCache: listAudioPorts failed
11-09 08:02:01.407   629  1158 E AudioSystem-JNI: AudioSystem::listAudioPorts error -19
11-09 08:02:01.408   629  1158 W AudioManager: updateAudioPortCache: listAudioPorts failed
11-09 08:02:01.454   830  1134 E AudioSystem-JNI: AudioSystem::listAudioPorts error -19
11-09 08:02:01.455   830  1134 W AudioManager: updateAudioPortCache: listAudioPorts failed
11-09 08:02:01.457   830  1134 E AudioSystem-JNI: AudioSystem::listAudioPorts error -19
11-09 08:02:01.458   830  1134 W AudioManager: updateAudioPortCache: listAudioPorts failed
11-09 08:02:01.510   629  1158 E AudioSystem-JNI: AudioSystem::listAudioPorts error -19
11-09 08:02:01.511   629  1158 W AudioManager: updateAudioPortCache: listAudioPorts failed
11-09 08:02:01.557   830  1134 E AudioSystem-JNI: AudioSystem::listAudioPorts error -19
11-09 08:02:01.558   830  1134 W AudioManager: updateAudioPortCache: listAudioPorts failed
11-09 08:02:01.560   830  1134 E AudioSystem-JNI: AudioSystem::listAudioPorts error -19
11-09 08:02:01.561   830  1134 W AudioManager: updateAudioPortCache: listAudioPorts failed
11-09 08:02:01.613   629  1158 E AudioSystem-JNI: AudioSystem::listAudioPorts error -19
11-09 08:02:01.614   629  1158 W AudioManager: updateAudioPortCache: listAudioPorts failed

Any tips?

Which kernel did you use, and at what resolution is the display set at? In my own testing 4.19 works with audio at all resolutions but frame rate is poor, 5.4 last i checked audio worked at 1080p and i think 5.10 is the same. If you want to test include TARGET_KERNEL_USE={4.19, 5.4 or 4.10} when you make artifacts

Also to save time you can build just the boot image with make -jx bootimage

From the devices information, the kernel is 4.19:

 # cat /proc/version 
Linux version 4.19.166-g528e2b02c5d3-ab7080275 (build-user@build-host) (Android (6875598, based on r399163b) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d), LLD 11.0.5 (/buildbot/tmp/tmpx1DlI_ 87f1315dfbea7c137aa2e6d362dbb457e388158d)) #1 SMP PREEMPT Wed Jan 13 18:25:27 UTC 2021
vim3:/ # 

That is strange, i will have to compile and test myself to see what’s going on.

Just tested with YouTube using a tablet build on kernel 5.4, on a 1080 monitor and i do have audio. Are perhaps testing on a display or tv with a higher resolution?