Please note as of Wednesday, August 15th, 2018 this wiki has been set to read only. If you are a TI Employee and require Edit ability please contact x0211426 from the company directory.

Audio Capacitive Touch BoosterPack C5535 Software

From Texas Instruments Wiki
Jump to: navigation, search

Contents

About Audio Capacitive Touch BoosterPack (ACTBP) C5535 Software

  • Runs on the C5535 DSP on the Audio Capacitive Touch BoosterPack board
  • Accepts UART commands to control audio player and recorder
  • Black-box "audio accelerator" for MSP430
  • Supports:
    • MP3 Encode & Decode
    • SD Card File System
    • USB Mass Storage
    • OLED display
    • Codec control, playback and record
    • Low-power mode
  • UART client interface to MSP430 on LaunchPad board

Software Architecture

Block Diagram

C5x uif arch booster.png

Overview

C5000 Virtual Register Control Interface or VRCI is a standard control protocol defined and implemented on many of software frameworks running on C5000 DSPs. VRCI allows an external host to control and communicate to C5000 software framework using the common UART hardware interface. VRCI consists of the following software components:

  • Virtual Register Model

To make the rich and powerful features easily available to the host, on the DSP side, C5000 software framework virtualized the functionality by a set of virtual register. The virtual register model insulates the users from the complexity of the software framework. It makes the complex software appears to b lox to the users. The virtual register set by design emulates the look and feel of the register set in many of the fixed function SoC hence presents itself as a programming model that most of the embedded software programmers are most familiar with.

For more details, please refer to Virtual Register Model and Description of Virtual Registers and Commands

  • Host API

A set of APIs is defined to allow the host to access the virtual registers of the software framework. The APIs are easy to use and free the developer from the details of the low-level protocol across UART. As part the UIF software package, a reference implementation is provided on hosts running on Windows. Additional implementation will be made available in future releases for MP430 family micro-controllers and other MCU offerings.

For more details, please refer to Host API.

  • Low-level UART Control Protocol

UART is used as the physical link between the host the C5000 DSP. UART is commonly integrated in many micro-controllers and micro-processors so it is readily available with no added cost. A simple and efficient low-level packet protocol is defined over the UART to allow the host and the DSP to exchange information. The protocol is simple, robust and yet flexible and powerful which provides the foundation of the upper level UIF software.

For more details, please refer to Low-level UART Control Protocol.

Download

BOOTIMG.BIN

Host APIs

Virtual Registers

Software Features

UART Virtual Register Control Interface and Host APIs

  • Powerful and fexible features made easy via simple UART Virtual Register Control interface and Host APIs
  • UART Virtual Register Control interface supports both UART and USB virtual COM port
  • Simple and easy to use virtual register programming model
  • Black box approach makes simple system integration, porting and upgrate


Audio Playback

  • MP3 file playback
  • Supports many bit rates and sample rates
  • Volume
  • Balance
  • Fast-forawrd and rewind
  • Time scale modification (TSM)
  • Stereo and mono
  • Cycle and shuffle modes

Audio Record

  • MP3 file recording
  • Stereo and mono
  • Selectable bit rates and sample rates
  • Default configurations for record: 192kbps bit rate, 48 KHz sample rate and stereo mode
    • Warning Warning: The Audio Capacitive Touch BoosterPack has only a mono-input. The codec on the hardware has been configured to treat the signal as a mono signal, and will contain the same information on both left and right channels.
  • Bit rate, sample rate and channel mode (mono/stereo) combinations supported for recording:
' Sampling Rate ' ' '
[kbps] 8 16 44.1 48
8 M M NO NO
32 MS MS NO NO
64 NO MS MS MS
96 NO MS MS MS
128 NO MS MS MS
192 NO NO S S
320 NO NO S S

Where: M - Only mono mode S - Only stereo mode MS - Both Mono and Stereo NO - Not supported

Storage media support

  • Micro SD card
  • USB 2.0 compliant

File System Services

  • Change to a directory
  • Create a directory
  • Delete a file or a directory
  • Format the SD card
  • List a directory

Boot mode

  • Secure boot from SD card

Low–power playback, record and low-power modes

  • Normal playback and record
  • Idle mode
  • Sleep mode
  • Powerdown mode

Virtual Register Model

C5000 software framework that supports the UART Virtual Register Control Interface implements a scheme called "Virtual Register Model". The Virtual Register Model virtualizes the rich functionalities and the complicated operations of the software framework via a set of emulated registers. The register model is very similar to the register model often encountered by embedded software developers working with an digital or analog ICs which have a set of memory-mapped registers. There are many benefits of this approach:

  • Quick Learning Curve

Most of software developers can become familiar with the virtual register model quickly and hence will be able to learn the rich features and functionalities of the software framework and apply what they learn to the products they are working on quickly.

  • Black Box Approach

The software framework appears to be a black box to the developers. The developers can save the tedious and error-prone process of integrating the software framework code to the application code. Developers will be able to continue to stay with their favorite application platform, be a TI MCU and other micro-controller/processors/DSPs while enjoying the full feature set and capabilities that the C5000 software framework has to offer.

  • Portability and upgradeability

On the DSP, side, the virtual register model of a software framework will stay compatible from one generation to the next. However, the performance, the power and the resource utilization will continue to improve. The same virtual register model will also be supported in the future generations of C5000 DSPs. On the application platform side, if the applications use the standard UIF APIs, the application code can be migrated easily to a different platform which may have a different processor running on a different OS.

The virtaul register set is software framework depedent. Different software frameworks will have different virtual register set. The idea is to provide a unique set of virtual registers to make the rich and powerful features of a software framework easy to use for the applications. As an example and to give custoemrs a feel of the virtual register model, the following table is a quick summary of the virtual register set for the Audio Player Recorder Framework/UIF framework used by Audio Booster Pack Product offered by TI. TI will continue develop addtional software frameworks for targetted applications.

Table of Virtual Registers for Audio Capacitive Touch BoosterPack

C55 Audio Player Recorder Framework Virtual Registers
Virtual Register Address Virtual Register Name Type R/W Description
0x00 operation scalar R/W This register invokes the control operations like play, record, stop, pause, resume etc. Each control operation will have a value which is defined by the enum ‘UifCommand’
0x01 play_file array R/W This register holds the file name to be played or directory name from which the files will be played.
0x02 record_file array R/W This register holds the name of the file being recorded
0x03 volume scalar R This register holds the value for the volume configuration
0x04 balance scalar R/W This register holds the value for the balance configuration
0x05 stereo scalar R/W This register provides channel selection playback/record mono/stereo
0x06 control_eq scalar R/W This register provides configurations for the equalizer
0x07 control_ks scalar R/W This register provides configurations for the TSM
0x08 record_bit rate scalar R/W This register holds the bit rate for record operation
0x09 record_sample_rate scalar R/W This register holds the sample rate for record operation
0x0A record_format scalar R/W This register provides selection of the file format for the record operation
0x0B play_format scalar R This register holds the format of the file being played
0x0C play_bit_rate scalar R This register holds the bit rate of the file being played
0x0D play_sample_rate scalar R This register holds the sample rate of the file being played
0x0E audio_output scalar R/W This register provides selection for the audio output on the HW EVM
0x0F audio_input scalar R/W This register provides selection for the audio input on the HW EVM
0x10 dir_info array R This register holds the directory listing information for the DIR command on the operation register
0x11 sys_file array R/W This register is used with CD, DEL, DIR and MKDIR command on the operation register
0x12 power_io array  R Register to get the io power value
0x13 power_core array  R Register to get the core power value
0x14 baud_rate scalar R/W Register to get the operating baud rate
0x15 play_number scalar R/W Register to get/set the playback number
0x16 current_play_file array R Register to get name of the file being played
0x17 record_status scalar R Register to get record status
0x18 current_record_file array R Register to get name of the file being recorded
0x19 power_mode scalar R/W Register to configure the power mode
0x1A sys_status scalar R This register indicates the current system status
0x1B file_count scalar R This register holds the number of files with extensions of .mp3  in the current directory
0x1C dir_count scalar R Ths register holds the number of the sub-directories in the current directory
0x1D play_status scalar R This register indicates the current play status
0x1E play_mode scalar R This register indicates the current play mode
0x1F shuffle_status scalar R This register indicates if the SHUFFLE is on or off
0x20 usb_control scalar R/W This register is used to enable or disable USB Mass Storage Class (MSC) mode
0x21 usb_status scalar R This register indicates if the USB cable is connected or not
0x22 event_control scalar R/W This register enables or disables the event control
0x23 version scalar R This register holds the revison number of the Audio Player Recorder Framework/UIF software
0x24 param scalar R/W This register is a general purpose register that holds a scalar value
0x25 str array R/W This register is general purpose regiser that holds a string

As seen from the above table, there are two types of virtaul registers: scalar and array. All the registers can be read and/or wriiten by the host. Scalar registers hold a single value, used for operations that need only one value to set up the operations. Array registers holds a array of values and are mostly used to hold the name of a file, listing of a directory and any other data that requires long string of values. A set of host APIs, which will be describe in a later section, is provided to enable easy access to these registers.

Description of Virtual Registers and Commands

Please refer to Audio Capacitive Touch BoosterPack Virtual Registers and Commands.

Host APIs

Helpful tips image.jpg
Host APIs Details

The most accurate and detailed description of Host APIs can be found File:C55 uif host api.zip and File:C55 acbp vreg.zip

uif_open

This API shall open the resource port corresponding to the port specified with the value in PortName

Syntax
Status uif_open(UIF *hPortHandle, char PortName[5])

Arguments

IN UIF* hPortHandle
  Handle to the UIF
  char* portname
  The name of the port(User specified – COMn)

Return Value

Status Success or Failure


Comments

None.

Constraints

None.

See Also

uif_control

This API shall open the resource port corresponding to the port specified with the value in PortName

Syntax
Status uif_control(UIF *hPortHandle,int baud, int datalen, int parity, int stopbit)

Arguements

IN UIF* hPortHandle
  Handle to the UIF
  int baud
  User specified Baudrate
  int datalen
  User specified data length
  int parity
  User specified parity
  int stopbit
  User specified stop bit
OUT None

Return Value

Status Success or Failure

Comments

If an invalid value is entered, the default values of baud=9600, datalen=8, stopbit=0 and parity=0 is set. Constraints

None.

See Also

uif_writeScalar

This API shall be called for writing scalar data to port. This takes the virtual reg address and the value to write to port as its arguments. This API is called for instructions which have scalar definite length data to be written to port.

Syntax

Status uif_writeScalar(UIF uif,INT8 virtualRegisterAddr,INT32 value,INT16 timeout)

Arguments

IN UIF* hPortHandle
  Handle to the UIF
  INT8 virtualRegisterAddr
  Virtual register name like play_file,time_out, dir_info etc.
  INT32 value
  Value to Write
  INT16 timeout
  Timeout value
OUT None

Return Value

Status Success or Failure

Comments

None.

Constraints

None.

See Also


uif_writeArray

This function is used to write array content to port. This API is called for instructions which take a string as parameter eg. $play_file. This method first sends the length of the array content followed by the array itself

Syntax

Status uif_writeArray(UIF uif, INT8 virtualRegisterAddr, INT16 length, CHAR* arrayToWrite, INT16 timeout)

Arguments

IN UIF* hPortHandle
  Handle to the UIF
  INT8 virtualRegisterAddr
  Virtual register name like play_file,time_out, dir_info etc.
  INT16 length
  Length of array to write
  CHAR* arrayToWrite
  Array to write
  INT16 timeout
  Timeout value
OUT None

Return Value

Status Success or Failure

Comments

None.

Constraints

None.

See Also


uif_readScalar

This function reads arrays from Audio Player Recorder Framework to Windows UI. This function is used for instructions where there is file name or content of variable length to be received from Audio Player Recorder Framework. Eg. File=$current_play_file

Syntax

Status uif_ReadScalar(UIF hPortHandle, INT8 virtualRegisterAddr, INT32 *value, INT16 timeout

Arguments

IN UIF* hPortHandle
  Handle to the UIF
  INT8 virtualRegisterAddr
  Virtual register name like play_file,time_out, dir_info etc.
  INT16 timeout
  Timeout value
OUT INT32* value
  Read-back value

Return Value

Status Success or Failure

Comments

None.

Constraints

None.

See Also

uif_readArray

This function reads arrays from Audio Player Recorder Framework to Windows UI. This function is used for instructions where there is file name or content of variable length to be received from Audio Player Recorder Framework. Eg. File=$current_play_file

Syntax

Status uif_ReadArray(UIF uif, INT8 virtualRegisterAddr, INT16* length, CHAR* arrayToRead, INT16 timeout)

Arguments

IN UIF* hPortHandle
  Handle to the UIF
  INT8 virtualRegisterAddr
  Virtual register name like play_file,time_out, dir_info etc.
  INT16 timeout
  Timeout value
OUT INT16* length
  Length of array read back
  CHAR* arrayToRead
  Array read back

Return Value

Status Success or Failure

Comments

None.

Constraints

None.

See Also

Programming Examples Using Host APIs

#include <uif_app.h>
 
UIF uif;
void main()
{
int status;
int my_play_number;
 status=uif_open(&uif,"\\\\.\\COM4");                               // Open COM4 as the communication port
 status=uif_control(&uif,9600,8,NOPARITY, ONESTOPBIT);              // Set up the port
 
 uif_WriteScalar(uif,UIF_CMD_BAURATE,BAU3);                         // $baurate= BAU3
 uif_WriteArray(uif, UIF_CMD_SYS_FILE, "\\");                       // $sys_file="\"
 uif_WriteScalar(uif,UIF_CMD_OPERATION,DIR);                        // $operation=DIR
 uif_ReadArray(uif,UIF_CMD_DIR_INFO, &len, my_dir_info);            // my_dir_info=$dir_info
 printf("%s\n",my_dir_info); //display my_dir_info
 
 uif_WriteArray(uif, UIF_CMD_SYS_FILE, "\\");                       // $sys_file="\Pop"
 uif_WriteScalar(uif,UIF_CMD_OPERATION,DIR);                        // $operation=DIR
 uif_ReadArray(uif,UIF_CMD_DIR_INFO, &len, my_dir_info);            // my_dir_info=$dir_info
 printf("%s\n",my_dir_info);                                        //display my_dir_info
 uif_WriteArray(uif, UIF_CMD_PLAY_FILE, "Song2");                   // $play_file="Song2"
 
 uif_writeScalar(uif,UIF_CMD_CONTROL_EQ,0x5678);                    // $control_eq=0x5678
 uif_writeScalar(uif,UIF_CMD_CONTROL_KS,2);                         // $control_ks=2
 uif_writeScalar(uif,UIF_CMD_STEREO,1);                             // $stereo=1
 uif_writeScalar(uif,UIF_CMD_OPERATION,UIF_CMD_PLAY_LIST);          // $operation=PLAY_LIST
 uif_writeScalar(uif,UIF_CMD_OPERATION,UIF_CMD_VOLUME_UP10);        // $operation=VOLUME_UP10
 uif_writeScalar(uif,UIF_CMD_OPERATION,UIF_CMD_BALANCE_LEFT05);     // $operation=BALANCE_LEFT05
 
 uif_ReadScalar(uif,UIF_CMD_PLAY_NUMBER, &my_play_number);          // display $play_number
 printf("%d\n", &my_play_number);
}

Low-level UART Control Protocol

Please refer to Low-level UART Virtual Register Control Protocol


Frequently Asked Questions (FAQ)

Q: What debugging ability do I have over the C5535 DSP code?

  • A: The C5535 DSP code is a black box for the ACTBP due to licensing restrictions.

Q: How can I update the ACTBP C5535 DSP software?

Q: Is a WAV file supported (PCM, MS-ADPCM, IMA-ADPCM)?

  • A: It is not supported at this time.

Q: Is FLAC suported?

  • A: It is not supported at this time.
  • A: Vinjey, a TI 3rd party has this codec: [1]

Q: Is OGG suported?

  • A: It is not supported at this time.
  • A: Vinjey, a TI 3rd party has this codec: [2]

Q: What MP3 playback rates can be supported

  • A: See datasheet from: [3]

Q: What ID3 tag versions are supported

  • A: ID3 version 1.1 and 2.4

Q: Whow many bands of EQ can be supported?

  • A: Equalizer module is currently configured for 5 bands. Band number is configurable, and could be configured to support up to 14 bands.

Q: What kind of filesystem is supported?

  • A: FAT16 and FAT32

Q: Do we support exFAT?

  • A: This is unknown and is being investigated (as of Dec 8, 2011).

Q: Do we support SDHC, SDXC?

  • A: SDHC is supported, and it has been tested with a 16GB SD card. It should be capable of supporing up to 32GB card, though it has not been tested (as of Dec 8, 2011)

Q: What version of USB is supported?

  • A: Currently only USB 2.0 is supported.

Q: Why is USB MSC not workng with my PC?

  • A: You may have an older PC with USB 1.0. USB 1.0 is not currenlty supported.
  • A: Please try a different USB port. We have seen differences in PC USB ports amoung PC manufacturers.

Q: What bit rates and sample rates are supported for recording?

  • A: Please refer to the following table.
kbps\KHz 8 16  44.1  48
8 M NO  NO
32 MS MS NO  NO 
64  NO MS MS MS
96 NO MS  MS MS 
128 NO MS  MS MS
196 NO NO  S
320 NO NO  S
  • M – Only mono mode
  • S – Only stereo mode
  • MS - Both Mono and Stereo
  • NO – Not supported

Q: Why do my recordings have noise?

  • A: You may be using a 16GB Kingston SD card or other un-tested SD cards. This is a known issue and we are working to resolve it. The 16GB SDs card that we have tested and are known to work is SanDisk Class 10 SD cards.

Q: In Audio Player Recorder Framework/UIF, what baud rates are supported with UIF inetrface?

  • A: The following baud rates are supported:

9600, 14400, 19200, 38400, 57600,115200 and 230400.
To Change the buad rate, on the command console, issue

$baudrate=<value>

<value> is one of the supported numerical values of the baud rates. For example, to change to 19200 baud rate, issue:

$baudrate=19200

You could also use host APIs in your applications to change the baud rate by following the steps below:

  1. Call the function uif_WriteScalar() with parameter ‘virtualRegisterAddr’ set to ‘UIF_CMD_BAUDRATE’ and parameter ‘value’ set to value of the baudrate needs to configurted.
  2. Check the return value of the function uif_WriteScalar(). Return value will be ‘0’ if baud rate configuration on Audio Player Recorder Framework/UIF is successful.

Note: Audio Player Recorder Framework sends acknowledgement for baud rate command and waits for 100msecs (To allow the transfer completion of ACK) before changing the baud rate to new value. Host applications should accommodate for this time delay.
Note: Parameter ‘value’ of the function uif_WriteScalar() shall be the actual value of the baud rate to be configured. Valid values are 9600, 14400, 19200, 38400, 57600, 115200 and 230400.

Q: What happens if an invalid baud rate value is sent to Audio Player Recorder Framework?

  • A: Audio Player Recorder Framework sends error code 0x03 along with the acknowledgement for the set baud rate command. This error code will be returned by the uif_WriteScalar() function.

Q: In Audio Player Recorder Framework, how many files and directories can be in the root directory and how many files can be in each subdirectory?

  • A: Audio Player Recorder Framework only supports one level of subdirectories. In the root directory, the number of files plus the number of subdirectories must be less or equal to 50. In each sub directory, there can be no more than 50 files. Only files with .MP3 ending will be recognized.

Q: In Audio Player Recorder Framework, how do I enable and disable USB Mass Storage Class (MSC) function?

  • A: Use $usb_control=1 to enable the USB MSC and $usb_ocntrol=0 on the command console or coresponding host APIs to disable USB MSC. Since it takes 15 to 20 seconds for the host to enumerate the USB MSC, Audio Player Recorder Framework will be in a state which last for 20 seconds waiting for the host to complete the enumaeration. During this period, all UIF commands are ignored, including $usb_control=0 command. The host is advised to wait at least 20 seconds to issue any command.

Q: In Audio Player Recorder Framework, how do I control the volume?

  • A: $volume is read-only register allows the host to read the level of volume. For example after power-up reset,
my_volume=$volume
display my_volume

will show the default value of $volume and in the current implementation a default value of 81 will be shown. $volume ranges from 0 to 99.

To change the value of $volume, use

$operation=VOLUME_UPxx

or

$operation=VOLUME_DOWNxx

to turn up or turn down the volume. xx ranges from 00 to 16.

Note in the current implementation, when you issue $operation=VOLUME_UPxx command, the value of $volume will not inclrease by a exact value of xx. Similar is true for the case of VOLUME_DOWNxx. Please refer to the next Q&A for a related issue.

Q: Why is the zero level around 34 to 40? The volume doesn't seem linear with the number.

  • A: The value of $volume does not relate linearly to the perception. There is not enough steps in the high volume range but too many in the low volume ranage. This is a known issue and will be addressed in a future release (ENH 1415)

Q: Why does it record sometimes feel like it is hanging when it starts?

  • A: With slower SD cards, when the file system searches for a free cluster to create the recorded file it searches from the first sector in the card until it finds enough free clusters to store the file data. If there are more free clusters at the beginning of the card, the faster it will find the space it needs. If the card is more full, then search will take longer. On some SD cards with varying amounts of data, search times up to 18-20 seconds have been observed.

Q: What are the baud rates supported in Audio Player Recorder Framework?

  • A: Audio Player Recorder Framework supports the baud rates 9600, 14400, 19200, 38400, 57600, 115200 and 230400 bps

Q: How to configure baud rate of the UART interface?

  • A: To change the baudrate from command console use the below command as an exmaple:
$baudrate = 19200

This command will change the baud rate to 19200.

Q: What is the procedure for an application to configure the baud rate with host APIs

  • A: Instead of using the command console, an application can use host APIs to set the baud rate. User shall follow the steps below when setting baud rate:
  1. Call the function uif_WriteScalar() with parameter ‘virtualRegisterAddr’ set to ‘UIF_CMD_BAUDRATE’ and parameter ‘value’ set to value of the baudrate needs to configurted.
  2. Check the return value of the function uif_WriteScalar(). Return value will be ‘0’ if baud rate configuration on Audio Player Recorder Framework is successful. If successful change the baud rate on the host

Note: Audio Player Recorder Framework sends acknowledgement for baud rate command and waits for 100msecs (To allow the transfer completion of ACK) before changing the baud rate to new value. Host applications should accommodate for this time delay. Note: Parameter ‘value’ of the function uif_WriteScalar() shall be the actual value of the baud rate to be configured. Valid values are 9600, 14400, 19200, 38400, 57600, 115200 and 230400.

Q: What happens if an invalid baud rate value is sent to Audio Player Recorder Framework?

  • A: Audio Player Recorder Framework sends error code 0x03 along with the acknowledgement for the set baud rate command. This error code will be returned by the uif_WriteScalar() function.

Q: What is the function of $play_number virtual register?

  • A: $play_number virtual registers contains the index of the song from $play_file to be played next. This register could be wriiten and read by the user. $play_file contains the list of songs to be played. $play_file contains either the name of a directory or the name of a file.

Q: How does play_number command work?

  • A: Behaviour of the play_number command differs based on the system state. During a playback initiated by PLAY_LIST, PLAY_NEXT or PLAY_PREV commands, $play_number contains the index of the song that are currently being played. The song that will be played next is usually determined by the Audio Player Recorder Framework software depending the state CYCLE and SHUFFLE. A user also has the option to overwrite the default sequence by writing a differnt value to $play_number before or during the playback. If the value is written before the playback, the next song that will be played will be $play_number. If the value is wriiten during playback, the next song to be played will be $play_number+1.

Note the user-specified $play_number value is only recongized by Audio Player Recorder Framework SW with PLAY_LIST and PLAY_NEXT commands. When playing back songs using $operation=PLAY_PREV command, user-specified $play_number value is ignored.

$play_number usage examples:

  • $Play_number is set when playback has not started
$op=DIR
dirinfo=$dir_info
display dirinfo

01 - Will I Am 206kbps 44khz .mp3
02 - Do It Again 205kbps 44khz .mp3
03 - Jai Ho 320kbps 44khz.mp3
04 - sample 128kbps 44kHz.mp3

$play_number=2
$op=PLAY_LIST     ----> Plays the song  “02 - Do It Again 205kbps 44khz .mp3”
  • $play_number is set during playback
$op=DIR
dirinfo=$dir_info
display dirinfo

01 - Will I Am 206kbps 44khz .mp3
02 - Do It Again 205kbps 44khz .mp3
03 - Jai Ho 320kbps 44khz.mp3
04 - sample 128kbps 44kHz.mp3

$op=PLAY_LIST
$play_number=2
$op=PLAY_NEXT   ----> Plays the file “03 - Jai Ho 320kbps 44khz.mp3”. Leaving the playback just to run till the end of the first song will also have the same effect

$play_number=3
$op=PLAY_PREV   ----> Play number will ignored and the file “02 - Do It Again 205kbps 44khz .mp3” will be played

Q: What is the valid range for playback? Will Audio Player Recorder Framework send error code for invalid play_number?

  • A: The valid tange depends on the state of playback. play_number can be 1 to maximum file count when playback is stooped. Play_number can be 1 to (maximum file count – 1) when playback is running. Audio Player Recorder Framework sends no error for invalid play_number, it simplily ignores the command.

Q: How does Audio Player Recorder Framework add time-stamps to recoded or newly created folders?

  • A: There is no support for real-time tracking for the current time and date in Audio Player Recorder Framework. HW RTC module is used to track the time from the system start-up. During Audio Player Recorder Framework initialization RTC module shall be configured to date 12 February 2012 and time 18:00:00. RTC counts from this initial time with real-time precision. Time stamps will be added to the recorded or newly created folders based on this time.

Q: Where the files recorded by Audio Player Recorder Framework will be stored on SD card?

  • A: Audio Player Recorder Framework stores recorded files on the SD card in a directory with name ‘RecDir’. If there is no directory with name ‘RecDir’, it will be created.

Q: How Audio Player Recorder Framework assigns names for the recoded files?

  • A: Audio Player Recorder Framework uses indexed naming format for recoded files as RECxxx. Whereas ‘xxx’ varies from 000 to 049.

Q: Can user configure the name for files to be recoded?

  • A: Yes, user can specify record file name by setting the $record_file register each time before starting the record operation. File name in the ‘record_file’ register will be valid for only one record operation. If user specifies same name twice in the record_file register, Audio Player Recorder Framework ignores the name and assigns file name using default naming format. If user specifies no file name, record file name will be set using default naming RECxxx.

Q: What is the maximum limit for record file count? What happens if the user tries to record beyond the limit?

  • A: Audio Player Recorder Framework allows record up to 50 files. When user tries to record more than 50 files, record will not be started and Audio Player Recorder Framework sends an error code (0x07) to the host UIF to indicate that the maximum file limit for record has reached. File count limit is applicable to all the audio files(MP3/WMA/AAC) in RecDir irrespective of whether they are created by Audio Player Recorder Framework or copied by user by some other means.

Q: If the user deletes some files in ‘RecDir’ folder, how the files will be named by Audio Player Recorder Framework in subsequencial recordings?

  • A: File naming always be done in sequence starting from REC000 to REC049. If some files are deleted in between, next record operation fills those gaps and continues with the sequence. For example, assume the user does record to create files from REC000.mp3 to REC020.mp3; he deletes files from REC010.mp3 to REC015.mp3 and starts the record. Then the file naming sequence starts from REC010.mp3 continues till REC015.mp3 and then proceeds with the naming from REC021.mp3 till REC049.mp3.

Q: What are the file formats supported for playback?

  • A: Audio Player Recorder Framework supports MP3 file format for playback. However Audio Player Recorder Framework framework reads the information of MP3, WMA and AAC files during the file browsing and getting file listing for playback. Audio Player Recorder Framework playback stops when it reads WMA or AAC files for playback. Playback can be again initiated using play command.

Q:What happens if I select an invalid configuration for record?

  • When invalid bit rate or sample rate is selected, record will happen at default configurations; 192kbps bit rate, 48 KHz sample rate and stereo mode.
  • When invalid channel mode is selected and if bit rate and sample rate combinations are valid, then channel mode supported for that combination will be selected.
  • For example
    • Assume 8kbps bit rate, 8 KHz sample rate and stereo mode is selected for record. Since stereo mode is not supported at 8kbps and 8KHz record happens with mono mode, 8kbps bit rate and 8 KHz sample rate.
    • Assume 320kbps bit rate, 48 KHz sample rate and mono mode is selected for record. Since mono mode is not supported at 320kbps and 48KHz record happens with stereo mode, 320kbps bit rate and 48 KHz sample rate.

Q: Do I get an ACK error code when I select an invalid record configuration?

  • A: No error ACK shall be sent to the host UIF when invalid record configurations are selected. Record configurations are validated only when record operation is initiated by the host UIF and the corresponding virtual registers shall be modified to valid values. Record configuration virtual registers can be read from host UIF during the record to check at what configurations record is happening.

Q: Does the PLAY command work while in fast forward or rewind mode?

  • A: No, the Play command is not supported when the system is in in fast forward or rewind mode.

Q: Does the Pause command work while in fast forward or rewind mode?

  • A: No, the Pause command is not supported when the system is in in fast forward or rewind mode.

Q: Why does record in 320kbps have noise in the recording?

  • A: When recording at higher bitrates such as 320kbps, the SD card may not be able to keep up with the encoded data being written. This is typically the case with SD cards which have no speed classification (i.e. they are not explictly marked as supporting class 4, class 6, class 10, etc.).
  • A: Use a faster SD card.

Q:What are the baud rates supported by Audio Player Recorder Framework?

  • A: Audio Player Recorder Framework supports the baud rates 9600, 14400, 19200, 38400, 57600, 115200 and 230400 bps

Q: How to do I configure the baud rate from the host?

  • A: You could use the host APIs as follows:
  1. Call the function uif_WriteScalar() with parameter 'virtualRegisterAddr' set to 'UIF_CMD_BAUDRATE' and parameter 'value' set to value of the baudrate needs to configurted.
  2. Check the return value of the function uif_WriteScalar(). Return value will be '0' if baud rate configuration on Audio Player Recorder Framework is successful. If successful change the baud rate on the host.

Please note:

  1. Audio Player Recorder Framework sends acknowledgement for baud rate command and waits for 100msecs (To allow the transfer completion of ACK) before changing the baud rate to new value. Host applications should accommodate for this time delay.
  2. Parameter 'value' of the function uif_WriteScalar() shall be the actual value of the baud rate to be configured. Valid values are 9600, 14400, 19200, 38400, 57600, 115200 and 230400.

Q: What happens if an invalid baud rate value is sent to Audio Player Recorder Framework?

  • A: Audio Player Recorder Framework sends the error code 0x03 along with the acknowledgement for the set baud rate command. This error code will be returned by the uif_WriteScalar() function.

Q: What is play_number command and how can it be used?

  • A: The play_number command sets the index of the song to be played next
  • A: Behaviour of the play_number command differs based on the system state:
    • Playback not running: play_number is set
    • Playback started: Index of the song played will be play_number. Sine play_number is set during playback, the song played next will be play_number +1, whether it is by using play_next command or by leaving the play to run the next song. play_number will be ignored when the previous file is selected using play_prev command.
  • A: play_number command examples
    • play_number is set when playback is not running
$op=DIR
dirinfo=$dir_info
display dirinfo

01 - Will I Am 206kbps 44khz .mp3
02 - Do It Again 205kbps 44khz .mp3
03 - Jai Ho 320kbps 44khz.mp3
04 - sample 128kbps 44kHz.mp3

$play_number=2
$op=PLAY_LIST
    • the $play_number=2 command plays the song “02 - Do It Again 205kbps 44khz .mp3”
    • play_number is set when playback is not running
$op=DIR
dirinfo=$dir_info
display dirinfo

01 - Will I Am 206kbps 44khz .mp3
02 - Do It Again 205kbps 44khz .mp3
03 - Jai Ho 320kbps 44khz.mp3
04 - sample 128kbps 44kHz.mp3

$op=PLAY_LIST
$play_number=2
$op=PLAY_NEXT   ----> Plays the file “03 - Jai Ho 320kbps 44khz.mp3”. Leaving the playback just to run till the end of the first song will also have the same effect

$play_number=3
$op=PLAY_PREV   ----> Play number will ignored and the file “02 - Do It Again 205kbps 44khz .mp3” will be played

Q: What is the valid range for playback and will there be an error code for invalid play_number?

  • A:
    • Playback NOT running: play_number can be 1 to maximum file count
    • Playback running play_number can be 1 to (maximum file count 1)
  • A: There is no error for invalid play_number, it just ignores the command

Q: Why is the date for recorded files Feb 12, 2012? / How are the file dates calculated?

  • A: There is no API support for adjusting the RTC at this time. However, the HW RTC module is used to track the time from the system start-up. During initialization, the RTC module is configured to 12 February 2012 and time 18:00:00. From then on the RTC counts from this initial time with real-time precision. Time stamps will be added to the recorded or newly created folders based on this time.

Q: Is there an API for setting the RTC?

  • A: not at this time. This has been filed as an enhancement request.

Q: What do the acknowledge error codes returned from Audio Player Recorder Framework mean?

  • A: Error codes are as below:
0 - The last operation is successful
1 - Generic failure. Used internally, host never receives this error code
2 - Invalid operation command. This error code will be sent when invalid operation command($op=xyz) is received.
3 - Command or command parameters invalid. This error code will be sent if the command requested will not match with any of the four requests;   scalar write, scalar read, array read and array write. This error code is also sent when parameters associated with a command are not valid. For invalid baud rate values, this error code is sent.
4 - Invalid operation. This error code is to be sent when an invalid operation, like writing a read-only register, is requested. This is not implemented on C55 UIF. Command console takes care of filtering the invalid operations.
5 - RX buffer overflow - Host sends a array write request of length more than 50 characters.
6 - Command is invalid for the current system state - Host sends a command which is not supported in the current system. This is only implemented for USB MSC to indicate that enumeration is in progress.
7 - File count in the record directory has reached maximum limit
  • There are only error codes for selected commands. For most of the commands all the invalid operations will be ignored. In the future, more error codes will be added.
  • Format of the acknowledgement packet is as shown below
-------------------------------------------------------------
|ACK ID | RSV0 | RSV1 |RSV2 | Status Byte 1 | Status Byte 0 |
-------------------------------------------------------------
  • Status byte 0 and 1 contains the error codes. Since we transfer MSB first, 5th and 6th byte of 6 byte acknowledgement packet on MSP will have this error codes.
  • ACKID can be
4 - Write completion acknowledgement
5 - Read completion acknowledgement

Q: What should I do if I have lost, broken, or formatted the SD card that shipped with the ACTBP kit

  • A: Contact TI for a replacement device
  • A: The SD card contains BOOTIMG.bin (bootloader image), MP3 files, and the MP3 CODEC. Only the BOOTIMG.bin file is downloadable due to royalties.

Support

Related