I add a systemd service for tegra_multimedia_api/sample/10_camera_recording.
[Unit]
Description=my test daemon
After=nvargus-daemon.service
[Service]
ExecStart=/home/nvidia/work/
WorkingDirectory=/home/nvidia/work/mytest
Restart=always
Type=simple
User=nvidia
[Install]
WantedBy=multi-user.target
mytest source code is simple, call camera_recording and save the log.
void dump_system_cmd(char *cmd, char *type, char *folder) {
char buf[256] = {0};
time_t timep;
struct tm *p;
time(&timep);
p = localtime(&timep);
sprintf(buf, "%s >> %s/%04d%02d%02d%02d%02d.%s", cmd, folder,
1900 + p->tm_year, 1 + p->tm_mon, p->tm_mday, p->tm_hour, p->tm_min,
type);
printf("buf = [%s]\n", buf);
system(buf);
}
int main(int argc, char **argv) {
dump_system_cmd("./camera_recording", "log", "argus_log");
sleep(10);
system("sync");
while (1) sleep(100);
}
I do power down and power up test for 58 times, then I find an issue.
abnormal case (3 times):
nvbuf_utils: Could not get EGL display connection
nvbuf_utils: ERROR getting proc addr of eglCreateImageKHR
nvbuf_utils: ERROR getting proc addr of eglDestroyImageKHR
Cannot get EGL display.
PRODUCER: Creating output stream
PRODUCER: Launching consumer thread
Opening in BLOCKING MODE
875967048
842091865
create video encoder return true
PRODUCER: Starting repeat capture requests.
CONSUMER: Got EOS, exiting...
CONSUMER: Done.
PRODUCER: Done -- exiting.
************************************
normal case (55 times):
PRODUCER: Creating output stream
PRODUCER: Launching consumer thread
Opening in BLOCKING MODE
875967048
842091865
create video encoder return true
PRODUCER: Starting repeat capture requests.
CONSUMER: Got EOS, exiting...
CONSUMER: Done.
PRODUCER: Done -- exiting.
************************************
Total Profiling Time = 0 sec
************************************
I do not know why, Could you help me? thank you very much!
Board:TX2
system version:# R32 (release), REVISION: 2.1, GCID: 16294929, BOARD: t186ref, EABI: aarch64, DATE: Tue Aug 13 04:45:36 UTC 2019