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.

DMAI Sound Data Size

Other Parts Discussed in Thread: OMAP-L137

How does one configure the data size for the Sound module in DMAI?  Specifically, how does one specify 16-bit data vs 32-bit data?

I believe this is a general DMAI question, but specifically this would be for DM6467 using DVSDK 3.10 beta (i.e. DMAI 2.10.00.06).

Thanks,
Brad

  • Brad,

    DMAI is hard coded to work with 16-bit data mainly because our audio codecs supports outputing 16-bit data only and i was curious on why you need 32-bit data. Anyway you can always modify DMAI for your need,  See below comment in DMAI code (linux/Sound_alsa.c).

        /* Set the format to 16 bit little endian */

        status = snd_pcm_hw_params_set_format(rc, hwParams, SND_PCM_FORMAT_S16_LE);

        if (status < 0) {

            Dmai_err2("Failed to set sample format on %s (%s)\n",

                      AUDIO_DEVICE, snd_strerror(status));

            return Dmai_EFAIL;

        }

    Note that if hw (or driver) does not support 32-bit data format then alsa will use it software transformation routine to convert 32 bit  to 16-bit before playing the output.

     

    Thanks
    Brijesh

  • Hi Brijesh,

    Thanks for the info.  I had not considered that audio codecs (AAC, mp3, etc).  I just had a quick look at some of those datasheets and I see what you mean about the 16-bit data.  For example in the case of the AAC encoder it had a note saying it could accept 32-bit data but internally would only utilize the 16 most significant bits.

    In my particular case it probably makes the most sense to only use 16 of the 24 bits of data the external converter can provide.  Hoever, I imagine there could be cases where someone might want greater precision.  For example if I was making a pro audio mixing board then I might be implementing algorithms where I want greater than 16-bit precision.  In that case I probably would be using something more like OMAP-L137 not DM6467!  :)

    In any case, I'm glad to know where that could be changed.  Thanks.

    Brad

  • Brad,

    Glad it helped. 

    As you have noticed  most of DMAI modules (Sound, Capture, Display) provides a simple set of operation to demonstrate on how to use the standard interfaces (ALSA, V4l2, etc) and  there  will be many application uses cases where DMAI will not fit and for those case application developer must use the standard interface API's. e,g ALSA  lib has 50+  API's ( http://www.alsa-project.org/alsa-doc/alsa-lib/ ) and providing DMAI options for all those API's will be very confusing and complicated.  

    Just to give you another view, in gstreamer we didn't use DMAI Sound module for audio output instead we use standard gstreamer audio sinks etc because DMAI simply does not provide all the options we needed for converting audio from 32-bit to 16-bit and more. 

    Thanks

    Brijesh

  • Brijesh,

    I am looking for the detail data structure for the DMAI Buffer_Handle.  I wan to extract the buffer in the hBufIn structure from the "Sound_read( hSound, hBufIn )", process the it and then append  the result back to the hBufOut to send it into "Sound_write( hSound, hBufOut );"   Would you know which file defines this structure?

    Also I don't see any DOC directory under my  ~/ti-dvsdk_omap3530-evm_4_00_00_17/dmai_2_05_00_18 directory.  Where can I find technical documentation for the DMAI function calls and their data structures?

    Move the post to this link:

    http://e2e.ti.com/support/embedded/linux/f/354/t/199671.aspx

    Regards,

    Sy