Other Parts Discussed in Thread: TLV320AIC3104
I have design in which I've integrated a tlv320aic3104 into a beaglebone black cape for developing a pilot of our product. I have the DSP connected and can read and write the device over i2c but can't record audio. I've got a valid looking wave on the mic line (even if I didn't I should get noise) however when I instantiate my cape and try to do an arecord for that device with proper settings and a 10 second duration I always get an input/output error and my recording file is completely empty (44B audio stub file).
My DTS is as follows (I have other devices on this board but nothing crosses with the i2s for the tlv320):
/**
* Copyright © 2015 AmbientBox, LLC. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/dts-v1/;
/plugin/;
/ {
compatible = "ti,beaglebone-black";
/* identification */
part-number = "AMBIENTBOX";
version = "00A0", "03";
/* state the resources this cape uses */
/* TODO: Add pins for xBee and wifi */
exclusive-use =
/* the pin header uses */
"P9.31", /* mcasp0: mcasp0_aclkx */
"P9.29", /* mcasp0: mcasp0_fsx */
"P9.28", /* mcasp0: mcasp0_axr2 */
"P9.25", /* mcasp0: mcasp0_ahclkx */
"P9.11", /* xbee UART_RXD */
"P9.13", /* xbee UART_TXD */
"P8.33", /* xbee UART_RTSN */
"P8.35", /* xbee UART_CTSN */
/* the hardware ip uses */
"gpio1_18", "gpio1_19",
/* "gpio1_12", green LED */
/* "gpio0_26", red LED */
"gpio1_29", /* RGBC interval value */
"gpio2_24", /* Temp/Humidity CS Value */
"gpio2_25", /* VOC Prediction Value */
"mcasp0", /* DSP */
"uart4" /* Xbee */;
fragment@0 {
target = <&am33xx_pinmux>;
__overlay__ {
i2c2_pins: pinmux_i2c2_pins {
pinctrl-single,pins = <
0x150 0x72 /*spi0_scl.i2c2_sda,SLEWCTRL_SLOW | INPUT_PULLUP |MODE2*/
0x154 0x72 /*spi0_d0.i2c2_scl,SLEWCTRL_SLOW | INPUT_PULLUP | MODE2*/
>;
};
ambientbox_pins: pinmux_ambientbox_pins {
pinctrl-single,pins = <
0x1ac 0x00 /* P9.25 mcasp0_ahclkx, MODE0 | INPUT */
0x19c 0x22 /* P9.28 mcasp0_ahclkr, */
0x194 0x20 /* P9.29 mcasp0_fsx, MODE0 | OUTPUT */
0x190 0x20 /* P9.31 mcasp0_aclkr.mcasp0_aclkx, MODE0 | OUTPUT_PULLDOWN */
0x198 0x20
0x070 0x20 /* P9_11 UART4_RXD */
0x074 0x20 /* P9_13 UART4_TXD */
0x0d4 0x20 /* P8_33 UART4_RTSN */
0x0d0 0x20 /* P8_35 UART4_CTSN */
0x030 0x07 /* P8_12 Green LED OUTPUT MODE7 */
0x028 0x07 /* P8_14 Red LED OUTPUT MODE7 */
>;
};
};
};
fragment@1 {
target = <&i2c2>;
__overlay__ {
#address-cells = <1>;
#size-cells = <0>;
clock-frequency = <100000>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&i2c2_pins>;
tlv320aic3x: tlv320aic3x@18 {
compatible = "ti,tlv320aic3x";
reg = <0x18>;
status = "okay";
};
};
};
fragment@2 {
target = <&mcasp0>;
__overlay__ {
pinctrl-names = "default";
pinctrl-0 = <&ambientbox_pins>;
status = "okay";
op-mode = <0>; /* MCASP_IIS_MODE */
tdm-slots = <2>;
num-serializer = <16>;
serial-dir = < /* 0: INACTIVE, 1: TX, 2: RX */
2 0 1 0
0 0 0 0
0 0 0 0
0 0 0 0
>;
tx-num-evt = <1>;
rx-num-evt = <1>;
};
};
fragment@3 {
target = <&ocp>;
__overlay__ {
sound {
compatible = "ti,da830-evm-audio";
ti,model = "DA830 EVM";
ti,audio-codec = <&tlv320aic3x>;
ti,mcasp-controller = <&mcasp0>;
ti,codec-clock-rate = <12000000>;
ti,audio-routing =
"Headphone Jack", "HPLOUT",
"Headphone Jack", "HPROUT",
"LINE1L", "Line In",
"LINE1R", "Line In";
};
};
};
};
I have hooked this up very similarly to the audio cape for the beaglebone black also HDMI is disabled so that it won't interfere.
You'll also notice I do not have, nor have any plans to have, audio out hooked up. Audio output is unnecessary for my needs. I've gone the route of this DSP given there was another design with it already so I hoped to shortcut development time. My ideal solution would be a DSP that could take two audio channels and create an FFT from that to send back to the MCU but so far that is wishful thinking.
So my main question comes down to how do I get the tlv320 audio output working and/or how do I debug from here as everything appears to be working from an i2c perspective.
Note I've tried programming the DSP based on the application note at http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=slaa403&fileType=pdf prior to enabling the cape with the same result (it does seem to take the programming based on i2c reads however).
I did walk through https://e2e.ti.com/support/arm/sitara_arm/f/791/p/345940/1229640 but it did not lead me to an answer.
Thank you for your help,
Paul
