斯瓦迪亚骑士

斯瓦迪亚骑士

0个粉丝

1

问答

0

专栏

0

资料

斯瓦迪亚骑士  发布于  2025-01-06 18:27:15
采纳率 0%
1个问答
77

Hi3519DV500,ss_mpi_vpss_get_chn_frame失败(错误码0xa0078007 VPSS参数设置无效)

代码思路
在sample_vio的基础上修改,打算在sample_vio_start_route函数中,调用sample_vio_start_vpss的地方之后调用ss_mpi_vpss_get_chn_frame获取图像

发现获取图像失败后,通过ss_mpi_vpss_get_chn_attr发现队列深度为0且模式不为USER,于是通过ss_mpi_vpss_set_chn_attr设置depth=2,chn_mode = OT_VPSS_CHN_MODE_USER,但是依然失败,错误码0xa0078007(VPSS参数设置无效),删除ss_mpi_vpss_set_chn_attr错误码依然如此

之后查看/proc/umap/vi和/proc/umap/vpss,好像里面什么都没有,vpss grp cfg什么的都是空的

查看/dev/logmpp,只有一条
vpss_user_get_frame [line]:717 [info]:grp0 chn0 frame_info invalid!

运行程序前加载ko的指令为:
./load3519dv500 -i -sensor0 os08a20 -sensor1 os08a20 -sensor2 os08a20 -sensor3 os08a20

sample看起来是有启动vi和vpss的,也都没有报错
请问可能有哪些地方存在问题?加载ko的指令是否有错?能否指出排查思路?感激不尽

补充:由于给的板子没有显示屏,所以现在无法确定sample_vio能不能成功,只知道运行sample_vio没有报错

运行sample程序后的选择如下:
(0) all mode route :vi linear(Online/Offline) -> vpss(Online/Offline) -> venc && vo.
(0) VI_ONLINE_VPSS_ONLINE, FMU OFF

修改后的sample_vio_start_route代码如下:
static td_s32 sample_vio_start_route(sample_vi_cfg vi_cfg, sample_vpss_cfg vpss_cfg, td_s32 route_num)
{
td_s32 i, j, ret;
ot_vpss_grp vpss_grp[SAMPLE_VIO_MAX_ROUTE_NUM] = {0, 1, 2, 3};

//shianran-add var(get frame)-begin
ot_video_frame_info *frame_info; //图像信息
td_s32 milli_sec = 100; //超时时间


ot_vpss_chn_attr *chn_attr;


//shianran-add var(get frame)-end

sample_comm_vi_get_size_by_sns_type(SENSOR0_TYPE, &g_vb_param.vb_size);

if (sample_vio_sys_init() != TD_SUCCESS) {
    return TD_FAILURE;
}

for (i = 0; i < route_num; i++) {
    ret = sample_comm_vi_start_vi(&vi_cfg[i]);
        if (ret != TD_SUCCESS) {
        goto start_vi_failed;
    }
}

for (i = 0; i < route_num; i++) {
    sample_comm_vi_bind_vpss(i, 0, vpss_grp[i], 0);
}

for (i = 0; i < route_num; i++) {
    ret = sample_vio_start_vpss(vpss_grp[i], vpss_cfg);
    if (ret != TD_SUCCESS) {
        goto start_vpss_failed;
    }
}


//shianran-set chn attr-begin
//设置vpss chn模式
ret = ss_mpi_vpss_get_chn_attr(0, 0, chn_attr);
if(ret != 0){
    std::cout << "DEBUG:ss_mpi_vpss_get_chn_attr FAIL!\n";
}
printf("DEBUG:ss_mpi_vpss_get_chn_attr: depth = %d\n", chn_attr->depth);


chn_attr->depth = 2;
chn_attr->chn_mode = OT_VPSS_CHN_MODE_USER;

ret = ss_mpi_vpss_set_chn_attr(0, 0, chn_attr);
if(ret != 0){
    std::cout << "DEBUG:ss_mpi_vpss_set_chn_attr FAIL!\n";
}

ret = ss_mpi_vpss_get_chn_attr(0, 0, chn_attr);
printf("DEBUG:ss_mpi_vpss_set_chn_attr: depth = %d\n", chn_attr->depth);
printf("DEBUG:ss_mpi_vpss_set_chn_attr: mode = %d\n", chn_attr->chn_mode);

//shianran-set chn attr-end

//shianran-add-begin
//从vpss获取图像并处理

//shianran-add-end

//shianran - delete vo -begin

// ret = sample_vio_start_venc_and_vo(vpss_grp, SAMPLE_VIO_MAX_ROUTE_NUM, route_num);
// if (ret != TD_SUCCESS) {
//     goto start_venc_and_vo_failed;
// }

//shianran - delete vo - end


while(true)
{
    ret = ss_mpi_vpss_get_chn_frame(0, 0, frame_info, milli_sec);
    if(ret != 0){
        std::cout << "ss_mpi_vpss_get_chn_frame fail\n";
        std::cout << "ret:" << ret << "\n";
        break;
    }
    std::cout << "get frame\n";

    ret = ss_mpi_vpss_release_chn_frame(0, 0, frame_info);
    if(ret != 0){
        std::cout << "ss_mpi_vpss_release_chn_frame fail\n";
        break;
    }
    std::cout << "release frame\n";
}


return TD_SUCCESS;

start_venc_and_vo_failed:
start_vpss_failed:
for (j = i - 1; j >= 0; j—) {
sample_vio_stop_vpss(vpss_grp[j]);
}
for (i = 0; i < route_num; i++) {
sample_comm_vi_un_bind_vpss(i, 0, vpss_grp[i], 0);
}
start_vi_failed:
for (j = i - 1; j >= 0; j—) {
sample_comm_vi_stop_vi(&vi_cfg[j]);
}
sample_comm_sys_exit();
return TD_FAILURE;
}

我来回答
回答4个
时间排序
认可量排序

UncleRoderick

35个粉丝

14

问答

1

专栏

14

资料

UncleRoderick 2025-01-06 19:54:14
认可0

chn_mode不支持动态修改吧,直接在创建chn的时候设置好

斯瓦迪亚骑士
斯瓦迪亚骑士   回复   UncleRoderick  2025-01-06 20:56:50
0

感谢回复。试了一下,通过调用ss_mpi_vpss_get_chn_attr确认设置成功,然后get frame还是同样的错误

斯瓦迪亚骑士

0个粉丝

1

问答

0

专栏

0

资料

斯瓦迪亚骑士 2025-01-06 21:04:58
认可0

更新:
我发现/proc/umap/vi和/proc/umap/vpss需要在运行的时候看才行,之前是结束掉程序再cat所以看不到,下面附上文件内容
open /proc/umap/vi:

[VI] Version: [HI3519DV500_MPP_V2.0.0.3 B021 Release], Build Time[Jun 30 2023, 16:56:23]

————————————————————vi module param————————————————————————————————-
max_out_width max_out_height detect_err_frame drop_err_frame
8192 8192 0 0

————————————————————vi vpss mode & vi aiisp mode & fmu mode————————————————————-
pipe_id vi_vpss_mode vi_aiisp_mode fmu_mode
0 vi_online_vpss_online default off
1 vi_offline_vpss_offline default off
2 vi_offline_vpss_offline default off
3 vi_offline_vpss_offline default off
4 vi_offline_vpss_offline default off
5 vi_offline_vpss_offline default off
6 vi_offline_vpss_offline default off
7 vi_offline_vpss_offline default off
8 vi_offline_vpss_offline default off
9 vi_offline_vpss_offline default off
10 vi_offline_vpss_offline default off
11 vi_offline_vpss_offline default off
12 vi_offline_vpss_offline default off
13 vi_offline_vpss_offline default off
14 vi_offline_vpss_offline default off

————————————————————vi dev attr1——————————————————————————————————
dev_id dev_status intf_mode work_mode comp_mask0 comp_mask1 scan_mode
0 enable mipi 1mux fff00000 0 progressive

————————————————————vi dev attr2——————————————————————————————————
dev_id data_seq data_type data_reverse width height data_rate irq_affinity
0 yvyu raw N 3840 2184 x1 0

————————————————————vi thermo sns attr———————————————————————————————
dev_id work_mode ooc_width ooc_height ooc_bitwidth cfg_num frame_rate sd_mux0 sd_mux1 sd_mux2 sd_mux3

————————————————————vi dev detect info———————————————————————————————
dev_id valid_width valid_height em_data_size total_width vfb_height vbb_height
0 0 0 0 0 0 0

————————————————————vi stitch grp attr———————————————————————————————
grp_id stitch_en cfg_mode max_pts_gap pipe_num pipe_id

————————————————————vi bind attr——————————————————————————————————
dev_id pipe_num pipe_id
0 2 0,1

————————————————————vi wdr fusion grp attr—————————————————————————————
grp_id wdr_mode cache_line pipe_num pipe_id pipe_reverse
0 2to1_line 2160 2 0,1 N

————————————————————vi pipe attr1—————————————————————————————————-
pipe_id bypass_mode isp_bypass width height pixel_format compress_mode
0 bypass_none N 3840 2160 raw12 line
1 bypass_none N 3840 2160 raw12 line

————————————————————vi pipe attr2—————————————————————————————————-
pipe_id bit_align_mode src_rate dst_rate frame_source vc_num vb_src vb_pool
0 high -1 -1 src_fe 1 common -1
1 high -1 -1 src_fe 0 common -1

————————————————————vi aiisp pool attr———————————————————————————————
pipe_id aiisp_type in_pool_id out_pool_id net_type

————————————————————vi pipe param—————————————————————————————————-
pipe_id discard_pro_pic_en out_mode data_rate yuv_skip_en signed_bit_extend_en bnr_info_en
0 N norm x1 Y N N
1 N norm x1 Y N N

————————————————————vi pipe bnr buf num——————————————————————————————-
pipe_id bnr_buf_num
0 2
1 2

————————————————————vi pipe mcf info————————————————————————————————
pipe_id mcf_vi_en queue_full ref_ok last_pts ref_pts

————————————————————vi pipe pre crop attr—————————————————————————————-
pipe_id enable rect_x rect_y rect_width rect_height
0 N 0 0 0 0
1 N 0 0 0 0

————————————————————vi pipe post crop attr—————————————————————————————
pipe_id enable rect_x rect_y rect_width rect_height
0 N 0 0 0 0
1 N 0 0 0 0

————————————————————vi pipe 3dnr attr———————————————————————————————-
pipe_id enable nr_type compress_mode nr_motion_mode
0 Y NORM frame NORM
1 N NORM none NORM

————————————————————vi pipe 3dnr param———————————————————————————————

————————————————————vi pipe0 3dnr param——————————————————————————————-
pipe version opt_mode iso ref1_en
0 VER_1 MANUAL 0 1
nry0_en nry1_en nry2_en nry3_en nrc0_en nrc1_en limit_range_en
0 1 1 1 1 1 0
sfs1_0 sfs2_1 sfs2_2 sfs2_3 sfc sfs2_c
3 0 30 0 10 10
sfs1_1 sfs4_1 sfs4_2 sfs4_3 trc
8 0 30 0 20
tfs0_1 tfs0_2
0 12
tfs1_1 tfs1_2 adv_math
0 12 0
sfn_1 sfn_2 sfn_3
0_2_4_0 4_2_4_0 0_2_4_0
sfn_4
0_2_4_0
math_0 math0_1 math0_2
128 200 400
math1_1 math1_2
200 999

————————————————————vi pipe frame dump attr————————————————————————————-
pipe_id enable depth
0 N 0
1 N 0

————————————————————vi pipe private data dump attr—————————————————————————
pipe_id enable data_mode depth data_size
0 N back 0 0
1 N back 0 0

————————————————————vi pipe low delay attr—————————————————————————————
pipe_id enable line_cnt one_buf
0 N 0 N
1 N 0 N

————————————————————vi pipe frame interrupt attr——————————————————————————
pipe_id interrupt_type early_line
0 start 0
1 start 0

————————————————————vi pipe user pic attr—————————————————————————————-
pipe_id enable width height stride pixel_format pool_id phy_addr
0 N 0 0 0 n/a 0 0
1 N 0 0 0 n/a 0 0

————————————————————vi pipe snap attr———————————————————————————————-
pipe_id snap_type load_ccm_en frame_cnt repeat_send_times zsl_en frame_depth rollback_ms interval op_mode

————————————————————vi pipe status—————————————————————————————————
pipe_id enable width height int_cnt send_cnt lost_cnt vb_fail_cnt frame_rate
0 Y 3840 2160 0 0 0 0 0
1 Y 3840 2160 0 0 0 0 0

————————————————————vi pipe offline task statistics————————————————————————-
pipe_id receive_pic_cnt busy_num task_submit_cnt task_fail_cnt task_cost_time max_cost_time
0 0 0 0 0 0 0
1 0 0 0 0 0 0

————————————————————vi phys chn attr1———————————————————————————————-
pipe_id chn_id width height pixel_format dynamic_range video_format compress_mode mirror flip
0 0 3840 2160 sp420 sdr8 linear seg N N

————————————————————vi phys chn attr2———————————————————————————————-
pipe_id chn_id depth src_rate dst_rate vb_src vb_pool align
0 0 0 -1 -1 common -1 0

————————————————————vi phys chn dis config—————————————————————————————
pipe_id chn_id mode motion_level pdt_type buf_num crop_ratio frame_rate camera_steady scale
0 0 4_DOF_GME Low RECORDER 0 0 0 0 0
1 0 4_DOF_GME Low RECORDER 0 0 0 0 0

————————————————————vi phys chn dis attr1—————————————————————————————-
pipe_id chn_id enable gdc_bypass mov_sub roef timelag hor_limit ver_limit still_crop strength
0 0 N N 0 0 0 0 0 N 0
1 0 N N 0 0 0 0 0 N 0

————————————————————vi phys chn dis attr2—————————————————————————————-
pipe_id chn_id dis_ldc_en focal_len_x focal_len_y coord_shift_x coord_shift_y max_du
0 0 N 0 0 0 0 0
1 0 N 0 0 0 0 0

————————————————————vi phys chn dis param—————————————————————————————-
pipe_id chn_id large_motion_stable_coef low_freq_motion_preserve low_freq_motion_freq
0 0 100 10 100
1 0 100 10 100

————————————————————vi chn low delay attr—————————————————————————————-
pipe_id chn_id enable line_cnt one_buf
0 0 N 0 N

————————————————————vi chn crop info————————————————————————————————
pipe_id chn_id crop_en coord x y width height trim_x trim_y trim_width trim_height
0 0 N ABS 0 0 0 0

————————————————————vi chn status—————————————————————————————————-
pipe_id chn_id enable width height send_cnt vb_fail_cnt lost_frame_cnt frame_rate
0 0 Y 0 0 0 0 0 0

————————————————————vi chn out frame info—————————————————————————————-
pipe_id chn_id width height compress_mode low_delay_frame delay
0 0 0 0 none N 0

————————————————————vi interrupt cost time statistics———————————————————————-
isp_time isp_max_time vicap_time vicap_max_time viproc_time viproc_max_time total_time int_time_per_sec
0 0 0 0 0 0 0 0
open /proc/umap/vpss:

[VPSS] Version: [HI3519DV500_MPP_V2.0.0.3 B021 Release], Build Time[Jun 30 2023, 16:56:24]

————————————————————vpss module param———————————————————————————————-
schedule_mode max_out_width max_out_height
NORMAL 8192 8192

————————————————————vpss grp cfg——————————————————————————————————
grp is_rotation_input_support is_dis_gyro_support max_split_num max_out_rgn_num is_save_out_lut out_lut_buf_size
0 N N 3 1 N 0

————————————————————vpss grp attr1—————————————————————————————————
grp max_w max_h pixel_fmt src_rate dst_rate user_ctrl backup
0 3840 2160 YVU-SP420 -1 -1 Y N

————————————————————vpss grp attr2—————————————————————————————————
grp buf_share_en buf_share_chn dci ie dei_mode dei_width dei_height mcf_en act_buf_share
0 N 0 N N OFF 0 0 N N

————————————————————vpss grp crop info———————————————————————————————
grp crop_en coord x y width height trim_x trim_y trim_width trim_height
0 N ABS 0 0 0 0 0 0 3840 2160

————————————————————vpss grp 3dnr attr———————————————————————————————
grp enable type ref_cmp motion_mode
0 N VIDEO N NORM

————————————————————vpss 3dnr param————————————————————————————————-

————————————————————frame interrupt attr——————————————————————————————
grp int_type early_line
0 START 0

————————————————————vpss grp gdc param———————————————————————————————
grp in_width in_height lut_cell_size
0 3840 2160 16

————————————————————vpss grp spread attr——————————————————————————————
grp enable coef

————————————————————vpss grp ldc v1 attr——————————————————————————————
grp enable aspect x_ratio y_ratio xy_ratio center_x_offset center_y_offset distortion_ratio

————————————————————vpss grp ldc v2 attr——————————————————————————————
grp enable aspect x_ratio y_ratio xy_ratio len_x len_y shift_x shift_y coef_intp_ratio

————————————————————vpss grp rotation attr—————————————————————————————
grp enable view_type angle x_offset y_offset width height

————————————————————vpss grp fisheye attr—————————————————————————————-
grp enable mount_mode rgn_num bg_color lmf_en hor_offset ver_offset trapezoid_coef fan_strength

————————————————————vpss grp fisheye rgn attr———————————————————————————-
grp rgn_index view_mode in_radius out_radius pan tilt hor_zoom ver_zoom out_x out_y out_w out_h

————————————————————vpss grp pmf attr———————————————————————————————-
grp enable width height pmf_coef

————————————————————vpss grp fov attr———————————————————————————————-
grp enable fov_coef

————————————————————vpss grp lut attr———————————————————————————————-
grp pre_lut_en post_lut_en lut_mode ratio

————————————————————vpss grp lut——————————————————————————————————
grp name in_width in_height out_width out_height cell_size phys_addr

————————————————————vpss grp zme attr———————————————————————————————-
grp width height

————————————————————vpss grp stitch attr——————————————————————————————
grp enable pipe_num sync_en stitch_mode correction_mode

————————————————————vpss grp stitch correction cylindrical attr——————————————————-
grp pipe pmf_enable dst_width dst_height x_offset y_offset ratio pmf_coef

————————————————————vpss grp stitch correction lut attr——————————————————————-
grp pipe in_width in_height out_width out_height cell_size phys_addr

————————————————————vpss grp stitch blend param——————————————————————————-
grp buf_num position[0] range[0] position[1] range[1] position[2] range[2]

————————————————————vpss chn crop info———————————————————————————————
grp chn crop_en coord x y width height trim_x trim_y trim_width trim_height
0 0 N ABS 0 0 0 0

————————————————————vpss chn attr1—————————————————————————————————
grp chn enable mode width height align mirror flip src_rate dst_rate depth vb_src pool_id
0 0 Y USER 3840 2160 32 N N -1 -1 2 common -

————————————————————vpss chn attr2—————————————————————————————————
grp chn aspect video_x video_y video_w video_h bg_color border left_w right_w top_w bottom_w bd_color
0 0 NONE 0 0 0 0 0x0 N 0 0 0 0 0x0

————————————————————vpss chn attr3—————————————————————————————————
grp chn sharpen sp_strength quick_send scale_type
0 0 N 0 N NORMAL

————————————————————vpss chn fmu info———————————————————————————————-
grp chn fmu_mode
0 0 off

————————————————————vpss ext chn attr1———————————————————————————————
grp ext_chn enable src_chn width height src_rate dst_rate depth align src_type vb_src pool_id

————————————————————vpss ext chn attr2———————————————————————————————
grp ext_chn scale_type

————————————————————vpss chn low delay attr————————————————————————————-
grp chn enable line_cnt one_buf_en one_buf_addr act_low_delay_en
0 0 Y 200 N 0x0 Y

————————————————————vpss rgn info—————————————————————————————————-
grp cover mosaic corner overlay position
0 0 0 0 0 cur

————————————————————vpss grp stitch pipe status——————————————————————————-
grp pipe recv_pic preview_lost free_num busy_num overlap_point0x overlap_point1x

————————————————————vpss grp gdc status——————————————————————————————-
grp enable dis_en out_width out_height
0 N N 0 0

————————————————————vpss chn proc ex————————————————————————————————
grp chn rotate cover_ex mosaic_ex line_ex corner_ex overlay_ex
0 0 N 0 0 0 0 0

————————————————————vpss node status————————————————————————————————
grp free_num busy_num delay_num backup cur
0 0 0 0 0 0

————————————————————vpss grp work status——————————————————————————————
grp recv_pic preview_lost new_do old_do new_undo old_undo start_fail start cost_time max_cost_time vpss
0 0 0 0 0 0 0 0 Y 0 0 -

————————————————————vpss grp video frame info———————————————————————————-
grp width height pixel_fmt video_format dynamic_range cmp_mode recv_fmu first_pic_pts cur_pic_pts
0 3840 2160 YVU-SP420 LINEAR SDR8 NONE off 16428280325 16429279202

————————————————————vpss chn output status—————————————————————————————
grp chn enable width height pixel_fmt video_format dynamic_range cmp_mode send_ok frame_rate proc_time
0 0 Y 3840 2160 YVU-SP420 LINEAR SDR8 SEG 0 1 3006

————————————————————vpss drv work status——————————————————————————————
link_int bus_err dcmp_err frame_err malloc_err free_err start_suc0 start_err0 node_err0
0 0 0 0 0 0 0 0 0

————————————————————vpss hardware node queue————————————————————————————
free_num wait_num proc_num sel00 busy000 busy001 sel01 busy010 busy011
22 0 0 0 0 0 0 0 0

————————————————————vpss int work status——————————————————————————————
cnt_per_sec max_cnt_per_sec cost_time max_cost_time cost_time_per_sec max_cost_time_per_sec
0 0 0 0 0 0

斯瓦迪亚骑士

0个粉丝

1

问答

0

专栏

0

资料

斯瓦迪亚骑士 2025-01-07 00:50:13
认可0

问题解决!!!
原因分析:
文档里写的是

td_s32 ss_mpi_vpss_get_chn_frame(ot_vpss_grp grp, ot_vpss_chn chn, ot_video_frame_info *frame_info, td_s32 milli_sec)

然后这个ot_video_frame_info * frame_info我就直接定义了一个指针,并没有分配内存,所以数据一进来就炸了
所以定义的时候改成ot_video_frame_info frame_info = {0}; 然后调用改成ret = ss_mpi_vpss_get_chn_frame(0, 0, &frame_info, milli_sec);

问题解决

或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
相关问答
无更多相似问答 去提问
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区