AnsweredAssumed Answered

Cannot use low audio sample rates on imx28evk with 3.14.19 kernel

Question asked by Craig McQueen on Nov 10, 2014
Latest reply on Nov 14, 2014 by Fabio Estevam

I'm testing the 3.14.19 kernel on imx28evk, with a Yocto build that uses the linux-fslc kernel provider.


If I try to play or record at 8 kHz or 11.025 kHz, I get an error message:


# aplay test_8k.wav
[ 6168.910201] mxs_evk_startup: Skipped programming wolfson codec
Playing WAVE 'test_8k.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Mono
[ 6168.941211] sgtl5000 0-000a: Invalid mclk frequency: 4.096MHz
[ 6168.947047] mxs-sgtl5000 sound.11: ASoC: machine hw_params failed: -22
aplay: set_params:1145: Unable to install hw params:


For an 8 kHz sample rate, I get

Invalid mclk frequency: 4.096MHz


For 11.025 kHz sample rate, I get

Invalid mclk frequency: 5.644MHz


Looking in the code (/sound/soc/mxs/mxs-sgtl5000c), I see:


     /* Sgtl5000 sysclk should be >= 8MHz and <= 27M */
     if (mclk < 8000000 || mclk > 27000000) {
          dev_err(codec_dai->dev, "Invalid mclk frequency: %u.%03uMHz\n",
               mclk / 1000000, mclk / 1000 % 1000);
          return -EINVAL;


But a sysclk constraint of 8 to 27 MHz only applies if the supplied clock is asynchronous to the frame clock, and the internal clock is being generated by PLL. I assume the PLL isn't being used. So can this constraint be relaxed?