My snap contains a single executable, which can either be run manually from the command line, or via a snap service. So actually when the snap is first installed, the app service is automatically started.
The executable uses libusb, and during startup it will call libusb_open().
When running manually from the command line, this works as expected.
However when running as a snap service, this function call always fails!
Here is the error from journalctl:
63702 May 24 12:13:05 odroid audit: SECCOMP auid=4294967295 uid=0 gid=0 ses=4294967295 pid=20267 comm="CaptureGRID4" exe="/snap/capturegrid4/8/CaptureGRID4" sig=0 arch=40000028 63702 syscall=281 compat=0 ip=0xb57fb898 code=0x50000 63703 May 24 12:13:05 odroid kernel: audit: type=1326 audit(1558699985.433:57): auid=4294967295 uid=0 gid=0 ses=4294967295 pid=20267 comm="CaptureGRID4" exe="/snap/capturegrid4/8/Captu 63703 reGRID4" sig=0 arch=40000028 syscall=281 compat=0 ip=0xb57fb898 code=0x50000 63704 May 24 12:13:05 odroid capturegrid4.node: [12:13:05.441 Camera Error: 1] failed to open USB: -99 LIBUSB_ERROR_OTHER (Other error)
Does this give some indication of what going wrong?
(I’m not sure how to debug this issue)
Is there some permission missing from my snap service definition?
Here is what it currently looks like:
apps: capturegrid4: command: desktop-launch $SNAP/CaptureGRID4 plugs: - camera - home - network - network-bind - raw-usb - removable-media - desktop - opengl - x11 environment: LANG: "C" LC_ALL: "C" node: command: CaptureGRID4 --cli --grid --api daemon: simple restart-condition: always plugs: - camera - home - network - network-bind - raw-usb - removable-media environment: LANG: "C" LC_ALL: "C"
This snap is running on armhf ubuntu18 odroid-xu4.
I’ve tried it on a pi3 ubuntu18 armhf image, and same problem
If I build the same snap for arm64 and run it on a pi3 ubuntu18 arm64 image, it works ok.