7 Replies Latest reply on Nov 30, 2016 4:07 AM by francescoaru

    External I2S wm8958 audio codec information

    doumdi

      Hi,

       

      In the the new Intel® Edison Products — Audio Setup Guide,  there is information about the wm8958 external audio codec. I found in the kernel code that the default implementation should use I2C-1. However, there is no guidelines on how to connect the codec to the Edison board in the guide.


      Right now, I am using a CP2114 usb to I2S bridge and a TI TLV320AIC3104 codec with the Edison platform. I was hoping to connect the TLV320AIC3104 directly to the Edison's I2S port, but it seems this would require more kernel work than I thought. 


      I would like to know if somebody was successful at connecting the the wm8958 codec and maybe share (I2S/Audio part of) the schematics and some tips?


      Thanks for your help!


      Dominic

        • 1. Re: External I2S wm8958 audio codec information
          Intel_Alvarado

          Hi,

           

          We will investigate on this. We will let you know when we find some useful information.

           

          Sergio

          • 2. Re: External I2S wm8958 audio codec information
            SergeyK

            Please check my post here: Intel Edison - I2S Audio Setup

             

            I connected a simpler WM8731 codec. As far as support in Linux there are two options:


            1. Write a machine driver for your codec. You can use the WM8958 code provided in Edison's firmware source code as an example.

            2. If your codec can be programmed to work with DSP Mode B / 24 bit / 48000 samples per second / 4 slot TDM format, you might be able to configure your codec directly using a set of i2cset commands, similar to what I've described in my blog. And then use the "dummy" codec supplied with Edison firmware.

            • 3. Re: External I2S wm8958 audio codec information
              doumdi

              Il will give it a try with the TI TLV320AIC3104 codec. Option #2 is simple enough to get it working quickly. I will then write the machine driver if it works. I will keep you informed of my findings.

               

              Thanks for the help.


              Dominic

              • 4. Re: External I2S wm8958 audio codec information
                rpress

                I am also trying to get I2S working on the Edison.  The solution that SergeyK posted is not quite I2S, it's PCM (or "DSP") mode.  This mode uses frame sync instead of an LR clock and the timing is different.  I2S only DACs won't work with this.

                 

                I have modified the kernel driver to engage I2S mode.  I was able to successfully change the LRCLK to something reasonable, but I cannot get the SoC DSP inside the Edison to I2S mode.  When I try, this is what I see in the kernel log:

                 

                [   34.121173] snd_intel_sst: runtime_resume called

                [   34.142431] snd_intel_sst: FW Version 01.09.00.02

                [   34.142457] snd_intel_sst: Build date Jan 14 2014 Time 20:08:46

                [   34.142716] snd_intel_sst: Alloc for str 1 pipe 0x90

                [   34.193469] snd_intel_sst: Start for str 1 pipe 0x90

                [   80.709771] snd_intel_sst: Stop for str 1 pipe 0x90

                [   80.710663] snd_intel_sst: Free for str 1 pipe 0x90

                [   81.703240] snd_intel_sst: sst: Wait timed-out condition:0x0, msg_id:0x1 fw_state 0x2

                [   81.703981] snd_intel_sst: Audio: Intel SST engine encountered an unrecoverable error

                [   81.704081] snd_intel_sst: Audio: trying to reset the dsp now

                 

                As far as I can tell the SoC DSP is a Tensilica Xtensa, using the "fw_sst_119a.bin" firmware.  Maybe there is a newer firmware that supports I2S mode?

                • 5. Re: External I2S wm8958 audio codec information
                  SergeyK

                  The DSP configuration stuff is in linux/sound/soc/intel/platform-libs/controls_v2_dpcm.c

                   

                  Here specifically:

                  static const struct sst_ssp_config

                  sst_ssp_configs[SST_NUM_SSPS][SST_MAX_SSP_MUX][SST_MAX_SSP_DOMAINS] = {

                  ...

                          [SST_SSP2] = {

                                  [SST_SSP_CODEC_MUX] = {

                                          [SST_SSP_CODEC_DOMAIN] = {

                                                  .ssp_id = SSP_CODEC,

                                                  .bits_per_slot = 24,

                                                  .slots = 4,

                                                  .ssp_mode = SSP_MODE_MASTER,

                                                  .pcm_mode = SSP_PCM_MODE_NETWORK,

                                                  .duplex = SSP_DUPLEX,

                                                  .ssp_protocol = SSP_MODE_PCM,

                                                  .fs_width = 1,

                                                  .fs_frequency = SSP_FS_48_KHZ,

                                                  .active_slot_map = 0xF,

                                                  .start_delay = 0,

                                          },

                                  },

                          },

                  };

                   

                  Try changing .ssp_protocol = SSP_MODE_PCM to .ssp_protocol = SSP_MODE_I2S and .slots = 4 to .slots = 2, depending on your codec you also might need to update the .bits_per_slot value

                  • 6. Re: External I2S wm8958 audio codec information
                    rpress

                    I have tried that.  When I set "ssp_protocol = SSP_MODE_I2S" I get the kernel error I posted above "snd_intel_sst: sst: Wait timed-out condition:0x0, msg_id:0x1 fw_state 0x2".  I have tried numerous different settings but anything with SSP_MODE_I2S gets that error and doesn't work.

                     

                    I believe the below should work, but doesn't.

                     

                            [SST_SSP2] = {

                                    [SST_SSP_CODEC_MUX] = {

                                            [SST_SSP_CODEC_DOMAIN] = {

                                                    .ssp_id = SSP_CODEC,

                                                    .bits_per_slot = 24,

                                                    .slots = 2,

                                                    .ssp_mode = SSP_MODE_MASTER,

                                                    .pcm_mode = SSP_PCM_MODE_NORMAL,

                                                    .duplex = SSP_DUPLEX,

                                                    .ssp_protocol = SSP_MODE_I2S,

                                                    .fs_width = 24,

                                                    .fs_frequency = SSP_FS_48_KHZ,

                                                    .active_slot_map = 0x3,

                                                    .start_delay = 1,

                                            },

                                    },

                            },

                    • 7. Re: External I2S wm8958 audio codec information
                      francescoaru

                      Hi,

                      sorry if I post in a old thread.

                      Has someone got I2S working on Edison SSP2?

                      Has Intel disclosed some useful info?

                       

                      Regards,

                       

                      Francesco