Skip to content

# NT98566 + SC501AI: Cannot start SDK - syscall_403 ENOSYS / hdal module symbol mismatch #2107

Open

Description

@RATMANrush

Hardware

  • SoC: Novatek NT98566 (NA51089)
  • Sensor: SmartSens SC501AI (5MP, confirmed from OEM firmware - vendor advertised as Sony IMX415)
  • Flash: XM25QH128C 16MB NOR
  • RAM: 128MB
  • Board: IVG-N8S (XMeye/ANBIUX branded camera)
  • OpenIPC firmware: openipc.nt98566-nor-lite (built 2026-05-10, kernel 4.19.91)

Problem

Majestic fails to start with open fail=-41 / Cannot start SDK. RTSP stream starts but delivers no video (vd_count=0, sps_len=0).

Investigation

1. syscall_403 returning ENOSYS

strace shows syscall_403 (0x193) called repeatedly by libhdal.so / libvendor_isp.so, returning errno 38 (ENOSYS):

syscall_403(0, 0x7eea1530, 0x516000, 0x193, 0, 0x7eea1530) = -1 (errno 38)
syscall_403(0x6, 0x7eea1488, 0x76dd5000, 0x193, 0x6, 0x7eea1488) = -1 (errno 38)

The OpenIPC kernel arch/arm/tools/syscall.tbl only goes up to entry 399. Syscall 403 is a Novatek proprietary syscall present in the OEM XMeye kernel but missing from the OpenIPC kernel.

2. OEM hdal modules incompatible with OpenIPC kernel

Attempting to use OEM kdrv_comm.ko from the original firmware dump fails because the OEM module requires nvttmr_base, nvttmr_lock, nvttmr_in_use symbols which were not exported by the OpenIPC kernel's timer-novatek.c (CONFIG_NOVATEK_TIMER was disabled).

Fix applied: Enabled CONFIG_NOVATEK_TIMER=y in nt98566.generic.config → symbols now exported. But further OEM modules (kdrv_h26x.ko) require symbols like H26XEnc_setUsrQpCfg, SetMemoryAddr, VdoEnc_Builtin_GetEncVar which appear to be built into the OEM kernel (not found in any extractable .ko).

3. Sensor and I2C

  • Pinmux must be set manually: echo sensor 0x220 > /proc/nvt_info/nvt_pinmux/pinmux_set
  • Fixed in DTB by modifying sensor { pinmux = <0x220> } in boot partition
  • nvt_sen_sc501ai.ko loads successfully (lsmod confirms)
  • i2cdetect -y 0 shows empty bus (sensor not responding) - MCLK not being enabled
  • After pinmux fix, dmesg no longer shows I2C timeouts but _isf_vdocap_do_open() no sen driver persists

4. Kernel version mismatch

Both OEM and OpenIPC kernels report vermagic: 4.19.91 preempt mod_unload ARMv7 but they are different builds with different exported symbols.

What works

  • ✅ OpenIPC boots successfully
  • ✅ Network (DHCP), SSH (dropbear), HTTP (port 80/443)
  • ✅ RTSP server starts on port 554
  • ✅ overlay filesystem (jffs2 on mtdblock3)
  • ✅ fw_printenv/fw_setenv working
  • ✅ All OpenIPC hdal .ko load correctly with CONFIG_NOVATEK_TIMER=y
  • ✅ nvt_sen_sc501ai.ko loads
  • ✅ Pinmux 0x220 set correctly

What doesn't work

  • ❌ Majestic SDK initialization (open fail=-41)
  • ❌ Sensor I2C communication (MCLK not enabled)
  • ❌ Video capture

Flash layout (working)

mtd0: 0x050000 "boot"     (contains U-Boot + DTB)
mtd1: 0x200000 "kernel"
mtd2: 0x480000 "rootfs"
mtd3: 0x930000 "rootfs_data"

Working bootargs

earlyprintk console=ttyS0,115200 init=/init mem=54M rootwait root=/dev/mtdblock2 rootfstype=squashfs mtdparts=spi_nor.0:0x50000(boot),0x200000(kernel),0x480000(rootfs),-(rootfs_data)

Sensor config (from OEM firmware)

[POWER]
id_0_mclk = 0        # CTL_SEN_CLK_SEL_SIEMCLK
id_0_pwdn_pin = 0xFFFFFFFF
id_0_rst_pin = 0x44  # S_GPIO_4
[I2C]
id_0_i2c_id = 0
id_0_i2c_addr = 0x30 # 0x60 >> 1

Requested help

  1. Syscall 403 - What is this Novatek proprietary syscall? Is it possible to add it to the OpenIPC kernel for NT98566/NT98562?

  2. MCLK - How to properly enable MCLK (SIEMCLK) for SC501AI on NT98566? The pinmux driver source (na51089_pinmux_host.c) references SEN_MCLK bit in TOP_REG3 but it's unclear how to trigger this from userspace/init.

  3. hdal symbols - H26XEnc_setUsrQpCfg, SetMemoryAddr, VdoEnc_Builtin_GetEncVar appear to be built into the OEM kernel. Are there OpenIPC versions of these?

OEM firmware analysis

  • OEM uses Load_NT98566 shell script to load hdal modules (identical structure to OpenIPC load_novatek)
  • OEM sensor detection via XmGetSensorType binary which sets pinmux echo sensor 0x220 > /proc/nvt_info/nvt_pinmux/pinmux_set
  • Original firmware backup (16MB) available for further analysis

Fix already applied to OpenIPC repo (PR suggestion)

Add CONFIG_NOVATEK_TIMER=y to br-ext-chip-novatek/board/nt9856x/nt98566.generic.config to export required timer symbols for OEM hdal modules.

Activity

  1. BlueMax commented on Aug 23, 2026

    @BlueMax

    What about using the original kernel (libc, etc)?
    I have similar hardware (IVG-N8F, FM25Q128A, 33/2025). I can find kernel/rootfs in the repo but no bootloader/u-boot. Did you compile it yourself?

  2. widgetii commented on Oct 4, 2026

    @widgetii
    Member

    This was closed by mistake earlier today during a bulk triage and has been reopened. It stays tracked here. Sorry for the noise.

  3. widgetii commented on Oct 22, 2026

    @widgetii
    Member

    We tested this on a lab NT98566 + SC501AI (also 128 MB, XM vendor U-Boot) running the current nightly openipc.nt98566-nor-lite, with only the stock OpenIPC modules. The sensor is detected as sc501ai_i2c and majestic streams H.265 (RTSP chn 0 vps_len 28 sps_len 37 pps_len 13).

    On your three questions:

    1. syscall 403 is clock_gettime64 on 32-bit ARM, not a Novatek syscall. musl calls it first, gets ENOSYS from kernel 4.19 and falls back to clock_gettime. It's harmless.
    2. MCLK is enabled by nvt_sen_sc501ai.ko from /etc/sensors/sen_sc501ai.cfg. With the DTB's sensor{pinmux=<0x220>} nothing more is needed. It works on the stock image.
    3. OEM modules: don't mix them in. They depend on symbols built into the OEM kernel. OpenIPC's own hdal modules work as shipped, and CONFIG_NOVATEK_TIMER isn't needed.

    Please go back to a fully stock setup: flash the nightly kernel and rootfs unmodified (no custom kernel config, no OEM .ko). mem= in bootargs must equal the osmem U-Boot variable. The vendor U-Boot lays memory out from osmem (Linux below it, the HDAL video pool above it), while the kernel only sees mem=. If they differ, the camera breaks. With mem= larger than osmem, the kernel and HDAL share memory, and the kernel panics in nvtmpp_heap_init when the video modules load. Your mem=54M with an unchanged osmem is that case. With osmem larger, the kernel hangs right after Uncompressing Linux... done. Keep the placeholder in bootargs (... mem=${osmem} ..., see OpenIPC/wiki#615) and change only osmem. On our board osmem=54M with a matching mem=54M boots and streams, and Linux gets 47 MB instead of 25 MB. If it still fails, please paste fw_printenv osmem bootargs, cat /proc/cmdline, cat /proc/hdal/comm/info, dmesg, and logread | grep majestic.

    @BlueMax: the U-Boot source is at https://github.com/OpenIPC/u-boot-nt9856x (Novatek SDK U-Boot 2019.04, nvt-na51089_nor_defconfig), but no prebuilt binary is published. The usual install keeps the camera's vendor U-Boot (and the Novatek loader in front of it) and replaces only the kernel and rootfs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions