DEVICE_ATTR demo简单使用(实用)

本文深入解析Linux内核中的DEVICE_ATTR宏,介绍其在sysfs文件系统中创建设备节点的作用,包括如何定义读写函数,并通过具体示例展示了如何在探针函数中使用device_create_file来创建sysfs节点。

1. DEVICE_ATTR 创建设备节点,可以write/read信息,操作gpio等,很实用.

参考官方文档:documentation/driver-model/Device.txt

先看看DEVICE_ATTR的原型:
DEVICE_ATTR(_name, _mode, _show, _store)
_name:名称,也就是将在sys fs中生成的文件名称。
_mode:上述文件的访问权限,与普通文件相同,UGO的格式。
_show:显示函数,cat该文件时,此函数被调用
_store:写函数,echo内容到该文件时,此函数被调用

2. DEVICE_ATTR函数原型(include/linux/device.h)

#define DEVICE_ATTR(_name, _mode, _show, _store) \
      struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
 /* interface for exporting device attributes */      
  struct device_attribute {                            
      struct attribute    attr;                        
      ssize_t (*show)(struct device *dev, struct device_attribute *attr,
              char *buf);                              
      ssize_t (*store)(struct device *dev, struct device_attribute *attr,                                                                                                                                        
               const char *buf, size_t count);         
  };     

3 . 主要修改show,store两个函数

static DEVICE_ATTR(camera1, S_IRUGO | S_IWUSR, my_show_camera1, my_store_camera1);

注意:  my_store_camera1:

return count,一般count大小就是一个PAGE_SIZE。 如果这个函数 return 0,这个store函数将被无限循环调用导致系统crash

static ssize_t my_store_camera1(struct device* cd, struct device_attribute *attr,
const char* buf, size_t len){
return len;
}

static ssize_t my_show_camera1(struct device* cd,struct device_attribute *attr, char* buf){
ssize_t ret = 0;
if (tc_camera_id1 == 1){
	sprintf(buf, "imx577\n");
} else{
	sprintf(buf, "find not camera\n");
}

ret = strlen(buf) + 1;

return ret;
}
static DEVICE_ATTR(camera1, S_IRUGO | S_IWUSR, my_show_camera1, my_store_camera1);

4.device_create_file

static int my_create_sysfs(struct platform_device *client){
struct device *dev = &(client->dev);

     int err = 0;

if ((err = device_create_file(dev, &dev_attr_camera1))){

goto err_out;
}

return 0;

err_out:

return err;

}

5. 在对应的probe里面加入device_create_file的调用即可

 static int cam_req_mgr_probe(struct platform_device *pdev){

....

    my_create_sysfs(pdev);

....

}

分析以下打印说明不成功原因和解决办法 [root@anyka ~]$ ./usr/bin/ak_svp2_sample -n 1000 -g 3 -f /mnt/rtsp/isp_gc4653_mi pi_2lane_av100.conf -c /mnt/rtsp/model_0x0A000000_V1.1.01.bin -m 0 -d 1 -e 0 [Application][2000-01-01 00:24:29 944] *************************camera_set_vclk **************** [Application][2000-01-01 00:24:29 945] ** svp camera_set_vclk isp_clk:348160000 demo version: libmpi_svp2 V1.0.06 ** [Application][2000-01-01 00:24:29 945] ***************************************** [ VI][2000-01-01 00:24:29 946] [ak_vi_open:458] register device, device id:[0] [ VI][2000-01-01 00:24:29 946] new device [ VI][2000-01-01 00:24:29 946] [vi_register_device:333] new dev=0x202008 ispsdk_lib version:libplat_isp_sdk V8.0.01 open isp dev: /dev/isp-param-0 --- AK_ISP_sdk_init g_isp_fd[0]=5 --- [ VI][2000-01-01 00:24:29 963] [vi_dev_opegc4653_core_g_ctrl cmd:8204 not support n:248] vi device open DEV0! [ VI][2000-01-01 00:gc4653_cropcap bounds.width:2560, bounds.height:1440 24:29 964] [vi_dev_open:269] open sensor dev: /dev/v4l-subdev0 gc4653_cropcap bounds.width:2560, bounds.height:1440 [ VI][2000-01-01 00:24:29 964] [vi_dev_open:279] priv_dma_alloc req_len:6914048, dma_addr:2168455168, act_len:6914048 --- vi_dev_open g_sensor_fd[0]=6 --- [ VI][2000-isp_param_file_mmap 6938 vm_iomap_memory ok. vm_start:0xb6687000 dma_addr:0x81400000, size:6914048 01-01 00:24:29 965] [vi_dev_open_td_chn:178] vi third chn devicegc4653_s_crop 933, left:0, top:0, width:2560, height:1440 open CHN16! [ VI][2000-01-01 00:24:29 966] register vigc4653_cropcap bounds.width:2560, bounds.height:1440 device ok, dev_count=1 [ VPSS][2000-01-01 00:24:29 967] [isp_open:108] dev:0 already opened! [ VPSS][2000-01-01 set_done_mode input#0 chn#0 done_mode:0 00:24:29 971] [isp.conf]version: 6.011, sensor id: 0x4653, stylegc4653_cropcap bounds.width:2560, bounds.height:1440 id: 0 [ VPSS][2000-01-01 00:24:29 973] isp subfile 0, modify time: 2024-4-1 17:30:56 [ VPSS][2000-01-01 00:24:29 974] 20221026 1. 2. 3. 4. GC4653 20240401 1.֡ [ VPSS][2000-01-01 00:24:29 974] isp subfile 1, modify time: 2024-4-1 17:30:50 [ VPSS][2000-01-01 00:24:29 975] 20221026 1. 2. GC4653 20240401 1.֡ [ VPSS][2000-01-01 00:24:29 976] [check_file:445] check isp cfg: /mnt/rtsp/isp_gc4653_mipi_2lane_av100.conf OK [ VPSS][2000-01-01 00:24:29 979] [isp_set_attr:1999] isp_set_attr module_id:0 [ VPSS][2000-01-01 00:24:29 979] [isp_set_attr:1999] isp_set_attr module_id:1 [ VPSS][2000-01-01 00:24:29 980] [isp_set_attr:1999] isp_set_attr module_id:2 [ VPSS][2000-01-01 00:24:29 981] [isp_set_attr:1999] isp_set_attr module_id:3 [ VPSS][2000-01-01 00:24:29 982] [isp_set_attr:1999] isp_set_attr module_id:4 [ VPSS][2000-01-01 00:24:29 982] [isp_set_attr:1999] isp_set_attr module_id:5 [ VPSS][2000-01-01 00:24:29 983] [isp_set_attr:1999] isp_set_attr module_id:6 [ VPSS][2000-01-01 00:24:29 984] [isp_set_attr:1999] isp_set_attr module_id:7 [ VPSS][2000-01-01 00:24:29 985] [isp_set_attr:1999] isp_set_attr module_id:8 [ VPSS][2000-01-01 00:24:29 985] [isp_set_attr:1999] isp_set_attr module_id:9 [ VPSS][2000-01-01 00:24:29 986] [isp_set_attr:1999] isp_set_attr module_id:10 [ VPSS][2000-01-01 00:24:29 988] [isp_set_attr:1999] isp_set_attr module_id:11 [ VPSS][2000-01-01 00:24:29 989] [isp_set_attr:1999] isp_set_attr module_id:12 [ VPSS][2000-01-01 00:24:29 990] [isp_set_attr:1999] isp_set_attr module_id:13 [ VPSS][2000-01-01 00:24:29 991] [isp_set_attr:1999] isp_set_attr module_id:14 [ VPSS][2000-01-01 00:24:29 992] [isp_set_attr:1999] isp_set_attr module_id:15 [ VPSS][2000-01-01 00:24:29 993] [isp_set_attr:1999] isp_set_attr module_id:16 [ VPSS][2000-01-01 00:24:29 994] [isp_set_attr:1999] isp_set_attr module_id:17 [ VPSS][2000-01-01 00:24:29 994] [isp_set_attr:1999] isp_set_attr module_id:18 [ VPSS][2000-01-01 00:24:29 995] [isp_set_attr:1999] isp_set_attr module_id:19 [ VPSS][2000-01-01 00:24:29 996] [isp_set_attr:1999] isp_set_attr module_id:20 [ VPSS][2000-01-01 00:24:29 997] [check_fps_para:426] hight light: frame_rate=20 max_exp_time=1124 low_light_gain=48 [ VPSS][2000-01-01 00:24:29 998] [check_fps_para:431] low light: frame_rate=8 max_exp_time=2812 light_gain=12 [ VPSS][2000-01-01 00:24:29 998] [init_fps_info:569] hight light fps: 20 [ VPSS][2000-01-01 00:24:29 999] [isp_set_sensor_fps:2614] set sensor fps: 20 [ VPSS][2000-01-01 00:24:29 999] [set_fps:244] set dev:0 fps:20 ok [ VPSS][2000-01-01 00:24:30 001] [isp_set_attr:1999] isp_set_attr module_id:21 [ VPSS][2000-01-01 00:24:30 010] [isp_set_attr:1999] isp_set_attr module_id:22 [ VPSS][2000-01-01 00:24:30 011] [isp_set_attr:1999] isp_set_attr module_id:23 [ VPSS][2000-01-01 00:24:30 012] [isp_module_init:1575] before load_sensor_conf [ VPSS][2000-01-01 00:24:30 013] [isp_module_init:1577] after load_sensor_conf [ VI][2000-01-01 00:24:30 021] vi_dev_get_sensor_crop 166, ret:0, w:2560, h:1440 [Application][2000-01-01 00:24:30 021] [start_vi:324] get dev res w:[2560]h:[1440] [ VI][2000-01-01 00:24:30 032] vi_dev_get_sensor_crop 166, ret:0, w:2560, h:1440 [ VI][2000-01-01 00:24:30 060] [vi_dev_set_frame_rate:542] Set dev [0] frame_rate [0] [ VI][2000-01-01 00:24:30 082] init CROP succeedded! reset to CROP[2560, 1440] [ VI][2000-01-01 00:24:30 086] [ak_vi_set_chn_attr_ex:1764] success register vi channel[0] [ VI][2000-01-01 00:24:30 096] Set chn mode [0] [ VI][2000-01-01 00:24:30 097] [vi_set_set_done_mode input#0 chn#1 done_mode:0 channel_attr:1081] set vi channel[0] mode:[0], slice_num[0] framgc4653_cropcap bounds.width:2560, bounds.height:1440 e_depth[2] [ VI][2000-01-01 00:24:30 108] init CROP succeedded! reset to CROP[2560, 1440] [ VI][2000-01-01 00:24:30 108] [vi_set_channel_attr:1094] set vi channel[0] crop: left[0] set_done_mode input#0 chn#2 done_mode:0 top[0] w[2560] h[1440] [ VI][2000-01-01 00:24:30 442] [vi_gc4653_cropcap bounds.width:2560, bounds.height:1440 dev_set_chn_res:946] chn id is[0], fd is:[7] [ VI][2000-01-01 00:24:30 443] [vi_dev_set_chn_res:989] vi_dev_set_chn_res w:ak_vb2_dc_alloc 1710 size:5529600 2560, h:1440 [ VI][2000-01-01 00:24:30 443] [vi_set_channeak_vb2_dc_alloc chn#0-0 alloc big_dma_addr data_size:11059200=2*5529600 (num*size), total_alloc_size=11059200+0 (alloc_size+alloc_size_other) l_attr:1108] set vi channel[0] res w[2560] h[1440] [ VI][2priv_dma_alloc req_len:11059200, dma_addr:2175369216, act_len:11059200 000-01-01 00:24:30 444] [vi_dev_set_chn_buf_size:586] Set Chn [0ak_vb2_dc_alloc vaddr:ca6cc000, dma_addr:0x81a98000, size:5529600, users:0/2 ] buf size [5529600] [ VI][2000-01-01 00:24:30 444] [vi_seak_vb2_dc_cookie 2071 t_channel_attr:1120] set vi channel[0] buf size[5529600] [Appliak_vb2_dc_vaddr 2079 cation][2000-01-01 00:24:30 450] [start_vi:363] vi device 0 mainak_vb2_dc_alloc 1710 size:5529600 sub channel attribute [ VI][2000-01-01 00:24:30 450] [ak_ak_vb2_dc_alloc vaddr:cac12000, dma_addr:0x81fde000, size:5529600, users:1/2 vi_set_chn_attr_ex:1764] success register vi channel[1] [ ak_vb2_dc_cookie 2071 VI][2000-01-01 00:24:30 457] Set chn mode [0] [ VI][2000-0ak_vb2_dc_vaddr 2079 1-01 00:24:30 458] [vi_set_channel_attr:1081] set vi channel[1] ak_vb2_dc_mmap 2051 vm_iomap_memory ok. vm_start:0xb6141000 dma_addr:0x81a98000,size:5529600 mode:[0], slice_num[0] frame_depth[2] [ VI][2000-01-01 00:ak_vb2_dc_mmap 2051 vm_iomap_memory ok. vm_start:0xb5bfb000 dma_addr:0x81fde000,size:5529600 24:30 468] init CROP succeedded! reset to CROP[2560, 1440] [ ak_vb2_dc_alloc 1710 size:348160 VI][2000-01-01 00:24:30 468] [vi_set_channel_attr:1094] set vak_vb2_dc_alloc chn#0-1 alloc big_dma_addr data_size:691200=2*345600 (num*size), total_alloc_size=696320+0 (alloc_size+alloc_size_other) i channel[1] crop: left[0] top[0] w[2560] h[1440] [ VI][20priv_dma_alloc req_len:696320, dma_addr:2186428416, act_len:696320 00-01-01 00:24:30 469] [vi_dev_set_chn_res:946] chn id is[1], fdak_vb2_dc_alloc vaddr:cb159000, dma_addr:0x82524000, size:348160, users:0/2 is:[8] [ VI][2000-01-01 00:24:30 469] [vi_dev_set_chn_resak_vb2_dc_cookie 2071 :989] vi_dev_set_chn_res w:640, h:360 [ VI][2000-01-01 00:ak_vb2_dc_vaddr 2079 24:30 470] [vi_set_channel_attr:1108] set vi channel[1] res w[64ak_vb2_dc_alloc 1710 size:348160 0] h[360] [ VI][2000-01-01 00:24:30 471] [vi_dev_set_chn_bak_vb2_dc_alloc vaddr:cb1ae000, dma_addr:0x82579000, size:348160, users:1/2 uf_size:586] Set Chn [1] buf size [345600] [ VI][2000-01-0ak_vb2_dc_cookie 2071 1 00:24:30 471] [vi_set_channel_attr:1120] set vi channel[1] bufak_vb2_dc_vaddr 2079 size[345600] [Application][2000-01-01 00:24:30 477] [start_vi:ak_vb2_dc_mmap 2051 vm_iomap_memory ok. vm_start:0xb5ba6000 dma_addr:0x82524000,size:348160 383] vi device 0 set sub channel attribute [ VI][2000-01-0ak_vb2_dc_mmap 2051 vm_iomap_memory ok. vm_start:0xb5b51000 dma_addr:0x82579000,size:348160 1 00:24:30 477] [ak_vi_set_chn_attr_ex:1764] success register viak_vb2_dc_alloc 1710 size:176128 channel[16] [ VI][2000-01-01 00:24:30 488] Set chn mode [ak_vb2_dc_alloc chn#0-2 alloc big_dma_addr data_size:345600=2*172800 (num*size), total_alloc_size=352256+0 (alloc_size+alloc_size_other) 0] [ VI][2000-01-01 00:24:30 489] [vi_set_channel_attr:108priv_dma_alloc req_len:352256, dma_addr:2187124736, act_len:352256 1] set vi channel[16] mode:[0], slice_num[0] frame_depth[2] [ ak_vb2_dc_alloc vaddr:cb204000, dma_addr:0x825ce000, size:176128, users:0/2 VI][2000-01-01 00:24:30 500] init CROP succeedded! reset to ak_vb2_dc_cookie 2071 CROP[2560, 1440] [ VI][2000-01-01 00:24:30 500] [vi_set_chak_vb2_dc_vaddr 2079 annel_attr:1094] set vi channel[16] crop: left[0] top[0] w[2560]ak_vb2_dc_alloc 1710 size:176128 h[1440] [ VI][2000-01-01 00:24:30 501] [vi_dev_set_chn_reak_vb2_dc_alloc vaddr:cb22f000, dma_addr:0x825f9000, size:176128, users:1/2 s:946] chn id is[16], fd is:[9] [ VI][2000-01-01 00:24:30 ak_vb2_dc_cookie 2071 501] [vi_dev_set_chn_res:989] vi_dev_set_chn_res w:320, h:180 [ak_vb2_dc_vaddr 2079 VI][2000-01-01 00:24:30 502] [vi_set_channel_attr:1108] seak_vb2_dc_mmap 2051 vm_iomap_memory ok. vm_start:0xb5b26000 dma_addr:0x825ce000,size:176128 t vi channel[16] res w[320] h[180] [ VI][2000-01-01 00:24:ak_vb2_dc_mmap 2051 vm_iomap_memory ok. vm_start:0xb5afb000 dma_addr:0x825f9000,size:176128 30 503] [vi_dev_set_chn_buf_size:586] Set Chn [16] buf size [172camera_set_pp_chn_buffer_addr_default 2940 800] [ VI][2000-01-01 00:24:30 503] [vi_set_channel_attr:10014: mipi_top_clk_init 97 44ab087f 120] set vi channel[16] buf size[172800] [Application][2000-01-camera_input_interface_init mipi 01 00:24:30 509] [start_vi:417] vi device 0 set td channel attricamera_set_sharepin bute [ VI][2000-01-01 00:24:30 642] [vi_set_capturegc4653_sen_set_power_on_func 1751 _on:1876] vi channel [0] is started! [ VI][2000-gc4653_sen_set_power_on_func 1758 01-01 00:24:30 777] [vi_set_capture_on:1876] vi channel [1] is started! [ VI][2000-01-01 00:24:30 912] [vi_set_capture_on:1876] vi channel [16] is started! [ VI][2000-01-01 00:24:30 913] [set_v4l2_qbuf:1712] i:0, userptr:0xb6141000, length:5529600 [ VI][2000-01-01 00:24:30 914] [set_v4l2_qbuf:1712] i:1, userptr:0xb5bfb000, length:5529600 gc4653_read client:c78f6700, addr:10 gc4653_read client:c78f6700, addr:10 id:4653 gc4653_read client:c78f6700, addr:10 R0x326:0x6c gc4653_read client:c78f6700, addr:10 R0x343:0x60 gc4653_sen_get_parameter_func param:8199 not support gc4653_sen_get_parameter_func param:8200 not support gc4653_sen_get_parameter_func param:8201 not support gc4653_core_g_ctrl cmd:8204 not support [ VI][2000-01-01 00:24:31 246] [ak_vi_enable_chn:2061] set camera_set_pp_chn_buffer_addr_default 2940 channel [0] capture on [ VI][2000-01-01 00:24:31 247] [setcamera_set_pp_chn_buffer_addr_default 2940 _v4l2_qbuf:1712] i:0, userptr:0xb5ba6000, length:348160 [ VI][2000-01-01 00:24:31 247] [set_v4l2_qbuf:1712] i:1, userptr:0xb5b51000, length:348160 [ VI][2000-01-01 00:24:31 256] [ak_vi_enable_chn:2061] set channel [1] capture on [ VI][2000-01-01 00:24:31 266] [ak_vi_enable_chn:2061] set channel [16] capture on [ SVP][2000-01-01 00:24:31 268] [nna_cb_init_reg:213] mapping, start: 0x21300000, len: 0x00001000 [ DRV][2000-01-01 00:24:31 268] Found uio0 mapping for 0x21300000 [ SVP][2000-01-01 00:24:31 269] [nna_cb_init_reg:233] init cnn reg, va: 0xb6fad000, pa: 0x21300000, len: 0x00001000 [ AKV_CNN][2000-01-01 00:24:31 284] net_handle->hw_feature_buffer->size=732100 [ AKV_CNN][2000-01-01 00:24:31 285] net_handle->hw_param_buffer->size=437296 [Application][2000-01-01 00:24:31 288] SVP Process start
最新发布
10-11
分析以下打印说明保存原因和解决办法 [root@anyka ~]$ ./usr/bin/ak_svp2_sample -n 1000 -g 3 -f /mnt/rtsp/isp_gc4653_mi pi_2lane_av100.conf -c /usr/sbin/model_0x0A000008_V2.0.00.bin -m 0 -d 1 -e 0 [Application][2000-01-01 00:18:52 061] *************************camera_set_vclk **************** [Application][2000-01-01 00:18:52 062] ** svp camera_set_vclk isp_clk:348160000 demo version: libmpi_svp2 V1.0.06 ** [Application][2000-01-01 00:18:52 062] ***************************************** [ VI][2000-01-01 00:18:52 062] [ak_vi_open:458] register device, device id:[0] [ VI][2000-01-01 00:18:52 063] new device [ VI][2000-01-01 00:18:52 063] [vi_register_device:333] new dev=0x1758008 ispsdk_lib version:libplat_isp_sdk V8.0.01 open isp dev: /dev/isp-param-0 --- AK_ISP_sdk_init g_isp_fd[0]=5 --- [ VI][2000-01-01 00:18:52 080] [vi_dev_opgc4653_core_g_ctrl cmd:8204 not support en:248] vi device open DEV0! [ VI][2000-01-01 00gc4653_cropcap bounds.width:2560, bounds.height:1440 gc4653_cropcap bounds.width:2560, bounds.height:1440v4l-subdev0 [ VI][2000-01-01 00:18:52 081] [vi_dev_open:279]priv_dma_alloc req_len:6914048, dma_addr:2168455168, act_len:6914048 --- vi_dev_open g_sensor_fd[0]=6 --- [ VI][2000isp_param_file_mmap 6938 vm_iomap_memory ok. vm_start:0xb66a7000 dma_addr:0x81400000, size:6914048 -01-01 00:18:52 082] [vi_dev_open_td_chn:178] vi third chn devicgc4653_s_crop 933, left:0, top:0, width:2560, height:1440 e open CHN16! [ VI][2000-01-01 00:18:52 083] register vgc4653_cropcap bounds.width:2560, bounds.height:1440 i device ok, dev_count=1 [ VPSS][2000-01-01 00:18:52 084] [isp_open:108] dev:0 already opened! [ VPSS][2000-01-01set_done_mode input#0 chn#0 done_mode:0 00:18:52 087] [isp.conf]version: 6.011, sensor id: 0x4653, stylgc4653_cropcap bounds.width:2560, bounds.height:1440 e id: 0 [ VPSS][2000-01-01 00:18:52 090] isp subfile 0, modify time: 2024-4-1 17:30:56 [ VPSS][2000-01-01 00:18:52 090] 20221026 1. 2. 3. 4. GC4653 20240401 1.֡ [ VPSS][2000-01-01 00:18:52 091] isp subfile 1, modify time: 2024-4-1 17:30:50 [ VPSS][2000-01-01 00:18:52 092] 20221026 1. 2. GC4653 20240401 1.֡ [ VPSS][2000-01-01 00:18:52 092] [check_file:445] check isp cfg: /mnt/rtsp/isp_gc4653_mipi_2lane_av100.conf OK [ VPSS][2000-01-01 00:18:52 095] [isp_set_attr:1999] isp_set_attr module_id:0 [ VPSS][2000-01-01 00:18:52 096] [isp_set_attr:1999] isp_set_attr module_id:1 [ VPSS][2000-01-01 00:18:52 097] [isp_set_attr:1999] isp_set_attr module_id:2 [ VPSS][2000-01-01 00:18:52 097] [isp_set_attr:1999] isp_set_attr module_id:3 [ VPSS][2000-01-01 00:18:52 098] [isp_set_attr:1999] isp_set_attr module_id:4 [ VPSS][2000-01-01 00:18:52 099] [isp_set_attr:1999] isp_set_attr module_id:5 [ VPSS][2000-01-01 00:18:52 100] [isp_set_attr:1999] isp_set_attr module_id:6 [ VPSS][2000-01-01 00:18:52 100] [isp_set_attr:1999] isp_set_attr module_id:7 [ VPSS][2000-01-01 00:18:52 101] [isp_set_attr:1999] isp_set_attr module_id:8 [ VPSS][2000-01-01 00:18:52 102] [isp_set_attr:1999] isp_set_attr module_id:9 [ VPSS][2000-01-01 00:18:52 103] [isp_set_attr:1999] isp_set_attr module_id:10 [ VPSS][2000-01-01 00:18:52 104] [isp_set_attr:1999] isp_set_attr module_id:11 [ VPSS][2000-01-01 00:18:52 106] [isp_set_attr:1999] isp_set_attr module_id:12 [ VPSS][2000-01-01 00:18:52 107] [isp_set_attr:1999] isp_set_attr module_id:13 [ VPSS][2000-01-01 00:18:52 107] [isp_set_attr:1999] isp_set_attr module_id:14 [ VPSS][2000-01-01 00:18:52 108] [isp_set_attr:1999] isp_set_attr module_id:15 [ VPSS][2000-01-01 00:18:52 109] [isp_set_attr:1999] isp_set_attr module_id:16 [ VPSS][2000-01-01 00:18:52 109] [isp_set_attr:1999] isp_set_attr module_id:17 [ VPSS][2000-01-01 00:18:52 110] [isp_set_attr:1999] isp_set_attr module_id:18 [ VPSS][2000-01-01 00:18:52 111] [isp_set_attr:1999] isp_set_attr module_id:19 [ VPSS][2000-01-01 00:18:52 112] [isp_set_attr:1999] isp_set_attr module_id:20 [ VPSS][2000-01-01 00:18:52 113] [check_fps_para:426] hight light: frame_rate=20 max_exp_time=1124 low_light_gain=48 [ VPSS][2000-01-01 00:18:52 113] [check_fps_para:431] low light: frame_rate=8 max_exp_time=2812 light_gain=12 [ VPSS][2000-01-01 00:18:52 114] [init_fps_info:569] hight light fps: 20 [ VPSS][2000-01-01 00:18:52 114] [isp_set_sensor_fps:2614] set sensor fps: 20 [ VPSS][2000-01-01 00:18:52 115] [set_fps:244] set dev:0 fps:20 ok [ VPSS][2000-01-01 00:18:52 116] [isp_set_attr:1999] isp_set_attr module_id:21 [ VPSS][2000-01-01 00:18:52 127] [isp_set_attr:1999] isp_set_attr module_id:22 [ VPSS][2000-01-01 00:18:52 128] [isp_set_attr:1999] isp_set_attr module_id:23 [ VPSS][2000-01-01 00:18:52 128] [isp_module_init:1575] before load_sensor_conf [ VPSS][2000-01-01 00:18:52 129] [isp_module_init:1577] after load_sensor_conf [ VI][2000-01-01 00:18:52 137] vi_dev_get_sensor_crop 166, ret:0, w:2560, h:1440 [Application][2000-01-01 00:18:52 138] [start_vi:324] get dev res w:[2560]h:[1440] [ VI][2000-01-01 00:18:52 148] vi_dev_get_sensor_crop 166, ret:0, w:2560, h:1440 [ VI][2000-01-01 00:18:52 176] [vi_dev_set_frame_rate:542] Set dev [0] frame_rate [0] [ VI][2000-01-01 00:18:52 198] init CROP succeedded! reset to CROP[2560, 1440] [ VI][2000-01-01 00:18:52 203] [ak_vi_set_chn_attr_ex:1764] success register vi channel[0] [ VI][2000-01-01 00:18:52 213] Set chn mode [0] [ VI][2000-01-01 00:18:52 213] [vi_setset_done_mode input#0 chn#1 done_mode:0 _channel_attr:1081] set vi channel[0] mode:[0], slice_num[0] fragc4653_cropcap bounds.width:2560, bounds.height:1440 me_depth[2] [ VI][2000-01-01 00:18:52 224] init CROP succeedded! reset to CROP[2560, 1440] [ VI][2000-01-01 00:18:52 225] [vi_set_channel_attr:1094] set vi channel[0] crop: left[0]set_done_mode input#0 chn#2 done_mode:0 top[0] w[2560] h[1440] [ VI][2000-01-01 00:18:52 558] [vigc4653_cropcap bounds.width:2560, bounds.height:1440 _dev_set_chn_res:946] chn id is[0], fd is:[7] [ VI][2000-01-01 00:18:52 559] [vi_dev_set_chn_res:989] vi_dev_set_chn_res w:2560, h:1440 [ VI][2000-01-01 00:18:52 560] [vi_set_channak_vb2_dc_alloc 1710 size:5529600 el_attr:1108] set vi channel[0] res w[2560] h[1440] [ VI][ak_vb2_dc_alloc chn#0-0 alloc big_dma_addr data_size:11059200=2*5529600 (num*size), total_alloc_size=11059200+0 (alloc_size+alloc_size_other) 2000-01-01 00:18:52 560] [vi_dev_set_chn_buf_size:586] Set Chn [priv_dma_alloc req_len:11059200, dma_addr:2175369216, act_len:11059200 0] buf size [5529600] [ VI][2000-01-01 00:18:52 561] [vi_sak_vb2_dc_alloc vaddr:cb0d8000, dma_addr:0x81a98000, size:5529600, users:0/2 et_channel_attr:1120] set vi channel[0] buf size[5529600] [Applak_vb2_dc_cookie 2071 ication][2000-01-01 00:18:52 567] [start_vi:363] vi device 0 maiak_vb2_dc_vaddr 2079 n sub channel attribute [ VI][2000-01-01 00:18:52 568] [akak_vb2_dc_alloc 1710 size:5529600 _vi_set_chn_attr_ex:1764] success register vi channel[1] [ ak_vb2_dc_alloc vaddr:cb61e000, dma_addr:0x81fde000, size:5529600, users:1/2 VI][2000-01-01 00:18:52 573] Set chn mode [0] [ VI][2000-ak_vb2_dc_cookie 2071 01-01 00:18:52 574] [vi_set_channel_attr:1081] set vi channel[1]ak_vb2_dc_vaddr 2079 mode:[0], slice_num[0] frame_depth[2] [ VI][2000-01-01 00ak_vb2_dc_mmap 2051 vm_iomap_memory ok. vm_start:0xb6161000 dma_addr:0x81a98000,size:5529600 :18:52 585] init CROP succeedded! reset to CROP[2560, 1440] [ ak_vb2_dc_mmap 2051 vm_iomap_memory ok. vm_start:0xb5c1b000 dma_addr:0x81fde000,size:5529600 VI][2000-01-01 00:18:52 585] [vi_set_channel_attr:1094] set ak_vb2_dc_alloc 1710 size:348160 vi channel[1] crop: left[0] top[0] w[2560] h[1440] [ VI][2ak_vb2_dc_alloc chn#0-1 alloc big_dma_addr data_size:691200=2*345600 (num*size), total_alloc_size=696320+0 (alloc_size+alloc_size_other) 000-01-01 00:18:52 586] [vi_dev_set_chn_res:946] chn id is[1], fpriv_dma_alloc req_len:696320, dma_addr:2186428416, act_len:696320 d is:[8] [ VI][2000-01-01 00:18:52 586] [vi_dev_set_chn_reak_vb2_dc_alloc vaddr:cad44000, dma_addr:0x82524000, size:348160, users:0/2 s:989] vi_dev_set_chn_res w:640, h:360 [ VI][2000-01-01 00ak_vb2_dc_cookie 2071 :18:52 587] [vi_set_channel_attr:1108] set vi channel[1] res w[6ak_vb2_dc_vaddr 2079 40] h[360] [ VI][2000-01-01 00:18:52 588] [vi_dev_set_chn_ak_vb2_dc_alloc 1710 size:348160 buf_size:586] Set Chn [1] buf size [345600] [ VI][2000-01-ak_vb2_dc_alloc vaddr:cad99000, dma_addr:0x82579000, size:348160, users:1/2 01 00:18:52 588] [vi_set_channel_attr:1120] set vi channel[1] buak_vb2_dc_cookie 2071 f size[345600] [Application][2000-01-01 00:18:52 595] [start_viak_vb2_dc_vaddr 2079 :383] vi device 0 set sub channel attribute [ VI][2000-01-ak_vb2_dc_mmap 2051 vm_iomap_memory ok. vm_start:0xb5bc6000 dma_addr:0x82524000,size:348160 01 00:18:52 596] [ak_vi_set_chn_attr_ex:1764] success register vak_vb2_dc_mmap 2051 vm_iomap_memory ok. vm_start:0xb5b71000 dma_addr:0x82579000,size:348160 i channel[16] [ VI][2000-01-01 00:18:52 605] Set chn mode ak_vb2_dc_alloc 1710 size:176128 [0] [ VI][2000-01-01 00:18:52 605] [vi_set_channel_attr:10ak_vb2_dc_alloc chn#0-2 alloc big_dma_addr data_size:345600=2*172800 (num*size), total_alloc_size=352256+0 (alloc_size+alloc_size_other) 81] set vi channel[16] mode:[0], slice_num[0] frame_depth[2] [ priv_dma_alloc req_len:352256, dma_addr:2187124736, act_len:352256 VI][2000-01-01 00:18:52 616] init CROP succeedded! reset toak_vb2_dc_alloc vaddr:cadef000, dma_addr:0x825ce000, size:176128, users:0/2 CROP[2560, 1440] [ VI][2000-01-01 00:18:52 617] [vi_set_cak_vb2_dc_cookie 2071 hannel_attr:1094] set vi channel[16] crop: left[0] top[0] w[2560ak_vb2_dc_vaddr 2079 ] h[1440] [ VI][2000-01-01 00:18:52 617] [vi_dev_set_chn_rak_vb2_dc_alloc 1710 size:176128 es:946] chn id is[16], fd is:[9] [ VI][2000-01-01 00:18:52ak_vb2_dc_alloc vaddr:cae1a000, dma_addr:0x825f9000, size:176128, users:1/2 618] [vi_dev_set_chn_res:989] vi_dev_set_chn_res w:320, h:180 ak_vb2_dc_cookie 2071 [ VI][2000-01-01 00:18:52 619] [vi_set_channel_attr:1108] sak_vb2_dc_vaddr 2079 et vi channel[16] res w[320] h[180] [ VI][2000-01-01 00:18ak_vb2_dc_mmap 2051 vm_iomap_memory ok. vm_start:0xb5b46000 dma_addr:0x825ce000,size:176128 :52 619] [vi_dev_set_chn_buf_size:586] Set Chn [16] buf size [17ak_vb2_dc_mmap 2051 vm_iomap_memory ok. vm_start:0xb5b1b000 dma_addr:0x825f9000,size:176128 2800] [ VI][2000-01-01 00:18:52 620] [vi_set_channel_attr:camera_set_pp_chn_buffer_addr_default 2940 1120] set vi channel[16] buf size[172800] [Application][2000-010014: mipi_top_clk_init 97 44ab087f -01 00:18:52 627] [start_vi:417] vi device 0 set td channel attrcamera_input_interface_init mipi ibute [ VI][2000-01-01 00:18:52 764] [vi_set_capturcamera_set_sharepin e_on:1876] vi channel [0] is started! [ VI][2000gc4653_sen_set_power_on_func 1751 -01-01 00:18:52 899] [vi_set_capture_on:1876] vi channel [1] is gc4653_sen_set_power_on_func 1758 started! [ VI][2000-01-01 00:18:53 035] [vi_set_capture_on:1876] vi channel [16] is started! [ VI][2000-01-01 00:18:53 036] [set_v4l2_qbuf:1712] i:0, userptr:0xb6161000, length:5529600 [ VI][2000-01-01 00:18:53 037] [set_v4l2_qbuf:1712] i:1, userptr:0xb5c1b000, length:5529600 gc4653_read client:c78f6700, addr:10 gc4653_read client:c78f6700, addr:10 id:4653 gc4653_read client:c78f6700, addr:10 R0x326:0x6c gc4653_read client:c78f6700, addr:10 R0x343:0x60 gc4653_sen_get_parameter_func param:8199 not support gc4653_sen_get_parameter_func param:8200 not support gc4653_sen_get_parameter_func param:8201 not support gc4653_core_g_ctrl cmd:8204 not support [ VI][2000-01-01 00:18:53 363] [ak_vi_enable_chn:2061] set camera_set_pp_chn_buffer_addr_default 2940 channel [0] capture on [ VI][2000-01-01 00:18:53 364] [setcamera_set_pp_chn_buffer_addr_default 2940 _v4l2_qbuf:1712] i:0, userptr:0xb5bc6000, length:348160 [ VI][2000-01-01 00:18:53 365] [set_v4l2_qbuf:1712] i:1, userptr:0xb5b71000, length:348160 [ VI][2000-01-01 00:18:53 374] [ak_vi_enable_chn:2061] set channel [1] capture on [ VI][2000-01-01 00:18:53 384] [ak_vi_enable_chn:2061] set channel [16] capture on [ SVP][2000-01-01 00:18:53 385] [nna_cb_init_reg:213] mapping, start: 0x21300000, len: 0x00001000 [ DRV][2000-01-01 00:18:53 386] Found uio0 mapping for 0x21300000 [ SVP][2000-01-01 00:18:53 387] [nna_cb_init_reg:233] init cnn reg, va: 0xb6fcd000, pa: 0x21300000, len: 0x00001000 [ AKV_CNN][2000-01-01 00:18:53 411] net_handle->hw_featuak_vb2_dc_put chn0#0 priv_dma_free re_buffer->size=4730880 [ AKV_CNN][2000-01-01 00:18:53 412] netset_chn_bufs_release chn0#0 _handle->hw_param_buffer->size=560000 [ AKV_CNN][2000-01-01 00:ak_vb2_dc_put chn0#1 priv_dma_free 18:53 412] NNA_Check_Model: model_id[0x0a000000] and header.modeset_chn_bufs_release chn0#1 l_label[0x0a000008] conflict. [ AKV_CNN][2000-01-01 00:18:53 41ak_vb2_dc_put chn0#2 priv_dma_free 3] NNA_Load: NNA_Check_Model fail! Please check model file. et_chn_bufs_release chn0#2 ;31m[ SVP][2000-01-01 00:18:53 425] [load_and_set_param_hd_180p:694] Load face detect model file failed! [ SVP][2000-01-01 00:18:53 425] [ak_svp2_create_chn:1375] handle 0 nna_load_and_set_param failed! [Application][2000-01-01 00:18:53 426] [start_svp:519] Create SVP chn failed [ SVP][2000-01-01 00:18:53 427] [nna_cb_exit_reg:249] unmapping, start: 0x21300000, len: 0x00001000 [ SVP][2000-01-01 00:18:53 428] [nna_cb_exit_reg:259] uninit cnn reg, va: 0xb6fcd000, pa: 0x21300000, len: 0x00001000 [ VI][2000-01-01 00:18:53 457] [vi_dev_release_chn_buffer:667] Set Chn [0] release chn buffer ok. [ VI][2000-01-01 00:18:53 457] [vi_set_capture_off:1922] channel [0] capture off, ret [0], pchn->status[0] [ VI][2000-01-01 00:18:53 474] [vi_dev_release_chn_buffer:667] Set Chn [1] release chn buffer ok. [ VI][2000-01-01 00:18:53 475] [vi_set_capture_off:1922] channel [1] capture off, ret [0], pchn->status[0] [ VI][2000-01-01 00:18:53 493] [vi_dev_release_chn_buffer:667] Set Chn [16] release chn buffer ok. [ VI][2000-01-01 00:18:53 494] [vi_set_capture_off:1922] channel [16] capture off, ret [0], pchn->status[0] [ VI][2000-01-01 00:18:53 495] [ak_vi_close:494] enter close vi --- AK_ISP_sdk_exit g_isp_fd[0]=5 closed --- camera_mipi_deinit 944 camera_mipi_deinit 960 [ VI][2000-01-01 00:18:53 655] [vi_dev_close:360] --- vi_dev_close g_sensor_fd[0]=6 closed --- [ VI][2000-01-01 00:18:53 656] [vi_unregister_device:439] unregister done [Application][2000-01-01 00:18:53 657] exit vi demo [root@anyka ~]$ udhcpc: sending discover udhcpc: sending discover
10-11
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值