This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: PCM5102a negotiation with McASP6

Part Number: AM5728
Other Parts Discussed in Thread: PCM5102A, PCM5102

Tool/software: Linux

I'm trying to play .wav file on my customboard with PCM5102a codec, connected to McASP6.
I've written a dummy PCM5102a driver, as it describes here, and I've added following strings in the dts file:

pcm5102a: pcm5102a {
  #sound-dai-cells = <0>;
  compatible = "ti,pcm5102a";
};

sound0: sound@0 {
  compatible = "simple-audio-card";
  simple-audio-card,name = "PCM5102";
  simple-audio-card,format = "i2s";
  simple-audio-card,bitclock-master = <&sound0_master>;
  simple-audio-card,frame-master = <&sound0_master>;

  sound0_master: simple-audio-card,cpu {
    sound-dai = <&mcasp6>;
  };

  simple-audio-card,codec {
    sound-dai = <&pcm5102a>;
  };
};

&mcasp6 {
  #sound-dai-cells = <0>;
  assigned-clocks = <&mcasp6_ahclkx_mux>;
  assigned-clock-parents = <&sys_clkin2>;
  pinctrl-names = "default";
  pinctrl-0 = <&mcasp6_pins_default>;
  status = "okay";

  op-mode = <0>; /* MCASP_IIS_MODE */
  tdm-slots = <2>;
  /* 4 serializers */
  serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
  0 1 0 0
  >;
  tx-num-evt = <32>;
  rx-num-evt = <32>;
};

After booting Linux, device was successfully registered:

[ 2.008698] asoc-simple-card sound@0: pcm5102a-hifi <-> 48474000.mcasp mapping ok
[ 6.294296] ALSA device list:
[ 6.297296] #0: PCM5102

But when I'm trying to playing a .wav file, following error appears:

root@am57xx-evm:~# aplay test.wav
Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
ALSA lib ../../../alsa-lib-1.1.0/src/pcm/pcm_params.c:2162:(snd1_pcm_hw_refine_slave) Slave PCM not usable
aplay: set_params:1204: Broken configuration for this PCM: no configurations available

How can I fix this problem?




 

  • Hello,

    I would recommend you to run aplay -l and cat /proc/asound/cards to see if alsa and kernel see your audio device.
    aplay -Dplughw:X,X <path to file>


    BR
    Margarita
  • Sound card in the /proc/asound/cards is matched with aplay -l founded device:

    $ cat /proc/asound/cards
    0 [PCM5102 ]: PCM5102 - PCM5102
    PCM5102
    $ aplay -l

    **** List of PLAYBACK Hardware Devices ****
    card 0: PCM5102 [PCM5102], device 0: davinci-mcasp.0-pcm5102a-hifi pcm5102a-hifi-0 []
    Subdevices: 1/1
    Subdevice #0: subdevice #0

    With directly setting hw device it's all the same result:

    aplay -D plughw:0,0 test.wav
    Playing WAVE 'test.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
    ALSA lib ../../../alsa-lib-1.1.0/src/pcm/pcm_params.c:2162:(snd1_pcm_hw_refine_slave) Slave PCM not usable
    aplay: set_params:1204: Broken configuration for this PCM: no configurations available






  • MCLK of PCM5102a is received from xrefclk1, multeplexed on mcasp6_ahclk.
    I've checked this pin with oscilloscope and found that there is no any signal.
    Can it be the source of the problem?