How to: Run Wyoming Satellite and OpenWakeWord on Android

I believe I have found the issue with the SIGSYS:31 error.

After investigating the stack traces, the error occurs on a syscall to pidfd_open aka syscall __NR_pidfd_open. It appears that the Android kernal’s SECCOMP is denying the syscall due to pidfd_open not being on the SECCOMP whitelist for older versions of Android (mine is v8.1.0, kernel 3.18.14).

Per discussion on how GO dealt with this, it appears that this syscall was properly added to the seccomp allow list in Android 12, so the issue would theoretically affect devices running Android 11 or lower.

My own testing has shown that the kernel DOES expose a pidfd_open syscall, but because Android improperly handles it in the whitelist (it should error with a SECCOMP_RET_TRAP or similar but instead errors with a SECCOMP_RET_KILL.

The relevant syscall is actually performed by the underlying python asyncio library, ironically during the very check to see if it should avoid using pidfd…:man_facepalming:. This appears to be getting called the first time that asyncio.create_subprocess_exec(...) is called, which in this case is when the satellite calls the wyoming library’s mic connect function.

My guess is that (at least part of) the reason @1Drew was able to make their workaround work is that the ubuntu distro allows the code to make that check without hitting the actual Android system SECCOMP check.

With all that in mind, I think so far the workarounds may be:

  • Root the android device and edit the SECCOMP config to reply with an error that doesn’t also kill the calling process (haven’t investigate how easy this is yet)
  • Run the code in a containerized fashion somehow such that this check doesn’t get made against the actual Android kernel.
  • Upgrade the Android version to 12+ (for old devices, this is not possible and thus would have to try rooting and installing something like lineageOS)
1 Like