Skip to contentSkip to conversation

Kernel Device Tree entries for simple-audio-card

DISCUSSION Rick Mann 2 participants 19 messages Sep 26, 2015 – Oct 2, 2015 Device tree bindings

lore
Share & tools
lore

Rick Mann

author
#0 lore raw

Hi. I've built a Beaglebone Black Cape that has, among other things, a TI Audio CODEC on it (TLV320AIC3104). This is the same CODEC as the BBB Audio Cape (http://elinux.org/CircuitCo:Audio_Cape_RevB), and it's connected in almost the exact same way.

The last few days I've been figuring out the Device Tree overlay needed to get Linux (4.1.4) to recognize it. It's finding the device and instantiating the low-level driver (tlv320aic3x-codec), although I'm not sure at this point if it's actually talking to it (I have verified that low-level i2c commands do work).

But when it comes to the sound card setup, I'm having trouble getting the Device Tree right. I'm hoping someone on this list can offer some insight. The DT is here:

https://github.com/JetForMe/podtique/blob/master/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

And this is dmesg when I try to load that (note the name of my overlay is BB-ENABLE-PRU, which is an artifact of the experimentation I've been doing; it'll change to something more appropriate):

[   65.859275] bone_capemgr bone_capemgr: part_number 'BB-ENABLE-PRU', version 'N/A'
[   65.859318] bone_capemgr bone_capemgr: slot #4: override
[   65.859336] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[   65.859355] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-ENABLE-PRU'
[   65.859488] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting part number/version based 'BB-ENABLE-PRU-00A0.dtbo
[   65.859506] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting firmware 'BB-ENABLE-PRU-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[   65.861105] bone_capemgr: bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; converting to live tree
[   65.875618] gpio-of-helper ocp:gpio_helper: ready
[   65.876327] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio' property of node '//fixedregulator@1[0]' - status (0)
[   65.876619] core: lz-codec-reg: no parameters
[   65.876713] fixed: reg-fixed-voltage fixedregulator@1: lz-codec-reg supplying 0uV
[   65.883284] pruss_uio 4a300000.pruss: pins are not configured from the driver
[   65.900080] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; overlay id #0
[   65.946254] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio-reset' property of node '/ocp/i2c@4819c000/tlv320aic3104@0[0]' - status (0)
[   65.946317] core: tlv320aic3x-codec 2-0018: Looking up IOVDD-supply from device tree
[   65.946405] core: tlv320aic3x-codec 2-0018: Looking up DVDD-supply from device tree
[   65.946468] core: tlv320aic3x-codec 2-0018: Looking up AVDD-supply from device tree
[   65.946544] core: tlv320aic3x-codec 2-0018: Looking up DRVDD-supply from device tree
[   65.946606] snd_soc_core: tlv320aic3x-codec 2-0018: codec register 2-0018
[   65.946640] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: dai register 2-0018 #1
[   65.946655] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered DAI 'tlv320aic3x-hifi'
[   65.946671] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered codec 'tlv320aic3x-codec.2-0018'
[   65.956491] //sound/simple-audio-card,cpu: could not get #sound-dai-cells for /ocp/mcasp@48038000
[   65.978759] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: dai register 48038000.mcasp #1
[   65.978795] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered DAI '48038000.mcasp'
[   65.978954] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered platform '48038000.mcasp'
[   66.012427] asoc-simple-card sound: parse error -22
[   66.042609] asoc-simple-card: probe of sound failed with error -22

Note the bit about "#sound-dai-cells". I'm not sure what's wrong here, and it seems like it might be something in the distro-provided DTB, not my own.

aplay lists nothing (I think in part because I have yet to put in a proper asound.conf file):

# aplay -l
aplay: device_list:268: no soundcards found...

Can someone suggest some diagnostics I can do to see what the state of things is? I'm just not sure what to look for. Thanks!

Signature · 2 lines
Rick Mann
[email protected]
#1 lore raw

I found that too. Check out the documentation here:
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/sound/simple-card.txt

You need to put in the #sound-dai-cells cell. Your value will likely
be 0 for the codec, and maybe 1 for the SOC dai, but I"m not sure.

Unfortunately, I don't really understand how it works.

-Caleb

Quoted 57 lines · Rick Mann

Hi. I've built a Beaglebone Black Cape that has, among other things, a TI Audio CODEC on it (TLV320AIC3104). This is the same CODEC as the BBB Audio Cape (http://elinux.org/CircuitCo:Audio_Cape_RevB), and it's connected in almost the exact same way.

The last few days I've been figuring out the Device Tree overlay needed to get Linux (4.1.4) to recognize it. It's finding the device and instantiating the low-level driver (tlv320aic3x-codec), although I'm not sure at this point if it's actually talking to it (I have verified that low-level i2c commands do work).

But when it comes to the sound card setup, I'm having trouble getting the Device Tree right. I'm hoping someone on this list can offer some insight. The DT is here:

https://github.com/JetForMe/podtique/blob/master/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

And this is dmesg when I try to load that (note the name of my overlay is BB-ENABLE-PRU, which is an artifact of the experimentation I've been doing; it'll change to something more appropriate):

[   65.859275] bone_capemgr bone_capemgr: part_number 'BB-ENABLE-PRU', version 'N/A'
[   65.859318] bone_capemgr bone_capemgr: slot #4: override
[   65.859336] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[   65.859355] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-ENABLE-PRU'
[   65.859488] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting part number/version based 'BB-ENABLE-PRU-00A0.dtbo
[   65.859506] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting firmware 'BB-ENABLE-PRU-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[   65.861105] bone_capemgr: bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; converting to live tree
[   65.875618] gpio-of-helper ocp:gpio_helper: ready
[   65.876327] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio' property of node '//fixedregulator@1[0]' - status (0)
[   65.876619] core: lz-codec-reg: no parameters
[   65.876713] fixed: reg-fixed-voltage fixedregulator@1: lz-codec-reg supplying 0uV
[   65.883284] pruss_uio 4a300000.pruss: pins are not configured from the driver
[   65.900080] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; overlay id #0
[   65.946254] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio-reset' property of node '/ocp/i2c@4819c000/tlv320aic3104@0[0]' - status (0)
[   65.946317] core: tlv320aic3x-codec 2-0018: Looking up IOVDD-supply from device tree
[   65.946405] core: tlv320aic3x-codec 2-0018: Looking up DVDD-supply from device tree
[   65.946468] core: tlv320aic3x-codec 2-0018: Looking up AVDD-supply from device tree
[   65.946544] core: tlv320aic3x-codec 2-0018: Looking up DRVDD-supply from device tree
[   65.946606] snd_soc_core: tlv320aic3x-codec 2-0018: codec register 2-0018
[   65.946640] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: dai register 2-0018 #1
[   65.946655] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered DAI 'tlv320aic3x-hifi'
[   65.946671] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered codec 'tlv320aic3x-codec.2-0018'
[   65.956491] //sound/simple-audio-card,cpu: could not get #sound-dai-cells for /ocp/mcasp@48038000
[   65.978759] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: dai register 48038000.mcasp #1
[   65.978795] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered DAI '48038000.mcasp'
[   65.978954] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered platform '48038000.mcasp'
[   66.012427] asoc-simple-card sound: parse error -22
[   66.042609] asoc-simple-card: probe of sound failed with error -22

Note the bit about "#sound-dai-cells". I'm not sure what's wrong here, and it seems like it might be something in the distro-provided DTB, not my own.

aplay lists nothing (I think in part because I have yet to put in a proper asound.conf file):

# aplay -l
aplay: device_list:268: no soundcards found...

Can someone suggest some diagnostics I can do to see what the state of things is? I'm just not sure what to look for. Thanks!

--
Rick Mann
[email protected]

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

author
#2 lore raw

Yeah, it turned out I needed a -cells = <0> on the mcasp0 peripheral.

I've got it finding it and creating a sound card, and if I run speaker-test, it sends a bunch of i2c commands to the codec (which aren't quite right). But the McASP/IIS pins never change state, so, I've made progress, but I'm still stuck.

Latest DTBO:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Quoted 75 lines · Caleb Crome

I found that too. Check out the documentation here:
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/sound/simple-card.txt

You need to put in the #sound-dai-cells cell. Your value will likely
be 0 for the codec, and maybe 1 for the SOC dai, but I"m not sure.

Unfortunately, I don't really understand how it works.

-Caleb

Quoted 53 lines · Rick Mann

Hi. I've built a Beaglebone Black Cape that has, among other things, a TI Audio CODEC on it (TLV320AIC3104). This is the same CODEC as the BBB Audio Cape (http://elinux.org/CircuitCo:Audio_Cape_RevB), and it's connected in almost the exact same way.

The last few days I've been figuring out the Device Tree overlay needed to get Linux (4.1.4) to recognize it. It's finding the device and instantiating the low-level driver (tlv320aic3x-codec), although I'm not sure at this point if it's actually talking to it (I have verified that low-level i2c commands do work).

But when it comes to the sound card setup, I'm having trouble getting the Device Tree right. I'm hoping someone on this list can offer some insight. The DT is here:

https://github.com/JetForMe/podtique/blob/master/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

And this is dmesg when I try to load that (note the name of my overlay is BB-ENABLE-PRU, which is an artifact of the experimentation I've been doing; it'll change to something more appropriate):

[   65.859275] bone_capemgr bone_capemgr: part_number 'BB-ENABLE-PRU', version 'N/A'
[   65.859318] bone_capemgr bone_capemgr: slot #4: override
[   65.859336] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[   65.859355] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-ENABLE-PRU'
[   65.859488] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting part number/version based 'BB-ENABLE-PRU-00A0.dtbo
[   65.859506] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting firmware 'BB-ENABLE-PRU-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[   65.861105] bone_capemgr: bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; converting to live tree
[   65.875618] gpio-of-helper ocp:gpio_helper: ready
[   65.876327] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio' property of node '//fixedregulator@1[0]' - status (0)
[   65.876619] core: lz-codec-reg: no parameters
[   65.876713] fixed: reg-fixed-voltage fixedregulator@1: lz-codec-reg supplying 0uV
[   65.883284] pruss_uio 4a300000.pruss: pins are not configured from the driver
[   65.900080] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; overlay id #0
[   65.946254] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio-reset' property of node '/ocp/i2c@4819c000/tlv320aic3104@0[0]' - status (0)
[   65.946317] core: tlv320aic3x-codec 2-0018: Looking up IOVDD-supply from device tree
[   65.946405] core: tlv320aic3x-codec 2-0018: Looking up DVDD-supply from device tree
[   65.946468] core: tlv320aic3x-codec 2-0018: Looking up AVDD-supply from device tree
[   65.946544] core: tlv320aic3x-codec 2-0018: Looking up DRVDD-supply from device tree
[   65.946606] snd_soc_core: tlv320aic3x-codec 2-0018: codec register 2-0018
[   65.946640] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: dai register 2-0018 #1
[   65.946655] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered DAI 'tlv320aic3x-hifi'
[   65.946671] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered codec 'tlv320aic3x-codec.2-0018'
[   65.956491] //sound/simple-audio-card,cpu: could not get #sound-dai-cells for /ocp/mcasp@48038000
[   65.978759] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: dai register 48038000.mcasp #1
[   65.978795] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered DAI '48038000.mcasp'
[   65.978954] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered platform '48038000.mcasp'
[   66.012427] asoc-simple-card sound: parse error -22
[   66.042609] asoc-simple-card: probe of sound failed with error -22

Note the bit about "#sound-dai-cells". I'm not sure what's wrong here, and it seems like it might be something in the distro-provided DTB, not my own.

aplay lists nothing (I think in part because I have yet to put in a proper asound.conf file):

# aplay -l
aplay: device_list:268: no soundcards found...

Can someone suggest some diagnostics I can do to see what the state of things is? I'm just not sure what to look for. Thanks!

--
Rick Mann
[email protected]

Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Signature · 2 lines
Rick Mann
[email protected]
#3 lore raw

I used these pins to get the audio cape going.

+/*

+   * MCASP pin mapping
+   *                          ball   BBB
+   * MCASP0_ACLKX             A13    P9.31
+   * MCASP0_AFSX              B13    P9.29
+   * MCASP0_AXR2  (mcasp OUT) C12    P9.28
+   * MCASP0_AXR3  (mcasp IN)  A14    P9.25

+*/

mcasp_0_pins_default: mcasp_0_pins_default {
pinctrl-single,pins = <

     0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx */
    0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */
    0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2 */
    0x1ac ( PIN_INPUT | MUX_MODE2 ) /* (A14) mcasp0_ahclkx.mcasp0_axr3 */
Quoted 1 line

;

};

And importantly, the audio cape needs to use the AXR2 and AXR3 for my use.

+&mcasp0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mcasp_0_pins_default>;
+ status = "okay";
+
+ op-mode = <0>; /* MCASP_IIS_MODE */
+ tdm-slots = <8>;
+ num-serializer = <16>;
+ serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
+ 0 0 1 2
+ 0 0 0 0
+ 0 0 0 0
+ 0 0 0 0
+ >;
+ tx-num-evt = <1>;
+ rx-num-evt = <1>;
};

Hope that can be of some help.

-Caleb

Quoted 90 lines · Rick Mann

Yeah, it turned out I needed a -cells = <0> on the mcasp0 peripheral.

I've got it finding it and creating a sound card, and if I run speaker-test, it sends a bunch of i2c commands to the codec (which aren't quite right). But the McASP/IIS pins never change state, so, I've made progress, but I'm still stuck.

Latest DTBO:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Quoted 67 lines · Caleb Crome

I found that too. Check out the documentation here:
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/sound/simple-card.txt

You need to put in the #sound-dai-cells cell. Your value will likely
be 0 for the codec, and maybe 1 for the SOC dai, but I"m not sure.

Unfortunately, I don't really understand how it works.

-Caleb

Quoted 53 lines · Rick Mann

Hi. I've built a Beaglebone Black Cape that has, among other things, a TI Audio CODEC on it (TLV320AIC3104). This is the same CODEC as the BBB Audio Cape (http://elinux.org/CircuitCo:Audio_Cape_RevB), and it's connected in almost the exact same way.

The last few days I've been figuring out the Device Tree overlay needed to get Linux (4.1.4) to recognize it. It's finding the device and instantiating the low-level driver (tlv320aic3x-codec), although I'm not sure at this point if it's actually talking to it (I have verified that low-level i2c commands do work).

But when it comes to the sound card setup, I'm having trouble getting the Device Tree right. I'm hoping someone on this list can offer some insight. The DT is here:

https://github.com/JetForMe/podtique/blob/master/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

And this is dmesg when I try to load that (note the name of my overlay is BB-ENABLE-PRU, which is an artifact of the experimentation I've been doing; it'll change to something more appropriate):

[   65.859275] bone_capemgr bone_capemgr: part_number 'BB-ENABLE-PRU', version 'N/A'
[   65.859318] bone_capemgr bone_capemgr: slot #4: override
[   65.859336] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[   65.859355] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-ENABLE-PRU'
[   65.859488] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting part number/version based 'BB-ENABLE-PRU-00A0.dtbo
[   65.859506] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting firmware 'BB-ENABLE-PRU-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[   65.861105] bone_capemgr: bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; converting to live tree
[   65.875618] gpio-of-helper ocp:gpio_helper: ready
[   65.876327] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio' property of node '//fixedregulator@1[0]' - status (0)
[   65.876619] core: lz-codec-reg: no parameters
[   65.876713] fixed: reg-fixed-voltage fixedregulator@1: lz-codec-reg supplying 0uV
[   65.883284] pruss_uio 4a300000.pruss: pins are not configured from the driver
[   65.900080] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; overlay id #0
[   65.946254] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio-reset' property of node '/ocp/i2c@4819c000/tlv320aic3104@0[0]' - status (0)
[   65.946317] core: tlv320aic3x-codec 2-0018: Looking up IOVDD-supply from device tree
[   65.946405] core: tlv320aic3x-codec 2-0018: Looking up DVDD-supply from device tree
[   65.946468] core: tlv320aic3x-codec 2-0018: Looking up AVDD-supply from device tree
[   65.946544] core: tlv320aic3x-codec 2-0018: Looking up DRVDD-supply from device tree
[   65.946606] snd_soc_core: tlv320aic3x-codec 2-0018: codec register 2-0018
[   65.946640] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: dai register 2-0018 #1
[   65.946655] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered DAI 'tlv320aic3x-hifi'
[   65.946671] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered codec 'tlv320aic3x-codec.2-0018'
[   65.956491] //sound/simple-audio-card,cpu: could not get #sound-dai-cells for /ocp/mcasp@48038000
[   65.978759] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: dai register 48038000.mcasp #1
[   65.978795] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered DAI '48038000.mcasp'
[   65.978954] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered platform '48038000.mcasp'
[   66.012427] asoc-simple-card sound: parse error -22
[   66.042609] asoc-simple-card: probe of sound failed with error -22

Note the bit about "#sound-dai-cells". I'm not sure what's wrong here, and it seems like it might be something in the distro-provided DTB, not my own.

aplay lists nothing (I think in part because I have yet to put in a proper asound.conf file):

# aplay -l
aplay: device_list:268: no soundcards found...

Can someone suggest some diagnostics I can do to see what the state of things is? I'm just not sure what to look for. Thanks!

--
Rick Mann
[email protected]

Quoted 8 lines
Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

--
Rick Mann
[email protected]

author
#4 lore raw

That's very similar to what I have (I use ax40 & axr2). I also use macsp0_ahclkx, but I'm not seeing a signal on it (or any other pin).

Does this work for you with a 4.1.x kernel?

Quoted 140 lines · Caleb Crome

I used these pins to get the audio cape going.

(quoted diff) +8 -0
+/*
+   * MCASP pin mapping
+   *                          ball   BBB
+   * MCASP0_ACLKX             A13    P9.31
+   * MCASP0_AFSX              B13    P9.29
+   * MCASP0_AXR2  (mcasp OUT) C12    P9.28
+   * MCASP0_AXR3  (mcasp IN)  A14    P9.25
+*/

mcasp_0_pins_default: mcasp_0_pins_default {
pinctrl-single,pins = <

    0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx */

0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */ 0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2 */ 0x1ac ( PIN_INPUT | MUX_MODE2 ) /* (A14) mcasp0_ahclkx.mcasp0_axr3 */

Quoted 1 line

;

};

And importantly, the audio cape needs to use the AXR2 and AXR3 for my use.

+&mcasp0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mcasp_0_pins_default>;
+ status = "okay";
+
+ op-mode = <0>; /* MCASP_IIS_MODE */
+ tdm-slots = <8>;
+ num-serializer = <16>;
+ serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
+ 0 0 1 2
+ 0 0 0 0
+ 0 0 0 0
+ 0 0 0 0
+ >;
+ tx-num-evt = <1>;
+ rx-num-evt = <1>;
};

Hope that can be of some help.

-Caleb

Quoted 90 lines · Rick Mann

Yeah, it turned out I needed a -cells = <0> on the mcasp0 peripheral.

I've got it finding it and creating a sound card, and if I run speaker-test, it sends a bunch of i2c commands to the codec (which aren't quite right). But the McASP/IIS pins never change state, so, I've made progress, but I'm still stuck.

Latest DTBO:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Quoted 67 lines · Caleb Crome

I found that too. Check out the documentation here:
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/sound/simple-card.txt

You need to put in the #sound-dai-cells cell. Your value will likely
be 0 for the codec, and maybe 1 for the SOC dai, but I"m not sure.

Unfortunately, I don't really understand how it works.

-Caleb

Quoted 53 lines · Rick Mann

Hi. I've built a Beaglebone Black Cape that has, among other things, a TI Audio CODEC on it (TLV320AIC3104). This is the same CODEC as the BBB Audio Cape (http://elinux.org/CircuitCo:Audio_Cape_RevB), and it's connected in almost the exact same way.

The last few days I've been figuring out the Device Tree overlay needed to get Linux (4.1.4) to recognize it. It's finding the device and instantiating the low-level driver (tlv320aic3x-codec), although I'm not sure at this point if it's actually talking to it (I have verified that low-level i2c commands do work).

But when it comes to the sound card setup, I'm having trouble getting the Device Tree right. I'm hoping someone on this list can offer some insight. The DT is here:

https://github.com/JetForMe/podtique/blob/master/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

And this is dmesg when I try to load that (note the name of my overlay is BB-ENABLE-PRU, which is an artifact of the experimentation I've been doing; it'll change to something more appropriate):

[   65.859275] bone_capemgr bone_capemgr: part_number 'BB-ENABLE-PRU', version 'N/A'
[   65.859318] bone_capemgr bone_capemgr: slot #4: override
[   65.859336] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[   65.859355] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-ENABLE-PRU'
[   65.859488] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting part number/version based 'BB-ENABLE-PRU-00A0.dtbo
[   65.859506] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting firmware 'BB-ENABLE-PRU-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[   65.861105] bone_capemgr: bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; converting to live tree
[   65.875618] gpio-of-helper ocp:gpio_helper: ready
[   65.876327] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio' property of node '//fixedregulator@1[0]' - status (0)
[   65.876619] core: lz-codec-reg: no parameters
[   65.876713] fixed: reg-fixed-voltage fixedregulator@1: lz-codec-reg supplying 0uV
[   65.883284] pruss_uio 4a300000.pruss: pins are not configured from the driver
[   65.900080] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; overlay id #0
[   65.946254] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio-reset' property of node '/ocp/i2c@4819c000/tlv320aic3104@0[0]' - status (0)
[   65.946317] core: tlv320aic3x-codec 2-0018: Looking up IOVDD-supply from device tree
[   65.946405] core: tlv320aic3x-codec 2-0018: Looking up DVDD-supply from device tree
[   65.946468] core: tlv320aic3x-codec 2-0018: Looking up AVDD-supply from device tree
[   65.946544] core: tlv320aic3x-codec 2-0018: Looking up DRVDD-supply from device tree
[   65.946606] snd_soc_core: tlv320aic3x-codec 2-0018: codec register 2-0018
[   65.946640] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: dai register 2-0018 #1
[   65.946655] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered DAI 'tlv320aic3x-hifi'
[   65.946671] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered codec 'tlv320aic3x-codec.2-0018'
[   65.956491] //sound/simple-audio-card,cpu: could not get #sound-dai-cells for /ocp/mcasp@48038000
[   65.978759] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: dai register 48038000.mcasp #1
[   65.978795] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered DAI '48038000.mcasp'
[   65.978954] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered platform '48038000.mcasp'
[   66.012427] asoc-simple-card sound: parse error -22
[   66.042609] asoc-simple-card: probe of sound failed with error -22

Note the bit about "#sound-dai-cells". I'm not sure what's wrong here, and it seems like it might be something in the distro-provided DTB, not my own.

aplay lists nothing (I think in part because I have yet to put in a proper asound.conf file):

# aplay -l
aplay: device_list:268: no soundcards found...

Can someone suggest some diagnostics I can do to see what the state of things is? I'm just not sure what to look for. Thanks!

--
Rick Mann
[email protected]

Quoted 8 lines
Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

--
Rick Mann
[email protected]

Signature · 2 lines
Rick Mann
[email protected]
#5 lore raw
Quoted 5 lines · Rick Mann

That's very similar to what I have (I use ax40 & axr2). I also use macsp0_ahclkx, but I'm not seeing a signal on it (or any other pin).

Does this work for you with a 4.1.x kernel?

Yes, it works for me. I assume your codec is master, do you see WCLK and BCLK running? How about MCLK?

Who is supposed to be driving MCLK in your case, the BBB or the codec?

I see that you have the AHCLKX set to INPUT. This should probably either be output (if the CPU is driving it), or not connected if the codec is driving it.

Quoted 1 line

0x1ac (PIN_INPUT | MUX_MODE0) // P9_25 MCLK MCLK mcasp0_ahclkx

-Caleb

Quoted 148 lines
Quoted 44 lines · Caleb Crome

I used these pins to get the audio cape going.

(quoted diff) +8 -0
+/*
+   * MCASP pin mapping
+   *                          ball   BBB
+   * MCASP0_ACLKX             A13    P9.31
+   * MCASP0_AFSX              B13    P9.29
+   * MCASP0_AXR2  (mcasp OUT) C12    P9.28
+   * MCASP0_AXR3  (mcasp IN)  A14    P9.25
+*/

mcasp_0_pins_default: mcasp_0_pins_default {
pinctrl-single,pins = <

    0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx */

0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */ 0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2 */ 0x1ac ( PIN_INPUT | MUX_MODE2 ) /* (A14) mcasp0_ahclkx.mcasp0_axr3 */

Quoted 1 line

;

};

And importantly, the audio cape needs to use the AXR2 and AXR3 for my use.

+&mcasp0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mcasp_0_pins_default>;
+ status = "okay";
+
+ op-mode = <0>; /* MCASP_IIS_MODE */
+ tdm-slots = <8>;
+ num-serializer = <16>;
+ serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
+ 0 0 1 2
+ 0 0 0 0
+ 0 0 0 0
+ 0 0 0 0
+ >;
+ tx-num-evt = <1>;
+ rx-num-evt = <1>;
};

Quoted 97 lines

Hope that can be of some help.

-Caleb

Quoted 90 lines · Rick Mann

Yeah, it turned out I needed a -cells = <0> on the mcasp0 peripheral.

I've got it finding it and creating a sound card, and if I run speaker-test, it sends a bunch of i2c commands to the codec (which aren't quite right). But the McASP/IIS pins never change state, so, I've made progress, but I'm still stuck.

Latest DTBO:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Quoted 67 lines · Caleb Crome

I found that too. Check out the documentation here:
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/sound/simple-card.txt

You need to put in the #sound-dai-cells cell. Your value will likely
be 0 for the codec, and maybe 1 for the SOC dai, but I"m not sure.

Unfortunately, I don't really understand how it works.

-Caleb

Quoted 53 lines · Rick Mann

Hi. I've built a Beaglebone Black Cape that has, among other things, a TI Audio CODEC on it (TLV320AIC3104). This is the same CODEC as the BBB Audio Cape (http://elinux.org/CircuitCo:Audio_Cape_RevB), and it's connected in almost the exact same way.

The last few days I've been figuring out the Device Tree overlay needed to get Linux (4.1.4) to recognize it. It's finding the device and instantiating the low-level driver (tlv320aic3x-codec), although I'm not sure at this point if it's actually talking to it (I have verified that low-level i2c commands do work).

But when it comes to the sound card setup, I'm having trouble getting the Device Tree right. I'm hoping someone on this list can offer some insight. The DT is here:

https://github.com/JetForMe/podtique/blob/master/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

And this is dmesg when I try to load that (note the name of my overlay is BB-ENABLE-PRU, which is an artifact of the experimentation I've been doing; it'll change to something more appropriate):

[   65.859275] bone_capemgr bone_capemgr: part_number 'BB-ENABLE-PRU', version 'N/A'
[   65.859318] bone_capemgr bone_capemgr: slot #4: override
[   65.859336] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[   65.859355] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-ENABLE-PRU'
[   65.859488] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting part number/version based 'BB-ENABLE-PRU-00A0.dtbo
[   65.859506] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting firmware 'BB-ENABLE-PRU-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[   65.861105] bone_capemgr: bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; converting to live tree
[   65.875618] gpio-of-helper ocp:gpio_helper: ready
[   65.876327] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio' property of node '//fixedregulator@1[0]' - status (0)
[   65.876619] core: lz-codec-reg: no parameters
[   65.876713] fixed: reg-fixed-voltage fixedregulator@1: lz-codec-reg supplying 0uV
[   65.883284] pruss_uio 4a300000.pruss: pins are not configured from the driver
[   65.900080] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; overlay id #0
[   65.946254] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio-reset' property of node '/ocp/i2c@4819c000/tlv320aic3104@0[0]' - status (0)
[   65.946317] core: tlv320aic3x-codec 2-0018: Looking up IOVDD-supply from device tree
[   65.946405] core: tlv320aic3x-codec 2-0018: Looking up DVDD-supply from device tree
[   65.946468] core: tlv320aic3x-codec 2-0018: Looking up AVDD-supply from device tree
[   65.946544] core: tlv320aic3x-codec 2-0018: Looking up DRVDD-supply from device tree
[   65.946606] snd_soc_core: tlv320aic3x-codec 2-0018: codec register 2-0018
[   65.946640] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: dai register 2-0018 #1
[   65.946655] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered DAI 'tlv320aic3x-hifi'
[   65.946671] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered codec 'tlv320aic3x-codec.2-0018'
[   65.956491] //sound/simple-audio-card,cpu: could not get #sound-dai-cells for /ocp/mcasp@48038000
[   65.978759] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: dai register 48038000.mcasp #1
[   65.978795] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered DAI '48038000.mcasp'
[   65.978954] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered platform '48038000.mcasp'
[   66.012427] asoc-simple-card sound: parse error -22
[   66.042609] asoc-simple-card: probe of sound failed with error -22

Note the bit about "#sound-dai-cells". I'm not sure what's wrong here, and it seems like it might be something in the distro-provided DTB, not my own.

aplay lists nothing (I think in part because I have yet to put in a proper asound.conf file):

# aplay -l
aplay: device_list:268: no soundcards found...

Can someone suggest some diagnostics I can do to see what the state of things is? I'm just not sure what to look for. Thanks!

--
Rick Mann
[email protected]

Quoted 8 lines
Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

--
Rick Mann
[email protected]

--
Rick Mann
[email protected]

author
#6 lore raw
Quoted 8 lines · Caleb Crome
Quoted 2 lines · Rick Mann

That's very similar to what I have (I use ax40 & axr2). I also use macsp0_ahclkx, but I'm not seeing a signal on it (or any other pin).

Quoted 6 lines
Quoted 1 line

Does this work for you with a 4.1.x kernel?

Yes, it works for me. I assume your codec is master, do you see WCLK and BCLK running? How about MCLK?

Who is supposed to be driving MCLK in your case, the BBB or the codec?

According to someone else, and as you assume above, the BBB should generate the MCLK and the TLV generates WCLK and BCLK. That's counterintuitive to me, but the configuration it's sending to the TLV for register 0x08 is 0xC0, which sets the bits such that WCLK and BCLK are outputs (master mode). I think MCLK is always an input on this device.

(BTW, thanks for asking. In verifying what I just wrote, I learned a lot about how it's supposed to work).

Quoted 5 lines

I see that you have the AHCLKX set to INPUT. This should probably either be output (if the CPU is driving it), or not connected if the codec is driving it.

Quoted 1 line

0x1ac (PIN_INPUT | MUX_MODE0) // P9_25 MCLK MCLK mcasp0_ahclkx

Yeah, I changed that the other day:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

pinctrl-single,pins = <                             //  Hdr     I2S     TLV     SoC
                                                    //  -----   ----    ----    -------------
    0x190 (PIN_INPUT_PULLDOWN | MUX_MODE0)          //  P9_31   BCLK    BCLK    mcasp0_aclkx
    0x194 (PIN_INPUT_PULLDOWN | MUX_MODE0)          //  P9_29   WCLK    WCLK    mcasp0_fsx
    0x198 (PIN_INPUT_PULLDOWN | MUX_MODE0)          //  P9_30   RX      SDOUT   mcasp0_axr0
    0x19c (PIN_INPUT_PULLDOWN | MUX_MODE2)          //  P9_28   TX      SDIN    mcasp0_axr2
    0x1ac (PIN_OUTPUT_PULLDOWN | MUX_MODE0)         //  P9_25   MCLK    MCLK    mcasp0_ahclkx
Quoted 1 line

;

The TRM indicates all the pins should have their receiver enabled, but I decided to make MCLK an output.

In all cases, NONE of the pins, including MCLK, changes state. BTW, when I run speaker-test, it gets this far and hangs:

$ speaker-test 

speaker-test 1.0.28

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 128 to 32768
Period size range from 8 to 2048
Using max buffer size 32768
Periods = 4
was set period_size = 2048
was set buffer_size = 32768
0 - Front Left

Which makes me think some internal sound data buffer is filling up, and the write is blocking, and nothing is emptying the buffer because the McASP isn't accepting bytes, and therefore not sending data out.

If I interrupt speaker-test, it usually outputs this:

^CWrite error: -4,Interrupted system call
xrun_recovery failed: -4,Interrupted system call
Transfer failed: Interrupted system call

Further reinforcing my theory. Which suggests something's still not right for McASP0.

Quoted 158 lines

-Caleb

Quoted 143 lines
Quoted 44 lines · Caleb Crome

I used these pins to get the audio cape going.

(quoted diff) +8 -0
+/*
+   * MCASP pin mapping
+   *                          ball   BBB
+   * MCASP0_ACLKX             A13    P9.31
+   * MCASP0_AFSX              B13    P9.29
+   * MCASP0_AXR2  (mcasp OUT) C12    P9.28
+   * MCASP0_AXR3  (mcasp IN)  A14    P9.25
+*/

mcasp_0_pins_default: mcasp_0_pins_default { pinctrl-single,pins = <
0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx */
0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */ 0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2 */ 0x1ac ( PIN_INPUT | MUX_MODE2 ) /* (A14) mcasp0_ahclkx.mcasp0_axr3 */

Quoted 1 line

;

};

And importantly, the audio cape needs to use the AXR2 and AXR3 for my use.

+&mcasp0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mcasp_0_pins_default>;
+ status = "okay";
+
+ op-mode = <0>; /* MCASP_IIS_MODE */
+ tdm-slots = <8>;
+ num-serializer = <16>;
+ serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
+ 0 0 1 2
+ 0 0 0 0
+ 0 0 0 0
+ 0 0 0 0
+ >;
+ tx-num-evt = <1>;
+ rx-num-evt = <1>;
};

Quoted 97 lines

Hope that can be of some help.

-Caleb

Quoted 90 lines · Rick Mann

Yeah, it turned out I needed a -cells = <0> on the mcasp0 peripheral.

I've got it finding it and creating a sound card, and if I run speaker-test, it sends a bunch of i2c commands to the codec (which aren't quite right). But the McASP/IIS pins never change state, so, I've made progress, but I'm still stuck.

Latest DTBO:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Quoted 67 lines · Caleb Crome

I found that too. Check out the documentation here:
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/sound/simple-card.txt

You need to put in the #sound-dai-cells cell. Your value will likely
be 0 for the codec, and maybe 1 for the SOC dai, but I"m not sure.

Unfortunately, I don't really understand how it works.

-Caleb

Quoted 53 lines · Rick Mann

Hi. I've built a Beaglebone Black Cape that has, among other things, a TI Audio CODEC on it (TLV320AIC3104). This is the same CODEC as the BBB Audio Cape (http://elinux.org/CircuitCo:Audio_Cape_RevB), and it's connected in almost the exact same way.

The last few days I've been figuring out the Device Tree overlay needed to get Linux (4.1.4) to recognize it. It's finding the device and instantiating the low-level driver (tlv320aic3x-codec), although I'm not sure at this point if it's actually talking to it (I have verified that low-level i2c commands do work).

But when it comes to the sound card setup, I'm having trouble getting the Device Tree right. I'm hoping someone on this list can offer some insight. The DT is here:

https://github.com/JetForMe/podtique/blob/master/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

And this is dmesg when I try to load that (note the name of my overlay is BB-ENABLE-PRU, which is an artifact of the experimentation I've been doing; it'll change to something more appropriate):

[   65.859275] bone_capemgr bone_capemgr: part_number 'BB-ENABLE-PRU', version 'N/A'
[   65.859318] bone_capemgr bone_capemgr: slot #4: override
[   65.859336] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[   65.859355] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-ENABLE-PRU'
[   65.859488] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting part number/version based 'BB-ENABLE-PRU-00A0.dtbo
[   65.859506] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting firmware 'BB-ENABLE-PRU-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[   65.861105] bone_capemgr: bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; converting to live tree
[   65.875618] gpio-of-helper ocp:gpio_helper: ready
[   65.876327] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio' property of node '//fixedregulator@1[0]' - status (0)
[   65.876619] core: lz-codec-reg: no parameters
[   65.876713] fixed: reg-fixed-voltage fixedregulator@1: lz-codec-reg supplying 0uV
[   65.883284] pruss_uio 4a300000.pruss: pins are not configured from the driver
[   65.900080] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; overlay id #0
[   65.946254] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio-reset' property of node '/ocp/i2c@4819c000/tlv320aic3104@0[0]' - status (0)
[   65.946317] core: tlv320aic3x-codec 2-0018: Looking up IOVDD-supply from device tree
[   65.946405] core: tlv320aic3x-codec 2-0018: Looking up DVDD-supply from device tree
[   65.946468] core: tlv320aic3x-codec 2-0018: Looking up AVDD-supply from device tree
[   65.946544] core: tlv320aic3x-codec 2-0018: Looking up DRVDD-supply from device tree
[   65.946606] snd_soc_core: tlv320aic3x-codec 2-0018: codec register 2-0018
[   65.946640] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: dai register 2-0018 #1
[   65.946655] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered DAI 'tlv320aic3x-hifi'
[   65.946671] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered codec 'tlv320aic3x-codec.2-0018'
[   65.956491] //sound/simple-audio-card,cpu: could not get #sound-dai-cells for /ocp/mcasp@48038000
[   65.978759] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: dai register 48038000.mcasp #1
[   65.978795] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered DAI '48038000.mcasp'
[   65.978954] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered platform '48038000.mcasp'
[   66.012427] asoc-simple-card sound: parse error -22
[   66.042609] asoc-simple-card: probe of sound failed with error -22

Note the bit about "#sound-dai-cells". I'm not sure what's wrong here, and it seems like it might be something in the distro-provided DTB, not my own.

aplay lists nothing (I think in part because I have yet to put in a proper asound.conf file):

# aplay -l
aplay: device_list:268: no soundcards found...

Can someone suggest some diagnostics I can do to see what the state of things is? I'm just not sure what to look for. Thanks!

--
Rick Mann
[email protected]

Quoted 8 lines
Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

--
Rick Mann
[email protected]

Quoted 5 lines

--
Rick Mann
[email protected]

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Signature · 2 lines
Rick Mann
[email protected]
#7 lore raw

Hmm, the pinmux looks right, except that you have your TX set as an input. You should have this:

mymcasp1_pins_default: mymcasp1_pins_default { pinctrl-single,pins = <
0x1ac ( PIN_OUTPUT | MUX_MODE0 ) /* (A14) mcasp0_ahclkx.mcasp0_ahclkx */

0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx */
0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */
0x198 ( PIN_INPUT | MUX_MODE0 ) /* (D12) mcasp0_axr0.mcasp0_axr0 */

0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2 */

Quoted 1 line

;

};

I'm not using a DTBO, but editing the DTB directly. Do you currently get
a sound card listed? i.e. does aplay -l show anything?

Also, did you disable your HDMI? You need to do that.

The thing you need to get is the MCLK a.k.a. the ahclkx going. After that, all else should fall in line. Maybe. If ahclkx isn't going, then perhaps it's a problem with enabling the mcasp, but your dts looks okay.

-Caleb

Quoted 4 lines · Rick Mann
Quoted 4 lines · Caleb Crome

On Mon, Sep 28, 2015 at 11:55 AM, Rick Mann <[email protected]>

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line

That's very similar to what I have (I use ax40 & axr2). I also use

macsp0_ahclkx, but I'm not seeing a signal on it (or any other pin).

Quoted 11 lines
Quoted 9 lines
Quoted 4 lines

Does this work for you with a 4.1.x kernel?

Yes, it works for me. I assume your codec is master, do you see WCLK and BCLK running? How about MCLK?

Who is supposed to be driving MCLK in your case, the BBB or the codec?

According to someone else, and as you assume above, the BBB should

generate the MCLK and the TLV generates WCLK and BCLK. That's counterintuitive to me, but the configuration it's sending to the TLV for register 0x08 is 0xC0, which sets the bits such that WCLK and BCLK are outputs (master mode). I think MCLK is always an input on this device.

Quoted 2 lines

(BTW, thanks for asking. In verifying what I just wrote, I learned a lot

about how it's supposed to work).

Quoted 10 lines
Quoted 6 lines

I see that you have the AHCLKX set to INPUT. This should probably either be output (if the CPU is driving it), or not connected if the codec is driving it.

Quoted 1 line

0x1ac (PIN_INPUT | MUX_MODE0) // P9_25 MCLK MCLK mcasp0_ahclkx

Yeah, I changed that the other day:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Quoted 2 lines

pinctrl-single,pins = < // Hdr I2S

TLV SoC

Quoted 1 line
                                                    //  -----   ----

---- -------------

Quoted 1 line
    0x190 (PIN_INPUT_PULLDOWN | MUX_MODE0)          //  P9_31   BCLK

BCLK mcasp0_aclkx

Quoted 1 line
    0x194 (PIN_INPUT_PULLDOWN | MUX_MODE0)          //  P9_29   WCLK

WCLK mcasp0_fsx

Quoted 1 line
    0x198 (PIN_INPUT_PULLDOWN | MUX_MODE0)          //  P9_30   RX

SDOUT mcasp0_axr0

Quoted 1 line
    0x19c (PIN_INPUT_PULLDOWN | MUX_MODE2)          //  P9_28   TX

SDIN mcasp0_axr2

Quoted 1 line
    0x1ac (PIN_OUTPUT_PULLDOWN | MUX_MODE0)         //  P9_25   MCLK

MCLK mcasp0_ahclkx

Quoted 3 lines
Quoted 1 line

;

The TRM indicates all the pins should have their receiver enabled, but I

decided to make MCLK an output.

Quoted 2 lines

In all cases, NONE of the pins, including MCLK, changes state. BTW, when

I run speaker-test, it gets this far and hangs:

Quoted 17 lines
$ speaker-test

speaker-test 1.0.28

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 128 to 32768
Period size range from 8 to 2048
Using max buffer size 32768
Periods = 4
was set period_size = 2048
was set buffer_size = 32768
0 - Front Left

Quoted 1 line

Which makes me think some internal sound data buffer is filling up, and

the write is blocking, and nothing is emptying the buffer because the McASP isn't accepting bytes, and therefore not sending data out.

Quoted 8 lines

If I interrupt speaker-test, it usually outputs this:

^CWrite error: -4,Interrupted system call
xrun_recovery failed: -4,Interrupted system call
Transfer failed: Interrupted system call

Further reinforcing my theory. Which suggests something's still not right

for McASP0.

Quoted 24 lines
Quoted 24 lines

-Caleb

Quoted 14 lines
Quoted 14 lines · Caleb Crome

I used these pins to get the audio cape going.

(quoted diff) +8 -0
+/*
+   * MCASP pin mapping
+   *                          ball   BBB
+   * MCASP0_ACLKX             A13    P9.31
+   * MCASP0_AFSX              B13    P9.29
+   * MCASP0_AXR2  (mcasp OUT) C12    P9.28
+   * MCASP0_AXR3  (mcasp IN)  A14    P9.25
+*/
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

mcasp_0_pins_default: mcasp_0_pins_default { pinctrl-single,pins = <
0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx

*/

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */ 0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2

*/

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

0x1ac ( PIN_INPUT | MUX_MODE2 ) /* (A14) mcasp0_ahclkx.mcasp0_axr3 */

Quoted 1 line

;

};

And importantly, the audio cape needs to use the AXR2 and AXR3 for my

use.

Quoted 27 lines
Quoted 27 lines
Quoted 27 lines
Quoted 27 lines

+&mcasp0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mcasp_0_pins_default>;
+ status = "okay";
+
+ op-mode = <0>; /* MCASP_IIS_MODE */
+ tdm-slots = <8>;
+ num-serializer = <16>;
+ serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
+ 0 0 1 2
+ 0 0 0 0
+ 0 0 0 0
+ 0 0 0 0
+ >;
+ tx-num-evt = <1>;
+ rx-num-evt = <1>;
};

Hope that can be of some help.

-Caleb

On Sun, Sep 27, 2015 at 10:14 PM, Rick Mann <[email protected]>

Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

Yeah, it turned out I needed a -cells = <0> on the mcasp0 peripheral.

I've got it finding it and creating a sound card, and if I run

speaker-test, it sends a bunch of i2c commands to the codec (which aren't quite right). But the McASP/IIS pins never change state, so, I've made progress, but I'm still stuck.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Latest DTBO:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines · Caleb Crome

I found that too. Check out the documentation here:

http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/sound/simple-card.txt

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

You need to put in the #sound-dai-cells cell. Your value will

likely

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

be 0 for the codec, and maybe 1 for the SOC dai, but I"m not sure.

Unfortunately, I don't really understand how it works.

-Caleb

On Fri, Sep 25, 2015 at 10:57 PM, Rick Mann <[email protected]>

Quoted 1 line · wrote:
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

Hi. I've built a Beaglebone Black Cape that has, among other

things, a TI Audio CODEC on it (TLV320AIC3104). This is the same CODEC as the BBB Audio Cape (http://elinux.org/CircuitCo:Audio_Cape_RevB), and it's connected in almost the exact same way.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

The last few days I've been figuring out the Device Tree overlay

needed to get Linux (4.1.4) to recognize it. It's finding the device and instantiating the low-level driver (tlv320aic3x-codec), although I'm not sure at this point if it's actually talking to it (I have verified that low-level i2c commands do work).

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

But when it comes to the sound card setup, I'm having trouble

getting the Device Tree right. I'm hoping someone on this list can offer some insight. The DT is here:

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

https://github.com/JetForMe/podtique/blob/master/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

And this is dmesg when I try to load that (note the name of my

overlay is BB-ENABLE-PRU, which is an artifact of the experimentation I've been doing; it'll change to something more appropriate):

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
[   65.859275] bone_capemgr bone_capemgr: part_number

'BB-ENABLE-PRU', version 'N/A'

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
[   65.859318] bone_capemgr bone_capemgr: slot #4: override
[   65.859336] bone_capemgr bone_capemgr: Using override eeprom

data at slot 4

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.859355] bone_capemgr bone_capemgr: slot #4: 'Override Board

Name,00A0,Override Manuf,BB-ENABLE-PRU'

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.859488] bone_capemgr: bone_capemgr bone_capemgr: slot #4:

Requesting part number/version based 'BB-ENABLE-PRU-00A0.dtbo

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.859506] bone_capemgr: bone_capemgr bone_capemgr: slot #4:

Requesting firmware 'BB-ENABLE-PRU-00A0.dtbo' for board-name 'Override Board Name', version '00A0'

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.861105] bone_capemgr: bone_capemgr bone_capemgr: slot #4:

dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; converting to live tree

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
[   65.875618] gpio-of-helper ocp:gpio_helper: ready
[   65.876327] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio'

property of node '//fixedregulator@1[0]' - status (0)

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
[   65.876619] core: lz-codec-reg: no parameters
[   65.876713] fixed: reg-fixed-voltage fixedregulator@1:

lz-codec-reg supplying 0uV

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.883284] pruss_uio 4a300000.pruss: pins are not configured

from the driver

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.900080] bone_capemgr bone_capemgr: slot #4: dtbo

'BB-ENABLE-PRU-00A0.dtbo' loaded; overlay id #0

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.946254] gpiolib_of: of_get_named_gpiod_flags: parsed

'gpio-reset' property of node '/ocp/i2c@4819c000/tlv320aic3104@0[0]' - status (0)

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.946317] core: tlv320aic3x-codec 2-0018: Looking up

IOVDD-supply from device tree

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.946405] core: tlv320aic3x-codec 2-0018: Looking up

DVDD-supply from device tree

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.946468] core: tlv320aic3x-codec 2-0018: Looking up

AVDD-supply from device tree

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.946544] core: tlv320aic3x-codec 2-0018: Looking up

DRVDD-supply from device tree

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.946606] snd_soc_core: tlv320aic3x-codec 2-0018: codec

register 2-0018

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.946640] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: dai

register 2-0018 #1

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.946655] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC:

Registered DAI 'tlv320aic3x-hifi'

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.946671] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC:

Registered codec 'tlv320aic3x-codec.2-0018'

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.956491] //sound/simple-audio-card,cpu: could not get

#sound-dai-cells for /ocp/mcasp@48038000

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.978759] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC:

dai register 48038000.mcasp #1

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.978795] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC:

Registered DAI '48038000.mcasp'

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
[   65.978954] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC:

Registered platform '48038000.mcasp'

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
[   66.012427] asoc-simple-card sound: parse error -22
[   66.042609] asoc-simple-card: probe of sound failed with error

-22

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Note the bit about "#sound-dai-cells". I'm not sure what's wrong

here, and it seems like it might be something in the distro-provided DTB, not my own.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

aplay lists nothing (I think in part because I have yet to put in a

proper asound.conf file):

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
# aplay -l
aplay: device_list:268: no soundcards found...

Can someone suggest some diagnostics I can do to see what the state

of things is? I'm just not sure what to look for. Thanks!

Quoted 39 lines
Quoted 28 lines
Quoted 23 lines
Quoted 16 lines
Quoted 16 lines
Quoted 14 lines
Quoted 10 lines

--
Rick Mann
[email protected]

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Quoted 5 lines
Quoted 5 lines

--
Rick Mann
[email protected]

Quoted 5 lines

--
Rick Mann
[email protected]

Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

--
Rick Mann
[email protected]

author
#8 lore raw
Quoted 14 lines · Caleb Crome

Hmm, the pinmux looks right, except that you have your TX set as an input. You should have this:

mymcasp1_pins_default: mymcasp1_pins_default {
	pinctrl-single,pins = <
		0x1ac ( PIN_OUTPUT | MUX_MODE0 ) /* (A14) mcasp0_ahclkx.mcasp0_ahclkx */
		0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx */
		0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */
		0x198 ( PIN_INPUT | MUX_MODE0 ) /* (D12) mcasp0_axr0.mcasp0_axr0 */
		0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2 */
	>;
};

The DTBO for the Audio Cape didn't mark the TX as an output, but I surely can try that.

Quoted 1 line

I'm not using a DTBO, but editing the DTB directly. Do you currently get a sound card listed? i.e. does aplay -l show anything?

Oh yes, I get a sound card. That depended on the "sound" and "mcasp0" entries in my overlay to be correct. Sadly, the kernel doesn't actually talk to the IC until you invoke speaker-test (or some other audio program).

Quoted 2 lines

Also, did you disable your HDMI? You need to do that.

Yeah, it's disabled by the main dtb that I load:

https://github.com/RobertCNelson/dtb-rebuilder/blob/4.1-ti/src/arm/am335x-boneblack-emmc-overlay.dts

Instead of the default:

https://github.com/RobertCNelson/dtb-rebuilder/blob/4.1-ti/src/arm/am335x-boneblack.dts

Quoted 2 lines

The thing you need to get is the MCLK a.k.a. the ahclkx going. After that, all else should fall in line. Maybe. If ahclkx isn't going, then perhaps it's a problem with enabling the mcasp, but your dts looks okay.

Thanks for double-checking!

Quoted 244 lines

-Caleb

Quoted 236 lines · Rick Mann
Quoted 8 lines · Caleb Crome
Quoted 2 lines · Rick Mann

That's very similar to what I have (I use ax40 & axr2). I also use macsp0_ahclkx, but I'm not seeing a signal on it (or any other pin).

Quoted 6 lines
Quoted 1 line

Does this work for you with a 4.1.x kernel?

Yes, it works for me. I assume your codec is master, do you see WCLK and BCLK running? How about MCLK?

Who is supposed to be driving MCLK in your case, the BBB or the codec?

According to someone else, and as you assume above, the BBB should generate the MCLK and the TLV generates WCLK and BCLK. That's counterintuitive to me, but the configuration it's sending to the TLV for register 0x08 is 0xC0, which sets the bits such that WCLK and BCLK are outputs (master mode). I think MCLK is always an input on this device.

(BTW, thanks for asking. In verifying what I just wrote, I learned a lot about how it's supposed to work).

Quoted 5 lines

I see that you have the AHCLKX set to INPUT. This should probably either be output (if the CPU is driving it), or not connected if the codec is driving it.

Quoted 1 line

0x1ac (PIN_INPUT | MUX_MODE0) // P9_25 MCLK MCLK mcasp0_ahclkx

Yeah, I changed that the other day:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

pinctrl-single,pins = <                             //  Hdr     I2S     TLV     SoC
                                                    //  -----   ----    ----    -------------
    0x190 (PIN_INPUT_PULLDOWN | MUX_MODE0)          //  P9_31   BCLK    BCLK    mcasp0_aclkx
    0x194 (PIN_INPUT_PULLDOWN | MUX_MODE0)          //  P9_29   WCLK    WCLK    mcasp0_fsx
    0x198 (PIN_INPUT_PULLDOWN | MUX_MODE0)          //  P9_30   RX      SDOUT   mcasp0_axr0
    0x19c (PIN_INPUT_PULLDOWN | MUX_MODE2)          //  P9_28   TX      SDIN    mcasp0_axr2
    0x1ac (PIN_OUTPUT_PULLDOWN | MUX_MODE0)         //  P9_25   MCLK    MCLK    mcasp0_ahclkx
Quoted 1 line

;

The TRM indicates all the pins should have their receiver enabled, but I decided to make MCLK an output.

In all cases, NONE of the pins, including MCLK, changes state. BTW, when I run speaker-test, it gets this far and hangs:

$ speaker-test

speaker-test 1.0.28

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 128 to 32768
Period size range from 8 to 2048
Using max buffer size 32768
Periods = 4
was set period_size = 2048
was set buffer_size = 32768
0 - Front Left

Which makes me think some internal sound data buffer is filling up, and the write is blocking, and nothing is emptying the buffer because the McASP isn't accepting bytes, and therefore not sending data out.

If I interrupt speaker-test, it usually outputs this:

^CWrite error: -4,Interrupted system call
xrun_recovery failed: -4,Interrupted system call
Transfer failed: Interrupted system call

Further reinforcing my theory. Which suggests something's still not right for McASP0.

Quoted 154 lines

-Caleb

Quoted 143 lines
Quoted 44 lines · Caleb Crome

I used these pins to get the audio cape going.

(quoted diff) +8 -0
+/*
+   * MCASP pin mapping
+   *                          ball   BBB
+   * MCASP0_ACLKX             A13    P9.31
+   * MCASP0_AFSX              B13    P9.29
+   * MCASP0_AXR2  (mcasp OUT) C12    P9.28
+   * MCASP0_AXR3  (mcasp IN)  A14    P9.25
+*/

mcasp_0_pins_default: mcasp_0_pins_default { pinctrl-single,pins = <
0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx */
0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */ 0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2 */ 0x1ac ( PIN_INPUT | MUX_MODE2 ) /* (A14) mcasp0_ahclkx.mcasp0_axr3 */

Quoted 1 line

;

};

And importantly, the audio cape needs to use the AXR2 and AXR3 for my use.

+&mcasp0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mcasp_0_pins_default>;
+ status = "okay";
+
+ op-mode = <0>; /* MCASP_IIS_MODE */
+ tdm-slots = <8>;
+ num-serializer = <16>;
+ serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
+ 0 0 1 2
+ 0 0 0 0
+ 0 0 0 0
+ 0 0 0 0
+ >;
+ tx-num-evt = <1>;
+ rx-num-evt = <1>;
};

Quoted 97 lines

Hope that can be of some help.

-Caleb

Quoted 90 lines · Rick Mann

Yeah, it turned out I needed a -cells = <0> on the mcasp0 peripheral.

I've got it finding it and creating a sound card, and if I run speaker-test, it sends a bunch of i2c commands to the codec (which aren't quite right). But the McASP/IIS pins never change state, so, I've made progress, but I'm still stuck.

Latest DTBO:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Quoted 67 lines · Caleb Crome

I found that too. Check out the documentation here:
http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/sound/simple-card.txt

You need to put in the #sound-dai-cells cell. Your value will likely
be 0 for the codec, and maybe 1 for the SOC dai, but I"m not sure.

Unfortunately, I don't really understand how it works.

-Caleb

Quoted 53 lines · Rick Mann

Hi. I've built a Beaglebone Black Cape that has, among other things, a TI Audio CODEC on it (TLV320AIC3104). This is the same CODEC as the BBB Audio Cape (http://elinux.org/CircuitCo:Audio_Cape_RevB), and it's connected in almost the exact same way.

The last few days I've been figuring out the Device Tree overlay needed to get Linux (4.1.4) to recognize it. It's finding the device and instantiating the low-level driver (tlv320aic3x-codec), although I'm not sure at this point if it's actually talking to it (I have verified that low-level i2c commands do work).

But when it comes to the sound card setup, I'm having trouble getting the Device Tree right. I'm hoping someone on this list can offer some insight. The DT is here:

https://github.com/JetForMe/podtique/blob/master/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

And this is dmesg when I try to load that (note the name of my overlay is BB-ENABLE-PRU, which is an artifact of the experimentation I've been doing; it'll change to something more appropriate):

[   65.859275] bone_capemgr bone_capemgr: part_number 'BB-ENABLE-PRU', version 'N/A'
[   65.859318] bone_capemgr bone_capemgr: slot #4: override
[   65.859336] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[   65.859355] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-ENABLE-PRU'
[   65.859488] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting part number/version based 'BB-ENABLE-PRU-00A0.dtbo
[   65.859506] bone_capemgr: bone_capemgr bone_capemgr: slot #4: Requesting firmware 'BB-ENABLE-PRU-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[   65.861105] bone_capemgr: bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; converting to live tree
[   65.875618] gpio-of-helper ocp:gpio_helper: ready
[   65.876327] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio' property of node '//fixedregulator@1[0]' - status (0)
[   65.876619] core: lz-codec-reg: no parameters
[   65.876713] fixed: reg-fixed-voltage fixedregulator@1: lz-codec-reg supplying 0uV
[   65.883284] pruss_uio 4a300000.pruss: pins are not configured from the driver
[   65.900080] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; overlay id #0
[   65.946254] gpiolib_of: of_get_named_gpiod_flags: parsed 'gpio-reset' property of node '/ocp/i2c@4819c000/tlv320aic3104@0[0]' - status (0)
[   65.946317] core: tlv320aic3x-codec 2-0018: Looking up IOVDD-supply from device tree
[   65.946405] core: tlv320aic3x-codec 2-0018: Looking up DVDD-supply from device tree
[   65.946468] core: tlv320aic3x-codec 2-0018: Looking up AVDD-supply from device tree
[   65.946544] core: tlv320aic3x-codec 2-0018: Looking up DRVDD-supply from device tree
[   65.946606] snd_soc_core: tlv320aic3x-codec 2-0018: codec register 2-0018
[   65.946640] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: dai register 2-0018 #1
[   65.946655] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered DAI 'tlv320aic3x-hifi'
[   65.946671] snd_soc_core: tlv320aic3x-codec 2-0018: ASoC: Registered codec 'tlv320aic3x-codec.2-0018'
[   65.956491] //sound/simple-audio-card,cpu: could not get #sound-dai-cells for /ocp/mcasp@48038000
[   65.978759] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: dai register 48038000.mcasp #1
[   65.978795] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered DAI '48038000.mcasp'
[   65.978954] snd_soc_core: davinci-mcasp 48038000.mcasp: ASoC: Registered platform '48038000.mcasp'
[   66.012427] asoc-simple-card sound: parse error -22
[   66.042609] asoc-simple-card: probe of sound failed with error -22

Note the bit about "#sound-dai-cells". I'm not sure what's wrong here, and it seems like it might be something in the distro-provided DTB, not my own.

aplay lists nothing (I think in part because I have yet to put in a proper asound.conf file):

# aplay -l
aplay: device_list:268: no soundcards found...

Can someone suggest some diagnostics I can do to see what the state of things is? I'm just not sure what to look for. Thanks!

--
Rick Mann
[email protected]

Quoted 8 lines
Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

--
Rick Mann
[email protected]

Quoted 5 lines

--
Rick Mann
[email protected]

Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

--
Rick Mann
[email protected]

Signature · 2 lines
Rick Mann
[email protected]
#9 lore raw
Quoted 15 lines · Rick Mann
Quoted 4 lines · Caleb Crome

Hmm, the pinmux looks right, except that you have your TX set as an

input. You should have this:

Quoted 4 lines

mymcasp1_pins_default: mymcasp1_pins_default {
pinctrl-single,pins = <
0x1ac ( PIN_OUTPUT | MUX_MODE0 ) /* (A14)

mcasp0_ahclkx.mcasp0_ahclkx */

Quoted 1 line
              0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13)

mcasp0_aclkx.mcasp0_aclkx */

Quoted 1 line
              0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13)

mcasp0_fsx.mcasp0_fsx */

Quoted 1 line
              0x198 ( PIN_INPUT | MUX_MODE0 ) /* (D12)
Quoted 9 lines

mcasp0_axr0.mcasp0_axr0 */

Quoted 1 line
              0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12)

mcasp0_ahclkr.mcasp0_axr2 */

Quoted 2 lines
      >;
};

The DTBO for the Audio Cape didn't mark the TX as an output, but I surely can try that.

That's because you didn't tell it to :-) There's checkbox you need to uncheck to make it Tx. It's an uncelar UI. You uncheck Rx to make it a Tx.

That won't get your clocking going unfortunately.

Also, the DTBO I found for the audio cape is for the BeagleBone, not the BeagleBoneBlack, so that threw me for a while.

also, I got things running using the audio cape and the davinci-evm.c device tree entry, not the simple-audio-card. I ended up putting a lot of printk's into the kernel so I could trace out how the whole thing worked.

Your fundamental problem seems to be in getting the McASP's output clock going. Once that's going, then you can worry about getting the codec's PLL to output BCLK and WCLK.

Look through the davinci-evm.c and see what it does that simple-audio-card doesn't. It's something to do with the MCLK for sure.

Once your MCLK is going, you can use i2cdump to look at the codec registers:

sudo i2cdump -f -y 1 0x18

or similar.

-caleb

author
#10 lore raw
Quoted 20 lines · Caleb Crome
Quoted 4 lines · Rick Mann

On Sep 28, 2015, at 16:46 , Caleb Crome <[email protected]> wrote:

Hmm, the pinmux looks right, except that you have your TX set as an input. You should have this:

Quoted 9 lines
mymcasp1_pins_default: mymcasp1_pins_default {
      pinctrl-single,pins = <
              0x1ac ( PIN_OUTPUT | MUX_MODE0 ) /* (A14) mcasp0_ahclkx.mcasp0_ahclkx */
              0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx */
              0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */
              0x198 ( PIN_INPUT | MUX_MODE0 ) /* (D12) mcasp0_axr0.mcasp0_axr0 */
              0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2 */
      >;
};
Quoted 3 lines

The DTBO for the Audio Cape didn't mark the TX as an output, but I surely can try that.

That's because you didn't tell it to :-) There's checkbox you need to uncheck to make it Tx. It's an uncelar UI. You uncheck Rx to make it a Tx.

What I mean is, the Audio Cape's DTBO (.dts, really), has the modes on all but the WCLK as 0x20 (one is 0x22). That makes them all inputs. Only WCLK is 0x00. Even if it's for the BB White and not Black, that part wouldn't change.

Quoted 9 lines

That won't get your clocking going unfortunately.

Also, the DTBO I found for the audio cape is for the BeagleBone, not the BeagleBoneBlack, so that threw me for a while.

also, I got things running using the audio cape and the davinci-evm.c device tree entry, not the simple-audio-card. I ended up putting a lot of printk's into the kernel so I could trace out how the whole thing worked.

Your fundamental problem seems to be in getting the McASP's output clock going. Once that's going, then you can worry about getting the codec's PLL to output BCLK and WCLK.

Look through the davinci-evm.c and see what it does that simple-audio-card doesn't. It's something to do with the MCLK for sure.

Could you send me your DTS?

Quoted 6 lines

Once your MCLK is going, you can use i2cdump to look at the codec registers:

sudo i2cdump -f -y 1 0x18

or similar.

Yeah, that works.

Signature · 2 lines
Rick Mann
[email protected]
#11 lore raw
Quoted 2 lines

Could you send me your DTS?

Yes, but I have modified a bit of stuff in the davinci-evm.c to make my multi-codec setup work right.

I turned off HDMI with this:

commit 7f20ffd56de6921bc5f8e2fee8da75d743d57847

Author: Caleb Crome <[email protected]>
Date:   Wed Sep 9 13:33:36 2015 -0700

turn off hdmi from boneblack

(quoted diff) +0 -0

b/arch/arm/boot/dts/am335x-boneblack.dts
index 5c42d25..6335072 100644

arch/arm/boot/dts/am335x-boneblack.dts +0 -4
@@ -34,51 +34,9 @@
 };
 
 &am33xx_pinmux {
- nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins {
- pinctrl-single,pins = <
- 0x1b0 0x03      /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
- 0xa0 0x08       /* lcd_data0.lcd_data0, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xa4 0x08       /* lcd_data1.lcd_data1, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xa8 0x08       /* lcd_data2.lcd_data2, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xac 0x08       /* lcd_data3.lcd_data3, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb0 0x08       /* lcd_data4.lcd_data4, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb4 0x08       /* lcd_data5.lcd_data5, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb8 0x08       /* lcd_data6.lcd_data6, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xbc 0x08       /* lcd_data7.lcd_data7, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc0 0x08       /* lcd_data8.lcd_data8, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc4 0x08       /* lcd_data9.lcd_data9, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc8 0x08       /* lcd_data10.lcd_data10, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xcc 0x08       /* lcd_data11.lcd_data11, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd0 0x08       /* lcd_data12.lcd_data12, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd4 0x08       /* lcd_data13.lcd_data13, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd8 0x08       /* lcd_data14.lcd_data14, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xdc 0x08       /* lcd_data15.lcd_data15, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xe0 0x00       /* lcd_vsync.lcd_vsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xe4 0x00       /* lcd_hsync.lcd_hsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xe8 0x00       /* lcd_pclk.lcd_pclk, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xec 0x00       /* lcd_ac_bias_en.lcd_ac_bias_en, OMAP_MUX_MODE0 |

AM33XX_PIN_OUTPUT */
- >;
- };
- nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins {
- pinctrl-single,pins = <
- 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
- >;
- };
-};
-
-&lcdc {
- status = "okay";
};

/ {
- hdmi {
- compatible = "ti,tilcdc,slave";
- i2c = <&i2c0>;
- pinctrl-names = "default", "off";
- pinctrl-0 = <&nxp_hdmi_bonelt_pins>;
- pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
- status = "okay";
- };
};

&rtc {

And here's the added bit:

Index: KERNEL/arch/arm/boot/dts/am335x-boneblack.dts
===================================================================
--- KERNEL.orig/arch/arm/boot/dts/am335x-boneblack.dts 2015-09-21 17:23:14.961343604 -0700
+++ KERNEL/arch/arm/boot/dts/am335x-boneblack.dts 2015-09-22 09:35:49.308278239 -0700
@@ -5,11 +5,25 @@
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
+
+
+
+/*

+   * MCASP pin mapping
+   *                          ball   BBB
+   * MCASP0_ACLKX             A13    P9.31
+   * MCASP0_AFSX              B13    P9.29
+   * MCASP0_AXR2  (mcasp OUT) C12    P9.28
+   * MCASP0_AXR3  (mcasp IN)  A14    P9.25

+*/
+
/dts-v1/;

#include "am33xx.dtsi"
#include "am335x-bone-common.dtsi"

+
+
/ {
model = "TI AM335x BeagleBone Black";
compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
@@ -34,9 +48,119 @@
};

&am33xx_pinmux {
+ i2c2_pins_default: i2c2_pins_default {
+ pinctrl-single,pins = <
+ 0x17c ( PIN_INPUT_PULLUP | MUX_MODE3 ) /* (D17)
uart1_rtsn.I2C2_SCL */
+ 0x178 ( PIN_INPUT_PULLUP | MUX_MODE3 ) /* (D18)
uart1_ctsn.I2C2_SDA */
+ >;
+ };
+
+
+ i2c1_pins_default: pinmux_i2c1_pins {
+ pinctrl-single,pins = <
+ 0x158 0x72 /*
uart1_ctsn.i2c2_sda, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */
+ 0x15c 0x72 /*
uart1_rtsn.i2c2_scl, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */
+ >;
+ };
+
+ mcasp_0_pins_default: mcasp_0_pins_default {
+ pinctrl-single,pins = <
+ 0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx */
+ 0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */
+ 0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2 */
+ 0x1ac ( PIN_INPUT | MUX_MODE2 ) /* (A14) mcasp0_ahclkx.mcasp0_axr3 */
+ >;
+ };
+};
+
+
+&i2c1 {
+ clock-frequency = <100000>;
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c1_pins_default>;
+ status="okay";
+
+ tlv320aic3x_a: tlv320aic3x@18 {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x18>;
+ tdm-offset = <0>;
+ status = "okay";
+ };
+
+ tlv320aic3x_b: tlv320aic3x@19 {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x19>;
+ tdm-offset = <32>;
+ status = "okay";
+ };
+
+ tlv320aic3x_c: tlv320aic3x@1a {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x1a>;
+ tdm-offset = <64>;
+ status = "okay";
+ };
+
+ tlv320aic3x_d: tlv320aic3x@1b {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x1b>;
+ tdm-offset = <96>;
+ status = "okay";
+ };
+
};

+&mcasp0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mcasp_0_pins_default>;
+ status = "okay";
+
+ op-mode = <0>; /* MCASP_IIS_MODE */
+ tdm-slots = <16>;
+ num-serializer = <16>;
+ serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
+ 0 0 1 2
+ 0 0 0 0
+ 0 0 0 0
+ 0 0 0 0
+ >;
+ tx-num-evt = <1>;
+ rx-num-evt = <1>;
+};
+
+
/ {
+ sound {
+ compatible = "ti,da830-evm-audio";
+ ti,model = "PUPPY-AUDIO";
+ ti,audio-codec = <

+       &tlv320aic3x_a
+       &tlv320aic3x_b
+       &tlv320aic3x_c
+       &tlv320aic3x_d
+       >;
+ ti,mcasp-controller = <&mcasp0>;
+ ti,codec-clock-rate = <12288000>;
+ ti,audio-routing =
+ "Headphone Jack",       "a HPLOUT",
+ "Headphone Jack",       "a HPROUT",
+ "Headphone Jack",       "b HPLOUT",
+ "Headphone Jack",       "b HPROUT",
+ "Headphone Jack",       "c HPLOUT",
+ "Headphone Jack",       "c HPROUT",
+ "Headphone Jack",       "d HPLOUT",
+ "Headphone Jack",       "d HPROUT",
+ "a LINE1L",               "Line In",
+ "a LINE1R",               "Line In",
+ "b LINE1L",               "Line In",
+ "b LINE1R",               "Line In",
+ "c LINE1L",               "Line In",
+ "c LINE1R",               "Line In",
+ "d LINE1L",               "Line In",
+ "d LINE1R",               "Line In";

+ status="okay";
+ };
};

&rtc {

author
#12 lore raw

Okay, so I switched to da830-evm-audio, and things are much better. But still not perfect. Here's the DTS:

https://github.com/JetForMe/podtique/blob/master/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Now I have a working MCLK, and I see clocking on BCLK and WCLK, but the rates are questionable. MCLK is 24 MHz (even though in the DTS it's set to 12 MHz); that might be okay. For the following call:

	# speaker-test -r 22050 -c 2 -f 1000 -F S16_LE -t sine -s 1 -D hw:0,0

WCLK is 11.88 kHz, and it is pulses (DSP mode), rather than high for left, low for right for each channel's word. BCLK is 379.5 kHz.

I'm looking at the i2c commands being sent to see if I can determine what the CODEC thinks it's trying to do.

Quoted 255 lines · Caleb Crome
Quoted 3 lines

Could you send me your DTS?

Yes, but I have modified a bit of stuff in the davinci-evm.c to make my multi-codec setup work right.

I turned off HDMI with this:

commit 7f20ffd56de6921bc5f8e2fee8da75d743d57847

Author: Caleb Crome <[email protected]>
Date:   Wed Sep 9 13:33:36 2015 -0700

turn off hdmi from boneblack

arch/arm/boot/dts/am335x-boneblack.dts +0 -4
index 5c42d25..6335072 100644
@@ -34,51 +34,9 @@
 };
 
 &am33xx_pinmux {
- nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins {
- pinctrl-single,pins = <
- 0x1b0 0x03      /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
- 0xa0 0x08       /* lcd_data0.lcd_data0, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xa4 0x08       /* lcd_data1.lcd_data1, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xa8 0x08       /* lcd_data2.lcd_data2, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xac 0x08       /* lcd_data3.lcd_data3, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb0 0x08       /* lcd_data4.lcd_data4, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb4 0x08       /* lcd_data5.lcd_data5, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb8 0x08       /* lcd_data6.lcd_data6, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xbc 0x08       /* lcd_data7.lcd_data7, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc0 0x08       /* lcd_data8.lcd_data8, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc4 0x08       /* lcd_data9.lcd_data9, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc8 0x08       /* lcd_data10.lcd_data10, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xcc 0x08       /* lcd_data11.lcd_data11, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd0 0x08       /* lcd_data12.lcd_data12, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd4 0x08       /* lcd_data13.lcd_data13, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd8 0x08       /* lcd_data14.lcd_data14, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xdc 0x08       /* lcd_data15.lcd_data15, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xe0 0x00       /* lcd_vsync.lcd_vsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xe4 0x00       /* lcd_hsync.lcd_hsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xe8 0x00       /* lcd_pclk.lcd_pclk, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xec 0x00       /* lcd_ac_bias_en.lcd_ac_bias_en, OMAP_MUX_MODE0 |

AM33XX_PIN_OUTPUT */
- >;
- };
- nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins {
- pinctrl-single,pins = <
- 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
- >;
- };

arch/arm/boot/dts/am335x-boneblack.dts +0 -4
-};
-
-&lcdc {
- status = "okay";

};

/ {
- hdmi {
- compatible = "ti,tilcdc,slave";
- i2c = <&i2c0>;
- pinctrl-names = "default", "off";
- pinctrl-0 = <&nxp_hdmi_bonelt_pins>;
- pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
- status = "okay";
- };
};

&rtc {

And here's the added bit:

Index: KERNEL/arch/arm/boot/dts/am335x-boneblack.dts
===================================================================
--- KERNEL.orig/arch/arm/boot/dts/am335x-boneblack.dts 2015-09-21 17:23:14.961343604 -0700
+++ KERNEL/arch/arm/boot/dts/am335x-boneblack.dts 2015-09-22 09:35:49.308278239 -0700

arch/arm/boot/dts/am335x-boneblack.dts +17 -0
@@ -5,11 +5,25 @@
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
+
+
+
+/*
+   * MCASP pin mapping
+   *                          ball   BBB
+   * MCASP0_ACLKX             A13    P9.31
+   * MCASP0_AFSX              B13    P9.29
+   * MCASP0_AXR2  (mcasp OUT) C12    P9.28
+   * MCASP0_AXR3  (mcasp IN)  A14    P9.25
+*/
+
 /dts-v1/;
 
 #include "am33xx.dtsi"
 #include "am335x-bone-common.dtsi"
 
+
+
 / {
 model = "TI AM335x BeagleBone Black";
 compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
@@ -34,9 +48,119 @@
 };
 
 &am33xx_pinmux {
+ i2c2_pins_default: i2c2_pins_default {
+        pinctrl-single,pins = <
+                0x17c ( PIN_INPUT_PULLUP | MUX_MODE3 ) /* (D17)

uart1_rtsn.I2C2_SCL */
+ 0x178 ( PIN_INPUT_PULLUP | MUX_MODE3 ) /* (D18)
uart1_ctsn.I2C2_SDA */

arch/arm/boot/dts/am335x-boneblack.dts +7 -0
+        >;
+ };
+
+
+ i2c1_pins_default: pinmux_i2c1_pins {
+                       pinctrl-single,pins = <
+                               0x158 0x72      /*

uart1_ctsn.i2c2_sda, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */
+ 0x15c 0x72 /*
uart1_rtsn.i2c2_scl, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */

arch/arm/boot/dts/am335x-boneblack.dts +49 -0
+                       >;
+        };
+
+ mcasp_0_pins_default: mcasp_0_pins_default {
+ pinctrl-single,pins = <
+ 0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx */
+ 0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */
+ 0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2 */
+ 0x1ac ( PIN_INPUT | MUX_MODE2 ) /* (A14) mcasp0_ahclkx.mcasp0_axr3 */
+ >;
+ };
+};
+
+
+&i2c1 {
+ clock-frequency = <100000>;
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c1_pins_default>;
+ status="okay";
+
+ tlv320aic3x_a: tlv320aic3x@18 {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x18>;
+ tdm-offset = <0>;
+ status = "okay";
+ };
+
+ tlv320aic3x_b: tlv320aic3x@19 {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x19>;
+ tdm-offset = <32>;
+ status = "okay";
+ };
+
+ tlv320aic3x_c: tlv320aic3x@1a {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x1a>;
+ tdm-offset = <64>;
+ status = "okay";
+ };
+
+ tlv320aic3x_d: tlv320aic3x@1b {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x1b>;
+ tdm-offset = <96>;
+ status = "okay";
+ };
+

};

+&mcasp0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mcasp_0_pins_default>;
+ status = "okay";

arch/arm/boot/dts/am335x-boneblack.dts +15 -0
+
+ op-mode = <0>;          /* MCASP_IIS_MODE */
+ tdm-slots = <16>;
+ num-serializer = <16>;
+ serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+ 0 0 1 2
+ 0 0 0 0
+ 0 0 0 0
+ 0 0 0 0
+ >;
+ tx-num-evt = <1>;
+ rx-num-evt = <1>;
+};
+
+

/ {
+ sound {
+ compatible = "ti,da830-evm-audio";
+ ti,model = "PUPPY-AUDIO";
+ ti,audio-codec = <

arch/arm/boot/dts/am335x-boneblack.dts +26 -0
+       &tlv320aic3x_a
+       &tlv320aic3x_b
+       &tlv320aic3x_c
+       &tlv320aic3x_d
+       >;
+ ti,mcasp-controller = <&mcasp0>;
+ ti,codec-clock-rate = <12288000>;
+ ti,audio-routing =
+ "Headphone Jack",       "a HPLOUT",
+ "Headphone Jack",       "a HPROUT",
+ "Headphone Jack",       "b HPLOUT",
+ "Headphone Jack",       "b HPROUT",
+ "Headphone Jack",       "c HPLOUT",
+ "Headphone Jack",       "c HPROUT",
+ "Headphone Jack",       "d HPLOUT",
+ "Headphone Jack",       "d HPROUT",
+ "a LINE1L",               "Line In",
+ "a LINE1R",               "Line In",
+ "b LINE1L",               "Line In",
+ "b LINE1R",               "Line In",
+ "c LINE1L",               "Line In",
+ "c LINE1R",               "Line In",
+ "d LINE1L",               "Line In",
+ "d LINE1R",               "Line In";
+ status="okay";
+ };

};

&rtc {
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Signature · 2 lines
Rick Mann
[email protected]
#13 lore raw

You need to fix the mclk rate first I think, then the pll settings should fall in line. The DTS you sent still has the simple-audio-card and not the da830 stuff in it.

Caleb

Sent from my iPhone

Quoted 276 lines · Rick Mann

Okay, so I switched to da830-evm-audio, and things are much better. But still not perfect. Here's the DTS:

https://github.com/JetForMe/podtique/blob/master/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Now I have a working MCLK, and I see clocking on BCLK and WCLK, but the rates are questionable. MCLK is 24 MHz (even though in the DTS it's set to 12 MHz); that might be okay. For the following call:

   # speaker-test -r 22050 -c 2 -f 1000 -F S16_LE -t sine -s 1 -D hw:0,0

WCLK is 11.88 kHz, and it is pulses (DSP mode), rather than high for left, low for right for each channel's word. BCLK is 379.5 kHz.

I'm looking at the i2c commands being sent to see if I can determine what the CODEC thinks it's trying to do.

Quoted 255 lines
Quoted 4 lines · Caleb Crome

Could you send me your DTS?

Yes, but I have modified a bit of stuff in the davinci-evm.c to make my multi-codec setup work right.

I turned off HDMI with this:

commit 7f20ffd56de6921bc5f8e2fee8da75d743d57847

Author: Caleb Crome <[email protected]>
Date:   Wed Sep 9 13:33:36 2015 -0700

turn off hdmi from boneblack

arch/arm/boot/dts/am335x-boneblack.dts +0 -4
index 5c42d25..6335072 100644
@@ -34,51 +34,9 @@
 };
 
 &am33xx_pinmux {
- nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins {
- pinctrl-single,pins = <
- 0x1b0 0x03      /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
- 0xa0 0x08       /* lcd_data0.lcd_data0, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xa4 0x08       /* lcd_data1.lcd_data1, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xa8 0x08       /* lcd_data2.lcd_data2, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xac 0x08       /* lcd_data3.lcd_data3, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb0 0x08       /* lcd_data4.lcd_data4, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb4 0x08       /* lcd_data5.lcd_data5, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb8 0x08       /* lcd_data6.lcd_data6, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xbc 0x08       /* lcd_data7.lcd_data7, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc0 0x08       /* lcd_data8.lcd_data8, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc4 0x08       /* lcd_data9.lcd_data9, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc8 0x08       /* lcd_data10.lcd_data10, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xcc 0x08       /* lcd_data11.lcd_data11, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd0 0x08       /* lcd_data12.lcd_data12, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd4 0x08       /* lcd_data13.lcd_data13, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd8 0x08       /* lcd_data14.lcd_data14, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xdc 0x08       /* lcd_data15.lcd_data15, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xe0 0x00       /* lcd_vsync.lcd_vsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xe4 0x00       /* lcd_hsync.lcd_hsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xe8 0x00       /* lcd_pclk.lcd_pclk, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xec 0x00       /* lcd_ac_bias_en.lcd_ac_bias_en, OMAP_MUX_MODE0 |

AM33XX_PIN_OUTPUT */
- >;
- };
- nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins {
- pinctrl-single,pins = <
- 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
- >;
- };

arch/arm/boot/dts/am335x-boneblack.dts +0 -4
-};
-
-&lcdc {
- status = "okay";

};

/ {
- hdmi {
- compatible = "ti,tilcdc,slave";
- i2c = <&i2c0>;
- pinctrl-names = "default", "off";
- pinctrl-0 = <&nxp_hdmi_bonelt_pins>;
- pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
- status = "okay";
- };
};

&rtc {

And here's the added bit:

Index: KERNEL/arch/arm/boot/dts/am335x-boneblack.dts
===================================================================
--- KERNEL.orig/arch/arm/boot/dts/am335x-boneblack.dts 2015-09-21 17:23:14.961343604 -0700
+++ KERNEL/arch/arm/boot/dts/am335x-boneblack.dts 2015-09-22 09:35:49.308278239 -0700

arch/arm/boot/dts/am335x-boneblack.dts +17 -0
@@ -5,11 +5,25 @@
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
+
+
+
+/*
+   * MCASP pin mapping
+   *                          ball   BBB
+   * MCASP0_ACLKX             A13    P9.31
+   * MCASP0_AFSX              B13    P9.29
+   * MCASP0_AXR2  (mcasp OUT) C12    P9.28
+   * MCASP0_AXR3  (mcasp IN)  A14    P9.25
+*/
+
 /dts-v1/;
 
 #include "am33xx.dtsi"
 #include "am335x-bone-common.dtsi"
 
+
+
 / {
 model = "TI AM335x BeagleBone Black";
 compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
@@ -34,9 +48,119 @@
 };
 
 &am33xx_pinmux {
+ i2c2_pins_default: i2c2_pins_default {
+        pinctrl-single,pins = <
+                0x17c ( PIN_INPUT_PULLUP | MUX_MODE3 ) /* (D17)

uart1_rtsn.I2C2_SCL */
+ 0x178 ( PIN_INPUT_PULLUP | MUX_MODE3 ) /* (D18)
uart1_ctsn.I2C2_SDA */

arch/arm/boot/dts/am335x-boneblack.dts +7 -0
+        >;
+ };
+
+
+ i2c1_pins_default: pinmux_i2c1_pins {
+                       pinctrl-single,pins = <
+                               0x158 0x72      /*

uart1_ctsn.i2c2_sda, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */
+ 0x15c 0x72 /*
uart1_rtsn.i2c2_scl, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */

arch/arm/boot/dts/am335x-boneblack.dts +49 -0
+                       >;
+        };
+
+ mcasp_0_pins_default: mcasp_0_pins_default {
+ pinctrl-single,pins = <
+ 0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx */
+ 0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */
+ 0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2 */
+ 0x1ac ( PIN_INPUT | MUX_MODE2 ) /* (A14) mcasp0_ahclkx.mcasp0_axr3 */
+ >;
+ };
+};
+
+
+&i2c1 {
+ clock-frequency = <100000>;
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c1_pins_default>;
+ status="okay";
+
+ tlv320aic3x_a: tlv320aic3x@18 {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x18>;
+ tdm-offset = <0>;
+ status = "okay";
+ };
+
+ tlv320aic3x_b: tlv320aic3x@19 {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x19>;
+ tdm-offset = <32>;
+ status = "okay";
+ };
+
+ tlv320aic3x_c: tlv320aic3x@1a {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x1a>;
+ tdm-offset = <64>;
+ status = "okay";
+ };
+
+ tlv320aic3x_d: tlv320aic3x@1b {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x1b>;
+ tdm-offset = <96>;
+ status = "okay";
+ };
+

};

+&mcasp0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mcasp_0_pins_default>;
+ status = "okay";

arch/arm/boot/dts/am335x-boneblack.dts +15 -0
+
+ op-mode = <0>;          /* MCASP_IIS_MODE */
+ tdm-slots = <16>;
+ num-serializer = <16>;
+ serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+ 0 0 1 2
+ 0 0 0 0
+ 0 0 0 0
+ 0 0 0 0
+ >;
+ tx-num-evt = <1>;
+ rx-num-evt = <1>;
+};
+
+

/ {
+ sound {
+ compatible = "ti,da830-evm-audio";
+ ti,model = "PUPPY-AUDIO";
+ ti,audio-codec = <

arch/arm/boot/dts/am335x-boneblack.dts +26 -0
+       &tlv320aic3x_a
+       &tlv320aic3x_b
+       &tlv320aic3x_c
+       &tlv320aic3x_d
+       >;
+ ti,mcasp-controller = <&mcasp0>;
+ ti,codec-clock-rate = <12288000>;
+ ti,audio-routing =
+ "Headphone Jack",       "a HPLOUT",
+ "Headphone Jack",       "a HPROUT",
+ "Headphone Jack",       "b HPLOUT",
+ "Headphone Jack",       "b HPROUT",
+ "Headphone Jack",       "c HPLOUT",
+ "Headphone Jack",       "c HPROUT",
+ "Headphone Jack",       "d HPLOUT",
+ "Headphone Jack",       "d HPROUT",
+ "a LINE1L",               "Line In",
+ "a LINE1R",               "Line In",
+ "b LINE1L",               "Line In",
+ "b LINE1R",               "Line In",
+ "c LINE1L",               "Line In",
+ "c LINE1R",               "Line In",
+ "d LINE1L",               "Line In",
+ "d LINE1R",               "Line In";
+ status="okay";
+ };

};

&rtc {
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Signature · 2 lines
Rick Mann
[email protected]
author
#14 lore raw

Ugh, sorry. Here you go:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Sent from my iPhone

Quoted 284 lines · Caleb Crome

You need to fix the mclk rate first I think, then the pll settings should fall in line. The DTS you sent still has the simple-audio-card and not the da830 stuff in it.

Caleb

Sent from my iPhone

Quoted 276 lines · Rick Mann

Okay, so I switched to da830-evm-audio, and things are much better. But still not perfect. Here's the DTS:

https://github.com/JetForMe/podtique/blob/master/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Now I have a working MCLK, and I see clocking on BCLK and WCLK, but the rates are questionable. MCLK is 24 MHz (even though in the DTS it's set to 12 MHz); that might be okay. For the following call:

  # speaker-test -r 22050 -c 2 -f 1000 -F S16_LE -t sine -s 1 -D hw:0,0

WCLK is 11.88 kHz, and it is pulses (DSP mode), rather than high for left, low for right for each channel's word. BCLK is 379.5 kHz.

I'm looking at the i2c commands being sent to see if I can determine what the CODEC thinks it's trying to do.

Quoted 255 lines
Quoted 4 lines · Caleb Crome

Could you send me your DTS?

Yes, but I have modified a bit of stuff in the davinci-evm.c to make my multi-codec setup work right.

I turned off HDMI with this:

commit 7f20ffd56de6921bc5f8e2fee8da75d743d57847

Author: Caleb Crome <[email protected]>
Date:   Wed Sep 9 13:33:36 2015 -0700

turn off hdmi from boneblack

arch/arm/boot/dts/am335x-boneblack.dts +0 -4
index 5c42d25..6335072 100644
@@ -34,51 +34,9 @@
 };
 
 &am33xx_pinmux {
- nxp_hdmi_bonelt_pins: nxp_hdmi_bonelt_pins {
- pinctrl-single,pins = <
- 0x1b0 0x03      /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
- 0xa0 0x08       /* lcd_data0.lcd_data0, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xa4 0x08       /* lcd_data1.lcd_data1, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xa8 0x08       /* lcd_data2.lcd_data2, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xac 0x08       /* lcd_data3.lcd_data3, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb0 0x08       /* lcd_data4.lcd_data4, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb4 0x08       /* lcd_data5.lcd_data5, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xb8 0x08       /* lcd_data6.lcd_data6, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xbc 0x08       /* lcd_data7.lcd_data7, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc0 0x08       /* lcd_data8.lcd_data8, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc4 0x08       /* lcd_data9.lcd_data9, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xc8 0x08       /* lcd_data10.lcd_data10, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xcc 0x08       /* lcd_data11.lcd_data11, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd0 0x08       /* lcd_data12.lcd_data12, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd4 0x08       /* lcd_data13.lcd_data13, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xd8 0x08       /* lcd_data14.lcd_data14, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xdc 0x08       /* lcd_data15.lcd_data15, OMAP_MUX_MODE0 |
AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA */
- 0xe0 0x00       /* lcd_vsync.lcd_vsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xe4 0x00       /* lcd_hsync.lcd_hsync, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xe8 0x00       /* lcd_pclk.lcd_pclk, OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT */
- 0xec 0x00       /* lcd_ac_bias_en.lcd_ac_bias_en, OMAP_MUX_MODE0 |

AM33XX_PIN_OUTPUT */
- >;
- };
- nxp_hdmi_bonelt_off_pins: nxp_hdmi_bonelt_off_pins {
- pinctrl-single,pins = <
- 0x1b0 0x03 /* xdma_event_intr0, OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT */
- >;
- };

arch/arm/boot/dts/am335x-boneblack.dts +0 -4
-};
-
-&lcdc {
- status = "okay";

};

/ {
- hdmi {
- compatible = "ti,tilcdc,slave";
- i2c = <&i2c0>;
- pinctrl-names = "default", "off";
- pinctrl-0 = <&nxp_hdmi_bonelt_pins>;
- pinctrl-1 = <&nxp_hdmi_bonelt_off_pins>;
- status = "okay";
- };
};

&rtc {

And here's the added bit:

Index: KERNEL/arch/arm/boot/dts/am335x-boneblack.dts
===================================================================
--- KERNEL.orig/arch/arm/boot/dts/am335x-boneblack.dts 2015-09-21 17:23:14.961343604 -0700
+++ KERNEL/arch/arm/boot/dts/am335x-boneblack.dts 2015-09-22 09:35:49.308278239 -0700

arch/arm/boot/dts/am335x-boneblack.dts +17 -0
@@ -5,11 +5,25 @@
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
+
+
+
+/*
+   * MCASP pin mapping
+   *                          ball   BBB
+   * MCASP0_ACLKX             A13    P9.31
+   * MCASP0_AFSX              B13    P9.29
+   * MCASP0_AXR2  (mcasp OUT) C12    P9.28
+   * MCASP0_AXR3  (mcasp IN)  A14    P9.25
+*/
+
 /dts-v1/;
 
 #include "am33xx.dtsi"
 #include "am335x-bone-common.dtsi"
 
+
+
 / {
 model = "TI AM335x BeagleBone Black";
 compatible = "ti,am335x-bone-black", "ti,am335x-bone", "ti,am33xx";
@@ -34,9 +48,119 @@
 };
 
 &am33xx_pinmux {
+ i2c2_pins_default: i2c2_pins_default {
+        pinctrl-single,pins = <
+                0x17c ( PIN_INPUT_PULLUP | MUX_MODE3 ) /* (D17)

uart1_rtsn.I2C2_SCL */
+ 0x178 ( PIN_INPUT_PULLUP | MUX_MODE3 ) /* (D18)
uart1_ctsn.I2C2_SDA */

arch/arm/boot/dts/am335x-boneblack.dts +7 -0
+        >;
+ };
+
+
+ i2c1_pins_default: pinmux_i2c1_pins {
+                       pinctrl-single,pins = <
+                               0x158 0x72      /*

uart1_ctsn.i2c2_sda, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */
+ 0x15c 0x72 /*
uart1_rtsn.i2c2_scl, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */

arch/arm/boot/dts/am335x-boneblack.dts +49 -0
+                       >;
+        };
+
+ mcasp_0_pins_default: mcasp_0_pins_default {
+ pinctrl-single,pins = <
+ 0x190 ( PIN_INPUT | MUX_MODE0 ) /* (A13) mcasp0_aclkx.mcasp0_aclkx */
+ 0x194 ( PIN_INPUT | MUX_MODE0 ) /* (B13) mcasp0_fsx.mcasp0_fsx */
+ 0x19c ( PIN_OUTPUT | MUX_MODE2 ) /* (C12) mcasp0_ahclkr.mcasp0_axr2 */
+ 0x1ac ( PIN_INPUT | MUX_MODE2 ) /* (A14) mcasp0_ahclkx.mcasp0_axr3 */
+ >;
+ };
+};
+
+
+&i2c1 {
+ clock-frequency = <100000>;
+ status = "okay";
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2c1_pins_default>;
+ status="okay";
+
+ tlv320aic3x_a: tlv320aic3x@18 {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x18>;
+ tdm-offset = <0>;
+ status = "okay";
+ };
+
+ tlv320aic3x_b: tlv320aic3x@19 {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x19>;
+ tdm-offset = <32>;
+ status = "okay";
+ };
+
+ tlv320aic3x_c: tlv320aic3x@1a {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x1a>;
+ tdm-offset = <64>;
+ status = "okay";
+ };
+
+ tlv320aic3x_d: tlv320aic3x@1b {
+ compatible = "ti,tlv320aic3x";
+ reg = <0x1b>;
+ tdm-offset = <96>;
+ status = "okay";
+ };
+

};

+&mcasp0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&mcasp_0_pins_default>;
+ status = "okay";

arch/arm/boot/dts/am335x-boneblack.dts +15 -0
+
+ op-mode = <0>;          /* MCASP_IIS_MODE */
+ tdm-slots = <16>;
+ num-serializer = <16>;
+ serial-dir = <  /* 0: INACTIVE, 1: TX, 2: RX */
+ 0 0 1 2
+ 0 0 0 0
+ 0 0 0 0
+ 0 0 0 0
+ >;
+ tx-num-evt = <1>;
+ rx-num-evt = <1>;
+};
+
+

/ {
+ sound {
+ compatible = "ti,da830-evm-audio";
+ ti,model = "PUPPY-AUDIO";
+ ti,audio-codec = <

arch/arm/boot/dts/am335x-boneblack.dts +26 -0
+       &tlv320aic3x_a
+       &tlv320aic3x_b
+       &tlv320aic3x_c
+       &tlv320aic3x_d
+       >;
+ ti,mcasp-controller = <&mcasp0>;
+ ti,codec-clock-rate = <12288000>;
+ ti,audio-routing =
+ "Headphone Jack",       "a HPLOUT",
+ "Headphone Jack",       "a HPROUT",
+ "Headphone Jack",       "b HPLOUT",
+ "Headphone Jack",       "b HPROUT",
+ "Headphone Jack",       "c HPLOUT",
+ "Headphone Jack",       "c HPROUT",
+ "Headphone Jack",       "d HPLOUT",
+ "Headphone Jack",       "d HPROUT",
+ "a LINE1L",               "Line In",
+ "a LINE1R",               "Line In",
+ "b LINE1L",               "Line In",
+ "b LINE1R",               "Line In",
+ "c LINE1L",               "Line In",
+ "c LINE1R",               "Line In",
+ "d LINE1L",               "Line In",
+ "d LINE1R",               "Line In";
+ status="okay";
+ };

};

&rtc {
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Signature · 2 lines
Rick Mann
[email protected]
#15 lore raw
Quoted 11 lines · Rick Mann

Ugh, sorry. Here you go:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Sent from my iPhone

On Sep 29, 2015, at 07:08, Caleb Crome <[email protected]> wrote:

Now I have a working MCLK, and I see clocking on BCLK and WCLK, but the rates are questionable. MCLK is 24 MHz (even though in the DTS it's set to 12 MHz); that might be okay.

It's definitely not obvious why you'd be getting 24MHz instead of 12. Wait. Are you getting exactly 24 MHz, or about 24 MHz? in davinci-evm.c there are some .sysclk settings set to 24576000 as in the da830_snd_soc_card_crvdata.

Quoted 7 lines

  # speaker-test -r 22050 -c 2 -f 1000 -F S16_LE -t sine -s 1 -D hw:0,0

WCLK is 11.88 kHz, and it is pulses (DSP mode), rather than high for left, low for right for each channel's word. BCLK is 379.5 kHz.

Sounds like you're not in I2S mode, you must be in DSP or left-justified mode. That's set in your eavinci-evm.c in the snd_soc_dai_link structure under the field .dai_fmt. Most of them are set to SND_SOC_DAIFMT_DSP_B.

-Caleb

author
#16 lore raw
Quoted 12 lines · Caleb Crome
Quoted 8 lines · Rick Mann

Ugh, sorry. Here you go:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Sent from my iPhone

On Sep 29, 2015, at 07:08, Caleb Crome <[email protected]> wrote:

Quoted 8 lines
Quoted 3 lines

Now I have a working MCLK, and I see clocking on BCLK and WCLK, but the rates are questionable. MCLK is 24 MHz (even though in the DTS it's set to 12 MHz); that might be okay.

It's definitely not obvious why you'd be getting 24MHz instead of 12. Wait. Are you getting exactly 24 MHz, or about 24 MHz? in davinci-evm.c there are some .sysclk settings set to 24576000 as in the da830_snd_soc_card_crvdata.

It's pretty exactly 24.00 MHz, ±0.02 MHz.

I noticed I get these errors (this is 4.1.4-ti-r9 from the Beaglebone Black Debian "console" distro. For reference, here's my overlay: https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts). Since I set the clock rate in the sound node, and snd_soc_register_card() is failing (-517 is EPROBE_DEFER, "Driver requests probe retry"), I wonder if the DTS-speified clock rate isn't getting passed through to the tlv320aic.

...

[  133.516593] davinci_evm sound: ASoC: CPU DAI (null) not registered
[  133.522815] davinci_evm sound: snd_soc_register_card failed (-517)
...
[  133.607805] davinci_evm sound: ASoC: DAPM unknown pin MONO_LOUT

Now, I don't specify MONO_LOUT anywhere in my DTS, but it is in tlv320aic3x.c and davinci-evm.c.

Here's the complete dmesg upon loading the device tree:

[  133.424928] bone_capemgr bone_capemgr: part_number 'BB-ENABLE-PRU', version 'N/A'
[  133.424975] bone_capemgr bone_capemgr: slot #4: override
[  133.424993] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[  133.425011] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-ENABLE-PRU'
[  133.425143] bone_capemgr:capemgr_load_slot:1148: bone_capemgr bone_capemgr: slot #4: Requesting part number/version based 'BB-ENABLE-PRU-00A0.dtbo
[  133.425164] bone_capemgr:capemgr_load_slot:1162: bone_capemgr bone_capemgr: slot #4: Requesting firmware 'BB-ENABLE-PRU-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[  133.426741] bone_capemgr:capemgr_load_slot:1171: bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; converting to live tree
[  133.440820] gpio-of-helper ocp:gpio_helper: ready
[  133.448385] pruss_uio 4a300000.pruss: pins are not configured from the driver
[  133.460959] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; overlay id #0
[  133.516558] snd_soc_core:soc_bind_dai_link:938: davinci_evm sound: ASoC: binding TLV320AIC3X at idx 0
[  133.516593] davinci_evm sound: ASoC: CPU DAI (null) not registered
[  133.522815] davinci_evm sound: snd_soc_register_card failed (-517)
[  133.533356] snd_soc_core:snd_soc_register_codec:3064: tlv320aic3x-codec 2-0018: codec register 2-0018
[  133.533406] snd_soc_core:snd_soc_register_dais:2590: tlv320aic3x-codec 2-0018: ASoC: dai register 2-0018 #1
[  133.533424] snd_soc_core:snd_soc_register_dais:2634: tlv320aic3x-codec 2-0018: ASoC: Registered DAI 'tlv320aic3x-hifi'
[  133.533442] snd_soc_core:snd_soc_register_codec:3138: tlv320aic3x-codec 2-0018: ASoC: Registered codec 'tlv320aic3x-codec.2-0018'
[  133.546622] base:of_property_match_string:1398: comparing tx with tx
[  133.546675] base:of_property_match_string:1398: comparing rx with tx
[  133.546686] base:of_property_match_string:1398: comparing rx with rx
[  133.546739] base:of_property_match_string:1398: comparing common with tx
[  133.546751] base:of_property_match_string:1398: comparing common with rx
[  133.546763] base:of_property_match_string:1398: comparing rx with tx
[  133.546773] base:of_property_match_string:1398: comparing rx with rx
[  133.550537] base:of_property_match_string:1398: comparing tx with tx
[  133.556638] snd_soc_core:snd_soc_register_dais:2590: davinci-mcasp 48038000.mcasp: ASoC: dai register 48038000.mcasp #1
[  133.556671] snd_soc_core:snd_soc_register_dais:2634: davinci-mcasp 48038000.mcasp: ASoC: Registered DAI '48038000.mcasp'
[  133.556830] snd_soc_core:snd_soc_add_platform:2892: davinci-mcasp 48038000.mcasp: ASoC: Registered platform '48038000.mcasp'
[  133.606784] snd_soc_core:soc_bind_dai_link:938: davinci_evm sound: ASoC: binding TLV320AIC3X at idx 0
[  133.607118] snd_soc_core:snd_soc_dapm_new_dai_widgets:3494: tlv320aic3x-codec 2-0018: ASoC: adding Playback widget
[  133.607139] snd_soc_core:snd_soc_dapm_new_dai_widgets:3513: tlv320aic3x-codec 2-0018: ASoC: adding Capture widget
[  133.607704] snd_soc_core:soc_probe_link_dais:1334: davinci_evm sound: ASoC: probe Podtique DaVinci EVM dai link 0 late -2
[  133.607724] snd_soc_core:soc_probe_link_dais:1334: davinci_evm sound: ASoC: probe Podtique DaVinci EVM dai link 0 late -1
[  133.607738] snd_soc_core:soc_probe_link_dais:1334: davinci_evm sound: ASoC: probe Podtique DaVinci EVM dai link 0 late 0
[  133.607752] snd_soc_core:soc_probe_link_dais:1334: davinci_evm sound: ASoC: probe Podtique DaVinci EVM dai link 0 late 1
[  133.607766] snd_soc_core:soc_probe_link_dais:1334: davinci_evm sound: ASoC: probe Podtique DaVinci EVM dai link 0 late 2
[  133.607805] davinci_evm sound: ASoC: DAPM unknown pin MONO_LOUT
[  133.627880] snd_soc_core:soc_new_pcm:2510: davinci_evm sound: ASoC: registered pcm #0 AIC3X tlv320aic3x-hifi-0
[  133.631201] davinci_evm sound: tlv320aic3x-hifi <-> 48038000.mcasp mapping ok
[  133.631252] snd_soc_core:snd_soc_dapm_link_dai_widgets:3570: tlv320aic3x-codec 2-0018: Right ADC -> Capture
[  133.631273] snd_soc_core:snd_soc_dapm_link_dai_widgets:3570: tlv320aic3x-codec 2-0018: Left ADC -> Capture
[  133.631294] snd_soc_core:snd_soc_dapm_link_dai_widgets:3570: tlv320aic3x-codec 2-0018: Playback -> Right DAC
[  133.631308] snd_soc_core:snd_soc_dapm_link_dai_widgets:3570: tlv320aic3x-codec 2-0018: Playback -> Left DAC
Quoted 6 lines
Quoted 6 lines


 # speaker-test -r 22050 -c 2 -f 1000 -F S16_LE -t sine -s 1 -D hw:0,0
Quoted 7 lines
Quoted 2 lines

WCLK is 11.88 kHz, and it is pulses (DSP mode), rather than high for left, low for right for each channel's word. BCLK is 379.5 kHz.

Sounds like you're not in I2S mode, you must be in DSP or left-justified mode. That's set in your eavinci-evm.c in the snd_soc_dai_link structure under the field .dai_fmt. Most of them are set to SND_SOC_DAIFMT_DSP_B.

Interesting you mention that. It in fact does set it to DSP mode. Someone else on the list said for stereo, DSP and I2S modes were the same, and I didn't challenge him on that. I don't know how the code that reads the mcasp0 overlay (and thus reads the op-mode=0 part) communicates with the tlv320aic3x.c code to set the correct i2c register, but seems to not be doing that correctly.

I think it's time I built that tree myself and dropped in some printk() statements. :-/

Signature · 8 lines
Rick Mann
[email protected]


_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
#17 lore raw

Sent from my iPhone

Quoted 18 lines · Rick Mann
Quoted 17 lines · Caleb Crome
Quoted 11 lines · Rick Mann

Ugh, sorry. Here you go:

https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts

Sent from my iPhone

On Sep 29, 2015, at 07:08, Caleb Crome <[email protected]> wrote:

Now I have a working MCLK, and I see clocking on BCLK and WCLK, but the rates are questionable. MCLK is 24 MHz (even though in the DTS it's set to 12 MHz); that might be okay.

Quoted 7 lines
Quoted 4 lines

It's definitely not obvious why you'd be getting 24MHz instead of 12. Wait. Are you getting exactly 24 MHz, or about 24 MHz? in davinci-evm.c there are some .sysclk settings set to 24576000 as in the da830_snd_soc_card_crvdata.

It's pretty exactly 24.00 MHz, ±0.02 MHz.

Oh, it's coming back to me. Perhaps 24 MHz is all the pin can put out. So if you set your sysclk to 24 MHz, then the PLL will get set to the right thing, and give you the right clocks.

My board has its own clock, so I don't actually use the mclk from the bbb.

Also, you can use DSP mode for stereo just fine. I don't think you need to worry about that at all as long as both sides recognize the format.

Quoted 1 line

I noticed I get these errors (this is 4.1.4-ti-r9 from the Beaglebone Black Debian "console" distro. For reference, here's my overlay: https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PRU.dts). Since I set the clock rate in the sound node, and snd_soc_register_card() is failing (-517 is EPROBE_DEFER, "Driver requests probe retry"), I wonder if the DTS-speified clock rate isn't getting passed through to the tlv320aic.

If not mistaken , that happens because the pin module isn't loaded yet. I think you can ignore this.

Quoted 66 lines

...

[  133.516593] davinci_evm sound: ASoC: CPU DAI (null) not registered
[  133.522815] davinci_evm sound: snd_soc_register_card failed (-517)
...
[  133.607805] davinci_evm sound: ASoC: DAPM unknown pin MONO_LOUT

Now, I don't specify MONO_LOUT anywhere in my DTS, but it is in tlv320aic3x.c and davinci-evm.c.

Here's the complete dmesg upon loading the device tree:

[  133.424928] bone_capemgr bone_capemgr: part_number 'BB-ENABLE-PRU', version 'N/A'
[  133.424975] bone_capemgr bone_capemgr: slot #4: override
[  133.424993] bone_capemgr bone_capemgr: Using override eeprom data at slot 4
[  133.425011] bone_capemgr bone_capemgr: slot #4: 'Override Board Name,00A0,Override Manuf,BB-ENABLE-PRU'
[  133.425143] bone_capemgr:capemgr_load_slot:1148: bone_capemgr bone_capemgr: slot #4: Requesting part number/version based 'BB-ENABLE-PRU-00A0.dtbo
[  133.425164] bone_capemgr:capemgr_load_slot:1162: bone_capemgr bone_capemgr: slot #4: Requesting firmware 'BB-ENABLE-PRU-00A0.dtbo' for board-name 'Override Board Name', version '00A0'
[  133.426741] bone_capemgr:capemgr_load_slot:1171: bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; converting to live tree
[  133.440820] gpio-of-helper ocp:gpio_helper: ready
[  133.448385] pruss_uio 4a300000.pruss: pins are not configured from the driver
[  133.460959] bone_capemgr bone_capemgr: slot #4: dtbo 'BB-ENABLE-PRU-00A0.dtbo' loaded; overlay id #0
[  133.516558] snd_soc_core:soc_bind_dai_link:938: davinci_evm sound: ASoC: binding TLV320AIC3X at idx 0
[  133.516593] davinci_evm sound: ASoC: CPU DAI (null) not registered
[  133.522815] davinci_evm sound: snd_soc_register_card failed (-517)
[  133.533356] snd_soc_core:snd_soc_register_codec:3064: tlv320aic3x-codec 2-0018: codec register 2-0018
[  133.533406] snd_soc_core:snd_soc_register_dais:2590: tlv320aic3x-codec 2-0018: ASoC: dai register 2-0018 #1
[  133.533424] snd_soc_core:snd_soc_register_dais:2634: tlv320aic3x-codec 2-0018: ASoC: Registered DAI 'tlv320aic3x-hifi'
[  133.533442] snd_soc_core:snd_soc_register_codec:3138: tlv320aic3x-codec 2-0018: ASoC: Registered codec 'tlv320aic3x-codec.2-0018'
[  133.546622] base:of_property_match_string:1398: comparing tx with tx
[  133.546675] base:of_property_match_string:1398: comparing rx with tx
[  133.546686] base:of_property_match_string:1398: comparing rx with rx
[  133.546739] base:of_property_match_string:1398: comparing common with tx
[  133.546751] base:of_property_match_string:1398: comparing common with rx
[  133.546763] base:of_property_match_string:1398: comparing rx with tx
[  133.546773] base:of_property_match_string:1398: comparing rx with rx
[  133.550537] base:of_property_match_string:1398: comparing tx with tx
[  133.556638] snd_soc_core:snd_soc_register_dais:2590: davinci-mcasp 48038000.mcasp: ASoC: dai register 48038000.mcasp #1
[  133.556671] snd_soc_core:snd_soc_register_dais:2634: davinci-mcasp 48038000.mcasp: ASoC: Registered DAI '48038000.mcasp'
[  133.556830] snd_soc_core:snd_soc_add_platform:2892: davinci-mcasp 48038000.mcasp: ASoC: Registered platform '48038000.mcasp'
[  133.606784] snd_soc_core:soc_bind_dai_link:938: davinci_evm sound: ASoC: binding TLV320AIC3X at idx 0
[  133.607118] snd_soc_core:snd_soc_dapm_new_dai_widgets:3494: tlv320aic3x-codec 2-0018: ASoC: adding Playback widget
[  133.607139] snd_soc_core:snd_soc_dapm_new_dai_widgets:3513: tlv320aic3x-codec 2-0018: ASoC: adding Capture widget
[  133.607704] snd_soc_core:soc_probe_link_dais:1334: davinci_evm sound: ASoC: probe Podtique DaVinci EVM dai link 0 late -2
[  133.607724] snd_soc_core:soc_probe_link_dais:1334: davinci_evm sound: ASoC: probe Podtique DaVinci EVM dai link 0 late -1
[  133.607738] snd_soc_core:soc_probe_link_dais:1334: davinci_evm sound: ASoC: probe Podtique DaVinci EVM dai link 0 late 0
[  133.607752] snd_soc_core:soc_probe_link_dais:1334: davinci_evm sound: ASoC: probe Podtique DaVinci EVM dai link 0 late 1
[  133.607766] snd_soc_core:soc_probe_link_dais:1334: davinci_evm sound: ASoC: probe Podtique DaVinci EVM dai link 0 late 2
[  133.607805] davinci_evm sound: ASoC: DAPM unknown pin MONO_LOUT
[  133.627880] snd_soc_core:soc_new_pcm:2510: davinci_evm sound: ASoC: registered pcm #0 AIC3X tlv320aic3x-hifi-0
[  133.631201] davinci_evm sound: tlv320aic3x-hifi <-> 48038000.mcasp mapping ok
[  133.631252] snd_soc_core:snd_soc_dapm_link_dai_widgets:3570: tlv320aic3x-codec 2-0018: Right ADC -> Capture
[  133.631273] snd_soc_core:snd_soc_dapm_link_dai_widgets:3570: tlv320aic3x-codec 2-0018: Left ADC -> Capture
[  133.631294] snd_soc_core:snd_soc_dapm_link_dai_widgets:3570: tlv320aic3x-codec 2-0018: Playback -> Right DAC
[  133.631308] snd_soc_core:snd_soc_dapm_link_dai_widgets:3570: tlv320aic3x-codec 2-0018: Playback -> Left DAC
Quoted 9 lines
Quoted 8 lines


# speaker-test -r 22050 -c 2 -f 1000 -F S16_LE -t sine -s 1 -D hw:0,0

WCLK is 11.88 kHz, and it is pulses (DSP mode), rather than high for left, low for right for each channel's word. BCLK is 379.5 kHz.

Quoted 15 lines
Quoted 4 lines

Sounds like you're not in I2S mode, you must be in DSP or left-justified mode. That's set in your eavinci-evm.c in the snd_soc_dai_link structure under the field .dai_fmt. Most of them are set to SND_SOC_DAIFMT_DSP_B.

Interesting you mention that. It in fact does set it to DSP mode. Someone else on the list said for stereo, DSP and I2S modes were the same, and I didn't challenge him on that. I don't know how the code that reads the mcasp0 overlay (and thus reads the op-mode=0 part) communicates with the tlv320aic3x.c code to set the correct i2c register, but seems to not be doing that correctly.

I think it's time I built that tree myself and dropped in some printk() statements. :-/

Signature · 2 lines
Rick Mann
[email protected]

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

author
#18 lore raw
Quoted 9 lines · Caleb Crome

Sent from my iPhone

Quoted 3 lines · Rick Mann
Quoted 6 lines
Quoted 2 lines

It's pretty exactly 24.00 MHz, ±0.02 MHz.

Oh, it's coming back to me. Perhaps 24 MHz is all the pin can put out. So if you set your sysclk to 24 MHz, then the PLL will get set to the right thing, and give you the right clocks.

My board has its own clock, so I don't actually use the mclk from the bbb.

Well, the other Audio Cape (from Circuitco) seems to get by specifying 12 MHz. I'll try setting it to 24, but it seems weird that they can use 12 and I can't. Maybe they can only use 12 in the 3.8.x kernel, and something broke since then?

Quoted 3 lines

Also, you can use DSP mode for stereo just fine. I don't think you need to worry about that at all as long as both sides recognize the format.

Good to know.

Signature · 8 lines
Rick Mann
[email protected]


_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel