forked from whitebkues1/tmp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfor-roger
More file actions
448 lines (403 loc) · 17.4 KB
/
Copy pathfor-roger
File metadata and controls
448 lines (403 loc) · 17.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1566101/sk-am62a-lp-v4l2_decode-vidioc_qbuf-failed
https://github.com/TexasInstruments/edgeai-tiovx-apps
########################### 跑不起来的
root@am62axx-evm:~# cd /opt/edgeai-tiovx-apps/
root@am62axx-evm:/opt/edgeai-tiovx-apps# ./bin/Release/edgeai-tiovx-apps-main configs/linux/object_detection.yaml
APP: Init ... !!!
164.707108 s: MEM: Init ... !!!
164.707212 s: MEM: Initialized DMA HEAP (fd=5) !!!
164.707453 s: MEM: Init ... Done !!!
164.707475 s: IPC: Init ... !!!
164.724360 s: IPC: Init ... Done !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
164.734009 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
164.738384 s: VX_ZONE_INFO: Globally Enabled VX_ZONE_ERROR
164.738432 s: VX_ZONE_INFO: Globally Enabled VX_ZONE_WARNING
164.738443 s: VX_ZONE_INFO: Globally Enabled VX_ZONE_INFO
164.740719 s: VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-0
164.740900 s: VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-1
164.741012 s: VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-2
164.741137 s: VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-3
164.741153 s: VX_ZONE_INFO: [tivxInitLocal:126] Initialization Done !!!
164.741169 s: VX_ZONE_INFO: Globally Disabled VX_ZONE_INFO
Input #0, h264, from '/opt/edgeai-test-data/videos/video0_1280_768.h264':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x768, 25 fps, 60 tbr, 1200k tbn
[TIOVX_MODULES][ERROR] 519: v4l2_decode_enqueue_buf: [V4L2_DECODE] VIDIOC_QBUF failed
[TIOVX_MODULES][ERROR] 519: v4l2_decode_enqueue_buf: [V4L2_DECODE] VIDIOC_QBUF failed
[TIOVX_MODULES][ERROR] 519: v4l2_decode_enqueue_buf: [V4L2_DECODE] VIDIOC_QBUF failed
[TIOVX_MODULES][ERROR] 519: v4l2_decode_enqueue_buf: [V4L2_DECODE] VIDIOC_QBUF failed
[TIOVX_MODULES][ERROR] 519: v4l2_decode_enqueue_buf: [V4L2_DECODE] VIDIOC_QBUF failed
[TIOVX_MODULES][ERROR] 519: v4l2_decode_enqueue_buf: [V4L2_DECODE] VIDIOC_QBUF failed
[TIOVX_MODULES][ERROR] 519: v4l2_decode_enqueue_buf: [V4L2_DECODE] VIDIOC_QBUF failed
[TIOVX_MODULES][ERROR] 519: v4l2_decode_enqueue_buf: [V4L2_DECODE] VIDIOC_QBUF failed
[TIOVX_MODULES][ERROR] 519: v4l2_decode_enqueue_buf: [V4L2_DECODE] VIDIOC_QBUF failed
[TIOVX_MODULES][ERROR] 519: v4l2_decode_enqueue_buf: [V4L2_DECODE] VIDIOC_QBUF failed
^C[TIOVX_MODULES][ERROR] 546: v4l2_decode_dqueue_buf: [V4L2_DECODE[ 164.502886] kauditd_printk_skb: 5 callbacks suppressed
] POLL failed
[ 164.502898] audit: type=1701 audit(172.032:18): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=630 comm="edgeai-tiovx-ap" exe="/opt/edgeai-tiovx-apps/bin/Release/edgeai-tiovx-apps-main" sig=11 res=1
[ 164.547521] audit: type=1334 audit(172.072:19): prog-id=19 op=LOAD
[ 164.553787] audit: type=1334 audit(172.080:20): prog-id=20 op=LOAD
[ 164.560013] audit: type=1334 audit(172.084:21): prog-id=21 op=LOAD
gSegmentation fault (core dumped)
root@am62axx-evm:/opt/edgeai-tiovx-apps# g[ 165.884608] audit: type=1334 audit(173.412:22): prog-id=21 op=UNLOAD
[ 165.891003] audit: type=1334 audit(173.412:23): prog-id=20 op=UNLOAD
[ 165.897415] audit: type=1334 audit(173.412:24): prog-id=19 op=UNLOAD
root@am62axx-evm:/opt/edgeai-tiovx-apps#
root@am62axx-evm:/opt/edgeai-tiovx-apps# grep -H . /sys/class/video4linux/video
video0/ video1/ video2/
root@am62axx-evm:/opt/edgeai-tiovx-apps# grep -H . /sys/class/video4linux/video*/name
/sys/class/video4linux/video0/name:e5010
/sys/class/video4linux/video1/name:C&M Wave5 VPU decoder
/sys/class/video4linux/video2/name:C&M Wave5 VPU encoder
#################################### 能跑起来的
root@am62axx-evm:~# grep -H . /sys/class/video4linux/video*/name
/sys/class/video4linux/video0/name:C&M Wave5 VPU decoder
/sys/class/video4linux/video1/name:C&M Wave5 VPU encoder
/sys/class/video4linux/video2/name:e5010
root@am62axx-evm:~# cd /opt/edgeai-tiovx-apps/
root@am62axx-evm:/opt/edgeai-tiovx-apps# ./bin/Release/edgeai-tiovx-apps-main configs/linux/object_detection.yaml
APP: Init ... !!!
438.579871 s: MEM: Init ... !!!
438.579972 s: MEM: Initialized DMA HEAP (fd=5) !!!
438.580212 s: MEM: Init ... Done !!!
438.580234 s: IPC: Init ... !!!
438.597354 s: IPC: Init ... Done !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
438.608184 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
438.612462 s: VX_ZONE_INFO: Globally Enabled VX_ZONE_ERROR
438.612497 s: VX_ZONE_INFO: Globally Enabled VX_ZONE_WARNING
438.612508 s: VX_ZONE_INFO: Globally Enabled VX_ZONE_INFO
438.614832 s: VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-0
438.614992 s: VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-1
438.615118 s: VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-2
438.615249 s: VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-3
438.615267 s: VX_ZONE_INFO: [tivxInitLocal:126] Initialization Done !!!
438.615283 s: VX_ZONE_INFO: Globally Disabled VX_ZONE_INFO
Input #0, h264, from '/opt/edgeai-test-data/videos/video0_1280_768.h264':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x768, 25 fps, 60 tbr, 1200k tbn
^Z
[1]+ Stopped(SIGTSTP) ./bin/Release/edgeai-tiovx-apps-main configs/linux/object_detection.yaml
root@am62axx-evm:/opt/edgeai-tiovx-apps#
############### 修改的yaml
root@am62axx-evm:/opt/edgeai-tiovx-apps# vi configs/linux/object_detection.yaml
title: Object Detection
inputs:
input0:
source: VIDEO
width: 1280
height: 768
device: /dev/video1
video_path: /opt/edgeai-test-data/videos/video0_1280_768.h264
models:
model0:
model_path: /opt/model_zoo/TFL-OD-2020-ssdLite-mobDet-DSP-coco-320x320
viz-threshold: 0.6
model1:
model_path: /opt/model_zoo/ONR-OD-8200-yolox-nano-lite-mmdet-coco-416x416
viz-threshold: 0.6
outputs:
output0:
sink: LINUX_DISPLAY
width: 1920
height: 1080
output1:
sink: H264_ENCODE
width: 1920
height: 1088
output_path: /opt/edgeai-test-data/output/output_video0.h264
output2:
sink: IMG_DIR
width: 1920
height: 1080
output_path: /opt/edgeai-test-data/output/
flows:
flow0:
pipeline: [input0,model1,output0]
mosaic:
- [320,150,1280,720]
################## 报错
terminate called after throwing an instance of '[ 107.322530] kauditd_printk_skb: 5 callbacks suppressed
YAML::ParserException'
what(): yaml-cpp: error at line 7, co[ 107.322540] audit: type=1701 audit(114.736:18): auid=4294967295 uid=0 gid=0 ses=4294967295 subj=kernel pid=630 comm="edgeai-tiovx-ap" exe="/opt/edgeai-tiovx-apps/bin/Release/edgeai-tiovx-apps-main" sig=6 res=1
lumn 1: illegal tab when looking for indentation
[ 107.357472] audit: type=1334 audit(114.772:19): prog-id=19 op=LOAD
[ 107.364375] audit: type=1334 audit(114.776:20): prog-id=20 op=LOAD
[ 107.370609] audit: type=1334 audit(114.784:21): prog-id=21 op=LOAD
Aborted (core dumped)
root@am62axx-evm:/opt/edgeai-tiovx-apps# [ 108.172592] audit: type=1334 audit(115.588:22): prog-id=21 op=UNLOAD
[ 108.178982] audit: type=1334 audit(115.588:23): prog-id=20 op=UNLOAD
[ 108.185348] audit: type=1334 audit(115.588:24): prog-id=19 op=UNLOAD
^C
##### 解析
int32_t parse_input_node(InputInfo *input_info, const YAML::Node &input_node)
{
const std::string source = input_node["source"].as<std::string>();
if("RTOS_CAM" == source)
{
input_info->source = RTOS_CAM;
}
else if("LINUX_CAM" == source)
{
input_info->source = LINUX_CAM;
}
else if("VIDEO" == source)
{
input_info->source = VIDEO;
}
else if("RAW_IMG" == source)
{
input_info->source = RAW_IMG;
}
else
{
TIOVX_APPS_ERROR("Invalid source '%s' specified.\n", source.c_str());
return -1;
}
sprintf(input_info->source_name, source.data());
input_info->width = input_node["width"].as<uint32_t>();
input_info->height = input_node["height"].as<uint32_t>();
/* Set default values. */
input_info->sensor_name[0] = '\0';
input_info->channel_mask = 0;
input_info->device[0] = '\0';
input_info->subdev[0] = '\0';
input_info->format[0] = '\0';
input_info->loop = true;
input_info->framerate = 1.0;
input_info->num_raw_img = 0;
input_info->ldc_enabled = false;
input_info->num_channels = 1;
/* Parse necessary information for RTOS_CAM. */
if (input_info->source == RTOS_CAM)
{
/* Parse sensor-name. */
if (input_node["sensor-name"])
{
sprintf(input_info->sensor_name,
input_node["sensor-name"].as<std::string>().data());
}
else
{
TIOVX_APPS_ERROR("Please specify sensor-name for %s.\n",
input_info->name);
return -1;
}
/* Parse channel-mask. */
if (input_node["channel-mask"])
{
const std::string channel_mask_str = input_node["channel-mask"].as<std::string>();
uint32_t channel_mask = std::stoi(channel_mask_str, 0, 2);
input_info->channel_mask = channel_mask;
input_info->num_channels = 0;
while(channel_mask > 0)
{
if(channel_mask & 0x1)
{
input_info->num_channels++;
}
channel_mask = channel_mask >> 1;
}
}
else
{
TIOVX_APPS_ERROR("Please specify channel-mask for %s.\n",
input_info->name);
return -1;
}
}
else if (input_info->source == LINUX_CAM)
{
/* Parse sensor-name. */
if (input_node["sensor-name"])
{
sprintf(input_info->sensor_name,
input_node["sensor-name"].as<std::string>().data());
}
else
{
TIOVX_APPS_ERROR("Please specify sensor-name for %s.\n",
input_info->name);
return -1;
}
/* Parse device. */
if (input_node["device"])
{
sprintf(input_info->device,
input_node["device"].as<std::string>().data());
}
else
{
TIOVX_APPS_ERROR("Please specify device for %s.\n",
input_info->name);
return -1;
}
/* Parse subdev. */
if (input_node["subdev"])
{
sprintf(input_info->subdev,
input_node["subdev"].as<std::string>().data());
}
else
{
TIOVX_APPS_ERROR("Please specify subdev for %s.\n",
input_info->name);
return -1;
}
}
else if (input_info->source == VIDEO)
{
/* Get video path */
if (input_node["video_path"])
{
std::string video_path = input_node["video_path"].as<std::string>();
if (!std::filesystem::exists(video_path))
{
TIOVX_APPS_ERROR("%s does not exist.\n", video_path.c_str());
return -1;
}
sprintf(input_info->video_path, video_path.data());
}
else
{
TIOVX_APPS_ERROR("Please specify video_path for %s.\n",
input_info->name);
return -1;
}
}
else if (input_info->source == RAW_IMG)
{
if (input_node["framerate"])
{
input_info->framerate = input_node["framerate"].as<float>();
}
/* Get images */
if (input_node["image_path"])
{
std::string image_path = input_node["image_path"].as<std::string>();
if (!std::filesystem::exists(image_path))
{
TIOVX_APPS_ERROR("%s does not exist.\n", image_path.c_str());
return -1;
}
if(std::filesystem::is_directory(image_path))
{
for(const auto &filename : std::filesystem::directory_iterator(image_path))
{
std::string path(filename.path());
sprintf(input_info->raw_img_paths[input_info->num_raw_img],
path.data());
input_info->num_raw_img++;
}
char temp[MAX_CHAR_ARRAY_SIZE];
for(uint32_t i = 1; i < input_info->num_raw_img; i++)
{
for(uint32_t j = 0; j < input_info->num_raw_img-i; j++)
{
if(strcmp(input_info->raw_img_paths[j],input_info->raw_img_paths[j+1]) > 0)
{
strcpy(temp, input_info->raw_img_paths[j]);
strcpy(input_info->raw_img_paths[j], input_info->raw_img_paths[j+1]);
strcpy(input_info->raw_img_paths[j+1], temp);
}
}
}
}
else
{
sprintf(input_info->raw_img_paths[0], image_path.data());
input_info->num_raw_img = 1;
}
}
else
{
TIOVX_APPS_ERROR("Please specify image_path for %s.\n",
input_info->name);
return -1;
}
/* Parse format. */
if (input_node["format"])
{
std::string format = input_node["format"].as<std::string>();
transform(format.begin(), format.end(), format.begin(), ::toupper);
sprintf(input_info->format,format.data());
}
else
{
TIOVX_APPS_ERROR("Please specify format for %s.\n",
input_info->name);
return -1;
}
}
/* Parse ldc */
if (input_node["ldc"])
{
input_info->ldc_enabled = input_node["ldc"].as<bool>();
}
/* Parse loop. */
if (input_node["loop"])
{
input_info->loop = input_node["loop"].as<bool>();
}
return 0;
}
##############
root@am62axx-evm:/opt/edgeai-tiovx-apps# mount --bind /dev/video1
mount: /dev/video1: mount failed: Invalid argument.
root@am62axx-evm:/opt/edgeai-tiovx-apps# mount -bind /dev/video1
mount: invalid option -- 'b'
Try 'mount --help' for more information.
root@am62axx-evm:/opt/edgeai-tiovx-apps# ls /dev/video*
/dev/video0 /dev/video1 /dev/video2
root@am62axx-evm:/opt/edgeai-tiovx-apps# mount -o -bind /dev/video1 /dev/video0
mount: /dev/video0: /dev/video1 is not a block device.
dmesg(1) may have more information after failed mount system call.
######################
root@am62axx-evm:/opt/edgeai-tiovx-apps# ps | grep edgeai
700 root 492m T ./bin/Release/edgeai-tiovx-apps-main configs/linux/object_detection.yaml
736 root 492m S ./bin/Release/edgeai-tiovx-apps-main configs/linux/object_detection.yaml
748 root 3496 S grep edgeai
root@am62axx-evm:/opt/edgeai-tiovx-apps# kill -9 700
root@am62axx-evm:/opt/edgeai-tiovx-apps# [ 1561.388204] vdec 30210000.video-codec: wave5_vpu_firmware_command_queue_error_check: result not ready: 0x800
[1]+ Killed ./bin/Release/edgeai-tiovx-apps-main configs/linux/object_detection.yaml
root@am62axx-evm:/opt/edgeai-tiovx-apps# ps | grep edgeai
736 root 492m S ./bin/Release/edgeai-tiovx-apps-main configs/linux/object_detection.yaml
751 root 3496 S grep edgeai
root@am62axx-evm:/opt/edgeai-tiovx-apps# kill -9 736
root@am62axx-evm:/opt/edgeai-tiovx-apps# [ 1579.440508] vdec 30210000.video-codec: wave5_vpu_firmware_command_queue_error_check: result not ready: 0x800
[2]+ Killed ./bin/Release/edgeai-tiovx-apps-main configs/linux/object_detection.yaml
#############
root@am62axx-evm:/opt/edgeai-tiovx-apps# ./bin/Release/edgeai-tiovx-apps-main configs/linux/object_detection.yaml
APP: Init ... !!!
2163.922908 s: MEM: Init ... !!!
2163.923006 s: MEM: Initialized DMA HEAP (fd=5) !!!
2163.923211 s: MEM: Init ... Done !!!
2163.923232 s: IPC: Init ... !!!
2163.940356 s: IPC: Init ... Done !!!
REMOTE_SERVICE: Init ... !!!
REMOTE_SERVICE: Init ... Done !!!
2163.945394 s: GTC Frequency = 200 MHz
APP: Init ... Done !!!
2163.945551 s: VX_ZONE_INFO: Globally Enabled VX_ZONE_ERROR
2163.945574 s: VX_ZONE_INFO: Globally Enabled VX_ZONE_WARNING
2163.945585 s: VX_ZONE_INFO: Globally Enabled VX_ZONE_INFO
2163.946563 s: VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-0
2163.946837 s: VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-1
2163.947091 s: VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-2
2163.947368 s: VX_ZONE_INFO: [tivxPlatformCreateTargetId:134] Added target MPU-3
2163.947406 s: VX_ZONE_INFO: [tivxInitLocal:126] Initialization Done !!!
2163.947429 s: VX_ZONE_INFO: Globally Disabled VX_ZONE_INFO
Input #0, h264, from '/opt/edgeai-test-data/videos/video0_1280_768.h264':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x768, 25 fps, 60 tbr, 1200k tbn
^Z
[1]+ Stopped(SIGTSTP) ./bin/Release/edgeai-tiovx-apps-main configs/linux/object_detection.yaml
root@am62axx-evm:/opt/edgeai-tiovx-apps# jobs
[1]+ Stopped(SIGTSTP) ./bin/Release/edgeai-tiovx-apps-main configs/linux/object_detection.yaml
root@am62axx-evm:/opt/edgeai-tiovx-apps# dmesg | tail -n 50
[ 1840.290312] vdec 30210000.video-codec: wave5_vpu_firmware_command_queue_error_check: result not ready: 0x800