Sent from my iPhone
On Oct 2, 2015, at 2:55 AM, Rick Mann rmann@latencyzero.com wrote:
On Oct 1, 2015, at 08:38 , Caleb Crome caleb@crome.org wrote:
On Tue, Sep 29, 2015 at 11:41 AM, Rick Mann rmann@latencyzero.com wrote:
Ugh, sorry. Here you go:
https://github.com/JetForMe/podtique/blob/v1/bbb/cape/Podtique1/BB-ENABLE-PR...
Sent from my iPhone
On Sep 29, 2015, at 07:08, Caleb Crome caleb@crome.org 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.
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.
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-PR...). 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.
... [ 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
# 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.
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. :-/
-- Rick Mann rmann@latencyzero.com