I found a bug with the rkaiq_3A service where it starts to early in the boot process and subsequently does not create the domain socket at /tmp/UNIX.domain0.
The current rkaiq_3A.service file consists of;
[Unit]
Description=Enable Rockchip camera engine rkaiq
DefaultDependencies=no
Before=rockchip.service
[Service]
Type=forking
ExecStart=/etc/init.d/rkaiq_3A.sh start
ExecStop=/etc/init.d/rkaiq_3A.sh stop
[Install]
WantedBy=sysinit.target
Interestingly there is no rockchip.service system file;
$ systemctl status rockchip.service
Unit rockchip.service could not be found.
And we can see the rkaiq_3A server starts to early in boot up with;
$ systemd-analyze critical-chain rkaiq_3A.service
rkaiq_3A.service +24ms
└─systemd-journald.socket @402ms
└─system.slice @373ms
└─-.slice @373ms
To fix this issue create an override service file by;
$ sudo cp /lib/systemd/system/rkaiq_3A.service /etc/systemd/system/rkaiq_3A.service
$ sudo nano /etc/systemd/system/rkaiq_3A.service
Then use this service file which waits for it to start when the local file system is available.
[Unit]
Description=Enable Rockchip camera engine rkaiq
After=local-fs.target systemd-udevd.service systemd-udev-settle.service
Wants=systemd-udev-settle.service
Requires=local-fs.target
[Service]
Type=forking
ExecStart=/etc/init.d/rkaiq_3A.sh start
ExecStop=/etc/init.d/rkaiq_3A.sh stop
[Install]
WantedBy=sysinit.target
Apply this override with;
sudo systemctl daemon-reload
sudo systemctl disable rkaiq_3A
sudo systemctl enable rkaiq_3A
sudo reboot
Once booted up the domain socket is now present.
$ ls -la /tmp/UNIX.domain0
srwxr-xr-x 1 root root 0 Jul 5 09:32 /tmp/UNIX.domain0
This fix means, when using the rkaiq_tool_server tool it would previously error with;
[aiqtool][main]:================== 0 =====================
[aiqtool][main]:capture cache dir:/tmp/capture_file_cache
[aiqtool][main]:disk space >= 200MB, use capture cache.
[aiqtool][Setup]:DomainTCPClient::Setup, domainPath:/tmp/UNIX.domain0
[aiqtool][Setup]:Linux,Create domain socket success.
[aiqtool][Setup]:server.sun_path:/tmp/UNIX.domain0
[aiqtool][Setup]:connect domain server failed. Error
[aiqtool][main]:#### ToolServer connect AIQ failed, path=/tmp/UNIX.domain0 ####
But now it works;
[aiqtool][main]:================== 0 =====================
[aiqtool][main]:capture cache dir:/tmp/capture_file_cache
[aiqtool][main]:disk space >= 200MB, use capture cache.
[aiqtool][main]:ToolServer using socket node /tmp/UNIX.domain0
[aiqtool][Setup]:DomainTCPClient::Setup, domainPath:/tmp/UNIX.domain0
[aiqtool][Setup]:Linux,Create domain socket success.
[aiqtool][Setup]:server.sun_path:/tmp/UNIX.domain0
[aiqtool][main]:#### ToolServer connect AIQ success, path=/tmp/UNIX.domain0 ####
This issue is present across all Rockchip platforms (5B, 5C, 4D, Zero 3E etc) on the Debian bookworm based OS images.
I believe this service file belongs to the camera_engine_rkaiq package but I can’t find the github source used to report there.