微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 硬件电路设计 > TI模拟硬件电路设计 > TLVaic3104基于am335x(sdk 6.0)配置问题

TLVaic3104基于am335x(sdk 6.0)配置问题

时间:10-02 整理:3721RD 点击:

各位好:

  就是我们的3104设备接的是I2C2,MACASP0这部分的代码已经修改完了,也能识别sound list设备了,现在播放音乐的时候出现错误,请帮忙看下额。

启动log:+++++++++++++++zhouqun aic3x_i2c_probe
[    1.800872] control_type = SND_SOC_I2C
[    1.804962] ++++++snd_soc_register_codec:0
[    1.809356] +++++++++++++++zhouqun aic3x_i2c_probe
[    1.814483] control_type = SND_SOC_I2C
[    1.818511] ++++++snd_soc_register_codec:0
[    1.823242] ++++++++zhouqun:snd_davinci_pcm_init
[    1.828308] +++++++zhouqun:davinci_soc_platform_probe
[    1.834075] ++++++++++++++++zhouqun:davinci_mcasp_init
[    1.834106]  ++++++++++++++==zhouqun : davinci_mcasp_probe
[    1.846038] +++++++zhouqun :evm_init
[    1.849884] ++++zhouqun am335x_evm?
[    1.855346] ++++++++++soc_bind_dai_link
[    1.859436] ++++++++zhouqun:binding TLV320AIC3X at idx 0
[    1.865325] +++++++++++++++ aic3x_probe
[    1.869445] ++++++++++++zhouqun <-aic3x_init
[    1.874023] +++++++zhouqun:aic3x_init
[    1.877929] +++++zhouqun:AIC3X_ASD_INTF_CTRLA (before)= 0
[    1.883666] +++++zhouqun:AIC3X_ASD_INTF_CTRLA (after) = 10
[    1.889495] +++++zhouqun:AIC3X_ASD_INTF_CTRLB (before) = 0
[    1.895355] +++++zhouqun:AIC3X_ASD_INTF_CTRLB (after) = 20
[    1.901184] +++++++zhouqun :LDAC_VOL = af
[    1.905456] +++++++zhouqun:RDAC_VOL = af
[    1.909667] ++++++++++++zhouqun aic3x_init->
[    1.915863] ++++++++++++++aic3x_probe FINISHED
[    1.925476] +++++zhouqun:evm_aic3x_init
[    1.930114] ++++++++++zhouqun :davinci_pcm_new
[    1.934906] ++++++++zhouqun:davinci_pcm_preallocate_dma_buffer
[    1.941589] ++++++++zhouqun:davinci_pcm_preallocate_dma_buffer
[    1.948272] asoc: tlv320aic3x-hifi <-> davinci-mcasp.0 mapping ok
[    1.957702] ALSA device list:
[    1.960876]   #0: AM335X EVM

播放音乐的错误log:

root@am335x-evm:/test# aplay 123.wav
[   34.629730] +++++++++zhouqun:davinci_mcasp_startup
[   34.635009] ++++++++zhouqun:davinci_pcm_open
[   34.639556] +++++++zhouqun:allocate_sram
[   34.643768] ++++++++zhouqun:davinci_pcm_dma_request
Playing WAVE '123.wav' : Signed 16 bit Little Endian, Rate 44100[   34.672454] ++++++++zhouqun :davinci_mcasp_set_dai_fmt
 Hz, Stereo
[   34.678131] +++++++=zhouqun:daifmt :1000d++++++++++davinci_mcasp_hw_params
[   34.687744] ++++++++++++zhouqun :davinci_hw_common_param
[   34.693450] ++++++++zhouqun :davinci_hw_param
[   34.698059] +++++zhouqun :davinci_config_channel_size
[   34.703460] +++++++zhouqun:davinci_pcm_hw_params
[   34.753753] +++++++++zhouqun:davinci_pcm_prepare
[   34.758728] ++++++zhouqun:davinci_pcm_enqueue_dma
[   34.763854] ++++++zhouqun:davinci_pcm_enqueue_dma
[   34.769897] +++++++++zhouqun:aic3x_set_power
[   34.810546] +++++++zhouqun:davinci_pcm_trigger
[   34.815307] +++++++++zhouqun:pcm_cmd = 1
[   34.819488] ++++++++++++zhouqun:davinci_mcasp_trigger
[   34.824829] +++++++++zhouqun:mcasp_cmd = 1
[   34.829193] +++++++++zhouuqn :davinci_mcasp_start
[   34.834167] ++++++++++zhouqun:mcasp_start_tx
[   34.838684] ++++++++zhouqun:mcasp_set_ctl_reg
[   34.843322] +++++++++zhouqun:(mcasp_get_reg(regs) & val
[   34.848846] ++++++++zhouqun:mcasp_set_ctl_reg
[   34.853485] +++++++++zhouqun:(mcasp_get_reg(regs) & val
[   34.859008] ++++++++zhouqun:mcasp_set_ctl_reg
[   34.863616] +++++++++zhouqun:(mcasp_get_reg(regs) & val
[   34.869171] ++++++++zhouqun:mcasp_set_ctl_reg
[   34.873779] +++++++++zhouqun:(mcasp_get_reg(regs) & val
[   34.879302] ++++++++zhouqun:mcasp_set_ctl_reg
[   34.883911] +++++++++zhouqun:(mcasp_get_reg(regs) & val
[   35.073608] +++++zhouqun:davinci_pcm_pointer
aplay: pcm_write[   45.073883] +++++++zhouqun:davinci_pcm_trigger
[   45.079589] +++++++++zhouqun:pcm_cmd = 0
[   45.083740] ++++++++++++zhouqun:davinci_mcasp_trigger
[   45.089111] +++++++++zhouqun:mcasp_cmd = 0
[   45.093475] ++++++++++++====zhouqun :davinci_mcasp_stop
[   45.099029] ++++++++++++zhouqun: mcasp_stop_tx
:1710: write error: Input/output[   45.105255] +++++++zhouqun:davinci_pcm_hw_free
 error
[   45.111419] +++++++zhouqun:davinci_pcm_hw_free
[   45.118316] +++++++++++zhouqun:davinci_pcm_close
root@am335x-evm:/test# [   50.125305] +++++++++zhouqun:aic3x_set_power



识别和初始化成功了, 但是可能配置和数据传输还有问题啊

是的,已经识别了,但是I2C时钟还有mclk总是测量不到,我在davinci-evm.c中给MCLK设置为11.2896mhz而且已经识别了,但就是不行,不知道哪里出错了,下面是我的寄存器配置。

/* Line1 Input control registers */
    snd_soc_write(codec,LINE1L_2_LADC_CTRL,0x04);
    snd_soc_write(codec,LINE1R_2_RADC_CTRL,0x04);

    /* ADC PGA Gain control registers */
    snd_soc_write(codec,LADC_VOL,0x00);
    snd_soc_write(codec,RADC_VOL,0x00);
    
    /* Codec datapath setup register */
    snd_soc_write(codec,AIC3X_CODEC_DATAPATH_REG,0x0A);

    /* DAC Power and Left High Power Output control registers */
    snd_soc_write(codec,HPLCOM_CFG,0xC0);
    
    /* DAC Digital control registers */
    snd_soc_write(codec,LDAC_VOL,0x00);
    snd_soc_write(codec,RDAC_VOL,0x00);

    /* Left High Power Output control registers */
    snd_soc_write(codec,DACL1_2_HPLOUT_VOL,0x80);

    /* Right High Power Output control registers */
    snd_soc_write(codec,DACR1_2_HPROUT_VOL,0x80);

    /* Left High Power Output control registers */
    snd_soc_write(codec,HPLOUT_CTRL,0x09);

    /* Right High Power Output control registers */
    snd_soc_write(codec,HPROUT_CTRL,0x09);


    /* Right High Power Output control registers */
    reg = snd_soc_read(codec,HPRCOM_CFG);
    printk("+++++++++zhouqun: HPRCOM_CFG (before)= %x\n",reg);
    snd_soc_write(codec,HPRCOM_CFG,0x06);
    reg = snd_soc_read(codec,HPRCOM_CFG);
    printk("+++++++++zhouqun: HPRCOM_CFG (after)= %x\n",reg);

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top