This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/PCM1774: Configuring PCM1774 for connection with DRA74x J6 processor over I2S audio interface

Part Number: PCM1774

Tool/software: Linux

Hi,

In our system, the J6 processor is connected to the PCM1774 DAC chip. The communication between J6 and PCM1774 chip is over two channels:

. I2C

. I2S

 I2C is used for the configuration of the DAC chip. I2S is connected to McASP2 sub-system in J6 processor. The Linux software stack looks like this:

Multimedia App -> ALSA -> Driver -> PCM1774

To test the entire stack I am using this very simple command:

 speaker-test -c2 -t wav

But, no sound on any of left or right speakers. To see what's going on the hardware, I connected my oscilloscope to the pins of PCM1774 and also TPA6211 Differential Audio Power Amplifiers. As I run the speaker-test app, I see the I2S inputs of the PCM1774 are supplied periodically with new data. But, its outputs on any of left or right stereo channels has a very weak signal (in order of some mili-volt). Also, the diff output of the Diff Audio AMP which is connected to the speakers, has a constant voltage. As inside PCM1774 there isn't any mechanism to generate a test pattern (like a sin wave) to appear on output, as a try, I connected an external function generator (a pulse waveform with 1 Volt P to P) to the analog inputs (microphone) of the chip. I configured the internal switches and mux in chip with the following script and now I can hear the pulse on both speakers. My configuration script uses I2C tool to communicate with PCM1774 and looks like this (the PCM1774 is located on I2C bus 0 in address 0x46):

########################################################

# Config PCM1774

########################################################

echo "WRITE ..."

# PCM1774_SYS_RESET
i2cset -f -y 0 0x46 0x55 0x80 b
# PCM1774_VOL_HPA_L
i2cset -f -y 0 0x46 0x40 0x3f b
# PCM1774_VOL_HPA_R
i2cset -f -y 0 0x46 0x41 0x3f b
# PCM1774_DAC_MUTE_L
i2cset -f -y 0 0x46 0x44 0x27 b
# PCM1774_DAC_MUTE_R
i2cset -f -y 0 0x46 0x45 0x27 b
# PCM1774_DAC_SAMPLE
i2cset -f -y 0 0x46 0x46 0x0d b
# PCM1774_DAC_PWR
i2cset -f -y 0 0x46 0x49 0xec b
# PCM1774_CLK_RATE
i2cset -f -y 0 0x46 0x56 0x21 b
# PCM1774_AMIX_PWR
i2cset -f -y 0 0x46 0x48 0x03 b
# PCM1774_AMIX_SELECT
i2cset -f -y 0 0x46 0x58 0x33 b
# PCM1774_DAC_PWR
i2cset -f -y 0 0x46 0x49 0xec b
# PCM1774_AOUT_CFG
i2cset -f -y 0 0x46 0x4a 0x01 b
# PCM1774_PG_PWR
i2cset -f -y 0 0x46 0x52 0x30 b
# PCM1774_AIN_SELECT
i2cset -f -y 0 0x46 0x57 0x11 b
# PCM1774_AIN_GAIN
i2cset -f -y 0 0x46 0x59 0x77 b
# PCM1774_MASTER_MODE
i2cset -f -y 0 0x46 0x54 0x01 b
# PCM1774_DAC_MUTE_L
i2cset -f -y 0 0x46 0x44 0x3F b
# PCM1774_DAC_MUTE_R
i2cset -f -y 0 0x46 0x45 0x3F b

echo "READ ..."
echo "PCM1774_SYS_REST"
i2cget -f -y 0 0x46 0x55
echo "PCM1774_VOL_HPA_L"
i2cget -f -y 0 0x46 0x40
echo "PCM1774_VOL_HPA_R"
i2cget -f -y 0 0x46 0x41
echo "PCM1774_DAC_MUTE_L"
i2cget -f -y 0 0x46 0x44
echo "PCM1774_DAC_MUTE_R"
i2cget -f -y 0 0x46 0x45
echo "PCM1774_DAC_SAMPLE"
i2cget -f -y 0 0x46 0x46
echo "PCM1774_DAC_PWR"
i2cget -f -y 0 0x46 0x49
echo "PCM1774_CLK_RATE"
i2cget -f -y 0 0x46 0x56
echo "PCM1774_AMIX_PWR"
i2cget -f -y 0 0x46 0x48
echo "PCM1774_AMIX_SELECT"
i2cget -f -y 0 0x46 0x58
echo "PCM1774_DAC_PWR"
i2cget -f -y 0 0x46 0x49
echo "PCM1774_AOUT_CFG"
i2cget -f -y 0 0x46 0x4a
echo "PCM1774_PG_PWR"
i2cget -f -y 0 0x46 0x52
echo "PCM1774_AIN_SELECT"
i2cget -f -y 0 0x46 0x57
echo "PCM1774_MASTER_MODE"
i2cget -f -y 0 0x46 0x54
echo "PCM1774_DAC_MUTE_L"
i2cget -f -y 0 0x46 0x44
echo "PCM1774_DAC_MUTE_R"
i2cget -f -y 0 0x46 0x45

As I can hear the injected input pulse into AIN1L and AIN1R on both speakers, it seems all the configuration of the internal stages like PGs, SWs, MXL, MXR, HPL, and HPR over I2C is successful and the chip is powered up correctly. Based on this evidence, I guess the I2S Audio Interface doesn't work correctly and cannot supply the DAC with fresh data from processor. Attached is the screen shot of my oscilloscope which demonstrates the waveform diagram of the I2C communication (Yellow: LRCK, Green: DIN, Blue: BCK, Red: HPO/LO). The input system clock to PCM1774 has 11.2896 MHz clock. It looks the J6 processor sends input digital data to PCM1774 in the right way, ins't it?

Do you have any idea how I might solve this issue? How may I further debug the Audio Interface?

Thanks.

Armin

  • Hi Armin,

    Can you share a schematic of your system? In addition, looks like you are setting your digital attenuation to -24dB, is that correct?
    # PCM1774_DAC_MUTE_L
    i2cset -f -y 0 0x46 0x44 0x27 b
    # PCM1774_DAC_MUTE_R
    i2cset -f -y 0 0x46 0x45 0x27 b

    Thanks,
    Paul
  • Hi Armin,

    Any updates?
    Thanks,
    Paul
  • Hi Paul,

    Thank you very much for your great consideration. Actually, I noticed that the issue was on hardware. I replaced my hardware platform with another one and now I can hear the sound is coming out of left and right speakers.
    Your support is very much appreciated.
    Thanks and regards,
    Armin