Trouble getting ALSA layer work with PCM5102A codec - Card not listed in aplay soundcards

Hi @silver2row ,

My BBB has the part. num. AM3358BZCZ100 on it… as far as I understand from your question, I believe I have the ZCZ model.

Thanks Seth, I’ll search more about the PRU… I found this document, I’ll read it out and seek if something catch my attention.

Hello,

I know very little on PRU stuff in general. I think you have the ZCZ too. This is good news (I think).

The above datasheet documentation I found is showing Mode 3 for setting up the pins.

For instance for Ball #D13, McASP0_AXR1 is the pin that corresponds to the mcasp1_axr0 muxing (P9_41).

I think this should help a bit when typing up the overlay. So, P9_42/27/41 all need to be in Mode 3.

So, Frame Sync is McASP0_FSR which is mcasp1_fsx (P9_27)

And, Bit Clock is McASP0_ACLKR which is mcasp1_aclkx (P9_42)

And then, I2S Data is McASP0_AXR1 which is __________ (P9_41) + THIS MAY BE THE ISSUE

So, P9_27 is a McASP GPIO?

/* P9_27 (ZCZ ball C13) gpio3_19 */
	P9_27_default_pin: pinmux_P9_27_default_pin { pinctrl-single,pins = <
		P9_27( PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE7) >; };	/* mcasp0_fsr.gpio3_19 */
	P9_27_gpio_pin: pinmux_P9_27_gpio_pin { pinctrl-single,pins = <
		P9_27( PIN_OUTPUT | INPUT_EN | MUX_MODE7) >; };			/* mcasp0_fsr.gpio3_19 */
	P9_27_gpio_pu_pin: pinmux_P9_27_gpio_pu_pin { pinctrl-single,pins = <
		P9_27( PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE7) >; };		/* mcasp0_fsr.gpio3_19 */
	P9_27_gpio_pd_pin: pinmux_P9_27_gpio_pd_pin { pinctrl-single,pins = <
		P9_27( PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE7) >; };	/* mcasp0_fsr.gpio3_19 */
	P9_27_eqep_pin: pinmux_P9_27_eqep_pin { pinctrl-single,pins = <
		P9_27( PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE1) >; };		/* mcasp0_fsr.eqep0b_in */
	P9_27_pruout_pin: pinmux_P9_27_pruout_pin { pinctrl-single,pins = <
		P9_27( PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE5) >; };	/* mcasp0_fsr.pru0_out5 */
	P9_27_pruin_pin: pinmux_P9_27_pruin_pin { pinctrl-single,pins = <
		P9_27( PIN_INPUT | MUX_MODE6) >; };				/* mcasp0_fsr.pru0_in5 */
	P9_27_mcasp_pin: pinmux_P9_27_mcasp_pin { pinctrl-single,pins = <
		P9_27( PIN_INPUT_PULLDOWN | MUX_MODE0) >; };			/* mcasp0_fsr.mcasp0_fsr */

and…P9_41 is P9_91 which is available as P9.41.1?

	/* P9_41.1 */
	/* P9_91 (ZCZ ball D13) gpio3_20 */
	P9_91_default_pin: pinmux_P9_91_default_pin { pinctrl-single,pins = <
		P9_91( PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE7) >; };	/* mcasp0_axr1.gpio3_20 */
	P9_91_gpio_pin: pinmux_P9_91_gpio_pin { pinctrl-single,pins = <
		P9_91( PIN_OUTPUT | INPUT_EN | MUX_MODE7) >; };			/* mcasp0_axr1.gpio3_20 */
	P9_91_gpio_pu_pin: pinmux_P9_91_gpio_pu_pin { pinctrl-single,pins = <
		P9_91( PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE7) >; };		/* mcasp0_axr1.gpio3_20 */
	P9_91_gpio_pd_pin: pinmux_P9_91_gpio_pd_pin { pinctrl-single,pins = <
		P9_91( PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE7) >; };	/* mcasp0_axr1.gpio3_20 */
	P9_91_eqep_pin: pinmux_P9_91_eqep_pin { pinctrl-single,pins = <
		P9_91( PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE1) >; };		/* mcasp0_axr1.eqep0_index */
	P9_91_pruout_pin: pinmux_P9_91_pruout_pin { pinctrl-single,pins = <
		P9_91( PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE5) >; };	/* mcasp0_axr1.pru0_out6 */
	P9_91_pruin_pin: pinmux_P9_91_pruin_pin { pinctrl-single,pins = <
		P9_91( PIN_INPUT | MUX_MODE6) >; };				/* mcasp0_axr1.pru0_in6 */

and then P9.42, which I called the issue may be done but as P9_42.1 as listed below:

	/* P9_42.1 */
	/* P9_92 (ZCZ ball B12) gpio3_18 */
	P9_92_default_pin: pinmux_P9_92_default_pin { pinctrl-single,pins = <
		P9_92( PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE7) >; };	/* mcasp0_aclkr.gpio3_18 */
	P9_92_gpio_pin: pinmux_P9_92_gpio_pin { pinctrl-single,pins = <
		P9_92( PIN_OUTPUT | INPUT_EN | MUX_MODE7) >; };			/* mcasp0_aclkr.gpio3_18 */
	P9_92_gpio_pu_pin: pinmux_P9_92_gpio_pu_pin { pinctrl-single,pins = <
		P9_92( PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE7) >; };		/* mcasp0_aclkr.gpio3_18 */
	P9_92_gpio_pd_pin: pinmux_P9_92_gpio_pd_pin { pinctrl-single,pins = <
		P9_92( PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE7) >; };	/* mcasp0_aclkr.gpio3_18 */
	P9_92_eqep_pin: pinmux_P9_92_eqep_pin { pinctrl-single,pins = <
		P9_92( PIN_OUTPUT_PULLUP | INPUT_EN | MUX_MODE1) >; };		/* mcasp0_aclkr.eqep0a_in */
	P9_92_pruout_pin: pinmux_P9_92_pruout_pin { pinctrl-single,pins = <
		P9_92( PIN_OUTPUT_PULLDOWN | INPUT_EN | MUX_MODE5) >; };	/* mcasp0_aclkr.pru0_out4 */
	P9_92_pruin_pin: pinmux_P9_92_pruin_pin { pinctrl-single,pins = <
		P9_92( PIN_INPUT | MUX_MODE6) >; };				/* mcasp0_aclkr.pru0_in4 */

I know this may be short or not to the point. I think this is done for a reason. The reason is out of my control.

Seth

P.S. I do not know the difference between P9_THE_PIN and P9_THE_PIN.1 and so I am lost. I will keep researching.

Update:

The ZCZ and ZCE package is a bit awkward… I say that b/c in the datasheet, one can use straight ZCZ or the ZCZ/ZCE package which is more complicated but can be noted down and done…

Another Update:

P9_27 has the incorrect ball allocated to it these days (I think) for i2s use:

# P9_27 for Kernel 4.19.x at am335x-bone-common-univ.dtsi

	/* P9_27 (ZCZ ball C13) */
	P9_27_pinmux {
		compatible = "bone-pinmux-helper";
		status = "okay";
		pinctrl-names = "default", "gpio", "gpio_pu", "gpio_pd", "eqep", "pruout", "pruin";
		pinctrl-0 = <&P9_27_default_pin>;
		pinctrl-1 = <&P9_27_gpio_pin>;
		pinctrl-2 = <&P9_27_gpio_pu_pin>;
		pinctrl-3 = <&P9_27_gpio_pd_pin>;
		pinctrl-4 = <&P9_27_eqep_pin>;
		pinctrl-5 = <&P9_27_pruout_pin>;
		pinctrl-6 = <&P9_27_pruin_pin>;
		pinctrl-7 = <&P9_27_mcasp_pin>;
	}

I looked up the McASP1 definitions at ZCZ and ZCE/ZCZ pins but have not come across the what is pinctrl-0-8.

I will check kernel 5.10.x soon.

But okay about your conclusion: I guess using HDMI and McASP0 may be the only way w/out getting some of the beagleboard.org people involved. I am a community person trying only and dually noted, by myself here. So, some things are a bit convoluted.

Oh!

p. 208 in sprs717l is a start w/ McASP in general. I think I may be out for the night. Good luck until next time. Okay.

And more ideas…

p. 208 provides me nothing. I think looking at the balls, BGA on the am335x, to see what exactly is available and if it is muxed will provide a better solution, e.g. whether to contact the beagleboard.org people to try to make your system function or keep dealing w/ guess work from me. No offense and I am sorry if I cornered you, in a sense, into thinking I could provide a 100% solution.

So, please forgive me. I cannot provide the exact solution but only clues is all I can offer. The beagleboard people are fully in charge of their own OS and what they will accept to be a part to their organization. I am sort of like a lamprey on a shark (just some user that enjoys computing).

Update and this may help?


  CC [M]  sound/core/oss/snd-mixer-oss.mod.o
  LD [M]  sound/core/oss/snd-mixer-oss.ko
  CC [M]  sound/core/oss/snd-pcm-oss.mod.o
  LD [M]  sound/core/oss/snd-pcm-oss.ko
  CC [M]  sound/core/snd-hwdep.mod.o
  LD [M]  sound/core/snd-hwdep.ko
  CC [M]  sound/core/snd-pcm-dmaengine.mod.o
  LD [M]  sound/core/snd-pcm-dmaengine.ko
  CC [M]  sound/core/snd-pcm.mod.o
  LD [M]  sound/core/snd-pcm.ko
  CC [M]  sound/core/snd-rawmidi.mod.o
  LD [M]  sound/core/snd-rawmidi.ko
  CC [M]  sound/core/snd-timer.mod.o
  LD [M]  sound/core/snd-timer.ko
  CC [M]  sound/core/snd.mod.o
  LD [M]  sound/core/snd.ko
  CC [M]  sound/soc/codecs/snd-soc-cpcap.mod.o
  LD [M]  sound/soc/codecs/snd-soc-cpcap.ko
  CC [M]  sound/soc/codecs/snd-soc-hdmi-codec.mod.o
  LD [M]  sound/soc/codecs/snd-soc-hdmi-codec.ko
  CC [M]  sound/soc/codecs/snd-soc-tlv320aic23-i2c.mod.o
  LD [M]  sound/soc/codecs/snd-soc-tlv320aic23-i2c.ko
  CC [M]  sound/soc/codecs/snd-soc-tlv320aic23.mod.o
  LD [M]  sound/soc/codecs/snd-soc-tlv320aic23.ko
  CC [M]  sound/soc/codecs/snd-soc-tlv320aic3x.mod.o
  LD [M]  sound/soc/codecs/snd-soc-tlv320aic3x.ko
  CC [M]  sound/soc/codecs/snd-soc-tpa6130a2.mod.o
  LD [M]  sound/soc/codecs/snd-soc-tpa6130a2.ko
  CC [M]  sound/soc/codecs/snd-soc-twl4030.mod.o
  LD [M]  sound/soc/codecs/snd-soc-twl4030.ko
  CC [M]  sound/soc/codecs/snd-soc-twl6040.mod.o
  LD [M]  sound/soc/codecs/snd-soc-twl6040.ko
  CC [M]  sound/soc/generic/snd-soc-audio-graph-card.mod.o
  LD [M]  sound/soc/generic/snd-soc-audio-graph-card.ko
  CC [M]  sound/soc/generic/snd-soc-simple-card-utils.mod.o
  LD [M]  sound/soc/generic/snd-soc-simple-card-utils.ko
  CC [M]  sound/soc/generic/snd-soc-simple-card.mod.o
  LD [M]  sound/soc/generic/snd-soc-simple-card.ko
  CC [M]  sound/soc/snd-soc-core.mod.o
  LD [M]  sound/soc/snd-soc-core.ko
  CC [M]  sound/soc/ti/snd-soc-davinci-mcasp.mod.o
  LD [M]  sound/soc/ti/snd-soc-davinci-mcasp.ko
  CC [M]  sound/soc/ti/snd-soc-omap-abe-twl6040.mod.o
  LD [M]  sound/soc/ti/snd-soc-omap-abe-twl6040.ko
  CC [M]  sound/soc/ti/snd-soc-omap-dmic.mod.o
  LD [M]  sound/soc/ti/snd-soc-omap-dmic.ko
  CC [M]  sound/soc/ti/snd-soc-omap-hdmi.mod.o
  LD [M]  sound/soc/ti/snd-soc-omap-hdmi.ko
  CC [M]  sound/soc/ti/snd-soc-omap-mcbsp.mod.o
  LD [M]  sound/soc/ti/snd-soc-omap-mcbsp.ko
  CC [M]  sound/soc/ti/snd-soc-omap-mcpdm.mod.o
  LD [M]  sound/soc/ti/snd-soc-omap-mcpdm.ko
  CC [M]  sound/soc/ti/snd-soc-omap-twl4030.mod.o
  LD [M]  sound/soc/ti/snd-soc-omap-twl4030.ko
  CC [M]  sound/soc/ti/snd-soc-omap3pandora.mod.o
  LD [M]  sound/soc/ti/snd-soc-omap3pandora.ko
  CC [M]  sound/soc/ti/snd-soc-rx51.mod.o
  LD [M]  sound/soc/ti/snd-soc-rx51.ko
  CC [M]  sound/soc/ti/snd-soc-ti-edma.mod.o
  LD [M]  sound/soc/ti/snd-soc-ti-edma.ko
  CC [M]  sound/soc/ti/snd-soc-ti-sdma.mod.o
  LD [M]  sound/soc/ti/snd-soc-ti-sdma.ko
  CC [M]  sound/soc/ti/snd-soc-ti-udma.mod.o
  LD [M]  sound/soc/ti/snd-soc-ti-udma.ko
  CC [M]  sound/soundcore.mod.o
  LD [M]  sound/soundcore.ko
  CC [M]  sound/usb/snd-usb-audio.mod.o
  LD [M]  sound/usb/snd-usb-audio.ko
  CC [M]  sound/usb/snd-usbmidi-lib.mod.o
  LD [M]  sound/usb/snd-usbmidi-lib.ko

Do any of those files look like winners?

i have a similar issue am working with Beaglebone black wireless and PCM1860EVM the overlays were correct:

#Docs: Making sure you're not a bot!

uname_r=6.16.5-bone16

#uuid=

#dtb=

###U-Boot Overlays###

###Documentation: Making sure you're not a bot! >

###Master Enable

enable_uboot_overlays=1

###

###Overide capes with eeprom

#uboot_overlay_addr0=.dtbo

#uboot_overlay_addr1=.dtbo

#uboot_overlay_addr2=.dtbo

#uboot_overlay_addr3=.dtbo

###

###Additional custom capes

#uboot_overlay_addr4=.dtbo

#uboot_overlay_addr5=.dtbo#uboot_overlay_addr6=.dtbo

#uboot_overlay_addr7=.dtbo

###

###Custom Cape

#dtb_overlay=.dtbo

###

###Disable auto loading of virtual capes (emmc/video/wireless/adc)

#disable_uboot_overlay_emmc=1

disable_uboot_overlay_video=1

disable_uboot_overlay_audio=1

#disable_uboot_overlay_wireless=1

#disable_uboot_overlay_adc=1

###

###PRUSS OPTIONS

###pru_rproc (4.14.x-ti kernel)

#uboot_overlay_pru=AM335X-PRU-RPROC-4-14-TI-00A0.dtbo

###pru_rproc (4.19.x-ti kernel)

#uboot_overlay_pru=AM335X-PRU-RPROC-4-19-TI-00A0.dtbo

###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)

uboot_overlay_addr4=/lib/firmware/BB-PCM1860-00A0.dtbo ###

##cape Universal Enable

#enable_uboot_cape_universal=1

###

###Debug: disable uboot autoload of Cape

#disable_uboot_overlay_addr0=1

#disable_uboot_overlay_addr1=1

#disable_uboot_overlay_addr2=1

#disable_uboot_overlay_addr3=1

###

###U-Boot fdt tweaks… (60000 = 384KB)

#uboot_fdt_buffer=0x60000

###U-Boot Overlays###

console=ttyS0,115200n8

cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rng>

#In the event of edid real failures, uncomment this next line:

#cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rn>

#Use an overlayfs on top of a read-only root filesystem:

#cmdline=fsck.repair=yes earlycon coherent_pool=1M net.ifnames=0 lpj=1990656 rn>

##enable Generic eMMC Flasher:

#cmdline=init=/usr/sbin/init-beagle-flasher

overlay .dts

/dts-v1/;

/plugin/;

/ {

compatible = "ti,beaglebone", "ti,beaglebone-black", "ti,beaglebone-black-wireless";



part-number = "BB-PCM1860";

version = "00A0";



/\* ================================

 \* Fragment 0: McASP0 Pinmux setup

 \* ================================ \*/

fragment@0 {

    target = <&am33xx_pinmux>;

    \__overlay_\_ {

        bb_mcasp0_pins: pinmux_bb_mcasp0_pins {

            pinctrl-single,pins = <

                0x190 0x20

                0x194 0x20

                0x198 0x20

                0x19c 0x20

            >;

        };

    };

};



/\* ================================

 \* Fragment 1: McASP0 Configuration

 \* ================================ \*/

fragment@1 {

    target = <&mcasp0>;

    \__overlay_\_ {

        status = "okay";

        pinctrl-names = "default";

        pinctrl-0 = <&bb_mcasp0_pins>;



        op-mode = <0>;       

        tdm-slots = <8>;     

        num-serializer = <4>;

        serial-dir = <0 0 0 0>;

        tx-num-evt = <0>;

        rx-num-evt = <32>;

    };

};

/\* ================================

 \* Fragment 2: I2C2 PCM1860 Codec

 \* ================================ \*/

fragment@2 {

    target = <&i2c2>;

    \__overlay_\_ {

        #address-cells = <1>;

        #size-cells = <0>;



        pcm1860: pcm1860@54 {

            compatible = "ti,pcm1860";

            reg = <0x54>;

            #sound-dai-cells = <0>;

            status = "okay";

        };

    };

};



/\* ================================

 \* Fragment 3: Simple Audio Card Setup

 \* ================================ \*/

fragment@3 {

    target-path = "/";

    \__overlay_\_ {

        sound {

            compatible = "simple-audio-card";

            simple-audio-card,name = "PCM1860 Audio";

            simple-audio-card,format = "i2s";



            /\* PCM1860 (codec) is the I2S master \*/

            simple-audio-card,bitclock-master = <&sound_master>;

            simple-audio-card,frame-master = <&sound_master>;



            simple-audio-card,cpu {

                sound-dai = <&mcasp0>;

            };



            sound_master: simple-audio-card,codec {

                sound-dai = <&pcm1860>;

            };

        };

    };

};

};

each time no sound card found and no driver for PCM1860 how do l resolve this

We are probably missing the config, I’ll look at this Saturday

voodoo@hestia:/opt/github/buildscripts/6.18.x/bb-kernel/KERNEL$ grep -R "pcm186" ./* | grep .compatible
./Documentation/devicetree/bindings/sound/pcm186x.txt: - compatible : "ti,pcm1862",
./Documentation/devicetree/bindings/sound/pcm186x.txt:		compatible = "ti,pcm1865";
./sound/soc/codecs/pcm186x-i2c.c:	{ .compatible = "ti,pcm1862", .data = (void *)PCM1862 },
./sound/soc/codecs/pcm186x-i2c.c:	{ .compatible = "ti,pcm1863", .data = (void *)PCM1863 },
./sound/soc/codecs/pcm186x-i2c.c:	{ .compatible = "ti,pcm1864", .data = (void *)PCM1864 },
./sound/soc/codecs/pcm186x-i2c.c:	{ .compatible = "ti,pcm1865", .data = (void *)PCM1865 },
./sound/soc/codecs/pcm186x-spi.c:	{ .compatible = "ti,pcm1862", .data = (void *)PCM1862 },
./sound/soc/codecs/pcm186x-spi.c:	{ .compatible = "ti,pcm1863", .data = (void *)PCM1863 },
./sound/soc/codecs/pcm186x-spi.c:	{ .compatible = "ti,pcm1864", .data = (void *)PCM1864 },
./sound/soc/codecs/pcm186x-spi.c:	{ .compatible = "ti,pcm1865", .data = (void *)PCM1865 },

ti,pcm1860 → ti,pcm186…

and pushed out v6.6.x → mainline…