[Support]: Detection process keeps restarting

See original GitHub issue

Describe the problem you are having

Frigate installed on HA running in a VM in DSM 7 on Synology DS920+. I also have a Google Coral USB that I passthrough to the VM. Everything seems to work just fine, but in the log every now and then (15 to 30 minutes) the Detection process appears to be stuck and restarts.

The Google Coral works because I tried to run the Official Google Coral Test in the docker container where Frigate is running (i just needed to install a few dependencies like git and curl). It runs (even if after running the container crashed.

Version

2.3

Frigate config file

mqtt:
  host: 192.168.91.92
  user: user
  password: pass

cameras:
  giardino:
    ffmpeg:
      inputs:
        - path: rtmp://192.168.91.100/bcs/channel0_ext.bcs?channel=0&stream=2&user=admin&password=666666
          roles:
            - detect
            - rtmp
      # hwaccel_args:
      #   - -hwaccel
      #   - vaapi
      #   - -hwaccel_device
      #   - /dev/dri/renderD128
      #   - -hwaccel_output_format
      #   - yuv420p
      input_args:
        - -avoid_negative_ts
        - make_zero
        - -fflags
        - nobuffer
        - -flags
        - low_delay
        - -strict
        - experimental
        - -fflags
        - +genpts+discardcorrupt
        - -rw_timeout
        - '5000000'
        - -use_wallclock_as_timestamps
        - '1'
    detect:
      width: 896
      height: 512
      fps: 5
    objects:
      track:
        - person
    motion:
      mask:
        - 0,512,387,512,385,464,0,464
    snapshots:
      enabled: True
      timestamp: false
      bounding_box: true
      retain:
        default: 7
    rtmp:
      enabled: True
detectors:
  coral:
    type: edgetpu

Relevant log output

[2021-11-01 21:07:28] frigate.app                    INFO    : Camera processor started for balcone: 224
[2021-11-01 21:07:28] frigate.app                    INFO    : Camera processor started for ingresso: 226
[2021-11-01 21:07:28] frigate.app                    INFO    : Capture process started for giardino: 228
[2021-11-01 21:07:28] frigate.app                    INFO    : Capture process started for garage: 232
[2021-11-01 21:07:28] frigate.app                    INFO    : Capture process started for balcone: 234
[2021-11-01 21:07:28] frigate.app                    INFO    : Capture process started for ingresso: 239
[2021-11-01 21:07:28] ws4py                          INFO    : Using epoll
[2021-11-01 21:07:31] frigate.edgetpu                INFO    : TPU found
[2021-11-01 21:09:34] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:35028]
[2021-11-01 21:09:37] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:35028]
[2021-11-02 00:32:29] frigate.watchdog               INFO    : Detection appears to be stuck. Restarting detection process...
[2021-11-02 00:32:29] root                           INFO    : Waiting for detection process to exit gracefully...
[2021-11-02 00:32:59] root                           INFO    : Detection process didnt exit. Force killing...
[2021-11-02 00:32:59] detector.coral                 INFO    : Starting detection process: 2775
[2021-11-02 00:32:59] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2021-11-02 00:33:03] frigate.edgetpu                INFO    : TPU found
[2021-11-02 01:02:39] frigate.watchdog               INFO    : Detection appears to be stuck. Restarting detection process...
[2021-11-02 01:02:39] root                           INFO    : Waiting for detection process to exit gracefully...
[2021-11-02 01:03:09] root                           INFO    : Detection process didnt exit. Force killing...
[2021-11-02 01:03:09] detector.coral                 INFO    : Starting detection process: 3147
[2021-11-02 01:03:09] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2021-11-02 01:03:13] frigate.edgetpu                INFO    : TPU found
[2021-11-02 02:34:29] frigate.watchdog               INFO    : Detection appears to be stuck. Restarting detection process...
[2021-11-02 02:34:29] root                           INFO    : Waiting for detection process to exit gracefully...
[2021-11-02 02:34:59] root                           INFO    : Detection process didnt exit. Force killing...
[2021-11-02 02:34:59] detector.coral                 INFO    : Starting detection process: 4261
[2021-11-02 02:34:59] frigate.edgetpu                INFO    : Attempting to load TPU as usb
[2021-11-02 02:35:03] frigate.edgetpu                INFO    : TPU found

FFprobe output from your camera

ffprobe version 4.3.1 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-17ubuntu1~20.04)
  configuration: --disable-debug --disable-doc --disable-ffplay --enable-shared --enable-avresample --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-gpl --enable-libfreetype --enable-libvidstab --enable-libmfx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libxcb --enable-libx265 --enable-libxvid --enable-libx264 --enable-nonfree --enable-openssl --enable-libfdk_aac --enable-postproc --enable-small --enable-version3 --enable-libzmq --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-libopenjpeg --enable-libkvazaar --enable-libaom --extra-libs=-lpthread --enable-vaapi --extra-cflags=-I/opt/ffmpeg/include --extra-ldflags=-L/opt/ffmpeg/lib
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, flv, from 'rtmp://192.168.91.100/bcs/channel0_ext.bcs?channel=0&stream=2&user=admin&password=666666':
  Metadata:
    displayWidth    : 896
    displayHeight   : 512
  Duration: 00:00:00.00, start: 15021.299000, bitrate: N/A
    Stream #0:0: Data: none
    Stream #0:1: Video: h264, yuv420p(progressive), 896x512, 17 fps, 20 tbr, 1k tbn
    Stream #0:2: Audio: aac, 16000 Hz, mono, fltp
Unsupported codec with id 0 for input stream 0
[1]   Exit 1                  ffprobe rtmp://192.168.91.100/bcs/channel0_ext.bcs?channel=0
[2]-  Done                    stream=2
[3]+  Done                    user=admin
root@ccab4aaf-frigate:/opt/frigate#

Frigate stats

No response

Operating system

Other

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

RLK8-810B4-A

Any other information that may be helpful

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
RobertusITcommented, Nov 11, 2021

We talked on twitter, federico. Anyway you can’t use google coral usb into a vm, with usb passthrough, not possibile. There is a fix from google about that, i wrote it some weeks ago into github, but i didn’t understand how to use it. https://groups.google.com/g/linux.kernel/c/_HnJnBL--8k From this link you can see this fix but i don’t know if we can use it. This error showed into home assistant shell, when coral comes down and up. The best solution is use Proxmox for example and make a virtual machine with Home assistant. Then create a lxc docker container in proxmox with frigate. I use this config and no problem. my lxc container with GPU HW


arch: amd64

cores: 4

features: nesting=1

hostname: FRIGATE

memory: 4096

net0: name=eth0,bridge=vmbr0,firewall=1,hwaddr=EE:4A:86:8A:F4:71,type=veth

onboot: 1

ostype: debian

protection: 0

rootfs: local-lvm:vm-101-disk-0,size=12G

swap: 1024

lxc.mount.entry: /dev/bus/usb/002/ dev/bus/usb/002/ none bind,optional,create=dir 0, 0

lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file 0, 0

lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file

lxc.cgroup2.devices.allow: c 189:* rwm

lxc.cgroup2.devices.allow: c 226:0 rwm

lxc.cgroup2.devices.allow: c 226:128 rwm

lxc.cgroup2.devices.allow: c 29:0 rwm

lxc.apparmor.profile: unconfined

lxc.cgroup2.devices.allow: a

lxc.cap.drop:

lxc.mount.auto: cgroup:rw

What hardware are you using to run proxmox and LXC with GPU HW? Sounds a bit too powerful for a DS 920+.

I didn’t use a nas for these things.

I use a NUC8i3BEH, nvme 500gb, 16GB RAM. 6 cams with google coral 24%CPU usage

0reactions
stale[bot]commented, Dec 11, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kill a Process that Keeps Restarting | Baeldung on Linux
Explore different ways to kill constantly restarting processes. ... After that, we check out ways to detect and identify such processes.
Read more >
Kill a process that keeps restarting - Unix Stack Exchange
doesn't help me in anyway. I have a python script which starts automatically with another process id using the same port when killed...
Read more >
c# process keeps restarting - Stack Overflow
the problems is that my watchdog keeps stopping application B and immediately restarts it. here is what I have: using System; using System....
Read more >
Why is the monit process sometimes restarting - Splunk Answers
Here's some pointers for a "real world" Splunk process monitor in Monit, that will restart splunk when it is detected down by 'splunk...
Read more >
Synergy keeps on auto-restarting ("detected process not ...
Devices: - Server hosted on Late 2013 retina Macbook Pro on Mac OS Sierra (version 10.12) running Synergy version 1.8.8-stable-25a8cb2 ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found