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.

88.2kHz HDMI audio output?

TI folks,

We have developed a product based on the DM814x, using:

  • DM814x PG 3.0
  • EZSDK 5.05.02.00
  • EZSDK OMX/HDVPSS Overlay 5.05.02.00
  • PSP 04.04.00.02
  • Most of the Arago updates for both linux and u-boot in ti81xx-master after the v2.6.37_TI81XXPSP_04.04.00.02.patch1 tag

I'm having some trouble altering the kernel to support HDMI audio with 88.2kHz sample rate.  I found the following:

  • arch/arm/plat-omap/hdmi_lib.c
    • need to set r=8 for IF_FS_88200 in IEC bits in hdmi_core_audio_config()
  • sound/soc/davinci/davinci-hdmi.c
    • add SNDRV_PCM_RATE_88200 to DAVINCI_HDMI_RATES
    • add line to audio_fs_n_list

But when I play, the 88200 still turns into 96000.  Is there somewhere else that needs an adjustment?  (I imagine some device driver alsa capabilities ....)

The documentation here:

http://processors.wiki.ti.com/index.php/DM81xx_AM38xx_Audio_Driver_User_Guide

seems to support the premise that the DM81xx can do 88.2k - but I'm having trouble translating the promise to reality.

Thanks,

Dan -

  • Update: I found one more place:

    • sound/soc/codecs/ti81xx_hdmi.c
      • add 88.2 to ti81xx_dai list

    So now 88.2k works!

    How about 176.4k and 192k?  The 192k is already supported by the hdmi files, but the McASP DAVINCI_MCASP_RATES list in sound/soc/davinci/davinci-mcasp.h only goes to 96k.  Is there a McASP limitation?

    (These speeds are listed in the DM814x TRM, table 2-23.)

    Dan -

  • Dan,

    It seems that HDMI audio driver supports only 192KHz by default (not 88.2KHz and 176.4KHz):

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_HDMI_Driver_User_Guide#TI81XX_HDMI_Audio_Support

    This section describes the features supported by ALSA SoC HDMI Audio driver

    Multiple sample rates support (32KHz, 44.1KHz, 48KHz, 96KHz and 192KHz )playback.

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_04.04.00.02_Feature_Performance_Guide#ALSA_SoC_HDMI_Audio_Driver

    The driver supports the following features:

    Multiple sample rates support (32KHz, 44.1KHz, 48KHz, 96KHz and 192KHz )playback

    See also the known HDMI audio issues:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_04.04.00.02_Release_Notes#Audio_2

    Regards,
    Pavel

  • Pavel,

    Thanks for responding.

    Yes, I already found and fixed the Audio Infoframe coding to comply with CEA-861, and added the missing IEC channel status cases, so it seems to be working.

    How about McASP, for the analog audio output?  Is there any reason why it was limited to 96k?

    Dan -

  • Dan,

    Daniel70334 said:
    How about McASP, for the analog audio output?  Is there any reason why it was limited to 96k?

    I think this is hardware limitation.

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_AUDIO_Driver_User_Guide#Setting_the_parameters_of_the_device

     /* Set sample rate. If the exact rate is not supported by the hardware, use nearest possible rate. */
      exact_rate = rate;
      if ((err = snd_pcm_hw_params_set_rate_near (playback_handle, hw_params, &exact_rate, 0)) < 0) {
        fprintf (stderr, "cannot set sample rate (%s)\n", snd_strerror (err));
        exit (1);
      }
    
      if (rate != exact_rate) {
        fprintf(stderr, "The rate %d Hz is not supported by your hardware.\n ==> Using %d Hz instead.\n", rate, exact_rate);
      }

    And this hardware limitation is caused by the audio codec used in the DM8148 TI EVM (TVL320AIC3106):

    The Audio codec used in DM814x/AM387x Base EVM is a TLV320AIC3106. It is a low-power stereo audio
    codec with stereo headphone amplifier, as well as codec with stereo headphone amplifier, as well as
    single-ended or fully differential configurations.
    The stereo audio DAC supports sampling rates from 8 kHz to 96 kHz and includes
    programmable digital filtering in the DAC path for 3D, bass, treble, midrange effects, speaker
    equalization, and de-emphasis for 32-kHz, 44.1-kHz, and 48-kHz rates.
    The stereo audio ADC supports sampling rates from 8 kHz to 96 kHz and is preceded by programmable 
    gain amplifiers or AGC that can provide up to 59.5-dB
    analog gain for low-level microphone inputs. A highly programmable PLL is included for flexible
    clock generation and support for all standard audio rates from a wide range of
    available MCLKs, varying from 512 kHz to 50 MHz.

    BR Pavel
  • Pavel,

    Our product does not use the TVL320AIC3106, it uses a different codec which goes up to 200k.

    So, to be clear, the DM814x McASP itself is not limited to 96k?

    Dan -

  • Dan,

    Daniel70334 said:

    Our product does not use the TVL320AIC3106, it uses a different codec which goes up to 200k.

    So, to be clear, the DM814x McASP itself is not limited to 96k?

    Yes, I think McASP is not limited to 96k, but to 192K. See what we have in DM814x McASP TRM:

    Features of the McASP include:
    • Two independent clock generator modules for transmit and receive.
    – Clocking flexibility allows the McASP to receive and transmit at different rates. For example, the McASP can receive data at 48 kHz but output up-sampled data at 96 kHz or 192 kHz.

    Receive data from a DVD at 48 kHz, but output up-sampled or decoded audio at 96 kHz or 192 kHz.
    This could be accomplished by inputting a high-frequency master clock (for example, 512 × receive FS), receiving with an internally-generated bit clock ratio of divide-by-8, and transmitting with an internally-generated bit clock ratio of divide-by-4 or divide-by-2.

    Also in source code, we have up to 192K:

    linux-kernel/include/sound/pcm.h

    #define SNDRV_PCM_RATE_96000        (1<<10)        /* 96000Hz */
    #define SNDRV_PCM_RATE_176400        (1<<11)        /* 176400Hz */
    #define SNDRV_PCM_RATE_192000        (1<<12)        /* 192000Hz */

    The AIC31x audio codec supports up to 96K, but other audio codecs (WM8580, WM8804, WM8728, WM8523, AK4104) support up to 192K:

    linux-kernel/sound/soc/codecs/tlv320aic3x.c

    #define AIC3X_RATES    SNDRV_PCM_RATE_8000_96000

    linux-kernel/sound/soc/codecs/wm8580.c

    .rates = SNDRV_PCM_RATE_8000_192000

    And the HDMI audio codec also supports up to 192K.

    For more information how to use different audio codec, see Audio.ppt available from the below wiki:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_AUDIO_Driver_User_Guide#FAQ

    BR
    Pavel

  • Hi Pavel,

    Pavel Botev said:

    Yes, I think McASP is not limited to 96k, but to 192K. See what we have in DM814x McASP TRM:

    Perfect, thanks.  I did indeed change DAVINCI_MCASP_RATES in  davinci-mcasp.h to SNDRV_PCM_RATE_8000_192000 to more correctly describe McASP range.  After that, McASP was no longer an impediment.

    Pavel Botev said:

    For more information how to use different audio codec, see Audio.ppt available from the below wiki:

    http://processors.wiki.ti.com/index.php/TI81XX_PSP_AUDIO_Driver_User_Guide#FAQ

    Thanks for the presentation.  The FAQ citing the presentation is about multi-channel audio support.  I want to ask more about this, but I will open up a new thread since its off-topic.

    Dan -