mirror of
https://github.com/m5stack/StackFlow.git
synced 2026-05-20 11:32:11 -07:00
[update] support ax650. add ax650 model.
This commit is contained in:
@@ -55,3 +55,60 @@ if 'CONFIG_AX_620E_MSP_ENABLED' in os.environ:
|
||||
'REGISTER':'static'
|
||||
})
|
||||
|
||||
if 'CONFIG_AX_650N_MSP_ENABLED' in os.environ:
|
||||
MSP_PATH = ''
|
||||
if 'CONFIG_MSP_V3_0_0_ENABLED' in os.environ:
|
||||
MSP_PATH = os.environ.get('EXT_MSP_PATH', check_wget_down("https://m5stack.oss-cn-shenzhen.aliyuncs.com/resource/linux/llm/m5stack_ax650n_msp.tar.gz", 'm5stack_ax650n_msp.tar.gz'))
|
||||
|
||||
SRCS=[]
|
||||
INCLUDE=[]
|
||||
PRIVATE_INCLUDE=[]
|
||||
REQUIREMENTS=[]
|
||||
STATIC_LIB=[]
|
||||
DYNAMIC_LIB=[]
|
||||
DEFINITIONS=[]
|
||||
DEFINITIONS_PRIVATE=['']
|
||||
LDFLAGS=[]
|
||||
LINK_SEARCH_PATH=[]
|
||||
|
||||
env["MSP_PATH"] = MSP_PATH
|
||||
# , os.path.join(MSP_PATH, 'sample/common')
|
||||
INCLUDE += [os.path.join(MSP_PATH, 'out/include'), os.path.join(MSP_PATH, 'sample'), os.path.join(MSP_PATH, 'sample/rtsp')]
|
||||
LINK_SEARCH_PATH += [os.path.join(MSP_PATH, 'out/lib')]
|
||||
REQUIREMENTS += ['dl', 'm', 'pthread']
|
||||
third_party = ['drm','faac','fdk-aac','ffmpeg','libsamplerate','mp4','opencv','opus','tinyalsa']
|
||||
for dirn in third_party:
|
||||
INCLUDE.append(os.path.join(MSP_PATH,'third-party',dirn,'include'))
|
||||
LINK_SEARCH_PATH.append(os.path.join(MSP_PATH,'third-party',dirn,'lib/arm64/glibc'))
|
||||
INCLUDE.append(os.path.join(MSP_PATH,'third-party/tinyalsa/include/tinyalsa'))
|
||||
INCLUDE.append(os.path.join(MSP_PATH,'third-party/live/out/include/liveMedia'))
|
||||
INCLUDE.append(os.path.join(MSP_PATH,'third-party/live/out/include/groupsock'))
|
||||
INCLUDE.append(os.path.join(MSP_PATH,'third-party/live/out/include/UsageEnvironment'))
|
||||
INCLUDE.append(os.path.join(MSP_PATH,'third-party/live/out/include/BasicUsageEnvironment'))
|
||||
INCLUDE.append(os.path.join(MSP_PATH,'component/isp_proton/sensor/platform/tcm'))
|
||||
LINK_SEARCH_PATH.append(os.path.join(MSP_PATH,'third-party/libsamplerate/lib'))
|
||||
INCLUDE.append(os.path.join(MSP_PATH,'third-party/openssl/include'))
|
||||
LINK_SEARCH_PATH.append(os.path.join(MSP_PATH,'third-party/openssl/arm64/glibc/lib'))
|
||||
LINK_SEARCH_PATH.append(os.path.join(MSP_PATH,'third-party/tinyalsa/lib'))
|
||||
LINK_SEARCH_PATH.append(os.path.join(MSP_PATH,'third-party/fdk-aac/lib'))
|
||||
LINK_SEARCH_PATH.append(os.path.join(MSP_PATH,'third-party/opus/lib'))
|
||||
LINK_SEARCH_PATH.append(os.path.join(MSP_PATH,'app/lib'))
|
||||
|
||||
if 'CONFIG_SAMPLE_COMMON_ENABLED' in os.environ:
|
||||
if 'CONFIG_MSP_V3_0_0_ENABLED' in os.environ:
|
||||
INCLUDE.append(os.path.join(MSP_PATH,'sample/common'))
|
||||
SRCS += AGlob(os.path.join(MSP_PATH,'sample/common/*.c*'))
|
||||
|
||||
env['COMPONENTS'].append({'target':os.path.basename(env['component_dir']),
|
||||
'SRCS':SRCS,
|
||||
'INCLUDE':INCLUDE,
|
||||
'PRIVATE_INCLUDE':PRIVATE_INCLUDE,
|
||||
'REQUIREMENTS':REQUIREMENTS,
|
||||
'STATIC_LIB':STATIC_LIB,
|
||||
'DYNAMIC_LIB':DYNAMIC_LIB,
|
||||
'DEFINITIONS':DEFINITIONS,
|
||||
'DEFINITIONS_PRIVATE':DEFINITIONS_PRIVATE,
|
||||
'LDFLAGS':LDFLAGS,
|
||||
'LINK_SEARCH_PATH':LINK_SEARCH_PATH,
|
||||
'REGISTER':'static'
|
||||
})
|
||||
@@ -22,9 +22,9 @@ DEFINITIONS += ['-std=c++17']
|
||||
LDFLAGS+=['-Wl,-rpath=/opt/m5stack/lib', '-Wl,-rpath=/usr/local/m5stack/lib', '-Wl,-rpath=/usr/local/m5stack/lib/gcc-10.3', '-Wl,-rpath=/opt/lib', '-Wl,-rpath=/opt/usr/lib', '-Wl,-rpath=./']
|
||||
# INCLUDE += [ADir('../include'), ADir('../include/cppzmq'), ADir('../include/libzmq')]
|
||||
LINK_SEARCH_PATH += [ADir('../static_lib')]
|
||||
|
||||
REQUIREMENTS += ['ax_sys', 'ax_interpreter', 'ax_audio', 'ax_audio_3a', 'ax_fdk', 'ax_opus']
|
||||
REQUIREMENTS += ['tinyalsa', 'opus', 'samplerate', 'fdk-aac']
|
||||
REQUIREMENTS += ['ax_sys', 'ax_audio', 'ax_audio_3a', 'tinyalsa', 'fdk-aac', 'opus', 'samplerate']
|
||||
if 'CONFIG_AX_620E_MSP_ENABLED' in os.environ:
|
||||
REQUIREMENTS += ['ax_interpreter', 'ax_fdk', 'ax_opus']
|
||||
|
||||
STATIC_FILES += [AFile('audio.json'), AFile('audio_kit.json')]
|
||||
STATIC_FILES += Glob('mode_*.json')
|
||||
|
||||
@@ -69,8 +69,13 @@ private:
|
||||
|
||||
void hw_cap()
|
||||
{
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
ax_cap_start(cap_config.card, cap_config.device, cap_config.volume, cap_config.channel, cap_config.rate,
|
||||
cap_config.bit, llm_audio::on_cap_sample);
|
||||
#else
|
||||
alsa_cap_start(cap_config.card, cap_config.device, cap_config.volume, cap_config.channel, cap_config.rate,
|
||||
cap_config.bit, llm_audio::on_cap_sample);
|
||||
#endif
|
||||
}
|
||||
|
||||
void _play(const std::string &audio_data)
|
||||
@@ -143,13 +148,17 @@ public:
|
||||
nlohmann::json error_body;
|
||||
std::string base_model_path;
|
||||
std::string base_model_config_path;
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
std::list<std::string> config_file_paths;
|
||||
if (access("/sys/devices/platform/soc/4851000.i2c/i2c-1/1-0043", F_OK) == 0) {
|
||||
config_file_paths = get_config_file_paths(base_model_path, base_model_config_path, "audio_kit");
|
||||
} else {
|
||||
config_file_paths = get_config_file_paths(base_model_path, base_model_config_path, "audio");
|
||||
}
|
||||
|
||||
#else
|
||||
std::list<std::string> config_file_paths =
|
||||
get_config_file_paths(base_model_path, base_model_config_path, "audio");
|
||||
#endif
|
||||
try {
|
||||
config_body = nlohmann::json::parse(data);
|
||||
for (auto file_name : config_file_paths) {
|
||||
@@ -201,6 +210,7 @@ public:
|
||||
CONFIG_AUTO_SET(file_body["play_param"], stVqeAttr.stAgcCfg.enAgcMode);
|
||||
CONFIG_AUTO_SET(file_body["play_param"], stVqeAttr.stAgcCfg.s16TargetLevel);
|
||||
CONFIG_AUTO_SET(file_body["play_param"], stVqeAttr.stAgcCfg.s16Gain);
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
CONFIG_AUTO_SET(file_body["play_param"], stHpfAttr.bEnable);
|
||||
CONFIG_AUTO_SET(file_body["play_param"], stHpfAttr.s32GainDb);
|
||||
CONFIG_AUTO_SET(file_body["play_param"], stHpfAttr.s32Freq);
|
||||
@@ -215,6 +225,7 @@ public:
|
||||
CONFIG_AUTO_SET(file_body["play_param"], stEqAttr.s32GainDb[3]);
|
||||
CONFIG_AUTO_SET(file_body["play_param"], stEqAttr.s32GainDb[4]);
|
||||
CONFIG_AUTO_SET(file_body["play_param"], stEqAttr.s32Samplerate);
|
||||
#endif
|
||||
CONFIG_AUTO_SET(file_body["play_param"], gResample);
|
||||
CONFIG_AUTO_SET(file_body["play_param"], enInSampleRate);
|
||||
CONFIG_AUTO_SET(file_body["play_param"], gInstant);
|
||||
@@ -247,7 +258,17 @@ public:
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], aistAttr.enBitwidth);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], aistAttr.enLinkMode);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], aistAttr.enSamplerate);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], aistAttr.enLayoutMode);
|
||||
// CONFIG_AUTO_SET(file_body["cap_param"], aistAttr.enLayoutMode);
|
||||
if (config_body.contains("aistAttr.enLayoutMode"))
|
||||
mode_config_.aistAttr.enLayoutMode = config_body["aistAttr.enLayoutMode"];
|
||||
else if (file_body["cap_param"].contains("aistAttr.enLayoutMode")) {
|
||||
mode_config_.aistAttr.enLayoutMode = file_body["cap_param"]["aistAttr.enLayoutMode"];
|
||||
if (access("/sys/devices/platform/soc/4851000.i2c/i2c-1/1-0043", F_OK) == 0) {
|
||||
if (mode_config_.aistAttr.enLayoutMode == AX_AI_REF_MIC) {
|
||||
mode_config_.aistAttr.enLayoutMode = AX_AI_MIC_REF;
|
||||
}
|
||||
}
|
||||
}
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], aistAttr.U32Depth);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], aistAttr.u32PeriodSize);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], aistAttr.u32PeriodCount);
|
||||
@@ -261,6 +282,7 @@ public:
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], aistVqeAttr.stAgcCfg.s16TargetLevel);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], aistVqeAttr.stAgcCfg.s16Gain);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], aistVqeAttr.stAecCfg.enAecMode);
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], stHpfAttr.bEnable);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], stHpfAttr.s32GainDb);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], stHpfAttr.s32Samplerate);
|
||||
@@ -276,6 +298,7 @@ public:
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], stEqAttr.s32GainDb[3]);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], stEqAttr.s32GainDb[4]);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], stEqAttr.s32Samplerate);
|
||||
#endif
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], gResample);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], enOutSampleRate);
|
||||
CONFIG_AUTO_SET(file_body["cap_param"], gDbDetection);
|
||||
|
||||
@@ -116,6 +116,7 @@ void ax_play(unsigned int card, unsigned int device, float Volume, int channel,
|
||||
goto AO_DEINIT;
|
||||
}
|
||||
}
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
if (play_config.stHpfAttr.bEnable) {
|
||||
ret = AX_ACODEC_TxHpfSetAttr(card, &play_config.stHpfAttr);
|
||||
if (ret) {
|
||||
@@ -152,10 +153,14 @@ void ax_play(unsigned int card, unsigned int device, float Volume, int channel,
|
||||
goto DIS_LPF;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
ret = AX_AO_EnableDev(card, device);
|
||||
if (ret) {
|
||||
printf("AX_AO_EnableDev failed! ret = %x \n", ret);
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
goto DIS_EQ;
|
||||
#endif
|
||||
goto DIS_AO_DEVICE;
|
||||
}
|
||||
if (play_config.gResample) {
|
||||
ret = AX_AO_EnableResample(card, device, play_config.enInSampleRate);
|
||||
@@ -184,7 +189,11 @@ void ax_play(unsigned int card, unsigned int device, float Volume, int channel,
|
||||
AX_POOL_ReleaseBlock(stFrmInfo.u32BlkId);
|
||||
break;
|
||||
}
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
ret = AX_AO_SendFrame(card, device, &stFrmInfo, NULL, 0.f, -1);
|
||||
#else
|
||||
ret = AX_AO_SendFrame(card, device, &stFrmInfo, -1);
|
||||
#endif
|
||||
if (ret != AX_SUCCESS) {
|
||||
AX_POOL_ReleaseBlock(stFrmInfo.u32BlkId);
|
||||
printf("AX_AO_SendFrame error, ret: %x\n", ret);
|
||||
@@ -205,6 +214,7 @@ void ax_play(unsigned int card, unsigned int device, float Volume, int channel,
|
||||
while (1) {
|
||||
ret = AX_AO_QueryDevStat(card, device, &stStatus);
|
||||
if (stStatus.u32DevBusyNum == 0) {
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
if (play_config.gInsertSilence) {
|
||||
break;
|
||||
} else {
|
||||
@@ -212,11 +222,15 @@ void ax_play(unsigned int card, unsigned int device, float Volume, int channel,
|
||||
break;
|
||||
}
|
||||
}
|
||||
#else
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
usleep(10 * 1000);
|
||||
}
|
||||
}
|
||||
printf("ao success.\n");
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
DIS_EQ:
|
||||
if (play_config.stEqAttr.bEnable) {
|
||||
ret = AX_ACODEC_TxEqDisable(card);
|
||||
@@ -238,7 +252,7 @@ DIS_HPF:
|
||||
printf("AX_ACODEC_TxHpfDisable failed! ret= %x\n", ret);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
DIS_AO_DEVICE:
|
||||
ret = AX_AO_DisableDev(card, device);
|
||||
if (ret) {
|
||||
@@ -329,7 +343,7 @@ void ax_cap_start(unsigned int card, unsigned int device, float Volume, int chan
|
||||
}
|
||||
outRate = rate;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
if (cap_config.stHpfAttr.bEnable) {
|
||||
ret = AX_ACODEC_RxHpfSetAttr(card, &cap_config.stHpfAttr);
|
||||
if (ret) {
|
||||
@@ -366,11 +380,14 @@ void ax_cap_start(unsigned int card, unsigned int device, float Volume, int chan
|
||||
goto DIS_LPF;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
ret = AX_AI_EnableDev(card, device);
|
||||
if (ret) {
|
||||
printf("AX_AI_EnableDev failed! ret = %x \n", ret);
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
goto DIS_EQ;
|
||||
#endif
|
||||
goto AI_DETACHPOOL;
|
||||
}
|
||||
|
||||
if (cap_config.gResample) {
|
||||
@@ -415,7 +432,7 @@ DIS_AI_DEVICE:
|
||||
printf("AX_AI_DisableDev failed! ret= %x\n", ret);
|
||||
goto FREE_SYS;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
DIS_EQ:
|
||||
if (cap_config.stEqAttr.bEnable) {
|
||||
ret = AX_ACODEC_RxEqDisable(card);
|
||||
@@ -437,7 +454,7 @@ DIS_HPF:
|
||||
printf("AX_ACODEC_RxHpfDisable failed! ret= %x\n", ret);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
AI_DETACHPOOL:
|
||||
ret = AX_AI_DetachPool(card, device);
|
||||
if (AX_SUCCESS != ret) {
|
||||
|
||||
@@ -7,8 +7,11 @@
|
||||
#include "ax_ai_api.h"
|
||||
#include "ax_ao_api.h"
|
||||
#include "ax_global_type.h"
|
||||
#include <global_config.h>
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
#include "ax_acodec_api.h"
|
||||
#include "ax_aac.h"
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
unsigned int card;
|
||||
@@ -26,9 +29,11 @@ typedef struct {
|
||||
AX_AP_DNVQE_ATTR_T stVqeAttr;
|
||||
AX_AP_UPTALKVQE_ATTR_T aistVqeAttr;
|
||||
};
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
AX_ACODEC_FREQ_ATTR_T stHpfAttr;
|
||||
AX_ACODEC_FREQ_ATTR_T stLpfAttr;
|
||||
AX_ACODEC_EQ_ATTR_T stEqAttr;
|
||||
#endif
|
||||
int gResample;
|
||||
union {
|
||||
AX_AUDIO_SAMPLE_RATE_E enInSampleRate;
|
||||
|
||||
@@ -41,11 +41,11 @@ SRCS += Glob(os.path.join(env["MSP_PATH"], 'sample/rtsp/*.c*') )
|
||||
# INCLUDE.append(ADir('ax_sample'))
|
||||
# SRCS += Glob('ax_sample/*.c*')
|
||||
|
||||
REQUIREMENTS += ['ax_sys', 'ax_interpreter']
|
||||
REQUIREMENTS += ['ax_engine', 'ax_interpreter', 'ax_sys', 'ax_vo']
|
||||
REQUIREMENTS += ['ax_ae', 'ax_skel', 'ax_venc', 'ax_mipi', 'ax_ives', 'ax_ivps', 'ax_proton', 'ax_audio', 'tinyalsa']
|
||||
REQUIREMENTS += ['ax_audio_3a','samplerate', 'ax_fdk', 'fdk-aac', 'ax_awb', 'ax_af', 'ax_nt_stream', 'ax_nt_ctrl']
|
||||
REQUIREMENTS += ['liveMedia', 'UsageEnvironment', 'groupsock', 'BasicUsageEnvironment']
|
||||
REQUIREMENTS += ['ax_sys', 'ax_interpreter', 'ax_engine']
|
||||
if 'CONFIG_AX_620E_MSP_ENABLED' in os.environ:
|
||||
REQUIREMENTS += ['ax_ae', 'ax_vo', 'ax_skel', 'ax_venc', 'ax_mipi', 'ax_ives', 'ax_ivps', 'ax_proton', 'ax_audio', 'tinyalsa']
|
||||
REQUIREMENTS += ['ax_audio_3a','samplerate', 'ax_fdk', 'fdk-aac', 'ax_awb', 'ax_af', 'ax_nt_stream', 'ax_nt_ctrl']
|
||||
REQUIREMENTS += ['liveMedia', 'UsageEnvironment', 'groupsock', 'BasicUsageEnvironment']
|
||||
|
||||
INCLUDE += [ADir('../include/opencv4')]
|
||||
static_file = []
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
#include "camera.h"
|
||||
#include "axera_camera.h"
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
@@ -18,6 +17,9 @@
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <global_config.h>
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
#include "axera_camera.h"
|
||||
#include "AXRtspWrapper.h"
|
||||
#include "ax_venc_api.h"
|
||||
#include "ax_global_type.h"
|
||||
@@ -29,6 +31,9 @@
|
||||
#include "common_vin.h"
|
||||
#include "ax_sys_api.h"
|
||||
#include "ax_ivps_api.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
|
||||
#ifndef ALIGN_UP
|
||||
#define ALIGN_UP(x, a) ((((x) + ((a) - 1)) / a) * a)
|
||||
@@ -115,8 +120,6 @@ AX_VIN_CHN_ATTR_T gSc850slChn0Attr = {
|
||||
.tFrameRateCtrl = {AX_INVALID_FRMRATE, AX_INVALID_FRMRATE},
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct axera_camera_index_t {
|
||||
char name[48];
|
||||
SAMPLE_VIN_CASE_E index;
|
||||
@@ -137,8 +140,6 @@ struct axera_camera_index_t {
|
||||
{"axera_single_os04a10_online", SYS_CASE_SINGLE_OS04A10_ONLINE},
|
||||
{"axera_single_sc850sl", SAMPLE_VIN_SINGLE_SC850SL}};
|
||||
|
||||
|
||||
|
||||
/* comm pool */
|
||||
COMMON_SYS_POOL_CFG_T gtSysCommPoolSingleDummySdr[] = {
|
||||
{2688, 1520, 2688, AX_FORMAT_BAYER_RAW_16BPP, 6}, /*vin raw16 use */
|
||||
@@ -1611,9 +1612,9 @@ int axera_camera_open_from(camera_t *camera)
|
||||
return -10;
|
||||
}
|
||||
|
||||
axera_obj.VinParam.eSysMode = axera_config->VinParam.eSysMode; // COMMON_VIN_SENSOR;
|
||||
axera_obj.VinParam.eHdrMode = axera_config->VinParam.eHdrMode; // AX_SNS_LINEAR_MODE;
|
||||
axera_obj.VinParam.bAiispEnable = axera_config->VinParam.bAiispEnable; // AX_TRUE;
|
||||
axera_obj.VinParam.eSysMode = axera_config->VinParam.eSysMode; // COMMON_VIN_SENSOR;
|
||||
axera_obj.VinParam.eHdrMode = axera_config->VinParam.eHdrMode; // AX_SNS_LINEAR_MODE;
|
||||
axera_obj.VinParam.bAiispEnable = axera_config->VinParam.bAiispEnable; // AX_TRUE;
|
||||
// axera_obj.gCams.tChnAttr
|
||||
__sample_case_config(&axera_obj.gCams, &axera_obj.VinParam, &axera_obj.tCommonArgs, &axera_obj.tPrivArgs);
|
||||
COMMON_SYS_Init(&axera_obj.tCommonArgs);
|
||||
@@ -1720,4 +1721,5 @@ int axera_camera_close(camera_t *camera)
|
||||
SLOGI("camera closed");
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -13,7 +13,10 @@
|
||||
#include <iostream>
|
||||
#include "../../../../SDK/components/utilities/include/sample_log.h"
|
||||
#include "camera.h"
|
||||
#include <global_config.h>
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
#include "axera_camera.h"
|
||||
#endif
|
||||
#include <glob.h>
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include "hv/TcpServer.h"
|
||||
@@ -172,7 +175,7 @@ public:
|
||||
{
|
||||
out_callback_ = out_callback;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
static bool parse_axera_config(const nlohmann::json &config_body, const nlohmann::json &file_body,
|
||||
void **custom_config)
|
||||
{
|
||||
@@ -473,11 +476,13 @@ public:
|
||||
(stVencChnAttr.stVencAttr.u32PicHeightSrc < frame_height)) {
|
||||
return true;
|
||||
}
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
init_rtsp(&stVencChnAttr);
|
||||
#endif
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif
|
||||
bool parse_config(const nlohmann::json &config_body)
|
||||
{
|
||||
try {
|
||||
@@ -502,11 +507,15 @@ public:
|
||||
hal_camera_open = camera_open;
|
||||
hal_camera_close = camera_close;
|
||||
hal_parse_config = NULL;
|
||||
} else if (devname_.find("axera_") != std::string::npos) {
|
||||
}
|
||||
#if defined(CONFIG_AX_620E_MSP_ENABLED) || defined(CONFIG_AX_620Q_MSP_ENABLED)
|
||||
else if (devname_.find("axera_") != std::string::npos) {
|
||||
hal_camera_open = axera_camera_open;
|
||||
hal_camera_close = axera_camera_close;
|
||||
hal_parse_config = llm_task::parse_axera_config;
|
||||
} else {
|
||||
}
|
||||
#endif
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
{
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"mode":"depth-anything-ax650",
|
||||
"type":"cv",
|
||||
"homepage":"https://huggingface.co/AXERA-TECH/Depth-Anything-V2",
|
||||
"compile_flage":"pulsar2 build --input depth_anything_v2_vits.onnx --config config.json --output_dir build-output --output_name depth_anything_v2_vits.axmodel --target_hardware AX650 --compiler.check 0",
|
||||
"pulsar_version":"3.3-ae03a08f",
|
||||
"capabilities":[
|
||||
"Segmentation"
|
||||
],
|
||||
"input_type":[
|
||||
"cv.jpeg.base64"
|
||||
],
|
||||
"output_type":[
|
||||
"cv.jpeg.base64"
|
||||
],
|
||||
"mode_param":{
|
||||
"depth_anything_model":"depth_anything.axmodel",
|
||||
"model_type":"segment",
|
||||
"img_h":518,
|
||||
"img_w":518
|
||||
},
|
||||
"mode_param_bak":{
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ typedef enum axNPU_TYPE_E {
|
||||
AX_BL_VNPU_2 = (1 << 4) /* running under BIG-LITTLE VNPU2 */
|
||||
} AX_NPU_TYPE_E;
|
||||
|
||||
#if defined(CHIP_AX650)
|
||||
#if defined(CONFIG_AX_650N_MSP_ENABLED)
|
||||
static AX_S32 CheckModelVNpu(const std::string &strModel, const AX_ENGINE_MODEL_TYPE_T &eModelType,
|
||||
const AX_S32 &nNpuType, AX_U32 &nNpuSet)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"mode": "melotts-en-au-ax650",
|
||||
"type": "tts",
|
||||
"homepage": "https://github.com/ml-inory/melotts.axera/tree/main/model_convert",
|
||||
"compile_flage": "pulsar2 build --input decoder-en.onnx --config config_decoder_u16_en-au.json --output_dir decoder-au-ax650 --output_name decoder-en-au.axmodel --target_hardware AX650 --npu_mode NPU3 --compiler.check 0",
|
||||
"pulsar_version": "4.0-64a0e58f",
|
||||
"capabilities": [
|
||||
"tts",
|
||||
"English"
|
||||
],
|
||||
"input_type": [
|
||||
"tts.utf-8"
|
||||
],
|
||||
"output_type": [
|
||||
"tts.wav",
|
||||
"sys.play.0_1"
|
||||
],
|
||||
"mode_param": {
|
||||
"encoder": "encoder-en-au.ort",
|
||||
"decoder": "decoder-en-au.axmodel",
|
||||
"gbin": "g-en-au.bin",
|
||||
"tokens": "tokens-en.txt",
|
||||
"lexicon": "lexicon-en.txt",
|
||||
"tagger": "en_tn_tagger.fst",
|
||||
"verbalizer": "en_tn_verbalizer.fst",
|
||||
"spacker_speed": 1.2,
|
||||
"mode_rate": 44100,
|
||||
"audio_rate": 16000,
|
||||
"awake_delay": 1000
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"mode": "melotts-en-br-ax650",
|
||||
"type": "tts",
|
||||
"homepage": "https://github.com/ml-inory/melotts.axera/tree/main/model_convert",
|
||||
"compile_flage": "pulsar2 build --input decoder-en.onnx --config config_decoder_u16_en-br.json --output_dir decoder-br-ax650 --output_name decoder-en-br.axmodel --target_hardware AX650 --npu_mode NPU3 --compiler.check 0",
|
||||
"pulsar_version": "4.0-64a0e58f",
|
||||
"capabilities": [
|
||||
"tts",
|
||||
"English"
|
||||
],
|
||||
"input_type": [
|
||||
"tts.utf-8"
|
||||
],
|
||||
"output_type": [
|
||||
"tts.wav",
|
||||
"sys.play.0_1"
|
||||
],
|
||||
"mode_param": {
|
||||
"encoder": "encoder-en-br.ort",
|
||||
"decoder": "decoder-en-br.axmodel",
|
||||
"gbin": "g-en-br.bin",
|
||||
"tokens": "tokens-en.txt",
|
||||
"lexicon": "lexicon-en.txt",
|
||||
"tagger": "en_tn_tagger.fst",
|
||||
"verbalizer": "en_tn_verbalizer.fst",
|
||||
"spacker_speed": 1.2,
|
||||
"mode_rate": 44100,
|
||||
"audio_rate": 16000,
|
||||
"awake_delay": 1000
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"mode": "melotts-en-default-ax650",
|
||||
"type": "tts",
|
||||
"homepage": "https://github.com/ml-inory/melotts.axera/tree/main/model_convert",
|
||||
"compile_flage": "pulsar2 build --input decoder-en.onnx --config config_decoder_u16_en-default.json --output_dir decoder-default-ax650 --output_name decoder-en-default.axmodel --target_hardware AX650 --npu_mode NPU3 --compiler.check 0",
|
||||
"pulsar_version": "4.0-64a0e58f",
|
||||
"capabilities": [
|
||||
"tts",
|
||||
"English"
|
||||
],
|
||||
"input_type": [
|
||||
"tts.utf-8"
|
||||
],
|
||||
"output_type": [
|
||||
"tts.wav",
|
||||
"sys.play.0_1"
|
||||
],
|
||||
"mode_param": {
|
||||
"encoder": "encoder-en-default.ort",
|
||||
"decoder": "decoder-en-default.axmodel",
|
||||
"gbin": "g-en-default.bin",
|
||||
"tokens": "tokens-en.txt",
|
||||
"lexicon": "lexicon-en.txt",
|
||||
"tagger": "en_tn_tagger.fst",
|
||||
"verbalizer": "en_tn_verbalizer.fst",
|
||||
"spacker_speed": 1.2,
|
||||
"mode_rate": 44100,
|
||||
"audio_rate": 16000,
|
||||
"awake_delay": 1000
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"mode": "melotts-en-india-ax650",
|
||||
"type": "tts",
|
||||
"homepage": "https://github.com/ml-inory/melotts.axera/tree/main/model_convert",
|
||||
"compile_flage": "pulsar2 build --input decoder-en.onnx --config config_decoder_u16_en-india.json --output_dir decoder-india-ax650 --output_name decoder-en-india.axmodel --target_hardware AX650 --npu_mode NPU3 --compiler.check 0",
|
||||
"pulsar_version": "4.0-64a0e58f",
|
||||
"capabilities": [
|
||||
"tts",
|
||||
"English"
|
||||
],
|
||||
"input_type": [
|
||||
"tts.utf-8"
|
||||
],
|
||||
"output_type": [
|
||||
"tts.wav",
|
||||
"sys.play.0_1"
|
||||
],
|
||||
"mode_param": {
|
||||
"encoder": "encoder-en-india.ort",
|
||||
"decoder": "decoder-en-india.axmodel",
|
||||
"gbin": "g-en-india.bin",
|
||||
"tokens": "tokens-en.txt",
|
||||
"lexicon": "lexicon-en.txt",
|
||||
"tagger": "en_tn_tagger.fst",
|
||||
"verbalizer": "en_tn_verbalizer.fst",
|
||||
"spacker_speed": 1.2,
|
||||
"mode_rate": 44100,
|
||||
"audio_rate": 16000,
|
||||
"awake_delay": 1000
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"mode": "melotts-en-us-ax650",
|
||||
"type": "tts",
|
||||
"homepage": "https://github.com/ml-inory/melotts.axera/tree/main/model_convert",
|
||||
"compile_flage": "pulsar2 build --input decoder-en.onnx --config config_decoder_u16_en-us.json --output_dir decoder-us-ax650 --output_name decoder-en-us.axmodel --target_hardware AX650 --npu_mode NPU3 --compiler.check 0",
|
||||
"pulsar_version": "4.0-64a0e58f",
|
||||
"capabilities": [
|
||||
"tts",
|
||||
"English"
|
||||
],
|
||||
"input_type": [
|
||||
"tts.utf-8"
|
||||
],
|
||||
"output_type": [
|
||||
"tts.wav",
|
||||
"sys.play.0_1"
|
||||
],
|
||||
"mode_param": {
|
||||
"encoder": "encoder-en-us.ort",
|
||||
"decoder": "decoder-en-us.axmodel",
|
||||
"gbin": "g-en-us.bin",
|
||||
"tokens": "tokens-en.txt",
|
||||
"lexicon": "lexicon-en.txt",
|
||||
"tagger": "en_tn_tagger.fst",
|
||||
"verbalizer": "en_tn_verbalizer.fst",
|
||||
"spacker_speed": 1.2,
|
||||
"mode_rate": 44100,
|
||||
"audio_rate": 16000,
|
||||
"awake_delay": 1000
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"mode": "melotts-es-es-ax650",
|
||||
"type": "tts",
|
||||
"homepage": "https://github.com/ml-inory/melotts.axera/tree/main/model_convert",
|
||||
"compile_flage": "pulsar2 build --input decoder-es.onnx --config config_decoder_u16_es-es.json --output_dir decoder-es-ax650 --output_name decoder-es-es.axmodel --target_hardware AX650 --npu_mode NPU3 --compiler.check 0",
|
||||
"pulsar_version": "4.0-64a0e58f",
|
||||
"capabilities": [
|
||||
"tts",
|
||||
"Spanish"
|
||||
],
|
||||
"input_type": [
|
||||
"tts.utf-8"
|
||||
],
|
||||
"output_type": [
|
||||
"tts.wav",
|
||||
"sys.play.0_1"
|
||||
],
|
||||
"mode_param": {
|
||||
"encoder": "encoder-es-es.ort",
|
||||
"decoder": "decoder-es-es.axmodel",
|
||||
"gbin": "g-es.bin",
|
||||
"tokens": "tokens-es.txt",
|
||||
"lexicon": "lexicon-es.txt",
|
||||
"spacker_speed": 1.2,
|
||||
"mode_rate": 44100,
|
||||
"audio_rate": 16000,
|
||||
"awake_delay": 1000
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"mode": "melotts-ja-jp-ax650",
|
||||
"type": "tts",
|
||||
"homepage": "https://github.com/ml-inory/melotts.axera/tree/main/model_convert",
|
||||
"compile_flage": "pulsar2 build --input decoder-jp.onnx --config config_decoder_u16_ja-jp.json --output_dir decoder-ja-ax650 --output_name decoder-ja-jp.axmodel --target_hardware AX650 --npu_mode NPU3 --compiler.check 0",
|
||||
"pulsar_version": "4.0-64a0e58f",
|
||||
"capabilities": [
|
||||
"tts",
|
||||
"Japanese"
|
||||
],
|
||||
"input_type": [
|
||||
"tts.utf-8"
|
||||
],
|
||||
"output_type": [
|
||||
"tts.wav",
|
||||
"sys.play.0_1"
|
||||
],
|
||||
"mode_param": {
|
||||
"encoder": "encoder-ja-jp.ort",
|
||||
"decoder": "decoder-ja-jp.axmodel",
|
||||
"gbin": "g-jp.bin",
|
||||
"tokens": "tokens-jp.txt",
|
||||
"lexicon": "lexicon-jp.txt",
|
||||
"tagger": "ja_tn_tagger.fst",
|
||||
"verbalizer": "ja_tn_verbalizer.fst",
|
||||
"spacker_speed": 1.1,
|
||||
"mode_rate": 44100,
|
||||
"audio_rate": 16000,
|
||||
"awake_delay": 1000
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"mode": "melotts-zh-cn-ax650",
|
||||
"type": "tts",
|
||||
"homepage": "https://github.com/ml-inory/melotts.axera/tree/main/model_convert",
|
||||
"compile_flage": "pulsar2 build --input decoder-zh.onnx --config config_decoder_u16_zh-cn.json --output_dir decoder-zh-ax650 --output_name decoder-zh-cn.axmodel --target_hardware AX650 --npu_mode NPU3 --compiler.check 0",
|
||||
"pulsar_version": "4.0-64a0e58f",
|
||||
"capabilities": [
|
||||
"tts",
|
||||
"Chinese"
|
||||
],
|
||||
"input_type": [
|
||||
"tts.utf-8"
|
||||
],
|
||||
"output_type": [
|
||||
"tts.wav",
|
||||
"sys.play.0_1"
|
||||
],
|
||||
"mode_param": {
|
||||
"encoder": "encoder-zh-cn.ort",
|
||||
"decoder": "decoder-zh-cn.axmodel",
|
||||
"gbin": "g-zh_mix_en.bin",
|
||||
"tokens": "tokens.txt",
|
||||
"lexicon": "lexicon.txt",
|
||||
"tagger": "zh_tn_tagger.fst",
|
||||
"verbalizer": "zh_tn_verbalizer.fst",
|
||||
"spacker_speed": 1.1,
|
||||
"mode_rate": 44100,
|
||||
"audio_rate": 16000,
|
||||
"awake_delay": 1000
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,7 @@ typedef enum axNPU_TYPE_E {
|
||||
AX_BL_VNPU_2 = (1 << 4) /* running under BIG-LITTLE VNPU2 */
|
||||
} AX_NPU_TYPE_E;
|
||||
|
||||
#if defined(CHIP_AX650)
|
||||
#if defined(CONFIG_AX_650N_MSP_ENABLED)
|
||||
static AX_S32 CheckModelVNpu(const std::string &strModel, const AX_ENGINE_MODEL_TYPE_T &eModelType, const AX_S32 &nNpuType, AX_U32 &nNpuSet) {
|
||||
AX_ENGINE_NPU_ATTR_T stNpuAttr;
|
||||
memset(&stNpuAttr, 0x00, sizeof(stNpuAttr));
|
||||
|
||||
@@ -3,8 +3,10 @@ import os
|
||||
Import('env')
|
||||
with open(env['PROJECT_TOOL_S']) as f:
|
||||
exec(f.read())
|
||||
|
||||
SRCS = append_srcs_dir(ADir('src'))
|
||||
if 'CONFIG_AX_620E_MSP_ENABLED' in os.environ:
|
||||
SRCS = append_srcs_dir(ADir('src'))
|
||||
else:
|
||||
SRCS = Glob('src/main.c')
|
||||
INCLUDE = [ADir('include'), ADir('.')]
|
||||
PRIVATE_INCLUDE = []
|
||||
REQUIREMENTS = ['pthread', 'utilities', 'ax_msp', 'eventpp', 'StackFlow', 'ax-samples']
|
||||
@@ -21,7 +23,8 @@ DEFINITIONS += ['-std=c++17']
|
||||
LDFLAGS+=['-Wl,-rpath=/opt/m5stack/lib', '-Wl,-rpath=/usr/local/m5stack/lib', '-Wl,-rpath=/usr/local/m5stack/lib/gcc-10.3', '-Wl,-rpath=/opt/lib', '-Wl,-rpath=/opt/usr/lib', '-Wl,-rpath=./']
|
||||
LINK_SEARCH_PATH += [ADir('../static_lib')]
|
||||
REQUIREMENTS += ['ax_engine', 'ax_interpreter', 'ax_sys']
|
||||
REQUIREMENTS += ['ax_skel', 'ax_engine', 'ax_venc', 'ax_vdec', 'ax_ivps', 'ax_proton']
|
||||
if 'CONFIG_AX_620E_MSP_ENABLED' in os.environ:
|
||||
REQUIREMENTS += ['ax_skel', 'ax_engine', 'ax_venc', 'ax_vdec', 'ax_ivps', 'ax_proton']
|
||||
|
||||
INCLUDE += [ADir('../include'), ADir('src/runner'), ADir('../include/opencv4')]
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user