7563
- 收藏
- 点赞
- 分享
- 举报
HI3531运行sample_hifb报错
运行sample_hifb时,HI_MPI_VO_SetPubAttr函数报错,错误码0xa00f8010,查找文档:
0xA00F8010 HI_ERR_VO_SYS_NOTREADY 系统未初始化
但是SAMPLE_COMM_SYS_Init已经将系统初始化过了,求解决方法,谢谢!
代码如下:
int main(int argc, char *argv[])
{
pthread_t phifb0;
#if HICHIP == HI3531_V100
pthread_t phifb1;
PTHREAD_HIFB_SAMPLE_INFO stInfo1;
VOU_GFX_BIND_LAYER_E enGfxBindLayer;
#endif
pthread_t phifb2;
PTHREAD_HIFB_SAMPLE_INFO stInfo0;
PTHREAD_HIFB_SAMPLE_INFO stInfo2;
VO_PUB_ATTR_S stPubAttr;
VB_CONF_S stVbConf;
HI_S32 s32Ret = HI_SUCCESS;
HI_S32 i;
SAMPLE_VI_MODE_E enViMode = SAMPLE_VI_MODE_1_D1;
SAMPLE_VO_MODE_E stVoMode = VO_MODE_4MUX;
HI_U32 u32ViChnNum = 4;
HI_U32 u32ViDevNum;
memset(&stVbConf, 0, sizeof(VB_CONF_S));
stVbConf.u32MaxPoolCnt = 16;
stVbConf.astCommPool[0].u32BlkSize = 768*576*2;
stVbConf.astCommPool[0].u32BlkCnt = 16;
stPubAttr.u32BgColor = 0xff00ff00;
#if HICHIP == HI3531_V100
stPubAttr.enIntfType = VO_INTF_VGA | VO_INTF_HDMI;
#else
stPubAttr.enIntfType = VO_INTF_BT1120;
#endif
stPubAttr.enIntfSync = VO_OUTPUT_720P50;
stPubAttr.bDoubleFrame = HI_FALSE;
signal(SIGINT, SAMPLE_VIO_HandleSig);
signal(SIGTERM, SAMPLE_VIO_HandleSig);
if(HI_SUCCESS != SAMPLE_COMM_SYS_Init(&stVbConf))
{
printf("func:%s,line:%d\n", __FUNCTION__, __LINE__);
return -1;
}
/* start VO to preview*/
if(HI_SUCCESS != SAMPLE_COMM_VO_StartDevLayer(VoDev, &stPubAttr,25))
{
printf("%s: Start DevLayer failed!\n", __FUNCTION__);
SAMPLE_COMM_SYS_Exit();
return -1;
}
。。。。。。。。。。。
return 0;
}
HI_S32 SAMPLE_COMM_SYS_Init(VB_CONF_S *pstVbConf)
{
MPP_SYS_CONF_S stSysConf = {0};
HI_S32 s32Ret = HI_FAILURE;
HI_MPI_SYS_Exit();
HI_MPI_VB_Exit();
if (NULL == pstVbConf)
{
SAMPLE_PRT("input parameter is null, it is invaild!\n");
return HI_FAILURE;
}
s32Ret = HI_MPI_VB_SetConf(pstVbConf);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("HI_MPI_VB_SetConf failed!\n");
return HI_FAILURE;
}
s32Ret = HI_MPI_VB_Init();
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("HI_MPI_VB_Init failed!\n");
return HI_FAILURE;
}
stSysConf.u32AlignWidth = SAMPLE_SYS_ALIGN_WIDTH;
s32Ret = HI_MPI_SYS_SetConf(&stSysConf);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("HI_MPI_SYS_SetConf failed\n");
return HI_FAILURE;
}
s32Ret = HI_MPI_SYS_Init();
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("HI_MPI_SYS_Init failed!\n");
return HI_FAILURE;
}
return HI_SUCCESS;
}
HI_S32 SAMPLE_COMM_VO_StartDevLayer(VO_DEV VoDev, VO_PUB_ATTR_S *pstPubAttr, HI_U32 u32SrcFrmRate)
{
HI_S32 s32Ret = HI_SUCCESS;
HI_U32 u32Width = 0;
HI_U32 u32Height = 0;
HI_U32 u32Frm = 0;
VO_VIDEO_LAYER_ATTR_S stLayerAttr;
if ( 0 == u32SrcFrmRate )
{
SAMPLE_PRT("vo u32SrcFrmRate invaild! %d!\n", u32SrcFrmRate);
return HI_FAILURE;
}
printf("-----------------dev:%d\n", VoDev);
s32Ret = HI_MPI_VO_SetPubAttr(VoDev, pstPubAttr);//-----------------此函数报错
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
return HI_FAILURE;
}
s32Ret = HI_MPI_VO_Enable(VoDev);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
return HI_FAILURE;
}
s32Ret = SAMPLE_COMM_VO_GetWH(pstPubAttr->enIntfSync, &u32Width, &u32Height, &u32Frm);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
return HI_FAILURE;
}
stLayerAttr.enPixFormat = SAMPLE_PIXEL_FORMAT;
stLayerAttr.u32DispFrmRt = u32SrcFrmRate;
stLayerAttr.stDispRect.s32X = 0;
stLayerAttr.stDispRect.s32Y = 0;
stLayerAttr.stDispRect.u32Width = u32Width;
stLayerAttr.stDispRect.u32Height = u32Height;
stLayerAttr.stImageSize.u32Width = u32Width;
stLayerAttr.stImageSize.u32Height = u32Height;
s32Ret = HI_MPI_VO_SetVideoLayerAttr(VoDev, &stLayerAttr);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
return HI_FAILURE;
}
s32Ret = HI_MPI_VO_EnableVideoLayer(VoDev);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
return HI_FAILURE;
}
return s32Ret;
}
日志如下:
# cat /dev/logmpp
<3>[ vo] [Func]:VouCascadePosUnBindChnBatch [Line]:11215 [Info]:<3>[ vo] Vo cascade device ID 92 invalid!
<3>[ vi] [Func]:VIU_DRV_DisableChn [Line]:1465 [Info]:<3>[ vi] !! Disable ViChn:0 timeout 120ms!!!
0xA00F8010 HI_ERR_VO_SYS_NOTREADY 系统未初始化
但是SAMPLE_COMM_SYS_Init已经将系统初始化过了,求解决方法,谢谢!
代码如下:
int main(int argc, char *argv[])
{
pthread_t phifb0;
#if HICHIP == HI3531_V100
pthread_t phifb1;
PTHREAD_HIFB_SAMPLE_INFO stInfo1;
VOU_GFX_BIND_LAYER_E enGfxBindLayer;
#endif
pthread_t phifb2;
PTHREAD_HIFB_SAMPLE_INFO stInfo0;
PTHREAD_HIFB_SAMPLE_INFO stInfo2;
VO_PUB_ATTR_S stPubAttr;
VB_CONF_S stVbConf;
HI_S32 s32Ret = HI_SUCCESS;
HI_S32 i;
SAMPLE_VI_MODE_E enViMode = SAMPLE_VI_MODE_1_D1;
SAMPLE_VO_MODE_E stVoMode = VO_MODE_4MUX;
HI_U32 u32ViChnNum = 4;
HI_U32 u32ViDevNum;
memset(&stVbConf, 0, sizeof(VB_CONF_S));
stVbConf.u32MaxPoolCnt = 16;
stVbConf.astCommPool[0].u32BlkSize = 768*576*2;
stVbConf.astCommPool[0].u32BlkCnt = 16;
stPubAttr.u32BgColor = 0xff00ff00;
#if HICHIP == HI3531_V100
stPubAttr.enIntfType = VO_INTF_VGA | VO_INTF_HDMI;
#else
stPubAttr.enIntfType = VO_INTF_BT1120;
#endif
stPubAttr.enIntfSync = VO_OUTPUT_720P50;
stPubAttr.bDoubleFrame = HI_FALSE;
signal(SIGINT, SAMPLE_VIO_HandleSig);
signal(SIGTERM, SAMPLE_VIO_HandleSig);
if(HI_SUCCESS != SAMPLE_COMM_SYS_Init(&stVbConf))
{
printf("func:%s,line:%d\n", __FUNCTION__, __LINE__);
return -1;
}
/* start VO to preview*/
if(HI_SUCCESS != SAMPLE_COMM_VO_StartDevLayer(VoDev, &stPubAttr,25))
{
printf("%s: Start DevLayer failed!\n", __FUNCTION__);
SAMPLE_COMM_SYS_Exit();
return -1;
}
。。。。。。。。。。。
return 0;
}
HI_S32 SAMPLE_COMM_SYS_Init(VB_CONF_S *pstVbConf)
{
MPP_SYS_CONF_S stSysConf = {0};
HI_S32 s32Ret = HI_FAILURE;
HI_MPI_SYS_Exit();
HI_MPI_VB_Exit();
if (NULL == pstVbConf)
{
SAMPLE_PRT("input parameter is null, it is invaild!\n");
return HI_FAILURE;
}
s32Ret = HI_MPI_VB_SetConf(pstVbConf);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("HI_MPI_VB_SetConf failed!\n");
return HI_FAILURE;
}
s32Ret = HI_MPI_VB_Init();
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("HI_MPI_VB_Init failed!\n");
return HI_FAILURE;
}
stSysConf.u32AlignWidth = SAMPLE_SYS_ALIGN_WIDTH;
s32Ret = HI_MPI_SYS_SetConf(&stSysConf);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("HI_MPI_SYS_SetConf failed\n");
return HI_FAILURE;
}
s32Ret = HI_MPI_SYS_Init();
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("HI_MPI_SYS_Init failed!\n");
return HI_FAILURE;
}
return HI_SUCCESS;
}
HI_S32 SAMPLE_COMM_VO_StartDevLayer(VO_DEV VoDev, VO_PUB_ATTR_S *pstPubAttr, HI_U32 u32SrcFrmRate)
{
HI_S32 s32Ret = HI_SUCCESS;
HI_U32 u32Width = 0;
HI_U32 u32Height = 0;
HI_U32 u32Frm = 0;
VO_VIDEO_LAYER_ATTR_S stLayerAttr;
if ( 0 == u32SrcFrmRate )
{
SAMPLE_PRT("vo u32SrcFrmRate invaild! %d!\n", u32SrcFrmRate);
return HI_FAILURE;
}
printf("-----------------dev:%d\n", VoDev);
s32Ret = HI_MPI_VO_SetPubAttr(VoDev, pstPubAttr);//-----------------此函数报错
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
return HI_FAILURE;
}
s32Ret = HI_MPI_VO_Enable(VoDev);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
return HI_FAILURE;
}
s32Ret = SAMPLE_COMM_VO_GetWH(pstPubAttr->enIntfSync, &u32Width, &u32Height, &u32Frm);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
return HI_FAILURE;
}
stLayerAttr.enPixFormat = SAMPLE_PIXEL_FORMAT;
stLayerAttr.u32DispFrmRt = u32SrcFrmRate;
stLayerAttr.stDispRect.s32X = 0;
stLayerAttr.stDispRect.s32Y = 0;
stLayerAttr.stDispRect.u32Width = u32Width;
stLayerAttr.stDispRect.u32Height = u32Height;
stLayerAttr.stImageSize.u32Width = u32Width;
stLayerAttr.stImageSize.u32Height = u32Height;
s32Ret = HI_MPI_VO_SetVideoLayerAttr(VoDev, &stLayerAttr);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
return HI_FAILURE;
}
s32Ret = HI_MPI_VO_EnableVideoLayer(VoDev);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
return HI_FAILURE;
}
return s32Ret;
}
日志如下:
# cat /dev/logmpp
<3>[ vo] [Func]:VouCascadePosUnBindChnBatch [Line]:11215 [Info]:<3>[ vo] Vo cascade device ID 92 invalid!
<3>[ vi] [Func]:VIU_DRV_DisableChn [Line]:1465 [Info]:<3>[ vi] !! Disable ViChn:0 timeout 120ms!!!
我来回答
回答3个
时间排序
认可量排序
认可0
认可0
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2014-09-28 14:26:08
-
2015-06-01 12:00:48
-
2015-06-01 12:01:46
-
2015-05-25 21:07:40
-
2015-05-25 21:11:56
-
2021-09-08 10:10:38
-
2014-09-29 10:21:08
-
2019-08-06 10:05:30
-
2018-12-11 22:22:53
-
2015-08-05 15:31:24
-
2016-04-15 14:46:24
-
2015-05-14 18:06:06
-
2015-09-17 17:22:21
-
2020-02-20 15:52:46
-
2017-09-19 11:12:29
-
2014-10-14 11:18:16
-
2013-01-03 15:02:47
-
02015-05-26 15:27:42
-
2015-11-10 15:13:51
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
5SS928的emmc有32GB,bootargs设置使用16GB,但是为啥能用的只有rootfs的大小
-
33SS928怎样烧写ubuntu系统
-
10ToolPlatform下载rootfs提示网络失败
-
10谁有GK7205V500的SDK
-
5Hi3516CV610 烧录不进去
-
10Hi3559AV100 芯片硬解码h265编码格式的视频时出现视频播放错误,解码错误信息 s32PackErr:码流有错
-
5海思SS928 / SD3403的sample_venc.c摄像头编码Demo中,采集到的摄像头的YUV数据在哪个相关的函数中?
-
5海鸥派openEuler无法启动网卡,连接WIFI存在问题
-
66有没有ISP相关的巨佬帮忙看看SS928对接IMX347的图像问题
-
50求助hi3559与FPGA通过SLVS-EC接口对接问题
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认