MME Support for Texas Instruments ADE

This document describes how to set up the MME ADE (Audio Decoder Engine) to work with the Texas Instruments ADE. The Texas Instruments ADE supports decoding of files in WMA9, AAC, MP3, PCM and WAV formats. It runs on the Texas Instruments Jacinto EVM.

Overview

When your system uses the ADE, a writer in the MME sends the compressed format to the ADE running on the DSP for decoding. The decoded PCM is then sent directly from the DSP to one of the three DACs on the Jacinto EVM.

For more information about the MME, see the Introduction to the MME, and the MME Developer's Guide. For more information about the Texas Instruments ADE, see the documentation provided by the manufacturer.

Requirements

The Texas Instruments ADE release package contains the following required items:

The dsplink 1.40.05 package contains:

The dsplink 1.61 package contains:

You must also ensure that your installation of io-media-generic includes ade3_writer.so. This writer is only available for ARMLE targets.

Version compatibility

The tables below shows component compatibility, and where components can be obtained. Component versions listed in a table are compatible only with other components listed in the same table:

MME 1.1 with dsplink 1.40.05 patch 3.0

The table below lists the components required for the MME 1.1 with dsplink 1.40.05 patch 3.0.

Component Version Availability
dsplink 1.40.05 patch 3.0 Foundry27 — BSPs
ade3_writer.so Compiled for dsplink 1.40.05 patch 3.0. Foundry27 — included in MME 1.1
TI ADE 1.01.00 — compiled for dsplink 1.40.05 patch 3.0. Request from Texas Instruments.

MME 1.1 with dsplink 1.40.05 patch 3.3

The table below lists the components required for the MME 1.1 with dsplink 1.40.05 patch 3.3.

Component Version Availability
dsplink 1.40.05 patch 3.3 Foundry27 — BSPs
ade3_writer.so Compiled for dsplink 1.40.05 patch 3.3. Request from QNX.
TI ADE 1.01.03 — compiled for dsplink 1.40.05 patch 3.3. Request from Texas Instruments.

MME 1.1 with dsplink 1.61

The table below lists the components required for the MME 1.1 with dsplink 1.61.

Component Version Availability
dsplink 1.61 Foundry27 — BSPs
ade3_writer.so Compiled for dsplink 1.61. Request from QNX.
TI ADE 1.02.02 — compiled for dsplink 1.61. Request from Texas Instruments.

MME 1.2 with dsplink 1.61

The table below lists the components required for the MME 1.2 with dsplink 1.61.

Component Version Availability
dsplink 1.61 Foundry27 — BSPs
ade3_writer.so Compiled for dsplink 1.61. Foundry27 — included in MME 1.2
TI ADE 1.02.02 — compiled for dsplink 1.61. Request from Texas Instruments.

The QNX Foundry27 web site is at: www.foundry27.com.

Installation

Installation of the ADE requires the following tasks:

For installation instructions, see the dsplink project Installation Notes on Foundry27.

Build the dsplink resource manager

To build the dsplink resource manager:

  1. For dsplink 1.40.05 only, replace the QNX CFG_Jacinto.c found in /lib/dsplink14005/config/all/ with the Texas Instruments CFG_Jacinto.c from the 64M directory.
    For dsplink 1.6n only, replace the CFG_ARM.c and CFG_DRA44XGEM_SHMEM.c files in lib/dsplink160/config/all/ with the configuration files from the Texas Instruments release package.
  2. For all dsplink versions, build the following to create the dsplink resource manager:

This build changes the ARM/DSP memory split.

Build the Jacinto image

To build the Jacinto image:

  1. Ensure that the build has the 64-megabyte memory configuration for dsplink, by commenting out the default configuration line:
    #Startup for dsplink config 8M ---CURRENT DEFAULT---
    #startup-jacinto -L 0x67800000,0x800000 -vvvvv
    
    

    and uncommenting the line for the 64-megabyte memory configuration:

    #Startup for dsplink config 64M
    startup-jacinto  -L 0x64000000,0x4000000 -vvvv
  2. Initialize the drivers — most of this information is also available in the documentation supplied by Texas Instruments with the ADE release:
    i2c-dm6446 -p0x01C21000 -i39
    waitfor /dev/i2c0
    i2c-dm6446 -p0x01C21800 -i41 --u 2
    waitfor /dev/i2c2
    spi-master -d dra446 base=0x01c24c00,irq=37,edmairq=0xc128,edmachannel=40,edma=1
    waitfor /dev/spi0
    regaccess -v0xE08cc5F1 -p0x01C48100 -l32
    regaccess -v0x114cc450 -p0x01C48104 -l32
    regaccess -v0x022aa02f -p0x01C48108 -l32
    regaccess -v0xffffffff -p0x01c4800c -l32
    regaccess -v0x0F000000 -p0x01C48034 -l32
    regaccess -v0x00000018 -p0x01C4812C -l32
    regaccess -v0x12       -p0x18000020 -l32
    regaccess -v0x12       -p0x18001020 -l32
    Audio_init -v
  3. Start dsplink:
    /proc/boot/dsplink &
    waitfor /dev/dsplink
  4. Load the DSP image:
    loaddspimage /proc/boot/audio_app.out &
  5. Make sure the following binaries are available to the system:

Modify the MME for Jacinto

To modify the MME for Jacinto support, do the following:

  1. Modify the mme_data.sql file to not use the default configuration by commenting out the following lines, as shown below:
    -- This example configures one output device in one zone, for one control context
    --INSERT INTO outputdevices(type, permanent, name, devicepath)
    --    VALUES(1, 1, 'defaultoutput', '/dev/snd/pcmC0D1p');
    --INSERT INTO zones(zoneid, name) SELECT 1, 'defaultzone';
    --INSERT INTO zoneoutputs(zoneid, outputdeviceid)
    --    SELECT 1, outputdeviceid FROM outputdevices
    --    WHERE name='defaultoutput';
    --INSERT INTO renderers(path) VALUES('/dev/io-media');
    --INSERT INTO controlcontexts(zoneid, rendid, name)
    --    VALUES( 1, 1, 'default' );
  2. Modify the mme_data.sql file to use the Jacinto multi-zone configuration example by uncommenting or adding, as required, the following:
    -- Jacinto multi-zone configuration example.
    -- Three Control Contexts, three Zones, one output device each.
    -- One io-media for all:
    INSERT INTO renderers(path)
        VALUES('/dev/io-media');
    
    -- zone0:
    INSERT INTO outputdevices(type, permanent, name, devicepath)
        VALUES(1, 1, 'appe_0', 'appe_output_0');
    INSERT INTO zones(zoneid, name)
        SELECT 1, 'zone0';
    INSERT INTO zoneoutputs(zoneid, outputdeviceid)
        SELECT 1, outputdeviceid FROM outputdevices
            WHERE name='appe_0';
    INSERT INTO controlcontexts(zoneid, rendid, name)
        VALUES( 1, 1, 'cc0' );
    
    -- zone1:
    INSERT INTO outputdevices(type, permanent, name, devicepath)
        VALUES(1, 1, 'appe_1', 'appe_output_1');
    INSERT INTO zones(zoneid, name)
        SELECT 2, 'zone1';
    INSERT INTO zoneoutputs(zoneid, outputdeviceid)
        SELECT 2, outputdeviceid FROM outputdevices
            WHERE name='appe_1';
    INSERT INTO controlcontexts(zoneid, rendid, name)
        VALUES( 2, 1, 'cc1' );
    
    -- zone2:
    INSERT INTO outputdevices(type, permanent, name, devicepath)
        VALUES(1, 1, 'appe_2', 'appe_output_2');
    INSERT INTO zones(zoneid, name)
        SELECT 3, 'zone2';
    INSERT INTO zoneoutputs(zoneid, outputdeviceid)
        SELECT 3, outputdeviceid FROM outputdevices
            WHERE name='appe_2';
    INSERT INTO controlcontexts(zoneid, rendid, name)
        VALUES( 3, 1, 'cc2' );
  3. In the QDB configuration file (qdb.cfg), use tmpfs for mme_library, mme_temp and mme. For example:
    [mme_temp]
    Filename    = /fs/tmpfs/mme_temp.db
    Schema File = /db/mme_temp.sql

Startup

To start the MME, use the standard MME startup procedure described in the MME Quickstart Guide in Introduction to the MME, but start io-fs-media as follows:

# io-fs-media -d tmp,noglob -cpages=4 -cbundles=0

and start io-media-generic as follows:

io-media-generic -Mmmf,dlldir=$QNX_TARGET/armle/lib/dll/mmedia \
-Mmmf,audio_writer=ade3_writer -Mmmf,keepdlls=all

Note: When using mmecli, you need to specify which control context to use: cc0, cc1 or cc2. Each control context plays to a different headphone output port on the Jacinto EVM. For example, to play to two different output zones do the following:
mmecli -c /dev/mme/cc0 newtrksession l "select fid from library"
mmecli -c /dev/mme/cc0 settrksession 1
mmecli -c /dev/mme/cc0 play 1
mmecli -c /dev/mme/cc1 newtrksession l "select fid from library"
mmecli -c /dev/mme/cc1 settrksession 2
mmecli -c /dev/mme/cc1 play 2

Note that the newtrksession option is the letter “l”, for a library mode track session; while the settrksession option is the numeral one, which is the track session number.


Audio routing

Audio routing is outside the scope of the MME for controlling the APPE audio routing, mixing, and post processing on the DSP. You must develop a separate audio management application to support these capabilities.