#xpenology

6 posts.

Xpenology on Proxmox

/ Nas /

In preparation for setting up and upgrading CRYSTALDRIN server to DSM 7.2, I tested out what’s the new process for creating an Xpenology VM in Proxmox.

I remember it being really complicated that involves a lot of commands.

With the recent development of interactive bootloaders, it was very easy now.

Xpenology NVR - DVA3219 + GTX 1060 Works

/ Cctv /

I continued with my Xpenology Experiments when I remember that there was an NVR that’s using an older version of Nvidia GPU: DVA3219. It’s officially paired with GTX 1050Ti which is the same generation of the GPU I have in hand.

I checked if any of the bootloaders have support with DVA3219 platform, arpl-i18n does under experimental platforms.

I quickly tried it up again. The installation had no issues. It detected the GPU just like with DVA3221. But I’m still not sure if any AI tasks will work.

I installed Surveillance Station, added 1 IP camera and setup AI tasks.

Facial Recognition works!

Object Detection works!

Intrusion Detection and People Counting did not work though.

Another interesting thing is I can run up to 3 AI tasks at the same time. Having AI tasks enabled directly reflects in GPU utilization.

Power Consumption

No AI tasks~50w
Facial Recognition Only~100w
Object Detection Only~80w
Facial Recognition + Object Detection~100w

Running this machine 24/7 would roughly translates to around 700 pesos per month (@ 10 pesos/kw)

Where to use: CRYSTALDIN-NAS

It’s fun that I found a use for this GPU. I got it for free but I really have no use for it.

I have a server running at CRYSTALDRIN that has a free x16 PCIe port. It’s running Proxmox. I can set up a virtual DVA3219 with GPU Passthrough and have this up and running.

I still have reservation with the monthly cost. An alternative is to use a Intel-based GPU which would only use around 20w (80% less, around 144 pesos per month).

Let’s see!

Proxmox Xpenology mount bootloader as a USB

/ Compute /

The special configuration required for the virtual machine that simulates the U disk:

  1. Select the model as q35.
  2. Enable SeaBIOS, or select UEFI and enter BIOS to turn off secure boot.
  3. Cancel all Boot Order under Options.
  4. Edit /etc/pve/qemu-server/101.conf.

Add the following line in (note to modify the mirror path):

args: -device 'nec-usb-xhci,id=usb-bus0,multifunction=on' -drive 'file=/path/to/arpl-sa6400.img,media=disk,format=raw,if=none,id=drive-disk-bootloader' -device 'usb-storage,bus=usb-bus0.0,port=1,drive=drive-disk-bootloader,id=usb-disk-bootloader,bootindex=999,removable=on'

Source: https://blog.jim.plus/blog/post/jim/synology-sa6400-with-i915

Xpenology AME Patcher

/ Nas /

AME patch is needed if you want support for HEVC encoding/decoding.

  1. Connect to SSH.
  2. Create the patch (below).
  3. Run sudo python ame.py.
import hashlib
import os

r = ['669066909066906690', 'B801000000', '30']
s = [(0x1F28, 0), (0x48F5, 1), (0x4921, 1), (0x4953, 1), (0x4975, 1), (0x9AC8, 2)]
prefix = '/var/packages/CodecPack/target/usr'
so = prefix + '/lib/libsynoame-license.so'

print("Patching")
with open(so, 'r+b') as fh:
    full = fh.read()
    if hashlib.md5(full).digest().hex() != 'fcc1084f4eadcf5855e6e8494fb79e23':
        print("MD5 mismatch")
        exit(1)
    for x in s:
        fh.seek(x[0] + 0x8000, 0)
        fh.write(bytes.fromhex(r[x[1]]))

lic = '/usr/syno/etc/license/data/ame/offline_license.json'
os.makedirs(os.path.dirname(lic), exist_ok=True)
with open(lic, 'w') as licf:
    licf.write('[{"appType": 14, "appName": "ame", "follow": ["device"], "server_time": 1666000000, "registered_at": 1651000000, "expireTime": 0, "status": "valid", "firstActTime": 1651000001, "extension_gid": null, "licenseCode": "0", "duration": 1576800000, "attribute": {"codec": "hevc", "type": "free"}, "licenseContent": 1}, {"appType": 14, "appName": "ame", "follow": ["device"], "server_time": 1666000000, "registered_at": 1651000000, "expireTime": 0, "status": "valid", "firstActTime": 1651000001, "extension_gid": null, "licenseCode": "0", "duration": 1576800000, "attribute": {"codec": "aac", "type": "free"}, "licenseContent": 1}]')

print("Checking whether patch is successful...")
ret = os.system(prefix + "/bin/synoame-bin-check-license")
if ret == 0:
    print("Successful, updating codecs...")
    os.system(prefix + "/bin/synoame-bin-auto-install-needed-codec")
    print("Done")
else:
    print(f"Patch is unsuccessful, retcode = {ret}")

7.2:

import hashlib
import os

r = ['669066909066906690', 'B801000000', '30']
s = [(0x3718, 0), (0x60A5, 1), (0x60D1, 1), (0x6111, 1), (0x6137, 1), (0xB5F0, 2)]
prefix = '/var/packages/CodecPack/target/usr'
so = prefix + '/lib/libsynoame-license.so'

print("Patching")
with open(so, 'r+b') as fh:
    full = fh.read()
    if hashlib.md5(full).digest().hex() != '09e3adeafe85b353c9427d93ef0185e9':
        print("MD5 mismatch")
        exit(1)
    for x in s:
        fh.seek(x[0] + 0x8000, 0)
        fh.write(bytes.fromhex(r[x[1]]))

lic = '/usr/syno/etc/license/data/ame/offline_license.json'
os.makedirs(os.path.dirname(lic), exist_ok=True)
with open(lic, 'w') as licf:
    licf.write('[{"attribute": {"codec": "hevc", "type": "free"}, "status": "valid", "extension_gid": null, "expireTime": 0, "appName": "ame", "follow": ["device"], "duration": 1576800000, "appType": 14, "licenseContent": 1, "registered_at": 1649315995, "server_time": 1685421618, "firstActTime": 1649315995, "licenseCode": "0"}, {"attribute": {"codec": "aac", "type": "free"}, "status": "valid", "extension_gid": null, "expireTime": 0, "appName": "ame", "follow": ["device"], "duration": 1576800000, "appType": 14, "licenseContent": 1, "registered_at": 1649315995, "server_time": 1685421618, "firstActTime": 1649315995, "licenseCode": "0"}]')

print("Checking whether patch is successful...")
ret = os.system(prefix + "/bin/synoame-bin-check-license")
if ret == 0:
    print("Successful, updating codecs...")
    os.system(prefix + "/bin/synoame-bin-auto-install-needed-codec")
    print("Done")
else:
    print(f"Patch is unsuccessful, retcode = {ret}")

https://xpenology.com/forum/topic/65643-ame-30-patcher/

Showing 4 of 6 posts