Skip to content

Commit

Permalink
applications: nrf5340_audio: Define channel_mode for decoder on bidir gw
Browse files Browse the repository at this point in the history
Fix bug where gateway got error
"Unsupported number of channels"
when doing bidir.

Signed-off-by: Erik Robstad <[email protected]>
  • Loading branch information
Erik Robstad authored and cvinayak committed Nov 23, 2023
1 parent d1fd7e8 commit c50484f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions applications/nrf5340_audio/src/audio/audio_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ static void audio_gateway_configure(void)
#if (CONFIG_STREAM_BIDIRECTIONAL)
sw_codec_cfg.decoder.enabled = true;
sw_codec_cfg.decoder.num_ch = 1;
sw_codec_cfg.decoder.channel_mode = SW_CODEC_MONO;
#endif /* (CONFIG_STREAM_BIDIRECTIONAL) */

if (IS_ENABLED(CONFIG_SW_CODEC_LC3)) {
Expand Down
6 changes: 4 additions & 2 deletions applications/nrf5340_audio/src/audio/sw_codec_select.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ int sw_codec_encode(void *pcm_data, size_t pcm_size, uint8_t **encoded_data, siz
break;
}
default:
LOG_ERR("Unsupported number of channels: %d", m_config.encoder.num_ch);
LOG_ERR("Unsupported channel mode for encoder: %d",
m_config.encoder.channel_mode);
return -ENODEV;
}

Expand Down Expand Up @@ -183,7 +184,8 @@ int sw_codec_decode(uint8_t const *const encoded_data, size_t encoded_size, bool
break;
}
default:
LOG_ERR("Unsupported number of channels: %d", m_config.encoder.num_ch);
LOG_ERR("Unsupported channel mode for decoder: %d",
m_config.decoder.channel_mode);
return -ENODEV;
}

Expand Down

0 comments on commit c50484f

Please sign in to comment.