Part Number:TLV320DAC3203
Hi TI:
目前项目急,等着试产。目前使用的型号是TLV320DAC3203,目前I2C是上拉到3.3V,I2C能正常访问,但是现在问题是耳机声音没有出来,下面我描述一下具体的情况,
请帮忙分析下,感谢!能否给一个TLV320DAC3203的底层驱动代码呢?
平台:RK3399, Android 9.0
内核:Linux 4.4.167
原理图:
软件配置:
DTS:
驱动使用的是tlv320aic32x4.c驱动(TI上的一些回复是说tlv320aic32x4驱动同时也能兼容tlv320dac3203,所以用这个驱动)
播放音频方法: 用下面tinyplay命令播放音频文件,用示波器量HPL和HPR引脚,没有波形出来
console:/data # tinyplay /sdcard/001.wav -D 1
Playing sample: 2 ch, 44100 hz, 16 bit
示波器量时钟:
LRCLK: 44.1KHZ
BCLK:2.82MHZ
MCLK:11.25MHZ
下面是寄存器和声卡信息:
1|console:/data # ./i2cdump -f -y 1 0x18
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 00 00 10 00 03 91 07 14 90 00 00 82 88 00 80 02 ..?.?????..??.??
10: 00 08 02 08 80 01 00 04 00 00 01 00 00 01 04 00 .?????.?..?..??.
20: 00 00 00 00 00 22 11 00 00 00 00 00 00 00 00 00 ….."?………
30: 00 00 00 00 00 12 03 02 02 00 00 00 08 01 00 16 …..????…??.?
40: 0c 00 00 00 6f 38 00 00 00 00 00 ee 10 d8 7e e3 ?…o8…..???~?
50: 00 00 88 00 00 00 00 00 7f 00 00 00 00 00 00 00 ..?…..?…….
60: 7f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?……………
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
console:/data # ./i2cset -f -y 1 0x18 0x00 0x01
console:/data # ./i2cdump -f -y 1 0x18
No size specified (using byte-data access)
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: 01 08 04 00 00 00 00 00 00 30 63 10 08 08 00 00 ???……0c???..
10: 00 00 40 40 29 00 00 00 00 00 00 00 00 00 00 00 ..@@)………..
20: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
30: 00 00 00 00 00 00 00 00 00 00 00 80 80 00 00 c0 ………..??..?
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
70: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ………..?….
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 …………….
console:/data #
console:/data # cat /proc/asound/cards
0 [ROCKCHIPSPDIF ]: ROCKCHIP_SPDIF – ROCKCHIP,SPDIF
ROCKCHIP,SPDIF
1 [realtekdac3203c]: realtek_dac3203 – realtek,dac3203-codec
realtek,dac3203-codec
2 [rockchiphdmi ]: rockchip_hdmi – rockchip,hdmi
rockchip,hdmi
console:/data # tinymix -D 1
Mixer name: 'realtek,dac3203-codec'
Number of controls: 34
ctl type num name value
0 INT 2 PCM Playback Volume 127 127
1 INT 2 HP Driver Gain Volume 6 6
2 INT 2 LO Driver Gain Volume 6 6
3 BOOL 2 HP DAC Playback Switch On On
4 BOOL 2 LO DAC Playback Switch Off Off
5 BOOL 2 Mic PGA Switch Off Off
6 BOOL 1 ADCFGA Left Mute Switch On
7 BOOL 1 ADCFGA Right Mute Switch On
8 INT 2 ADC Level Volume 24 24
9 INT 2 PGA Level Volume 0 0
10 INT 1 Auto-mute Switch 0
11 BOOL 1 AGC Left Switch Off
12 BOOL 1 AGC Right Switch Off
13 INT 2 AGC Target Level 0 0
14 INT 2 AGC Gain Hysteresis 0 0
15 INT 2 AGC Hysteresis 0 0
16 INT 2 AGC Noise Threshold 0 0
17 INT 2 AGC Max PGA 127 127
18 INT 2 AGC Attack Time 0 0
19 INT 2 AGC Decay Time 0 0
20 INT 2 AGC Noise Debounce 0 0
21 INT 2 AGC Signal Debounce 0 0
22 BOOL 1 HPL Output Mixer L_DAC Switch On
23 BOOL 1 HPL Output Mixer IN1_L Switch Off
24 BOOL 1 LOL Output Mixer L_DAC Switch Off
25 BOOL 1 HPR Output Mixer R_DAC Switch On
26 BOOL 1 HPR Output Mixer IN1_R Switch Off
27 BOOL 1 LOR Output Mixer R_DAC Switch Off
28 BOOL 1 Left Input Mixer IN1_L P Switch Off
29 BOOL 1 Left Input Mixer IN2_L P Switch Off
30 BOOL 1 Left Input Mixer IN3_L P Switch Off
31 BOOL 1 Right Input Mixer IN1_R P Switch Off
32 BOOL 1 Right Input Mixer IN2_R P Switch Off
33 BOOL 1 Right Input Mixer IN3_R P Switch OFF
Amy Luo:
您好,
先向您确认下
1、您的耳机阻抗是多少?
2、VCCA3V0_CODEC电压是3.0V还是3.3V?
在DAC datasheet中数字信号输入的最大电压是IOVDD+0.3V,如果IOVDD是3.0V的话,将I2C上拉到3.3V,有损坏IC的风险,因为3.3V不可能稳定在3.3V,会随着输出功率或源端波动,有超出3.3V的风险。
3、关于寄存器内容,抱歉,我看不懂,您可以标出来,page0相应寄存器值与page 1相应寄存器值吗
,
bill yin:
Dear Amy:
感谢您的回复。
1. 目前阻抗是32欧姆,
2. VCCA3V0_CODEC 电压目前是3.3V,试了也是不行的。把其设置为1.8V也还是不行,耳放没有声音输出。
3. 是PAGE0和PAGE1的寄存器。
4. 能否发一份能正常工作的驱动代码给我参考,以及看电路上还有哪些有问题的呢?正确的电路是怎么样的呢
,
bill yin:
Dear Amy:
非常感谢支持。
有关于问题3中的寄存器的内容,详见如下:
能否帮忙给下正确的配置参考代码呢及相关建议呢
,
bill yin:
Dear Amy:
非常感谢支持。
有关于问题3中的寄存器的内容,详见如下:
能否帮忙给下正确的配置参考代码呢及相关建议呢
,
Amy Luo:
1、32欧姆阻抗在差分输出时在IC阻抗范围内,没问题。
2、根据您配置的CODEC CLKIN Clock Dividers和PLL的参数,在MCLK输入11.25MHZ的时候,fs不是44.1khz,而是41.3KHZ
3、看您的寄存器P0_R63(0x3f)配置为0x16,power down了Left DAC和Right DAC
4、代码您可以参考下面文档中的4.6 章节即DAC Playback with 48 ksps Sample Rate through Class-D Headphone Amplifiers:
https://www.ti.com.cn/cn/lit/ug/slau434a/slau434a.pdf?ts=1623997464176&ref_url=https%253A%252F%252Fwww.ti.com.cn%252Fproduct%252Fcn%252FTLV320DAC3203
5、电路可参考TLV320DAC3203EVM:
https://www.ti.com.cn/cn/lit/ug/slau441/slau441.pdf?ts=1623995820541&ref_url=https%253A%252F%252Fwww.ti.com.cn%252Fproduct%252Fcn%252FTLV320DAC3203
,
bill yin:
Dear Amy:
非常感谢支持,我这边先尝试验证下,如有问题还得请教您
感谢!
,
Amy Luo:
别客气,有问题请跟帖反馈