LC3 codec with 24-bit PCM

Hi, I'm hoping someone could advise on interfacing with the T2 LC3 codec included in nRF Connect.

The context is I have stereo I2S microphones providing 24-bit 2's complement PCM audio streams, which are to be encoded and decoded via the LC3 codec.

The API suggests 24-bit data should use a buffer with 3-bytes per sample. Therefore my approach is to provide a [3 * N] bytes buffer of PCM data, aligned on the 24th bit assuming the codec will parse this correctly when initialised with a 'bits per sample' of 24.

Using this method, I would expect the decoder to output similar PCM values as the input, however instead I get values with seemingly no correlation at all, so I'm not sure if I'm either making a false assumption about the codec's interface for 24 bit samples, or if they're not actually supported within the implementation.

I've tried configuring the codec for 32-bit, and simply feeding in in the 24-bit value with an ( << 8) bit shift, which is the non-adjusted output from the I2S driver running in 24in32 mode. When I do this, I do get a value which looks similar and consistent, and produces an audible response in playback - but the audio is very noisy and I think this is because the codec should be configured for 24-bit resolution.

Can anyone offer some insight? Thanks.

Parents
  • Hi, 

    There is a parameter to set bitDepth. Not sure if you are using the LC3 directly or if you are going through our application, because we removed support for 24 bit I2S since we are having issues with the clock divisions. In any case our application is set to default use 16 bit. Also note that the T2 implementation of LC3 only use 16 bit to encode, meaning you mask out all the upper bits if given 24 or 32 bits. It does support 24 bit, but the information is lost.

    Regards,
    Amanda H.

Reply
  • Hi, 

    There is a parameter to set bitDepth. Not sure if you are using the LC3 directly or if you are going through our application, because we removed support for 24 bit I2S since we are having issues with the clock divisions. In any case our application is set to default use 16 bit. Also note that the T2 implementation of LC3 only use 16 bit to encode, meaning you mask out all the upper bits if given 24 or 32 bits. It does support 24 bit, but the information is lost.

    Regards,
    Amanda H.

Children
Related