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.

PCM1864EVM, changing mode on Linux

Other Parts Discussed in Thread: PCM1864, PCM1864EVM, PCM1865

Hello,

is this possible to change mode using Linux?

The main target is to record all four channels with the use of a BeagleBone Black and save recorded file on a SD card. I know that USB to I2S and I2C can only transport 2 channels of audio over a single I2S to USB stream, so I want to send 2 channels over that and other 2 over I2C directly to BBB using J8 pins. In order to do that I need to change mode 0, on which the EVM is running after booting to mode 2. I also know, that GUI change registers upon switching modes, so is there any option to send commands, that respond to swtiching modes without the use of GUI?

Is this possible, or maybe there is a better solution?

  • Hello,

    It may be better to not try to use the GUI and I don't recommend using the GUI and BBB in combination

    You should be able to use the GUI to place the PCM1864 into the desired 2x2-ch I2S or 4xTDM mode of operation and then wire in the McASP/BSP port of the BBB to the Audio Serial Interface connections on the PCM1864EVM.  In this configuration, the EVM will configure the PCM1864 using the I2C interface and then the BBB will control the TDM audio serial interface to record the four channels of data.

    Note there are publicly upstreamed Linux drivers for the PCM1864 so the other option would be to do everything through the BBB.

    https://e2e.ti.com/support/audio/f/audio-forum/773056/faq-linux-drivers-device-drivers-for-aic31xx-dac31xx-aic325x-aic320x-aic326x-aic321x

  • Daniel,

    Let me add to Collin's response. All this configuration can be directly done on the BragleBone. The PCM1864 linux drivers for BeagleBone support a TDM mode configuration that allows the McASP of the Sitara (with DSP_A bus format) to receive more than two channels. Then you can use an arecord command with 4 ch:

    arecord -c 4 -f S16_LE -r 48000 -d 5 --device="hw:0,1" test.wav

    You will need to set the DTS to something similar to the following, where changes to the DTS depend on your configuration and connections:

    i2c0 {
          #address-cells = <1>;
          #size-cells = <0>;
          pcm1865: pcm1865@4a {
            compatible = "ti,pcm1865";
            #sound-dai-cells = <0>;
                reg = <0x4a>;
                avdd-supply = <&reg_3v3_analog>;
                dvdd-supply = <&reg_3v3>;
                iovdd-supply = <&reg_1v8>; };
        };
    };
     
    sound {
        compatible = "simple-audio-card";
        simple-audio-card,name = "TI BeagleBone Black";
        /*
         * you might need to add:
         * simple-audio-card,widgets
         * simple-audio-card,routing
         */
     
         simple-audio-card,dai-link@0 {
            format = "dsp_a";
            bitclock-master = <&sound0_0_master>;
            frame-master = <&sound0_0_master>;
            sound0_0_master: cpu {
                sound-dai = <&mcasp0>;
                clocks = <&clk_mcasp0>;
                dai-tdm-slot-num = <8>;
                dai-tdm-slot-width = <32>;
                dai-tdm-slot-tx-mask = <1 1 1 1>;
                dai-tdm-slot-rx-mask = <1 1 1 1>;
            };
     
            codec {
                sound-dai = <&ti,pcm1865 0>;
                dai-tdm-slot-num = <8>;
                dai-tdm-slot-width = <32>;
                dai-tdm-slot-tx-mask = <1 1 1 1>;
                dai-tdm-slot-rx-mask = <1 1 1 1>;
            };
        };
    };
    The following application notes walk you through setting these parameters and provide more detailed information: