I have reviewed the AIC32x4 setup from the TI TLV320AIC3204 Application Reference Guide document [0]. Looking at the examples section I used the following as a basis, concentrating on the highlighted part which sets up the routing …
4.0.1 Stereo DAC Playback with 48ksps Sample Rate and High Performance.
Assumption
AVdd = 1.8V, DVdd = 1.8V
MCLK = 12.288MHz
Ext C = 47uF
Based on C the wait time will change.
Wait time = N*Rpop*C + 4* Offset ramp time
Default settings used.
PLL Disabled
DOSR 128
# Initialize to Page 0
w 30 00 00
# Initialize the device through software reset
w 30 01 01
# Power up the NDAC divider with value 1
w 30 0b 81
# Power up the MDAC divider with value 2
w 30 0c 82
# Program the OSR of DAC to 128
w 30 0d 00
w 30 0e 80
# Set the word length of Audio Interface to 20bits PTM_P4
w 30 1b 10
# Set the DAC Mode to PRB_P8
w 30 3c 08
# Select Page 1
w 30 00 01
# Disable Internal Crude AVdd in presence of external AVdd supply or before
#powering up internal AVdd LDO
w 30 01 08
# Enable Master Analog Power Control
w 30 02 00
# Set the REF charging time to 40ms
w 30 7b 01
# HP soft stepping settings for optimal pop performance at power up
# Rpop used is 6k with N = 6 and soft step = 20usec. This should work with 47uF coupling
# capacitor. Can try N=5,6 or 7 time constants as well. Trade-off delay vs “pop” sound.
w 30 14 25
# Set the Input Common Mode to 0.9V and Output Common Mode for Headphone to
# Input Common Mode
w 30 0a 00
[b]# Route Left DAC to HPL
w 30 0c 08
# Route Right DAC to HPR
w 30 0d 08[/b]
# Set the DAC PTM mode to PTM_P3/4
w 30 03 00
w 30 04 00
# Set the HPL gain to 0dB
w 30 10 00
# Set the HPR gain to 0dB
w 30 11 00
[b]# Power up HPL and HPR drivers
w 30 09 30[/b]
# Wait for 2.5 sec for soft stepping to take effect
# Else read Page 1, Register 63d, D(7:6). When = “11” soft-stepping is complete
# Select Page 0
w 30 00 00
[b]# Power up the Left and Right DAC Channels with route the Left Audio digital data to
# Left Channel DAC and Right Audio digital data to Right Channel DAC
w 30 3f d6
# Unmute the DAC digital volume control
w 30 40 00[/b]
Please note that this is example is based upon using the headphones as the output and not the line-out. However, looking at the registers in the same guide it is easy to adapt to line out. So based upon the above I believe that the following need to be set …
I assume that this is correct based upon the driver names, but it is obviously completely untested as I don’t have one of these codecs available. There maybe some other settings that you need to tweak for example, the instructions from TI say to write 0x00 to 0x40 (register page 0) to unmute the DACs. By default the L/R DACs are muted and there is no mixer control to do this. Looking at the driver I think you need to call “->digital_mute()” function to do this.
I was trying to set the amixer per you proposed settings, but the amixer replied with the following error for most of the options: amixer: Cannot find the given element from control hw:1. The only one that applied the settings was “z Auto-mute Switch”.
I see that you have already set these before. Looking at your past trace, what is missing is the connection from “LOx Output Mixer” → “LOx Power” → “LOx” → I2S. There must be another mixer setting that missing.
moreover the dapm(s) as you have mentioned in message #126 are not recognized, I assume that the word “switch” has to be postfixed: z LOL Output Mixer L_DAC switch as I have used in message #104.
Yes that is possible. Is there switch called “z OUT”? If so you probably need to enable that too.
Looking back at your comment #104, I think that your right, the connection from the Left/Right DAC → Left/Right Playback is missing. According to [0], “Left/Right Playback” seems to be the right prefix label for the DAC but it is still not making this link.
Is it correct that when I grep for a switch the name that is provided is without the word switch at the end but if I need to cset it then I have to add the word switch? Moreover, when I cset it (with the word switch) the original switch is not modified.I guess that the switches cannot be turned on until the full route is connected, per the link in message #129.
Regards,
Igal
This is not a problem. The I2S driver is common between Tegra210 and Tegra186 and because Tegra210 was the earlier device it uses its name. Furthermore, Tegra210 does not have any DSPK devices and so this is why this one has the Tegra186 prefix.
Jon, hi,
in file tegra_t186ref_mobile_rt565x.c the z IN and z OUT are defines as SND_SOC_DAPM_LINE in the tegra_t186ref_dapm_widget (type struct snd_soc_dapm_widget)
Do you mean to add another widget of type SOC_DAPM_PIN_SWITCH or replace SND_SOC_DAPM_LINE?