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.

PUREPATHSTUDIO: purepath studio with tlv320aic3268

Part Number: PUREPATHSTUDIO
Other Parts Discussed in Thread: TLV320AIC3268

i ve been trying for weeks to implement the volume contro for individual input on the audio mixer circuit which uses the tlv320aic3268 codec , but never been successfull , is there nay tutorial or anything where i can check how to use purepath for codec instead for evm's

  • Hi,

    Was this previous response not helpful?  PUREPATHSTUDIO: NEED HELP WITH IMPLEMENTING PUREPTH EXPORT WITH CODE 

    Are you trying to use PPS to generate code for use on your own board instead of EVM? If so, you can take the output when you do Build->Generate code, this should export a file called "base_main_Rate44.cfg" or whatever sample rate you are using with the device. Then, the .cfg file will have register writes in a format that we use for the TI tool called PurePath Console, this is a software we use to do I2C communication over USB. 

    This is what the output looks like, we see "w 30 04 33" for example, this is setting register 0x04 to 0x33, on the device with address 0x30. Then, The next line is "> 00", this is setting register 0x05 to 0x00, then register 0x06 to 0x91, then register 0x7 to 0x08. From this format, you can edit the file to act as your I2C configuration for any other syntax you need.

    Let me know if you need more help by replying here.

    Best,
    Mir

  •   i have created a set  in the pure path studio, from the reference u gave earlier , one doubt is , i have 2 analog input so for that do i need to use two of the Dec 4x1 blocks , and my goal is to achieve individual volume control + master volume control

  • Hi,

    The 2 analog inputs should be handled by the one Dec4xIn block, since it has both left and right channels of the ADC. You select which input pin is used to route to the ADC in SystemSettingsCode. 

    I also notice you are using "I2S_In2", this is the secondary ASI. I assume since there is only one I2S block on your diagram you mean to be using the primary ASI? If so, just change out the I2S_In2 for "I2S_In".

    Best,
    Mir

  • in my connection the i2s is routed to asi2 ,so I2S_In2 is correct for that?

  • Hi,

    Yes that will be alright. Let me know if you need more help here.

  • I attempted to convert the .cfg file into a .cpp file using a Python-based converter and embedded it into my firmware configuration code, but the implementation is not working as expected. I also could not clearly understand the approach you mentioned earlier for handling the .cfg file.

    My primary objective is to implement independent volume control for the different audio paths in the system. Is there any alternative method to achieve this without relying on the current .cfg conversion approach? Or is there a proper way to perform MiniDSP integration so that volume control can be implemented correctly?

  • Hi,

    I have made a similar project that converts this format into i2cset format for Linux systems, you can adjust the i2cset command to be however your format is in your .cpp:

    with open("output_i2cset.txt", "w", encoding="utf-8") as f:
    
        # example output line = "i2cset -y -f 0 0x18 0x01 0x01"
    
        # example input line = "w 30 7f 00" or "> 05"
    
    
        file = open("C:\\Users\\Documents\\nameofppsproject\\base_main_Rate16.cfg", "r")
        line = file.readline()
        prevRegAddress = "00"
        prevDeviceAddress = "00"
        while line:
            curLine = line.strip() #removes leading/trailing whitespace for easy parsing
    
            # remove all commented lines:
            if curLine[0] != "#": 
    
                if curLine[0] == "w":
                    cmdlist = curLine.split()
                    deviceAddress = "0x"+cmdlist[1]
                    regAddress = "0x"+cmdlist[2]
                    regValue = "0x"+cmdlist[3]
    
                    outString = "i2cset -y -f 0 "+deviceAddress+" "+regAddress+" "+regValue
                    print(outString)
    
                    prevDeviceAddress = deviceAddress
                    prevRegAddress = cmdlist[2]
                    
                    f.write(outString+"\n")
                elif curLine[0] == ">":
                    curVal = curLine.split()
                    curVal = "0x"+curVal[1]
                    # convert address to hex and add 1, then back to string
                    curRegAddress = format(int(prevRegAddress, 16)+1, "02x")
                    
                    outString = "i2cset -y -f 0 "+prevDeviceAddress+" 0x"+curRegAddress+" "+curVal
                    print(outString)
    
                    prevRegAddress = curRegAddress
    
                    f.write(outString+"\n")
    
    
            line = file.readline() #go to next line
    
        file.close()
    

    I hope reading through this code helps you understand better. 

    However, yes you can adjust the volume more directly with I2C - first you will need to choose the signal path, since you want to send analog inputs to analog outputs, this will be a type of bypass path. The most volume-adjustable and configurable path will be through the MAL/MAR paths, this stands for mixer amplifier left and right. The analog input goes through the PGA, where you can set the input gain, and then through the mixer amplifier, bypassing any digital conversion, where it can go to the line outputs, headphone outputs, or speaker out (in this example I showed the line outputs). The DAC output can be mixed in to any of these outputs as well, this is with your I2S input. I2S digital volume can be changed with register 65 on page 0.

    Does this look okay to you? Either option will involve register writes to change the volume - the miniDSP option involves register writes in miniDSP-only registers, which you can find in the "Component Interface" section when you click on the volume slider. The MAL/MAR path involves register writes where all registers will be mentioned in the datasheet. I can help write it out for you if you need some help there as well, but you will have to give more info about which inputs and outputs you are using (schematic will be helpful).

    Best,
    Mir