TechNexion / edm-yocto-bsp

(Archived, please change to use tn-imx-yocto-manifest) Yocto Project manifests
17 stars 18 forks source link

Audio support on PICO-PI-IMX8M-2G #20

Open sweeney101 opened 5 years ago

sweeney101 commented 5 years ago

Audio playback issue on PICO-PI-IMX8M-2G using the linux tn-imx_4.14.98_2.0.0_ga-wip kernel (prebuilt image fsl-image-qt5-validation-imx-pico-imx8mq).

Running some test commands I get the following output: aplay /usr/shar/sounds/alsa/noise.wav

[ 2992.099490] fsl-sai 30050000.sai: failed to derive required Tx rate: 2822400 [ 2992.106651] fsl-sai 30050000.sai: ASoC: can't set 30050000.sai hw params: -22 ALSA lib ../../../alsa-lib-1.1.5/src/pcm/pcm_direct.c:1271:(snd1_pcm_direct_initialize_slave) unable to install hw params ALSA lib ../../../alsa-lib-1.1.5/src/pcm/pcm_dmix.c:1111:(snd_pcm_dmix_open) unable to initialize slave aplay: main:828: audio open error: Invalid argument

I see similar "failed to derive required Tx rate" issues if I try to play an mp4 through gplay-1.0 along with:

====== BEEP: 4.4.5 build on Apr 20 2019 15:58:42. ====== Core: AAC decoder Wrapper build on Dec 7 2017 18:13:51 file: /usr/lib/imx-mm/audio-codec/wrap/lib_aacd_wrap_arm_elinux.so.3 CODEC: BLN_MAD-MMCODECS_AACD_ARM_03.09.00_ARMV8 build on Sep 20 2017 15:02:50. [ 3104.543472] cma: cma_alloc: alloc failed, req-size: 3544 pages, ret: -12 [ 3104.551425] cma: cma_alloc: alloc failed, req-size: 3544 pages, ret: -12

I will try to setup a build environment to build the latest, but this is using the latest prebuilt image available for download.

richard-hu commented 5 years ago

@sweeney101

Thanks for your feedback.

We confirm that this issue happens on PICO-IMX8M in linux 4.14.98. "PICO-IMX8MQ: HDMI audio only works for specific sample rate". This issue doesn't happen in linux 4.9.88.

We test the HDMI audio is able to play audio file with sample rate 48KHz, but fails to play the audio file with sample rate 44.1KHz. It looks the SAI controller can't get required clock so it fails to play. We have tested to add "plughw" parameter in aplay command to specify to use SW re-sampling, but still can't get it work.

We will assign a owner internally to fix this issue.

test_AUD_file.zip

Richard