Skip to content

Commit

Permalink
add include statements in aps_cxx_audio_detect_main
Browse files Browse the repository at this point in the history
  • Loading branch information
inscape-sa committed Dec 13, 2019
1 parent 6e46e12 commit 98240c8
Show file tree
Hide file tree
Showing 9 changed files with 541 additions and 9 deletions.
Expand Up @@ -14,15 +14,6 @@

static char helloworld[] = "Hello, ASMP World(0)!";

static char *strcopy(char *dest, const char *src)
{
char *d = dest;
while (*src) *d++ = *src++;
*d = '\0';

return dest;
}

int main(void)
{
mpmutex_t mutex;
Expand Down
5 changes: 5 additions & 0 deletions _aps_samples/aps00_sandbox/aps_cxx_audio_detect/Makefile
Expand Up @@ -18,6 +18,11 @@ CXXSRCS = $(filter-out $(MAINSRC),$(wildcard *.c) $(wildcard */*.c)) $(wildcard
CFLAGS += $(foreach inc,$(wildcard ../*/include),-I$(inc))
CXXFLAGS += $(foreach inc,$(wildcard ../*/include),-I$(inc))

## for Memory Utility
CXXFLAGS += -D_POSIX
CXXFLAGS += -DUSE_MEMMGR_FENCE
CXXFLAGS += -DATTENTION_USE_FILENAME_LINE

CONFIG_APS_CXX_AUDIO_DETECT_PROGNAME ?= aps_cxx_audio_detect$(EXEEXT)
PROGNAME = $(CONFIG_APS_CXX_AUDIO_DETECT_PROGNAME)

Expand Down
@@ -1,5 +1,37 @@

/** Included Files */
#include <sdk/config.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
#include <fcntl.h>
#include <time.h>
#include <errno.h>
#include <asmp/mpshm.h>
#include <sys/stat.h>

#include "memutils/os_utils/chateau_osal.h"
#include "memutils/simple_fifo/CMN_SimpleFifo.h"
#include "memutils/memory_manager/MemHandle.h"
#include "memutils/message/Message.h"
#include "audio/audio_high_level_api.h"
#include <audio/utilities/wav_containerformat.h>
#include <audio/utilities/frame_samples.h>
#include "include/msgq_id.h"
#include "include/mem_layout.h"
#include "include/memory_layout.h"
#include "include/msgq_pool.h"
#include "include/pool_layout.h"
#include "include/fixed_fence.h"

#include <arch/chip/cxd56_audio.h>

/** Section number of memory layout
* to use (in "include/mem_layout.h") */
#define AUDIO_SECTION SECTION_NO0

/** Parameter definitions */

extern "C" int aps_cxx_audio_detect_main(int argc, char *argv[])
{
Expand Down
@@ -0,0 +1,49 @@
/* This file is generated automatically. */
/****************************************************************************
* fixed_fence.h
*
* Copyright 2019 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/

#ifndef FIXED_FENCE_H_INCLUDED
#define FIXED_FENCE_H_INCLUDED

#include "memutils/memory_manager/MemMgrTypes.h"

namespace MemMgrLite {

extern PoolAddr const FixedAreaFences[] = {
}; /* end of FixedAreaFences */

} /* end of namespace MemMgrLite */

#endif /* FIXED_FENCE_H_INCLUDED */
161 changes: 161 additions & 0 deletions _aps_samples/aps00_sandbox/aps_cxx_audio_detect/include/mem_layout.h
@@ -0,0 +1,161 @@
/* This file is generated automatically. */
/****************************************************************************
* mem_layout.h
*
* Copyright 2019 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/

#ifndef MEM_LAYOUT_H_INCLUDED
#define MEM_LAYOUT_H_INCLUDED

/*
* Memory devices
*/
/* AUD_SRAM: type=RAM, use=0x0003f300, remainder=0x00000d00 */
#define AUD_SRAM_ADDR 0x000c0000
#define AUD_SRAM_SIZE 0x00040000

/*
* Fixed areas
*/
#define AUDIO_WORK_AREA_ALIGN 0x00000008
#define AUDIO_WORK_AREA_ADDR 0x000c0000
#define AUDIO_WORK_AREA_DRM 0x000c0000 /* _DRM is obsolete macro. to use _ADDR */
#define AUDIO_WORK_AREA_SIZE 0x0003d000

#define MSG_QUE_AREA_ALIGN 0x00000008
#define MSG_QUE_AREA_ADDR 0x000fd000
#define MSG_QUE_AREA_DRM 0x000fd000 /* _DRM is obsolete macro. to use _ADDR */
#define MSG_QUE_AREA_SIZE 0x00002000

#define MEMMGR_WORK_AREA_ALIGN 0x00000008
#define MEMMGR_WORK_AREA_ADDR 0x000ff000
#define MEMMGR_WORK_AREA_DRM 0x000ff000 /* _DRM is obsolete macro. to use _ADDR */
#define MEMMGR_WORK_AREA_SIZE 0x00000200

#define MEMMGR_DATA_AREA_ALIGN 0x00000008
#define MEMMGR_DATA_AREA_ADDR 0x000ff200
#define MEMMGR_DATA_AREA_DRM 0x000ff200 /* _DRM is obsolete macro. to use _ADDR */
#define MEMMGR_DATA_AREA_SIZE 0x00000100

/*
* Memory Manager max work area size
*/

#define S0_MEMMGR_WORK_AREA_ADDR MEMMGR_WORK_AREA_ADDR
#define S0_MEMMGR_WORK_AREA_SIZE 0x0000009c

/*
* Section IDs
*/
#define SECTION_NO0 0

#define NUM_MEM_SECTIONS 1

/*
* Pool IDs
*/
const MemMgrLite::PoolId S0_NULL_POOL = { 0, SECTION_NO0}; /* 0 */
const MemMgrLite::PoolId S0_ES_BUF_POOL = { 1, SECTION_NO0}; /* 1 */
const MemMgrLite::PoolId S0_PREPROC_BUF_POOL = { 2, SECTION_NO0}; /* 2 */
const MemMgrLite::PoolId S0_INPUT_BUF_POOL = { 3, SECTION_NO0}; /* 3 */
const MemMgrLite::PoolId S0_ENC_APU_CMD_POOL = { 4, SECTION_NO0}; /* 4 */
const MemMgrLite::PoolId S0_SRC_APU_CMD_POOL = { 5, SECTION_NO0}; /* 5 */
const MemMgrLite::PoolId S0_PRE_APU_CMD_POOL = { 6, SECTION_NO0}; /* 6 */

#define NUM_MEM_S0_LAYOUTS 1
#define NUM_MEM_S0_POOLS 7

#define NUM_MEM_LAYOUTS 1
#define NUM_MEM_POOLS 7


/*
* Pool areas
*/
/* Section0 Layout0: */
#define MEMMGR_S0_L0_WORK_SIZE 0x0000009c

/* Skip 0x0004 bytes for alignment. */
#define S0_L0_ES_BUF_POOL_ALIGN 0x00000008
#define S0_L0_ES_BUF_POOL_L_FENCE 0x000c0004
#define S0_L0_ES_BUF_POOL_ADDR 0x000c0008
#define S0_L0_ES_BUF_POOL_SIZE 0x0000f000
#define S0_L0_ES_BUF_POOL_U_FENCE 0x000cf008
#define S0_L0_ES_BUF_POOL_NUM_SEG 0x00000005
#define S0_L0_ES_BUF_POOL_SEG_SIZE 0x00003000

#define S0_L0_PREPROC_BUF_POOL_ALIGN 0x00000008
#define S0_L0_PREPROC_BUF_POOL_L_FENCE 0x000cf00c
#define S0_L0_PREPROC_BUF_POOL_ADDR 0x000cf010
#define S0_L0_PREPROC_BUF_POOL_SIZE 0x0000f000
#define S0_L0_PREPROC_BUF_POOL_U_FENCE 0x000de010
#define S0_L0_PREPROC_BUF_POOL_NUM_SEG 0x00000005
#define S0_L0_PREPROC_BUF_POOL_SEG_SIZE 0x00003000

#define S0_L0_INPUT_BUF_POOL_ALIGN 0x00000008
#define S0_L0_INPUT_BUF_POOL_L_FENCE 0x000de014
#define S0_L0_INPUT_BUF_POOL_ADDR 0x000de018
#define S0_L0_INPUT_BUF_POOL_SIZE 0x0000f000
#define S0_L0_INPUT_BUF_POOL_U_FENCE 0x000ed018
#define S0_L0_INPUT_BUF_POOL_NUM_SEG 0x00000005
#define S0_L0_INPUT_BUF_POOL_SEG_SIZE 0x00003000

#define S0_L0_ENC_APU_CMD_POOL_ALIGN 0x00000008
#define S0_L0_ENC_APU_CMD_POOL_L_FENCE 0x000ed01c
#define S0_L0_ENC_APU_CMD_POOL_ADDR 0x000ed020
#define S0_L0_ENC_APU_CMD_POOL_SIZE 0x00000114
#define S0_L0_ENC_APU_CMD_POOL_U_FENCE 0x000ed134
#define S0_L0_ENC_APU_CMD_POOL_NUM_SEG 0x00000003
#define S0_L0_ENC_APU_CMD_POOL_SEG_SIZE 0x0000005c

/* Skip 0x0004 bytes for alignment. */
#define S0_L0_SRC_APU_CMD_POOL_ALIGN 0x00000008
#define S0_L0_SRC_APU_CMD_POOL_L_FENCE 0x000ed13c
#define S0_L0_SRC_APU_CMD_POOL_ADDR 0x000ed140
#define S0_L0_SRC_APU_CMD_POOL_SIZE 0x00000114
#define S0_L0_SRC_APU_CMD_POOL_U_FENCE 0x000ed254
#define S0_L0_SRC_APU_CMD_POOL_NUM_SEG 0x00000003
#define S0_L0_SRC_APU_CMD_POOL_SEG_SIZE 0x0000005c

/* Skip 0x0004 bytes for alignment. */
#define S0_L0_PRE_APU_CMD_POOL_ALIGN 0x00000008
#define S0_L0_PRE_APU_CMD_POOL_L_FENCE 0x000ed25c
#define S0_L0_PRE_APU_CMD_POOL_ADDR 0x000ed260
#define S0_L0_PRE_APU_CMD_POOL_SIZE 0x00000114
#define S0_L0_PRE_APU_CMD_POOL_U_FENCE 0x000ed374
#define S0_L0_PRE_APU_CMD_POOL_NUM_SEG 0x00000003
#define S0_L0_PRE_APU_CMD_POOL_SEG_SIZE 0x0000005c

/* Remainder AUDIO_WORK_AREA=0x0000fc88 */

#endif /* MEM_LAYOUT_H_INCLUDED */
@@ -0,0 +1,40 @@
/****************************************************************************
* audio_recorder/include/memory_layout.h
*
* Copyright 2018 Sony Semiconductor Solutions Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
* 3. Neither the name of Sony Semiconductor Solutions Corporation nor
* the names of its contributors may be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************/
#ifndef __AUDIO_LAYOUT_H_INCLUDED__
#define __AUDIO_LAYOUT_H_INCLUDED__

#define MEM_LAYOUT_RECORDER (0)

#endif /* __AUDIO_LAYOUT_H_INCLUDED__ */

0 comments on commit 98240c8

Please sign in to comment.