This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM816x audio encoding on DSP: wrong timing (too slow) for 32 bit PCM input (S32_LE)

Expert 1935 points

Hello,

My OMX application captures & encodes audio (48kHz, stereo 32bit pcm) using the DSP.

When capturing direclty from an alsa device (using snd_pcm_readi, blocking reads) the result is slowed down:

When using a 16 bit PCM file for input, everything is encoded fine, when using  a 32bit PCM file for input, it's slowed down.

Does the codec support 32 bit?

The AAClcenc datasheet & manual list no limitation to 16 bit.

This is my codec config:

    debug_printf ("aenc set input format (pcm)\n");//input
    OMX_INIT_PARAM(&pcm_mode);
    pcm_mode.nPortIndex = OMX_AUDENC_INPUT_PORT;
    OMX_GetParameter(aenc, OMX_IndexParamAudioPcm, &pcm_mode);
    pcm_mode.nChannels = channels;
    pcm_mode.nSamplingRate = samplerate;
    pcm_mode.eNumData = OMX_NumericalDataSigned;
    pcm_mode.eEndian = OMX_EndianLittle;
    pcm_mode.bInterleaved = 1;//bool
    pcm_mode.nBitPerSample = 32;
    pcm_mode.ePCMMode = OMX_AUDIO_PCMModeLinear;
    eError = OMX_SetParameter(aenc, OMX_IndexParamAudioPcm, &pcm_mode);
    if(eError != OMX_ErrorNone) return eError;

    debug_printf ("aenc set output format\n");//output
    OMX_INIT_PARAM(&aac_mode);
    aac_mode.nPortIndex = OMX_AUDENC_OUTPUT_PORT;
    OMX_GetParameter(aenc, OMX_IndexParamAudioAac, &aac_mode);
    aac_mode.nBitRate = bitrate;
    if(format==1) aac_mode.eAACStreamFormat = OMX_AUDIO_AACStreamFormatRAW;
    else if(format==2) aac_mode.eAACStreamFormat = OMX_AUDIO_AACStreamFormatMP4ADTS;
    else aac_mode.eAACStreamFormat = OMX_AUDIO_AACStreamFormatADIF;
    eError = OMX_SetParameter(aenc, OMX_IndexParamAudioAac, &aac_mode);
    if(eError != OMX_ErrorNone) return eError;

channels = 2, samplerate 48000, bitrate 192000.

Best regards,

Lo2

  • Hello,

    Here is the Supported Services and Features for aaclcenc:
    This user guide accompanies TI’s implementation of AAC Encoder on the
    C674x platform.
    This version of the codec has the following supported features:
    eXpressDSP Digital Media v1.0 (XDM 1.0 IAUDENC1) compliant
    Supports only 16-bit PCM samples as input.
    Supports only constant Bit-Rate (CBR) encoding
    Supports input sampling frequencies from 16 kHz to 48 kHz for mono
    and stereo input files.
    Supports input sampling frequencies from 32 kHz to 48 kHz for
    multichannel input files.
    Supports only AAC-LC output format
    Supports mono, stereo, 5 channel and 6 channel input files.
    Supports maximum of six channels including LFE.
    Supports bit-rates based on sampling frequency, audio object type and
    number of channels
    Supports Audio Data Interchange Format (ADIF), Audio Data Transport
    Stream (ADTSand raw output format.
    Compliant with the ISO/IEC 14496-3 (MPEG 4 AAC) and ISO/IEC
    13818-7 (MPEG 2-AAC) standards

    Best Regards,

    Margarita

  • Hi,

    I copied 32 to 16 bit, works fine.

    Thanks,

    Lo