Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Panel
panelIconId1f6a7
panelIcon:construction:
panelIconText🚧
bgColor#FFF0B3

This page is a work in progress. Improvements to content and formatting are underway.

Overview

As shown below, there are 3 main components of an Audio Weaver system that require communication in order to tune an audio system. The Designer GUI will generate text based tuning commands (AWS) based on the layout and any user tuning commands. These commands are sent to AWE Server, which in turn compiles the AWS commands into binary commands (AWB) that can be sent to the target running the AWE Core. The target processes the AWB commands and then generates a reply message that is sent back to the AWE Server.

...

Expand
titleClick to expand

Command

Description

add_module

Adds one or more modules to a given layout.

add_symbol_id

Defines a new entry in the symbol table based on the unique ID of the object.

audio_pump

Run the layout using either WAV/MP3 files, or audio line input as the source (BSP)

audio_stop

Stop the audio pump if running (BSP)

bind_wire

Binds a named wire to an input or output pin

close_input

Close an audio device used for combined input, giving zero samples in its place

close_output

Close an audio device used for combined output

cmd

Generic command handler (advanced).

compile

Compiles an AWS script file to AWB binary form (BSP)

connect

Initiates a connection from a client (backward compatibility, ignored, BSP)

clear_credentials

Removes credentials from the INI file

clear_symbols

Empty the server symbol table. (Windows, Linux)

create_active

Creates a control to display 4 radio buttons of module state (BSP, GUI only)

create_bitmap

Creates an image control on a dialog (BSP, GUI only)

create_button

Creates a button on a dialog (BSP, GUI only)

create_checkbox

Creates a checkbox on a dialog (BSP, GUI only)

create_dialog

Creates a named dialog (BSP, GUI only)

create_droplist

Creates a drop list control on a dialog (BSP, GUI only)

create_awslist

Creates a drop list control specifying AWS script files allowing the user to select and run presets from the list (BSP, GUI only)

create_edit

Creates an edit box control on a dialog (BSP, GUI only)

create_filelist

Creates a file list control on a dialog.  Used for streaming files to the target (BSP, GUI only)

create_graph

Creates a graph control that represents array elements as bar graphs (BSP, GUI only)

create_grid

Creates a grid control operating as as small spreadsheet for manipulating one or two dimensional arrays (BSP, GUI only)

create_layout

Creates a layout with the specified properties

create_led

Creates an LED style control on a dialog (BSP, GUI only)

create_lookup

Creates an O(1) ID lookup table

create_meter

Creates a meter control on a dialog (BSP, GUI only)

create_module

Creates a module with the specified properties

create_slider

Creates a slider or knob control on a dialog (BSP, GUI only)

create_spline

Creates an X-Y spline control on a dialog (BSP, GUI only)

create_text

Creates a static text control on a dialog (BSP, GUI only)

create_wire

Creates a wire with specified properties

deferred_process

Cause deferred commands to be executed.

delete_file

Deletes a file (BSP)

destroy

Unconditionally destroys all created objects (BSP)

destroy_dialog

Destroys a dialog (BSP, GUI only)

dialog_state

Toggles between normal and expanded views (BSP, GUI only)

end_binary

Stops logging of binary commands sent to the target (BSP)

erase_all

Erases all files in the target file system (BSP)

exists_dialog

Checks if a dialog with a specified name exists (BSP, GUI only)

exit

Causes the server to exit (BSP)

fast_audio_pump

Run a layout using only files at the greatest possible speed. Intended for test (BSP)

fast_read

Reads float arrays of binary data (Matlab)

fast_read_int

Reads integer arrays of binary data (Matlab)

fast_write

Writes arrays of binary float data (Matlab)

fast_write_int

Writes arrays of binary integer data (Matlab)

fast_write_partial

Writes arrays of binary float data without performing a set call (Matlab)

fast_write_int_partial

Writes arrays of binary integer data without performing a set call (Matlab)

file_exists

Report if a specified file exists (BSP)

file_logging

Specifies whether to log commands and replies to a file (BSP)

file_to_pin

Bind a WAV file to an input pin as a file player (BSP)
THE COMMAND IS NOT IMPLEMENTED.

foreground

Brings all Audio Weaver windows to the foreground thus making them visible (BSP, GUI only)

framework

Change the connected target (BSP)

getini

Returns an entry from the AWE_Server.ini file (BSP)

get_call

Calls the get_call function of a module

get_cores

Returns the number of cores or instances.

get_core_list

Returns the number of cores or instances, and their IDs.

get_executable_dir

Returns the directory containing the AWE_Server.exe executable (BSP)

get_extended_info

Returns the target’s extended info.

get_filesystem_info

Returns information about the target file system (BSP)

get_first_core

Return info on the first (and possibly only) core (BSP)

get_first_file

Returns the properties of the first file (BSP)

get_first_io

Returns the properties of the first I/O object

get_first_object

Returns the properties of the first object instance

get_heap_count

Returns the number of framework heaps

get_heap_size

Returns the free space and sizes of the heaps

get_instance_table

Returns the number of cores or instances and their IDs.

get_moduleclass_count

Returns the number of module classes

get_moduleclass_info

Returns information about the specified module class

get_module_state

Returns the muted etc. state of the given module

get_next_core

Return info on cores after the first (BSP)

get_next_file

Returns the properties of the next file, or fails if no more (BSP)

get_next_io

Returns the properties of the next I/O object, or fails of no more

get_next_object

Returns the properties of the next object, or fails if no more objects

get_object_byname

Returns the properties of the named object

get_rate

Returns the properties of an audio file

get_schema

Returns the schema for a class (BSP)

get_target_info

Returns the detailed info for an AWE instance.

get_type

Report the type of an expression (int, float, ...) (BSP)

get_value

Returns the value of a symbolically specified location

get_version

Returns the current version number of Audio Weaver (BSP)

gui_logging

Controls whether commands and replies are logged on the server control panel (BSP)

kill_pump

Cause the audio pump to die

make_binary

Starts logging of binary target commands to a named file (BSP)

open_web_page

Launches a browser and displayed a specified page (BSP, GUI only)

pin_to_file

Bind a file writer to an output pin
THE COMMAND IS NOT IMPLEMENTED.

pump

Pump the entire framework once

pump_layout

Pumps the given layout once

pump_module

Executes the pump function of the given module

query_pin

Queries a named pin for its properties

query_pump

Test if the audio pump is running

query_wire

Queries a named wire for its properties

read_file

Reads from a file (BSP)

read_float_array

Reads values from an array as floats

read_fract_array

Reads values from an array as fracts reported is floating values

read_int_array

Reads values from an array as integers

reboot_target

Cause an embedded target to reboot. Ignored by Windows and Linux

rename_pin

Change the name of a pin
THE COMMAND IS NOT IMPLEMENTED.

reopen_input

Reopen an input device previously closed with close_input

reopen_output

Reopen an output device previously closed with close_output

script

Executes a script file containing commands (BSP)

select_core

Choose which core to report on (BSP, GUI only)

setini

Writes a specified INI file entry with a value (BSP)

set_call

Calls the set_call function of a module

set_core_description

Sets a description file used for target emulation

set_cores

For multicore SMP systems you can specify how many cores to use (BSP)

set_instance_id

Change the ID of some module to the specified ID

set_module_state

Sets a given module to muted, activated, bypass, or disabled

set_path

Set the path to search for audio files used by audio_pump

set_pointer

Assigns a symbolically specified location a pointer value

set_value

Assigns a symbolically specified location a value

show

Allows the server dialog to be hidden while child dialogs are up (BSP, GUI only)

target_execute

Cause an embedded target to run an AWB file from its local file system

trace

Cause a target to echo a message to stdout.

update_lookup

Updates the O(1) ID lookup table after IDs have been changed by assignment (legacy support only, ignored)

write_file

Write to a target file system file (BSP)

write_float_array

Writes values to a float array

write_float_array_partial

As write_float_array, but no set call.

write_fract_array

Writes values to a fract array

write_fract_array_partial

As write_fract_array, but no set call.

write_int_array

Writes values to an integer array

write_int_array_partial

As write_int_array, but no set call.

write_pump_read

Write input wire, pump, layout, read output wire. Intended for test

...

If the server is connected to a target, the file_name argument is not permitted. If the file is not found as specified, and does not have an absolute path, it is searched for in the audio path. See set_path.

audio_stop (BSP)

Syntax

audio_stop

...

When several device are merged for audio input (numbered 0 - N-1) close one of these devices by its index, causing zero samples to be generated in its place. This command is a specialized command for users that need to disconnect from a device that is about to be reconfigured. See reopen_input.

close_output (BSP)

Syntax:

...

When several device are merged for audio output (numbered 0 - N-1) close one of these devices by its index. Samples being written to that device are discarded. This command is a specialized command for users that need to disconnect from a device that is about to be reconfigured. See reopen_output,

cmd

Syntax:

cmd,opcode [,arg1, ... ,argN]

...

destroy_dialog,dialog

where:

dialog must be a dialog created by create_dialog,

...

dialog_state,dialog,state

where:

dialog must be a dialog created by create_dialog,

state must be 0 or 1

This command sets the given dialog to its initial size if zero, otherwise to its alternate size. If the alternate size dimensions given to create_dialog were zero or the same as the initial size, the command has no effect.

...

Terminates logging of binary commands and writes the file. This command works in conjunction with make_binary.

exists_dialog (BSP, GUI only)

...

Checks if a dialog with the specified name already exists. The function returns either:

success,0 (Dialog does not exist)

success,1 (Dialog does exist)

failed, argument count (Incorrect number of arguments to the function)

exit (BSP)

Syntax:

exit

This command destroys the server.

...

Plays the input file through the layout as fast as possible, optionally recording the layout output in a WAV file. The output file will be at whatever rate the layout specifies, and have has as many channels as the output wire.

...

Reads the specified number of float elements in an array of data and returns the result as binary data rather than as text. This command is only supported through the MATLAB AWEClient.dll and is not for general use. The format of the binary reply packet is described in Internal Binary Packets.

fast_read_int (Matlab)

Syntax:

...

Reads the specified number of integer elements in an array of data and returns the result as binary data rather than as text. This command is only supported through the MATLAB AWEClient.dll and is not for general use. The format of the binary reply packet is described in section 6 Internal Binary Packets.

fast_write (Matlab)

Syntax:

...

Writes the float array passed by Matlab to the target layout starting at the address given. This command is only supported through the MATLAB AWEClient.dll and is not for general use. It causes the AWE server to receive a binary packet containing the Matlab array values as documented in section 6 Internal Binary Packets.

fast_write_int (Matlab)

Syntax:

...

Writes the integer array passed by Matlab to the target layout starting at the address given. This command is only supported through the MATLAB AWEClient.dll and is not for general use. It causes the AWE server to receive a binary packet containing the Matlab array values as documented in section 6 Internal Binary Packets.

fast_write_partial (Matlab)

...

Writes the float array passed by Matlab to the target layout starting at the address given. This command is only supported through the MATLAB AWEClient.dll and is not for general use. It causes the AWE server to receive a binary packet containing the Matlab array values as documented in section 6 Internal Binary Packets.

The final set call performed by fast_write is suppressed.

...

Writes the integer array passed by Matlab to the target layout starting at the address given. This command is only supported through the MATLAB AWEClient.dll and is not for general use. It causes the AWE server to receive a binary packet containing the Matlab array values as documented in section 6 Internal Binary Packets.

The final set call performed by fast_write_int is suppressed.

file_exists (BSP)

...

This command either succeeds or fails. The possible failures are:

failed,argument count // command takes only one argument

failed,no target // command requires a connected target

If it succeeds the possible replies:

success,0, // name not found in path

success,1,full_path // found this file in the path

success,2,full_path // found this directory in the path

If found, the full_path will be in the convention of the OS on which the server is running. The only supported OSs are Windows and Linux.

...

YYYY/MM/DD HH:MM:SS.mmm: << message

The form of sent message log items is:

YYYY/MM/DD HH:MM:SS.mmm: >> message

In each case, mmm is the milliseconds past the second.

...

The available proxies are:

0 - Native

1 - RS232

2 - USB

3 - Ethernet

4 - SPI

8 - FTDI

9 - TotalPhaseSPI

Only those proxies enabled in the INI file can be specified. Linux supports only the Ethernet proxy. The default proxy is Native, and is always available.

Replies:

failed,framework %d is current framework

failed,no such framework as %d

failed,can't create framework %d: old connection %d restored

success

getini

Syntax:

getini,section,key

Reads the AWE server INI file.

Replies:

success,section=section_name,key=key_name,value=key_value

A return value of '0,no such key' indicates the INI file does not contain the specified key.

...

Performs a get call on the specified module with the given mask. See module documentation for specifics. If the module has no get function, does nothing.

Replies:

success,module_name=instanceID

get_filesystem_info (BSP)

...

This command queries the target file system properties. On success it returns:

success,type,size,available,overhead,deleted,inuse,free,sizes

where:

type is 1 for Native, or 2 for FLASH.

size is the target device size in words – note that the implementation may only use a portion of the total FLASH storage for the file system.

available is the number of available storage words.

overhead is number of words used for internal data structures

deleted is the number of words used by deleted files

inuse is the number of words used for all purposes

sizes is (block size in words << 16) | max filename length

Note that the file system does not release storage from deleted files – that storage is lost. Repeatedly creating and deleting files will consume all storage. The file system can be restored to its initial empty state with erase_all.

get_first_core (BSP)

Syntax:

...

Returns the target info for the first core in the system which should have ID zero. See get_target_info.

get_next_core (BSP)

Syntax:

...

Returns the target info for the core following prevCoreID in the system. If there is no successor core, it fails. See get_target_info.

get_cores (BSP)

Syntax:

get_cores

Returns the number of cores (or instances) defined by the target.

success,numberOfCores

get_core_list (BSP)

Syntax:

...

Returns the number of cores (or instances) defined by the target, and all their IDs. See also get_instance_table below which is an alias.

success,number of cores, <list of core IDs>

get_instance_table (BSP)

Syntax:

...

This command reads the specified file from the target file system, and writes the file as AWE_directory/filename to your hard drive, in which case it reports success. There are many possible failures including file not found and the target not having a file system.

...

This command is intended for rare cases where a device has to be reconfigured , but can't be while AWE has an open handle on it.

...

Reopens a device previously closed by close_output. The same parameters are used as when the device was originally opened when audio started. It is an error to reopen an already open device, or use an index that does not exist.

...

This command writes the specified local hard disk file to the target file system with the file attribute specified. If a file of that name exists on the target, it is first deleted (see delete_file). There are many possible failures including file not found on your hard disk, not enough space on the target, and the target not having a file system.

The attribute value may be any 7 bit value constructed by orring the following together expressed as decimal:

Code Block
#define LOAD_IMAGE			0x01

...


#define STARTUP_FILE			0x02

...


#define DATA_FILE			0x04	// Any file of type "Other"

...


#define COMPILED_SCRIPT		0x08

...


#define COMMAND_SCRIPT		0x10

...


#define PRESET_SCRIPT		0x20

...


#define COMPILED_PRESET_SCRIPT	0x28

...


#define LOADER_FILE			0x40

Common useful values are 0x18 (= decimal 24) for a compiled AWB file, and 0x1a (= decimal 26) for a bootable compiled AWB file. Other possible attribute combinations are generally not useful.

...

A useful set of commands to compile a script file, and load it into a file system is:

erase_all

compile,1,source_file.aws, destination_file.awb

write_file, destination_file.awb,26

When you next reset the target, the layout should be running. Note that the AWS and AWB extensions are convention only, you can use anything you like.

get_extended_info

Syntax:

get_exterdedextended_info

This command returns user version followed by 12 undefined words

success,user_version,<12 undefined words>

get_first_io

Syntax:

get_first_io

This command returns the first I/O object, as in this example:

success,Input,1,1,48000,1074003968,256,4194304,

The format is

success,instance_name,instanceID,boundID,sampleRate,info1,info2,info3,

Where:

boundID

...

zero if the pin is not bound, othereise the ID of the bound wire.

info1

...

a packed bitfield of 10 bit channels | 17 bits blockSize | 4 bit sample size bytes | 1 bit complex

info2

...

a packed bitfield of 17 bits blockSize | 6 bits data type

info3

...

a packed bitfield of 10 bits rows | 10 bits cols | 1 bit isIPC | 1 bit isPrivate | 1 bit clock master | 1 bit special

For more information on these fields see Framework.h.

See get_next_io.

get_first_object

Syntax:

get_first_object

...

where each member is formatted as:

member_name=member_type:value

The layout of all classes is given in the schema file, where each member is named and its type given: className will be found in the schema file. The value is displayed appropriately for the type: float values are displayed using %g, all other values are displayed as decimal unsigned integers.

If the member is an array of fixed bounds in the schema, then each element of the array is displayed in the form:

member_name[subscript]=type:value

where the subscript ranges from 0 to N-1.

...

get_heap_count

This command returns:

success, number_of_heaps

Currently this value is always 3.

...

success, free1,free2,free3,size1,size2,size3

where:

freeN

...

the number words available in heap N.

sizeN

...

the total size of heap N

All sizes are in 32-bit words.

...

When first created, modules are active. See set_module_state.

get_moduleclass_count

Syntax:

...

get_moduleclass_info,module_class_index

where:

module_class_index must be in the range 0 to one less than the value returned by get_moduleclass_count.

On success, the return value is:

success,className,classID,nParams,DLLName

where:

className

...

the name of the class as it appears in the schema file,

classID

...

the numeric value of the class id,

nParams

...

the number of public and private parameters an instance of the module may take. The values are packed as separate 16 bit numbers into a 32 bit value. The high 16 bits represent the number of private words; the lower 16 bits represent the number of public words.

DLLname is the library the module is found in.

...

Returns the next I/O object in the form described in get_first_io, or:

failed, no more I/O pins

...

Returns the next object in the forms described in get_first_object, or:

failed, no more objects

...

get_object_byname,instanceName

where:

instanceName is some identifier

The command looks up instanceName in the object symbol table. If found, the reply value is as described in get_first_object, otherwise it is:

failed, 'instanceName' is undefined

...

get_schema,className

where:

className is some identifier

The command looks up className in the schema symbol table. If found, the reply value is:

success,Class=className,ClassID=id,member,...

where:

className is the argument to the command,

id is the numeric id of the class,

each member is formatted as:

member_name=type

otherwise, the reply is:

failed, class 'className' is undefined

...

success,sampleRate,profileFreq,packetBufLen,nCores,nThreads,nInputs,nOutputs,baseBlockSize,packedInfo,version,CpuType,targetName,proxyName,CpuFreq,instanceID,isSMP,nInputPins,nOutputPins,featureBits

Where:

sampleRate - target sample rate in Hz

profileFreq - target profiling clock frequency in Hz

packetBufferLen - the size in words of the target's packet buffer

nCores - the number of cores the target currently has. For SMP targets the default 2. nCores can be changed using the set_cores command.

isSMP – flag indicating if core supports SMP

nInputPins – number of input pins

nOutputPins – number of output pins

baseBlockSize - the base block size for audio. Layouts must use an integer multiple of this nThreads - the number of concurrent threads per core. Typically 2 for embedded targets and 4 for SMP targets.

nInputs - the number of input channels

nOutputs - the number of output channels

packedInfo – 7 bits CPU type | 8 bits output channels | 8 bits input channels | 1 bit floating point | 1 bit file system | 4 bits sizeof(int)

version - 32 bit version number usually expressed as w.x.y.z where each field is a byte of the word most significant first

targetName - an up to 8 character name for the target

CpuFreq - the frequency of the target clock in Hz

instanceID - the ID of this core in the range ((0…15) * 16) i.e. (0, 16, 32, …, 240)

isSMP - 1 if the core is SMP (Windows or Linux)

featureBits - usually 0, reserved for DSP Concepts internal use

get_type (BSP)

Syntax:

get_type,expression

Evaluates the type of expression and returns the type as an integer if the expression is legal. The possible reported values are:

0 - integer

1 - unsigned integer

2 - float

3 - fract

4 - object

5 - pointer to integer

6 - pointer to unsigned integer

7 - pointer to float

8 - pointer to fract

9 - pointer to object

get_value

Syntax:

get_value,expression

where expression is formed as follows:

instanceName [. memberName]

InstanceName must be the name of some object. The first memberName must name a member of the class of which instanceName is an instance. Subsequent terms depend on the type of the member as follows:

Member Type

Followed by

int

nothing, reply is success,address,int,intvalue

float

nothing, reply is success,address,float,floatvalue

[N]int

[0 : N-1], reply is success,address,int,intvalue

[N]float

[0 : N-1], reply is success,address,float,floatvalue

*className

.member belonging to className (follows pointer)

**className

[subscript].member belonging to className (follows subscripted pointer)

className

.member belonging to className (accesses member)

Note that the final three type name members: if the types of those members are not one of the first 4 scalar forms, then more members must be named to complete the expression. This continues iteratively until the expression reaches one of the first 4 scalar forms.

If the expression is not legal according to these rules, one of the following may be returned:

failed, 'string' is not an identifier

failed, 'name' requires dot expression

failed, no such member of 'class' as 'string'

get_version (BSP)

Syntax:

get_version

...

Begins logging of binary commands sent from the Server to the target. The commands are buffered in internal memory on the PC. When complete, call end_binary to write the commands to the specified file filename.

make_binary is used to create compiled scripts on the target. Only a subset of commands are stored – only those needed to actually instantiate the system and begin processing. The commands logged are:

bind_wire

audio_pump

create_layout

create_module

create_wire

destroy

set_module_state

set_value

write_float_array

write_fract_array

write_int_array

open_web_page (BSP, GUI only)

...

If there are no layouts to pump, the error message is:

Server response: "failed,no layout(s) to pump"

If server is not connected to the target, the error message is:

Server response: "failed,not connected to the target"

otherwise the replay is:

success, cycles, cycles interval

This call is intended to be used with the command write_pump_read for testing. See also fast_write and fast_read.

pump_layout

Syntax:

pump_layout,layout_instance_name [,pump cycles]

...

This command pumps a single layout as though by pump above. It is intended to be used with writing an input wire and reading an output wire for testing. See also fast_write and fast_read.

On success the reply is

success, instance_name=instanceID [, pump cycles]

...

pump_module,module_instance_name

where module_instance_name must be an object created by create_module.

This command pumps a single module as though by pump_layout above. It is intended to be used with writing an input wire and reading an output wire for testing. See also fast_write and fast_read.

On success the reply is

success,Name=instanceID

...

On success, the reply is as described in get_first_io.

query_pump (BSP)

Syntax:

query_pump

This command reports the audio pump status as an integer. The possible values are:

0 - target has no layout, not pumping

1 - target has a layout, not pumping

2 - target has no layout, pumping

3 - target has a layout, pumping

This command is intended for use by an external monitoring process which watches for the pump dying by transitioning from 3 to 1, which usually indicates an I/O error on audio hardware which can only happen on Linux systems.

...

where wireName must be an object created by create_wire.

On success the reply is

success,wireName=objectID,sampleRate,info1,info2

...

read_float_array,expression,count

where:

expression is an expression that evaluates to an array element, so must be subscripted

count is the number of values to read starting at that element

The reply is

success,val[0], ..., val[count-1]

...

read_fract_array,expression,count

where:

expression is an expression that evaluates to an array element, so must be subscripted

count is the number of values to read

The reply is

success,val[0], ..., val[count-1]

where each value is reported as float interpreting each value as fract32, and so constrianed constrained to report a value in the range -1 to 1.

...

read_int_array,expression,count

where:

expression is an expression that evaluates to an array element, so must be subscripted

count is the number of values to read

The reply is

success,val[0], ..., val[count-1]

...

This command executes the commands stored in fileName. Generally, these files have an AWS extension, and are generated by Designer.

...

Assigns to or creates in the INI file an item of the form:

Code Block
[section]

...


key=value

set_call

Syntax:

set_call,module_name,mask

...

If the description file has errors, the offending error is reported by failed,parse error, and the detailed error will be in awelog.txt. It is outside the scope of this document to describe the description file format and the possible parse errors which are legion. On error, the existing system is unchanged.

Any attempt to set the description file currently in use reports success,no change. If the command succeeded in loading a new file (or reverting to SMP) the reply is success.

set_cores (BSP,

...

Windows, Linux)

Syntax:

set_cores,N

For SMP targets only, destroys all existing core objects, and creates N new ones. The allowed range is 1-16. The number of cores on server start is 2. The current number of cores can be found using get_cores. Embedded targets with multiple cores have a fixed number of physical cares and do not implement this command.

...

As objects are created, they are assigned IDs starting at 1. If a layout needs to assign a new ID, it must be >= 30000, and not in use by another object. The object_name must be that of an existing object.

...

set_module_state,module_instance_name,state

where:

module_instance_name is the name of a module created with create_module, or is a dot-expression naming a member of an object that is a module

state is a decimal value, and one of

0: active

1: bypass

2: mute

3: inactive

This command sets the state of the module. On success the reply is:

success, module_instance_name=instanceID

See also get_module_state.

set_path (BSP)

Syntax:

set_path,path_item1 [, path_item2 ... ,path_itemN ]

This command takes any number of arguments, each of which is a file system path. It is used to set the search path for audio files specified to audio_pump. The paths are persisted in the server INI file as:

Code Block
{AudioPath]

...


Path=item1| ... |itemN

When audio_pump is searching for a file, it works through this list in order, and uses the first match found.

...

Sets the communication time out between Matlab and the server. By default, the value is 4000, or 4 seconds. (This command is useful to prevent issues when you issue a command, such as erase_all, which may take a long time to execute.)

...

set_value,expression,value [, expression,value]*

where:

expression is as described in get_value,

value is a number to be assigned to the location described by expression

There may be any number of [expression,value] pairs given to the command. On completion of the last assignment, the set function of each unique module instance (if any) referenced by any of the expressions are called.

On success the reply is:

...

If the server has any dialogs created by create_dialog, then show,0 causes the server dialog to be hidden. The dialog is un-hidden by destroy, using destroy_dialog to destroy the last child dialog, or by show,1. The show,0 command does nothing if there are no child dialogs.

...

write_float_array,expression,val0,....,valN-1

where:

expression is an expression that evaluates to an array element, and so must be subscripted

This command writes the values to each successive element location starting at expression. The reply is

...

write_float_array_partial,expression,val0,....,valN-1

As write_float_aray except the final set call is suppressed.

...

write_fract_array,expression,val0,....,valN-1

where:

expression is an expression that evaluates to an array element, and so must be subscripted

This command writes the values to each successive element location starting at expression. The reply is

success

Misuse of the command can corrupt storage, because there is no bounds checking for arrays.

...

write_fract_array_partial,expression,val0,....,valN-1

As write_fract_aray except the final set call is suppressed.

...

write_int_array,expression,val0,...,valN-1

where:

expression is an expression that evaluates to an array element, and must be subscripted

This command writes the values to each successive int location starting at expression. The reply is

success

Misuse of the command can corrupt storage, because there is no bounds checking for arrays.

...

write_int_array_partial,expression,val0,...,valN-1

As write_int_aray except the final set call is suppressed.

...

write_pump_read,layout,inputWire,outputWire,val1, ... ,valN

This command writes the vali vali to inputWire, then pumps the layout, then reads outputWire and replies:

success,cycles,val1, ... ,valN

...

Commands can produce error messages from the following table:

Text

Description

failed, heap type index range

A heap index was not in the range of heaps

failed, awe_fwMalloc no more storage

The given heap does not have enough storage to satisfy the requested size

failed, awe_fwMallocScratch no more storage

The scratch heap does not have enough storage to satisfy the requested size

failed, constructor argument count

A create_xx call has an incorrect number of arguments

failed, class index out of range

The given class index is not in the range of classes

failed, class not found

The named class was not found in the symbol table

failed, module already owned

An attempt was made to give a module to a layout when it is already in another layout

failed, address outside heap

An attempt was made to assign to a location not in any heap

failed, not a wire

A wire argument to create_module is not actually a wire

failed, number of inputs and outputs must match

Some modules require that the number of inputs and outputs are the same

failed, input pin types must be the same

Some modules require that the types of input and output pins be the same

failed, module needs at least one input

Many modules require at least one input

failed, module needs at least one output

Many modules require at least one output

failed, inputs must match corresponding outputs

Some module require that each

...

ith input have the same type as each

...

ith output

failed, not a module

An attempt was made to give an object not a module instance to add_module

failed, I/O count error

The input/output count is not acceptable

failed, parameter error

A parameter given to create_module is wrong for the specified module class

failed, no more objects

There are no more objects for get_next_object to display

failed, not object pointer

An expression expected to be of pointer type is not

failed, not input pin

The pin must be an input pin.

failed, I/O pin in use

An attempt was made to bind an I/O pin that was already bound with bind_wire

failed, pin types not compatible

An attempt was made using bind_wire to bind a wire incompatible with the I/O pin

failed, pin sizes not compatible

An attempt was made using bind_wire to bind a wire not an integer multiple of the I/O pin size

failed, not output pin

The pin must be an output pin.

failed, no more I/O pins

There are no more pin objects for get_next_io to display

failed, no layouts to pump

'pump' was called when no layouts exist

failed, module must have only one output

Many modules require only one output

failed, output wire must have only one sample

Some modules require that an output have only a single sample

failed, incompatible block sizes

All contained modules must have the same block size

failed, wire index out of range

A container wire vector indexed a wire out of range

failed, unknown error %d

An unknown error occurred

failed, argument count

A command had an invalid number of arguments

failed, not implemented on target

The target does not implement the command

failed, instance name '%s' not identifier

The argument must be an identifier

failed, instance name '%s' is already used

The instance name has already been defined

failed, class name '%s' is not defined

An attempt was made to use an undefined class name

failed, class name '%s' has different classID than created instance

An object was created, but then found to have a different class than it should have

failed, instance name '%s' is not a pin type

The argument must be a pin type

failed, name '%s' undefined

A name was seen that has not been defined

failed, expression error

The expression given to get_value or set_value had an error

failed, wire name '%s' undefined

A supposed wire name given to create_module is not defined

failed, wire name '%s' is not a Wire

A supposed wire name given to create_module is not of type Wire

failed, module name '%s' undefined

A supposed module name given to add_module is undefined

failed, '%s' is not a module

A supposed module name given to add_module is not a module

failed, unknown argument

A command that takes a symbolic argument had an unknown string argument

failed, open sound card for input returned an error

'audio_pump' could not open the sound card for input

failed, player create returned 0x%08x

'audio_pump' could not open the sound card for output

failed, renderer create returned 0x%08x

'audio_pump' could not create

...

output  object

failed, empty filename

A required filename was empty

failed, unknown command '%s'

The command keyword is unknown

failed, empty command

The command was empty

failed, can't find instance class

An attempt to lookup the class of an instance failed

failed, can't find instance

An attempt to lookup an instance failed

failed, '%s' requires subscript

An expression requires a subscript

failed, '%s' syntax error: missing ']'

Malformed subscript

failed, '%s' subscript %d out of range

A subscript is outside the array bounds (static arrays only, very rare)

failed, '%s' requires dot expression

An expression stopped early

failed, no such member of '%s' as '%s'

The member name given is not a member

failed, %s(%d): empty class name

Empty class name in schema file

failed, %s(%d): syntax error in alias of class '%s'

Error while aliasing one class to another in schema file

failed, %s(%d): unknown base class'%s' in alias of class '%s'

Reference to unknown base class while aliasing one class to another in schema file

failed, %s(%d): comma expected in class '%s'

Missing comma in schema file

failed, %s(%d): syntax error in derivation of class '%s'

Syntax error parsing derived class in schema file

failed, %s(%d): unknown base class '%s' in alias of class '%s'

Attempt to derive a class from an unknown base in schema file

failed, %s(%d): unexpected '{' in body of class %s

There can only be one level of bracing in schema files

failed, %s(%d): empty member name in class %s

Member name is empty in schema file

failed, %s(%d): non-numeric dimension in class %s

Array dimension has non-numeric subscript in schema file

failed, %s(%d): expected ']' to close dimension in class %s

Missing close bracket in array dimension in schema file

failed, %s(%d): empty type name in class %s

A type name is empty in schema file

failed, %s(%d): unknown type name '%s' in class %s

A type name is undefined in schema file.

failed, %s(%d): unexpected end of file in class %s

Unexpected end of file in schema file

failed, no such core

A core ID was specified that the target does not have.

failed, too many bound wires

An attempt was made to bind more than 17 times to an input pin

Schema Files

Schema files provide a means for describing the layout of DSP storage that is compact and has a simple grammar, and does not need the complexity of the C/C++ type system.

The server has a file Schemas.sch that defines all the classes in the DSP. Each schema corresponds to a structure in the code. Class names and member names must be identifiers in the C/C++ sense. Schema files support C++ comments only.

The form of a schema is:

ClassName

{

member1 type

….

memberN type

}

This is the simplest form, and directly maps to a C struct.

Code Block
ClassName
{
	member1		type
	….
	memberN		type
}

The supported types are as follows:

Type

Description

int

32 bit integer

float

32 bit IEEE float

[N]int

array of integer with N elements

[N]float

array of floats with N elements

*int

pointer to array of integer with unknown number of elements

*float

pointer to array of float with an unknown number of elements

*className

pointer to a class instance

**className

pointer to an array of pointers to class instance with unknown number of elements

className

a nested structure

To support mapping to DSP code, class names may have an associated class ID like this:

Code Block
className value

...


{

...


	….

...


}

If value is not present, the value zero (unknown ID) is used. The value may be in hex or decimal.

Classes may derive from other classes like this:

Code Block
A

...


{

...


	….

...


}

...



B, A

...


{

...


	….

...


}

The meaning is the same as public derivation in C++. In the example above, B inherits all the members of A.

The use of a class ID may be combined with inheritance like this:

Code Block
className value, baseClass

...


{

...


	….

...


}

As expected, the new class gets the given class ID, and also inherits all the members of the base class. There is no limit to inheritance depth.

All type names must be declared before use. This means that a circular definition such as:

Code Block
A

...


{

...


	m *B

...


}

...


B

...


{

...


	m *A

...


}

can't be written, since an attempt is made to refer to B before it is declared.

...

The packet header looks like this:

struct SBinaryPacket

{

Code Block
struct SBinaryPacket
{
	/** Magic packet header value. */

...


	unsigned int m_magic;

...



	/** Length of data in bytes. */

...


	unsigned int m_len;

...



	/** Length of data in floats. */

...


	unsigned int m_nFloats;

...



	/** Command opcode. */

...


	unsigned int m_opcode;

...


};

m_magic – contains 0x07ff0003

m_len – total packet size in bytes

m_nFloats – payload size in words – note that payload data is not constrained to floats

m_opcode – command opcode, always 30 to server, always 29 from server

It is always required that string data is also sent with a command to the server to specify a destination address as an expression. This data follows the last payload word. Let us assume a payload of 32 words, and string value containing 10 characters including the terminating NULL. Then the length values will be:

...

Any binary message with an opcode other than 30 causes a server assertion failure, since binary messages are intended for internal AWE use only, and would be a serious error with other opcodes. The reply to this message will be success or failed,<reason>, as with other messages. This command is sent to the AWE server by the Maltalb DLL when it processes fast_write.

The text command documented earlier fast_read generates a binary reply with payload of the number of words requested, and with no string part or a string message failed,<reason>. For that message, we have:

...

Binary packets have the form:

word 0: 16 bit length | 8 bit core ID | 8 bit opcode

word 1 - N-2 command payload

word N-1: XOR sum of all preceding words

Reply packets have the form:

word 0: 16 bit length in words | 16 bit zero

word 1 - N-2 reply payload

word N-1: XOR sum of all preceding words

Commands may have no payload. Replies always have at least one payload word, and for almost all of them word 1 is the return value - frequently the error code. Many replies only have this one payload word.

For more about binary packets, including a detailed list of available commands, see the ‘Tuning AWE Core Tuning Command Syntax and Protocol’ section of the AWECore Integration Guide at this location: https://w.dspconcepts.com/docsProtocol.