Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
zsilet
Level 1
Level 1
First solution authored 5 sign-ins First reply posted

Dear Infineon team,

I am trying to capture the raw data from four I2S microphones running with the CYW943907AEVAL1F (not planning to use a codec). I am using the API within wiced_audio.h (simplified code sample below), and would like to set up both I2S buses for receive. Looking at the API, I was assuming that I can use device IDs AUDIO_DEVICE_ID_I2S_0_ADC / AUDIO_DEVICE_ID_I2S_1_ADC to achieve this, but I have had no luck so far. In order to keep things simple, I have tried to get only one channel running first, with the following results (when calling wiced_audio_init()):

  • AUDIO_DEVICE_ID_I2S_0_ADC - all setup succeeds, but mclk(J6.3)/bclk(J6.5)/lrclk(J6.6) lines do not toggle
  • AUDIO_DEVICE_ID_I2S_1_ADC - all setup succeeds, but mclk(J6.26)/bclk(J6.29)/lrclk(J6.27) lines do not toggle
  • AUDIO_DEVICE_ID_SPDIF_ADC - all setup succeeds, mclk(J6.3)/bclk(J6.5)/lrclk(J6.6) lines DO toggle
  • AUDIO_DEVICE_ID_SPDIF_DAC - wiced_audio_init returns failure

Is there anything obvious I am missing in the way I am attempting to set up the I2S subsystem? This is my first foray into the WICED SDK and this chipset, so it is quite possible that I am missing something very basic.

I am using WICED Studio because MODUS Toolbox does not seem to support WiFi Direct (which my project also requires). From my forum searches, it seems WICED Studio SDK 6.x has stripped out previously available (SDK 5.x) audio examples, and all the download links to the 5.x version of the SDK seem to be broken, so I am a bit at wits end.

I appreciate any help/direction.

My project submake has

  • GLOBAL_DEFINES += WICED_USE_AUDIO

My project application file is as follows:


// #define AUDIO_DEVICE AUDIO_DEVICE_ID_I2S_0_ADC // Does not activate any clock lines
// #define AUDIO_DEVICE AUDIO_DEVICE_ID_I2S_1_ADC // Does not activate any clock lines
#define AUDIO_DEVICE AUDIO_DEVICE_ID_SPDIF_ADC // Activates I2S_1 clock lines
// #define AUDIO_DEVICE AUDIO_DEVICE_ID_SPDIF_DAC // wiced_audio_init() returns failure


wiced_audio_session_ref mic_pair_1;
void application_start(void)
{
    wiced_init();

    /* The following call registers the I2S/SPDIF Audio devices */
    if (platform_init_audio() != WICED_SUCCESS)
    {
        WPRINT_APP_INFO(("platform_init_audio FAILED\n"));
    }

    memset(&mic_pair_1, 0, sizeof(wiced_audio_session_ref));
    if (wiced_audio_init(AUDIO_DEVICE_ID_I2S_0_ADC, &mic_pair_1, WICED_AUDIO_DEVICE_PERIOD_SIZE) != WICED_SUCCESS)
    {
        WPRINT_APP_INFO(("wiced_audio_init FAILED\n"));
    }

    if (wiced_audio_create_buffer(mic_pair_1, WICED_AUDIO_DEVICE_PERIOD_SIZE * 2, NULL, NULL) != WICED_SUCCESS)
    {
        WPRINT_APP_INFO(("wiced_audio_create_buffer FAILED\n"));
    }

    wiced_audio_config_t config;
    // config.period_size     = WICED_AUDIO_DEVICE_PERIOD_SIZE; /* Default set in wiced_audio.h */
    config.sample_rate     = 16000; /* See i2s_pll_config for list of all possible sample rates*/
    config.bits_per_sample = 16;    /* Assuming this is Data Bits, between 8-32, default 16. */
    config.channels        = 2;
    config.frame_size      = (config.bits_per_sample * config.channels) / 8;
    config.volume          = 100; /* Percent attenuation */
    if (wiced_audio_configure(mic_pair_1, &config) != WICED_SUCCESS)
    {
        WPRINT_APP_INFO(("wiced_audio_configure FAILED\n"));
    }

    if (wiced_audio_start(mic_pair_1) != WICED_SUCCESS)
    {
        WPRINT_APP_INFO(("wiced_audio_start FAILED\n"));
    }
    WPRINT_APP_INFO(("Audio started\n"));
}


 

0 Likes
1 Solution
zsilet
Level 1
Level 1
First solution authored 5 sign-ins First reply posted

Just to close this out, with a few tweaks to the wised_audio and platform_audio files, I now have everything running properly. 

View solution in original post

0 Likes
3 Replies
Murali_R
Moderator
Moderator
Moderator
250 sign-ins 250 replies posted 100 solutions authored

WiFi Audio support has been discontinued. Please get in touch with local sales/marketing for further information.

0 Likes
zsilet
Level 1
Level 1
First solution authored 5 sign-ins First reply posted

Thank you for your response. You mention "WiFi Audio support" has been discontinued. I am not sure what WiFi Audio support specifically encompasses, but I am simply trying to use the I2S interface and get the data out of the DMA buffers. 

Even though some support has been discontinued, as you mention, I would like to ask whether there is any existing documentation that describes the I2S registers and settings for this SoC. The information in the CYW43907 data sheet is very scarce, and the only other document I have found (https://www.infineon.com/dgdl/Infineon-Component_I2S_V2.40-Software%20Module%20Datasheets-v02_07-EN....) seems to be for the PSOC SDK, which from what I gather is not an exact match for the CYW43907.

In the days since I posted this question, I have noticed that by enabling SPDIF mode, I can indeed get the I2S clock/word lines to toggle, and thus get the MICs to flow data to the SoC. Plotting the data captured via a logic analyzer, I have verified that a 1K tone played to the mics is indeed creating the appropriate PCM data flow to the processor. That said, the data that appears in the DMA buffer on the SoC looks nothing like the data that was fed to the chip. This progress gives me some hope, but I could definitely use some additional documentation, if available. 

0 Likes
zsilet
Level 1
Level 1
First solution authored 5 sign-ins First reply posted

Just to close this out, with a few tweaks to the wised_audio and platform_audio files, I now have everything running properly. 

0 Likes