Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial support for rockchip boards #8382

Merged
merged 12 commits into from
Nov 2, 2023
Merged

Initial support for rockchip boards #8382

merged 12 commits into from
Nov 2, 2023

Conversation

MarcA711
Copy link
Contributor

This allows users with certain rockchip socs to use the integrated NPU to accelerate inference.

@netlify
Copy link

netlify bot commented Oct 29, 2023

Deploy Preview for frigate-docs ready!

Name Link
🔨 Latest commit 7fa6a0c
🔍 Latest deploy log https://app.netlify.com/sites/frigate-docs/deploys/65436992f228a70008f8f995
😎 Deploy Preview https://deploy-preview-8382--frigate-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Sponsor Collaborator

@NickM-27 NickM-27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handful of things to look at but this is a good start, a couple notes / questions:

  • how much testing has been done?
  • is ffmpeg going to be added in a separate PR?
  • be sure to add yourself as a code owner in CODEOWNERS file for docker/rockchip

.github/workflows/ci.yml Outdated Show resolved Hide resolved
docker/rockchip/Dockerfile Outdated Show resolved Hide resolved
docker/rockchip/Dockerfile Outdated Show resolved Hide resolved
docker/rockchip/requirements-wheels-rk.txt Show resolved Hide resolved
docs/docs/configuration/object_detectors.md Outdated Show resolved Hide resolved
docs/docs/configuration/object_detectors.md Show resolved Hide resolved
docs/docs/configuration/object_detectors.md Show resolved Hide resolved
docs/docs/configuration/object_detectors.md Outdated Show resolved Hide resolved
docs/docs/configuration/object_detectors.md Outdated Show resolved Hide resolved
@MrPlatnum
Copy link

Is there a docker container availible for this already? I would really like to test it.

apply requested changes

Co-authored-by: Nicolas Mowen <[email protected]>
@MarcA711
Copy link
Contributor Author

Not yet, but you can build it yourself. Clone my fork https://github.com/MarcA711/frigate-rockchip then cd into the cloned directory and build it with sudo make local-rk. Then you should be able to run it with the configuration and docker-compose I pasted to the docs. If you need assistance, I would be glad to help. Please let me know if everything works and with SoC and board you use.

@MrPlatnum
Copy link

MrPlatnum commented Oct 30, 2023

Thank you very much :)
I managed to get it working. I will let it run for a few days and see if it is stable or any errors occour. I am using a Orange Pi 5 (RK3588S). Do you also plan on adding a custom ffmpeg? I managed to get this working as well but its kinda messy

@NickM-27
Copy link
Sponsor Collaborator

By the way what inference times are y'all seeing?

@MrPlatnum
Copy link

MrPlatnum commented Oct 30, 2023

Comfortable under 100 for me (around 80), but i only have one 2.560 x 1.440 camera running as of now at 5 FPS detection speed

@MarcA711
Copy link
Contributor Author

I guess I did all requested changes besides removing the hide-warnings package.

To your questions:

  • I only got an Orange Pi 5 Plus with RK3588 SoC, so I couldn't try it out on other boards/ socs. On my board I ran it several hours without issues.
  • I plan to include ffmpeg next. I also thought about including gstreamer, since rockchip officially supports gstreamer, not ffmpeg. There is just a community fork of ffmpeg, that enables hw acceleration. I also experienced some issues with ffmpeg, whereas gstreamer worked fine for me so far. But gstreamer can only be used with go2rtc for transcoding. Is there any chance frigate will also support gstreamer?

docker/rockchip/Dockerfile Outdated Show resolved Hide resolved
docker/rockchip/rknn.py Outdated Show resolved Hide resolved
docker/rockchip/Dockerfile Outdated Show resolved Hide resolved
@NickM-27
Copy link
Sponsor Collaborator

I plan to include ffmpeg next. I also thought about including gstreamer, since rockchip officially supports gstreamer, not ffmpeg. There is just a community fork of ffmpeg, that enables hw acceleration. I also experienced some issues with ffmpeg, whereas gstreamer worked fine for me so far. But gstreamer can only be used with go2rtc for transcoding. Is there any chance frigate will also support gstreamer?

this would be a major undertaking especially given all the ways that ffmpeg is embedded into the configuration and is only moving more in that direction, I don't think using gstreamer in frigate makes sense

@MarcA711
Copy link
Contributor Author

Yes, I already imagined that this wouldn't be that easy. Too bad because I like to work with gstreamer because it is so versatile.

You asked for inference speeds:
I have 3 cams, detection at 1280x720 with 5 FPS. Frigate reports inference speeds from 30 ms - 35 ms. The NPU's load is around 10% on Core 0, and 0% on Core 1 and Core 2.

@NickM-27
Copy link
Sponsor Collaborator

Nice, that is not too bad at all

@MarcA711
Copy link
Contributor Author

How does the EdgeTpu perform?
I guess the rockchip SoCs NPU got a little advantage since it can access RAM directly. The EdgeTpu needs to load data from RAM over USB (or pcie for the m.2 version) which results in a lower bandwith and delay. But not sure if this plays any role for this rather small object detections.

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Oct 30, 2023

It is generally faster but of course it depends on the model, the COCO edge tpu model that comes with frigate has an inference speed of about 9 ms. My frigate+ model has an inference speed of ~ 4.9 ms

@MrPlatnum
Copy link

@MarcA711 I let the container run for the night but it does not pick up any objects/persons this far where my coral would definitely have. I used your minimal config example without changes. Do you have any extra ffmpeg args?

@MarcA711
Copy link
Contributor Author

MarcA711 commented Oct 31, 2023

Did you enable recording for your camera stream? Try this config:

detectors:
  rknn:
    type: rknn

model:
  input_pixel_format: bgr

objects:
  track:
    - person

mqtt:
  enabled: false

detect:
  enabled: true
  width: 2560
  height: 1440
  fps: 5
record:
  enabled: true
  events:
    retain:
      default: 10
      mode: motion

cameras:
  driveway:
    ffmpeg:
      output_args:
        record: preset-record-generic
      inputs:
        - path: rtsp:https://xxx:[email protected]:554/xxx
          input_args: "preset-rtsp-generic"
          roles:
            - detect
            - record

@NickM-27
Copy link
Sponsor Collaborator

those input args are not input args, that's not right. I would just let frigate use the default input args

@MarcA711
Copy link
Contributor Author

You are right, I updated my comment.

@MarcA711
Copy link
Contributor Author

I have a question. At the moment, I rewrite my dockerfile.

I try to build the wheels for the rknn toolkit2. I do it this way:

FROM wheels as wheels-rk
COPY docker/rockchip/requirements-wheels-rk.txt /requirements-wheels-rk.txt
RUN pip3 wheel --wheel-dir=/wheels-rk -r /requirements-wheels-rk.txt

requirements-wheels-rk.txt has the following contents:

rknn-toolkit-lite2 @ https://github.com/MarcA711/rknn-toolkit2/raw/master/rknn_toolkit_lite2/packages/rknn_toolkit_lite2-1.5.2-cp39-cp39-linux_aarch64.whl

rknn-toolkit-lite2 depends on numpy for example. However, numpy was already installed in the main frigate image before. How do I make sure, that I don't overwrite the numpy version in the main image?

@MrPlatnum
Copy link

MrPlatnum commented Oct 31, 2023

This is my config:

birdseye:
  enabled: True
  mode: continuous
record:
  enabled: True
  retain:
    days: 30
    mode: motion
  events:
    retain:
      default: 30
      mode: active_objects
snapshots:
  enabled: true
mqtt:
  enabled: false
detectors:
  rknn:                               # required
    type: rknn                        # required
model:                                # required
  path: /models/yolov8n-320x320.rknn
  input_pixel_format: bgr             # required
cameras:
  garten:
    ffmpeg:
      input_args:
        - -fflags
        - +genpts+discardcorrupt
        - -loglevel
        - info
      inputs:
      - path: rtmp:https://192.168.XXX.XXX
        hwaccel_args: -hwaccel drm -hwaccel_device /dev/dri/card0 -c:v h264_rkmpp_decoder
        roles:
        - record
      - path: rtmp:https://192.168.XXX.XXX
        hwaccel_args: -hwaccel drm -hwaccel_device /dev/dri/card0 -c:v h264_rkmpp_decoder
        roles:
        - rtmp
        - detect
    rtmp:
      enabled: True
    detect:
      width: 640
      height: 360
      fps: 15
      

But no objects/persons still.
Also no errors the log reads:

2023-10-31 14:45:33.767004464  I RKNN: [14:45:33.766] RKNN Runtime Information: librknnrt version: 1.5.2 (c6b7b351a@2023-08-23T15:28:22)
2023-10-31 14:45:33.767031005  I RKNN: [14:45:33.767] RKNN Driver Information: version: 0.9.0
2023-10-31 14:45:33.767386542  I RKNN: [14:45:33.767] RKNN Model Information: version: 6, toolkit version: 1.5.2+b642f30c(compiler version: 1.5.2 (c6b7b351a@2023-08-23T07:39:01)), target: RKNPU v2, target platform: rk3588, framework name: ONNX, framework layout: NCHW, model inference type: static_shape

@NickM-27
Copy link
Sponsor Collaborator

@MarcA711 by default I believe pip will not overwrite the dependencies, numpy is already installed so as long as the installed version satisfies rknn requirement it won't be overwritten. if it does not satisfy the requirement then pip will throw an error and the build will fail

@NickM-27
Copy link
Sponsor Collaborator

@MrPlatnum you are also missing some important input args, I'd highly suggest just using one of the presets.

The easiest way to debug this behavior would be with a recording of the debug view with bounding boxes, regions, and motion boxes enabled

@MarcA711
Copy link
Contributor Author

@NickM-27 the problem is, there are no packages installed in the wheel image. It just builds the wheels and saves them to a .whl-file. When I install these .whl-files in the main image, it will override numpy.

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Oct 31, 2023

I don't believe that is correct if you are pulling from the correct layer. Tensorrt pulls from the wheels target which contains all of the original python dependencies and then just creates its own wheel in a separate folder, there are no duplicates.

Then this is installed from in the frigate layer

FROM wheels as trt-wheels
ARG DEBIAN_FRONTEND
ARG TARGETARCH
# Add TensorRT wheels to another folder
COPY docker/tensorrt/requirements-amd64.txt /requirements-tensorrt.txt
RUN mkdir -p /trt-wheels && pip3 wheel --wheel-dir=/trt-wheels -r /requirements-tensorrt.txt
FROM tensorrt-base AS frigate-tensorrt
ENV TRT_VER=8.5.3
RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
pip3 install -U /deps/trt-wheels/*.whl && \
ldconfig

they are then installed later on in the final image

RUN --mount=type=bind,from=trt-wheels,source=/trt-wheels,target=/deps/trt-wheels \
pip3 install -U /deps/trt-wheels/*.whl

@NickM-27
Copy link
Sponsor Collaborator

actually nevermind I believe you are correct, looking at the requirements file for amd64 nvidia and it does define numpy https://github.com/blakeblackshear/frigate/blob/dev/docker/tensorrt/requirements-amd64.txt

@MarcA711
Copy link
Contributor Author

Well, I found a solution. I can use the requirements-wheels.txt from the main image as a constraints file:
pip3 wheel --wheel-dir=/wheels-rk -c /requirements-wheels.txt -r /requirements-wheels-rk.txt
This way, the versions of the packages match.

However, links are not allowed in constraints files, so these lines have to be removed somehow:

git+https://github.com/fbcotter/py3nvml#egg=py3nvml
openvino @ https://github.com/NateMeyer/openvino-wheels/releases/download/multi-arch_2022.3.1/openvino-2022.3.1-1-cp39-cp39-manylinux_2_31_x86_64.whl; platform_machine == 'x86_64'
openvino @ https://github.com/NateMeyer/openvino-wheels/releases/download/multi-arch_2022.3.1/openvino-2022.3.1-1-cp39-cp39-linux_aarch64.whl; platform_machine == 'aarch64'

Any idea how to do that?

@MaBeniu
Copy link

MaBeniu commented Nov 25, 2023

it is homeassistant OS
image

@MaBeniu
Copy link

MaBeniu commented Dec 21, 2023

I have now started playing with different setup. I installed Ubuntu 20.04 with kernel 5.10.0 that according to vendor of the device has most of the features included.
for a first test I started frigate with as simple as possible setup.

mqtt:
  host: 172.18.0.3
  user: mqtt-frigate
  password: pass
birdseye:
  enabled: false
detectors:
  cpu1:
    type: cpu
    num_threads: 2
  # coral_pci:
  #   type: edgetpu
  #   device: pci:0
  # rknn:                               
  #   type: rknn                       
#model:
#  input_pixel_format: bgr
ffmpeg:
  hwaccel_args: preset-rk-h264
  input_args: preset-rtsp-restream
cameras:
  stogine:
    enabled: true
    ffmpeg:
      inputs:
        - path: rtsp:https://admin:{FRIGATE_RTSP_PASSWORD}@192.168.0.125:554/cam/realmonitor?channel=1&subtype=0
          roles:
            - detect
  • with CPU detector enabled I am getting very high CPU load but at least I can see an image of the camera loaded

image

  • if I try running it with coral_pci then I get error that detector is stuck and restarting. no frames are captured
  • if I try running it with rknn I get such and applications then shuts down:
2023-12-21 11:11:55.767775452  [2023-12-21 11:11:55] detector.rknn                  INFO    : Starting detection process: 312
2023-12-21 11:11:55.787342356  [2023-12-21 11:11:55] frigate.app                    INFO    : Output process started: 314
2023-12-21 11:11:55.872528774  [2023-12-21 11:11:55] frigate.app                    INFO    : Camera processor started for stogine: 321
2023-12-21 11:11:55.903977522  [2023-12-21 11:11:55] frigate.app                    INFO    : Capture process started for stogine: 324
2023-12-21 11:11:56.275239417  **************************************************
2023-12-21 11:11:56.275325464  !!! It is detected that some necessary files are missing in the container.
2023-12-21 11:11:56.275357550  !!! When starting the container, please use the -v parameter to map the corresponding files in the host to the container.
2023-12-21 11:11:56.275431930  The reference parameters of run container are as follows:
2023-12-21 11:11:56.275519436      -v /dev/dri/renderD129:/dev/dri/renderD129
2023-12-21 11:11:56.275545688      -v /proc/device-tree/compatible:/proc/device-tree/compatible
2023-12-21 11:11:56.275622109  **************************************************
2023-12-21 11:11:56.276299697  E Catch exception when init runtime!
2023-12-21 11:11:56.280316801  E Traceback (most recent call last):
2023-12-21 11:11:56.280336636    File "/usr/local/lib/python3.9/dist-packages/rknnlite/api/rknn_lite.py", line 140, in init_runtime
2023-12-21 11:11:56.280355887      self.rknn_runtime = RKNNRuntime(root_dir=self.root_dir, target=target, device_id=device_id,
2023-12-21 11:11:56.280361138    File "rknnlite/api/rknn_runtime.py", line 305, in rknnlite.api.rknn_runtime.RKNNRuntime.__init__
2023-12-21 11:11:56.280366971    File "rknnlite/api/rknn_runtime.py", line 346, in rknnlite.api.rknn_runtime.RKNNRuntime._check_container
2023-12-21 11:11:56.280433476  RuntimeError
2023-12-21 11:11:56.280436684  
2023-12-21 11:11:56.282769300  [2023-12-21 11:11:56] frigate.detectors.plugins.rknn E       : Error initializing rknn runtime. Do you run docker in privileged mode?
2023-12-21 11:11:56.940778718  [INFO] Starting go2rtc healthcheck service...

here is my docker compose setup:

frigate:
    container_name: frigate
    privileged: true 
    restart: no
    image: ghcr.io/blakeblackshear/frigate:0.13.0-beta7-rk
    shm_size: "100mb" 
    devices:
      - /dev/apex_0:/dev/apex_0 #this is coral edgetpu
      - /dev/dri/renderD128:/dev/dri/renderD128 #as I find such in my /dev
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: "pass"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /home/me/homeassistant/frigate:/config
      - /home/me/media:/media/frigate
      - /proc/device-tree/compatible:/proc/device-tree/compatible
      - type: tmpfs
        target: /tmp/cache
        tmpfs:
          size: 1000000000

FFPROBE:
Video:
Codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
Resolution: 2560x1440
FPS: 25/1

would appreciate more knowledgable people help how to setup my linux and docker setup as I assume I am missing something?

@MarcA711 if anytime you would be able to assist would be helpfull.
otherwise I started to think for a noob like I am maybe buying something with Intel would be wiser :(

@MarcA711
Copy link
Contributor Author

Hey,
I have some spare time within the next 2 weeks and could gladly help you.

Could you please run this command and post the output:

sudo cat /sys/kernel/debug/rknpu/version

Can you provide a link to the distro that you run on your device?

Moreover, could you try adding the bold lines to your docker-compose.yml:


version: "3.9"
frigate:
    container_name: frigate
    privileged: true 
    restart: no
    image: ghcr.io/blakeblackshear/frigate:0.13.0-beta7-rk
    shm_size: "100mb" 
    devices:
      - /dev/apex_0:/dev/apex_0 #this is coral edgetpu
      - /dev/dri/renderD128:/dev/dri/renderD128 #as I find such in my /dev
      - /dev/dri/renderD129:/dev/dri/renderD129
    ports:
      - "5000:5000"
      - "8554:8554" # RTSP feeds
      - "8555:8555/tcp" # WebRTC over tcp
      - "8555:8555/udp" # WebRTC over udp
    environment:
      FRIGATE_RTSP_PASSWORD: "pass"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /home/me/homeassistant/frigate:/config
      - /home/me/media:/media/frigate
      - /proc/device-tree/compatible:/proc/device-tree/compatible
      - type: tmpfs
        target: /tmp/cache
        tmpfs:
          size: 1000000000

@MaBeniu
Copy link

MaBeniu commented Dec 21, 2023

cat: /sys/kernel/debug/rknpu/version: No such file or directory

drwxr-xr-x  13 root root    0 Dec 21 13:55 ./
dr-xr-xr-x  14 root root    0 Dec 21 13:55 ../
-r--r--r--   1 root root 4096 Dec 21 13:58 boot_mode
drwxr-xr-x   2 root root    0 Dec 21 13:58 cgroup/
drwxr-xr-x   2 root root    0 Dec 21 13:55 config/
drwx------  40 root root    0 Jan  1  1970 debug/
-r--r--r--   1 root root 4096 Dec 21 13:58 fscaps
drwxr-xr-x   9 root root    0 Dec 21 13:58 iommu_groups/
drwxr-xr-x 131 root root    0 Dec 21 13:58 irq/
drwxr-xr-x   3 root root    0 Dec 21 13:55 mm/
-r--r--r--   1 root root   76 Dec 21 13:58 notes
-rw-r--r--   1 root root 4096 Dec 21 13:58 profiling
-rw-r--r--   1 root root 4096 Dec 21 13:58 rcu_expedited
-rw-r--r--   1 root root 4096 Dec 21 13:58 rcu_normal
drwxr-xr-x   2 root root    0 Dec 21 13:55 security/
drwxr-xr-x 127 root root    0 Dec 21 13:58 slab/
drwxr-xr-x   4 root root    0 Dec 21 13:58 software_nodes/
drwx------   6 root root    0 Jan  1  1970 tracing/
-rw-r--r--   1 root root 4096 Dec 21 13:55 uevent_helper
-r--r--r--   1 root root 4096 Dec 21 13:58 uevent_seqnum
drwxr-xr-x   2 root root    0 Dec 21 13:58 wakeup_reasons/

this is under kernel directory /sys/kernel

update:
changing docker-compose version to 3.9 actually helped, now with cpu detector I finally get live feed for camera. but for now I use only substream with low resolution.

update:
this is the source of the kernel I use https://github.com/hardkernel/linux/commits/odroidm1-5.10.y

p.s. I have mostly free time until new year so will be mostly available also

@MarcA711
Copy link
Contributor Author

Could you then try: sudo ls /sys/kernel/debug/rknpu/
In case the above command gives No such file or directory error try this: sudo ls /sys/kernel/debug/

Does rknn detector work as well now? If not, could you run this: ls /dev/dri/

@MaBeniu
Copy link

MaBeniu commented Dec 21, 2023

image

@MarcA711
Copy link
Contributor Author

It seems that the rknpu is not enabled on your distro.

From the odroid os install guide (https://wiki.odroid.com/getting_started/os_installation_guide#tab__odroid-m1) I can see that there are multiple versions of Ubuntu. Some explicitly mention that the NPU is enabled and you should disable Petitboot (described here: https://wiki.odroid.com/odroid-m1/software/boot_sequence#bypassing_petitboot). First, I would disable Petitboot on your current installation and see, if the NPU works. If not, install Ubuntu Gnome with NPU support.

To check if the NPU works, you should type sudo ls /dev/dri/ and it should list renderD129

@MaBeniu
Copy link

MaBeniu commented Dec 22, 2023

ohhh well that lovely linux.... i made love for all day today. 3 OS reinstalls 😄
so I have now ubuntu 20.04 (npu pre-prepared by vendor) with 4.19 kernel.
renderD129 is available and also rknn is live and doing its job. 🥳🥳🥳🥳🥳

I would appreciate some more help with few other issues:

  1. I suspect with the prepared OS version I also got some models that are used so would be usefull for some guidance to check and maybe update to the proper versions.
  2. ffmpeg with 640x480 resolution I get 30% capture CPU usage, while in HA I used to have for this camera with 4MP resolution only 13%
2023-12-22 19:36:43.609259720  I RKNN: [19:36:43.609] RKNN Runtime Information: librknnrt version: 1.5.2 (c6b7b351a@2023-08-23T15:28:22)
2023-12-22 19:36:43.610443133  I RKNN: [19:36:43.610] RKNN Driver Information: version: 0.4.2
2023-12-22 19:36:43.615879774  I RKNN: [19:36:43.615] RKNN Model Information: version: 6, toolkit version: 1.5.2+b642f30c(compiler version: 1.5.2 (c6b7b351a@2023-08-23T07:39:01)), target: RKNPU lite, target platform: rk3568, framework name: ONNX, framework layout: NCHW, model inference type: static_shape```

@MarcA711
Copy link
Contributor Author

I am glad that it works!
However, Kernel 4.19 is very old. Your kernel comes with rknn driver version 0.4.2. The current version is 0.9.2 and rockchip recommends using 0.8.8 or newer.
There are armbian builds for your board (https://www.armbian.com/odroid-m1/) alternatively there is a debian (https://github.com/inindev/odroid-m1). I don't know if these allow using the npu, you will have to try.
If it won't work, you should think about compiling a kernel with up-to-date drivers yourself.

To the other issues you mentioned:

  1. I don't quite understand what you mean, could you explain it again in more detail?
  2. The poorer performance may be due to the old kernel you are using now.

@MaBeniu
Copy link

MaBeniu commented Dec 23, 2023

Ok, this means fun only begins here... What about hardware acceleration, how can I test that? If I understand right rkmpp is key here?

@MarcA711
Copy link
Contributor Author

hardware video decoding should work, since you specified this options:

ffmpeg:
  hwaccel_args: preset-rk-h264

Hardware transcoding is also possible using go2rtc, but since your cam already sends a h264 streams this is not necessary. Hardware video scaling is not possible in the current version but will be included in the next one.

@MaBeniu
Copy link

MaBeniu commented Dec 26, 2023

sad story for this device I am not suitable :) at least I lack knowledge thats needed to make it run.
i flashed 5.10 Kernel that as per some suggestions in the forum also supports NPU and expecting it to have better performance.
However after flashing I got various issues. Frigate application ffmpeg processing doesnt work anymore. for rknn I gett error that libs are missing. on top of this I got mac address changing on each reboot.

looking around now to order sbc with AlderLake N100 CPU I found few options with cost of 130$ and those devices have also reasonable performance and power consumption.

@MarcA711
Copy link
Contributor Author

Sorry for the late reply, i had a cold.

It's a pity that the board didn't work out for you. Unfortunately, the rk3568 platform is not as well supported as the rk3588 platform. In the future this will hopefully get better.

However, didn't the board work for you using the 4.19 kernel? The only issue was a higher CPU usage.

@MaBeniu
Copy link

MaBeniu commented Dec 29, 2023

Sorry for the late reply, i had a cold.

It's a pity that the board didn't work out for you. Unfortunately, the rk3568 platform is not as well supported as the rk3588 platform. In the future this will hopefully get better.

However, didn't the board work for you using the 4.19 kernel? The only issue was a higher CPU usage.

Yes it worked but with very low performance. Seemed even worse than with frigate as HAOS addon running only on cpu. Already ordered new device but if vendor will bring some upgrades will test it someday

Thanks anyway for your contribution to the community .

P.s. tried armbian and other options with no luck
P.p.s. compiling is something I googled about but haven't got a clue how to do it myself, seemed too complicated for me

@MarcA711
Copy link
Contributor Author

MarcA711 commented Jan 5, 2024

@MaBeniu I have seen, that Rockchip plans to release a new Kernel (version 6.1) for rk3568 socs. Maybe this will resolve your issues.

@MaBeniu
Copy link

MaBeniu commented Jan 6, 2024

@MaBeniu I have seen, that Rockchip plans to release a new Kernel (version 6.1) for rk3568 socs. Maybe this will resolve your issues.

Maybe. Thanks for heads up! Once released I will test it. soon I this device will become secondary.

@JMNRA
Copy link

JMNRA commented Jan 30, 2024

hi @MarcA711 , could you pass me your dockercompose and the basic frigate configuration file so I can run it on my op5+ please?

@MarcA711
Copy link
Contributor Author

MarcA711 commented Jan 30, 2024

@Bascht74
Copy link

Bascht74 commented Feb 4, 2024

@MarcA711 Is there any news about the HA Add-On with the hardware decoder for FFMPEG enabled?

Not needed anymore after I read everything in this ticket here:
blakeblackshear/frigate-hass-addons#145

Wow, I thought it might be easier, but I have to be pacient...

@MarcA711
Copy link
Contributor Author

MarcA711 commented Feb 6, 2024

Hey @Bascht74,

As you may have seen, I found a new approach and posted instructions. Maybe you can help testing?

@Bascht74
Copy link

Bascht74 commented Feb 7, 2024

@MarcA711 Could you point me to the right direction? Where can I find it :-) ?

I hope it is not using supervised HA. As I am doing it for a friend I cannot play with his stuff too much…

@Bascht74
Copy link

Bascht74 commented Feb 7, 2024

Coudn‘t we try something different?
If I see right, HA Supervisor could bind mount the right folder, but it is not doing it.

We could patch that file so that the right folder would be mounted within the docker container. From that perspective we could see, if there are any side effects and if it is a solution.

If yes, we could kindly ask for implementation because it is a solution for our issue/demand.

@NickM-27
Copy link
Sponsor Collaborator

NickM-27 commented Feb 7, 2024

like was described that was already tried and it does not work due to limitations around addons

@MarcA711
Copy link
Contributor Author

MarcA711 commented Feb 7, 2024

@Bascht74
Here is my new approach:
blakeblackshear/frigate-hass-addons#145 (comment)

But yes, it uses supervised HA. HAOS will not work with frigate rockchip in under a year or so. The only alternative is HA Container. This will work right now (I use this setup). But it will not support HA add-ons.

@Bascht74
Copy link

Bascht74 commented Feb 7, 2024

@Bascht74 Here is my new approach: blakeblackshear/frigate-hass-addons#145 (comment)

But yes, it uses supervised HA. HAOS will not work with frigate rockchip in under a year or so. The only alternative is HA Container. This will work right now (I use this setup). But it will not support HA add-ons.

As I don't want to patch the OS for my friend, I cannot follow that path.
I thought that the discussion here could lead to a solution:
home-assistant/supervisor#4863

... but if I understand everything correctly that would only help for HA supervised.

@MarcA711
Copy link
Contributor Author

MarcA711 commented Feb 7, 2024

There are two ways to run frigate and Home Assistant together: Home Assistant Supervised and Home Assistant Container

If you want to go with Home Assistant Supervised, you don't need to patch the os. You just need to install Debian on your board and then install home assistant supervised on it. You can still use the system (e.g. run other docker containers not related to Home Assistant).

However, if you say you don't want to change your friends system too much, you should look into Home Assistant Container. This basically installs Home Assistant in Docker and leaves the rest of the system as is. This method lacks some features compared to Home Assistant Supervised (see this overview), most notably you can't install Home Assistant Add-Ons. However, most Add-Ons are available as standalone docker images, so this is no deal breaker. If you use Home Assistant Container, you can just run frigate in another docker container. Instructions to install Home Assistant Container are here

Edit: added links

@MarcA711
Copy link
Contributor Author

MarcA711 commented Feb 7, 2024

I thought that the discussion here could lead to a solution:
home-assistant/supervisor#4863

... but if I understand everything correctly that would only help for HA supervised.

What do you mean by this? The discussion actually led to a solution (using Home Assistant Supervised). Unfortunately, Home Assistant OS will not work with frigate-rockchip. But since you said you don't want to change your friends system, Home Assistant OS is even worse for you. You would need to install a new OS to his system and Home Assistant actually manages his board then, so his access to the system would be restricted.

@Bascht74
Copy link

Bascht74 commented Feb 7, 2024

I thought that the discussion here could lead to a solution:
home-assistant/supervisor#4863
... but if I understand everything correctly that would only help for HA supervised.

What do you mean by this? The discussion actually led to a solution (using Home Assistant Supervised). Unfortunately, Home Assistant OS will not work with frigate-rockchip. But since you said you don't want to change your friends system, Home Assistant OS is even worse for you. You would need to install a new OS to his system and Home Assistant actually manages his board then, so his access to the system would be restricted.

... could lead to a solution for HAOS with the add-on. But I think then he has to wait...

@MarcA711
Copy link
Contributor Author

MarcA711 commented Feb 7, 2024

Well, it will at least take one year until the missing drives are developed, tested, merged into the Linux Kernel and then they will have to arrive in HAOS...

Once setup, HA supervised is actually not that different. Maybe you should give it a try once it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants