Stereo output from the headset in nRF5340 Audio CIS mode

Currently, I'm using nRF5340 Audio on a homemade board, and I've managed to get the sound input from the gateway as a LINE input and the sound coming out of the headset, but the sound only comes out of the headset in mono.

I want to get stereo output from the headset in nRF5340 Audio CIS mode, but what should I set and how?

Parents
  • Additional information.
    The I2S bit length is 16 bits on the gateway side and 32 bits on the headset side.

  • Hi,

    Junichi said:
    The I2S bit length is 16 bits on the gateway side and 32 bits on the headset side.

    Can you elaborate on this?

    Documentation has a Note which describes that "the audio outputs only to the left channel of the audio jack, even if the given headset is configured as the right headset. This is because of the mono hardware codec chip used on the development kits. If you want to play stereo sound using one development kit, you must connect an external hardware codec chip that supports stereo." There is also nrf5340 stereo audio output discussion which could be useful.

    Best regards,
    Dejan

  • I am using nRF5340 Audio source and developing it on a homemade board instead of nRF5340 Audio DK.

    Both the gateway and headset use stereo hardware codecs.

    I have confirmed that the I2S signal on the gateway side has waveforms on both L/R channels, but the I2S signal on the headset side only has a waveform on the L channel.

    The I2S settings on the headset side are:
    static nrfx_i2s_config_t cfg = {
    .skip_gpio_cfg = true,
    .skip_psel_cfg = true,
    .irq_priority = DT_IRQ(I2S_NL, priority),
    .mode = NRF_I2S_MODE_MASTER,
    .format = NRF_I2S_FORMAT_I2S,
    .alignment = NRF_I2S_ALIGN_LEFT,
    .ratio = NRF_I2S_RATIO_256X,
    .mck_setup = 0xAAAAA000,
    .channels = NRF_I2S_CHANNELS_STEREO,
    .clksrc = NRF_I2S_CLKSRC_ACLK,
    .enable_bypass = true,
    .sample_width = NRF_I2S_SWIDTH_32BIT,
    };
    The I2S settings on the Gateway side are as follows.
    static nrfx_i2s_config_t cfg = {
    .skip_gpio_cfg = true,
    .skip_psel_cfg = true,
    .irq_priority = DT_IRQ(I2S_NL, priority),
    .mode = NRF_I2S_MODE_MASTER,
    .format = NRF_I2S_FORMAT_I2S,
    .alignment = NRF_I2S_ALIGN_LE FT,
    .ratio = NRF_I2S_RATIO_256X,
    .mck_setup = 0x66666000,
    .channels = NRF_I2S_CHANNELS_STEREO,
    .clksrc = NRF_I2S_CLKSRC_ACLK,
    .enable_bypass = true,
    .sample_width = NRF_I2S_SWIDTH_16BIT,
    };
    prj_release.conf for Gateway and Headset is
    # nRF5340 Audio
    CONFIG_NRF5340_AUDIO=y CONFIG_TRANSPORT_BIS=n CONFIG_TRANSPORT_CIS=y CONFIG_STREAM_BIDIRECTIONAL=y CONFIG_AUDIO_SOURCE_USB=y CONFIG_AUDIO_SOURCE_I2 S=n CONFIG_BOARD_ENABLE_DCDC_APP=n CONFIG_BOARD_ENABLE_DCDC_NET=n CONFIG_AUDIO_BIT_DEPTH_32=y CONFIG_AUDIO_SAMPLE_RATE_48000_HZ=y CONFIG_AUDIO_DEV=1 # General
    CONFIG_DEBUG=n
    CONFIG_ASSERT=n
    CONFIG_STACK_USAGE=n
    CONFIG_THREAD_MONITOR=n
    CONFIG_SERIAL=n
    CONFIG_CONSOLE=n
    CONFIG_PRINTK=n
    CONFIG_UART_CONSOLE=n
    CONFIG_BOOT_BANNER=n
    I2S is set to stereo on both.
    Please let me know the settings you made when building and the changes you made to the source code.

Reply
  • I am using nRF5340 Audio source and developing it on a homemade board instead of nRF5340 Audio DK.

    Both the gateway and headset use stereo hardware codecs.

    I have confirmed that the I2S signal on the gateway side has waveforms on both L/R channels, but the I2S signal on the headset side only has a waveform on the L channel.

    The I2S settings on the headset side are:
    static nrfx_i2s_config_t cfg = {
    .skip_gpio_cfg = true,
    .skip_psel_cfg = true,
    .irq_priority = DT_IRQ(I2S_NL, priority),
    .mode = NRF_I2S_MODE_MASTER,
    .format = NRF_I2S_FORMAT_I2S,
    .alignment = NRF_I2S_ALIGN_LEFT,
    .ratio = NRF_I2S_RATIO_256X,
    .mck_setup = 0xAAAAA000,
    .channels = NRF_I2S_CHANNELS_STEREO,
    .clksrc = NRF_I2S_CLKSRC_ACLK,
    .enable_bypass = true,
    .sample_width = NRF_I2S_SWIDTH_32BIT,
    };
    The I2S settings on the Gateway side are as follows.
    static nrfx_i2s_config_t cfg = {
    .skip_gpio_cfg = true,
    .skip_psel_cfg = true,
    .irq_priority = DT_IRQ(I2S_NL, priority),
    .mode = NRF_I2S_MODE_MASTER,
    .format = NRF_I2S_FORMAT_I2S,
    .alignment = NRF_I2S_ALIGN_LE FT,
    .ratio = NRF_I2S_RATIO_256X,
    .mck_setup = 0x66666000,
    .channels = NRF_I2S_CHANNELS_STEREO,
    .clksrc = NRF_I2S_CLKSRC_ACLK,
    .enable_bypass = true,
    .sample_width = NRF_I2S_SWIDTH_16BIT,
    };
    prj_release.conf for Gateway and Headset is
    # nRF5340 Audio
    CONFIG_NRF5340_AUDIO=y CONFIG_TRANSPORT_BIS=n CONFIG_TRANSPORT_CIS=y CONFIG_STREAM_BIDIRECTIONAL=y CONFIG_AUDIO_SOURCE_USB=y CONFIG_AUDIO_SOURCE_I2 S=n CONFIG_BOARD_ENABLE_DCDC_APP=n CONFIG_BOARD_ENABLE_DCDC_NET=n CONFIG_AUDIO_BIT_DEPTH_32=y CONFIG_AUDIO_SAMPLE_RATE_48000_HZ=y CONFIG_AUDIO_DEV=1 # General
    CONFIG_DEBUG=n
    CONFIG_ASSERT=n
    CONFIG_STACK_USAGE=n
    CONFIG_THREAD_MONITOR=n
    CONFIG_SERIAL=n
    CONFIG_CONSOLE=n
    CONFIG_PRINTK=n
    CONFIG_UART_CONSOLE=n
    CONFIG_BOOT_BANNER=n
    I2S is set to stereo on both.
    Please let me know the settings you made when building and the changes you made to the source code.

Children
No Data
Related