Quantcast
Channel: Processors
Viewing all articles
Browse latest Browse all 148998

Forum Post: RE: Can't get sound from TLV320DAC3100 codec on Linux

$
0
0

Thank you for the suggestions, I'll try those settings when I have it working again...

I had the BCLK and WCLK settings as output in the FW. However, since I'm not 100% sure that the firmware is loaded and working correctly with our codec, I can't be sure that the settings are being applied as I think they should.

I double checked my mux settings in arch/arm/mach-omap2/board-am335xevm.c, and they look right I think. clkout1 is output, fsx and aclkx are input from wclk and bclk, and axr0 is the DIN output.

/* Module pin mux for mcasp1/audio pins */
static struct pinmux_config mcasp1_pin_mux[] = {
    {"mcasp0_aclkr.mcasp1_aclkx",   OMAP_MUX_MODE3 | AM33XX_INPUT_EN},      /* AUDIO_BCLK */
    {"mcasp0_fsr.mcasp1_fsx",       OMAP_MUX_MODE3 | AM33XX_INPUT_EN},      /* AUDIO_WCLK */
    {"mcasp0_axr1.mcasp1_axr0",     OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT},    /* AUDIO_DIN */
    {NULL, 0},
};

/* Module pin mux for clkout1/audio pins */
static struct pinmux_config clkout1_pin_mux[] = {
    {"xdma_event_intr0.clkout1",    OMAP_MUX_MODE3 | AM33XX_PIN_OUTPUT},    /* AUDIO_MCLK */
    {NULL, 0},
};

I probed the MCLK line and it's 24MHz, but the bclk and wclk were oddly jittery. I could see a very low voltage Sine/square wave signal appearing and disappearing so was hard to get a freq reading. Since it wasn't constant I don't know whether it's working, as with the Sitara diagnostics app both lines had a constant frequency output on them, 1.4MHz and 44kHz approximately.

I had followed instructions on https://gitorious.org/ti-codecs/pages/CodecDriverAIC31xx to download ti-codecs from git://gitorious.org/ti-codecs/ti-codecs.git and transferred a number of files to my kernel src directory:

sound/soc/codecs/tlv320aic31xx_default_fw.h
sound/soc/codecs/tlv320aic31xx.c
sound/soc/codecs/tlv320aic31xx.h

sound/soc/codecs/aic3xxx/aic3xxx_cfw.h
sound/soc/codecs/aic3xxx/aic3xxx_cfw_ops.c
sound/soc/codecs/aic3xxx/aic3xxx_cfw_ops.h

including a Multifunction AIC3XXX driver (looked like it was needed from the given menuconfig options):

drivers/mfd/tlv320aic3xxx-i2c.c
drivers/mfd/tlv320aic3xxx-core.c
drivers/mfd/tlv320aic3xxx-irq.c

include/linux/mfd/tlv320aic3xxx-registers.h
include/linux/mfd/tlv320aic31xx-registers.h
include/linux/mfd/tlv320aic3xxx-core.h

I replaced my sound/soc/davinci/davinci-evm.c with sound/soc/davinci/davinci-aic31xx.c and added

static struct snd_soc_dai_link am335x_evm_dai = {
    .name = "TLV320AIC31X",
    .stream_name = "AIC3X",
    .cpu_dai_name = "davinci-mcasp.1",
    .codec_dai_name = "tlv320aic31xx-MM_EXT",
    .codec_name = "tlv320aic31xx-codec",
    .platform_name = "davinci-pcm-audio",
    .init = evm_aic3x_init,
    .ops = &evm_ops,
};

plus the Kconfig and Makefile changes required. I think this new file has the definition of the EVM sound card using the tlv320aic31xx driver instead of the tlv320aic3x driver.

I got in touch with our suppliers and they suggested a tlv320aic31xx driver from https://gitorious.org/ti-codecs/ti-codecs/commit/2a6df0d6bb1c270aba57018fad5d3cde221e4d4f, which has just the one C file and looks completely different from the other implementation above. This one looks like it contains the codec register commands and does not require to load separate .bin firmware files, so it gets around the issue of building from cfg and pfw files myself. However, since it's on a much newer kernel than my 3.2 version I had to do quite a bit of backporting of regmap to get it to compile.

Now though, I'm back to square one as the new driver does not seem to install during boot-up as the last one did so there is no device in /dev/snd/ :(

I've tried building it as a module and it loads fine, but then I don't know how to get ALSA to rescan the I2C interface and find the device and install the EVM sound card. Argh.... frustrating day.


Viewing all articles
Browse latest Browse all 148998

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>