Skip to content

Add Android AMY hello-world C-scale app - #4

Draft
linuxificator wants to merge 28 commits into
feature/android-unix-socketfrom
feature/android-hello-world
Draft

Add Android AMY hello-world C-scale app#4
linuxificator wants to merge 28 commits into
feature/android-unix-socketfrom
feature/android-hello-world

Conversation

@linuxificator

@linuxificator linuxificator commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Summary

Adds a minimal Android application that exercises the generic Android AMY service end to end.

On launch the app:

  • starts AmyService from the amy-service module;
  • connects to the private <filesDir>/amy.sock AF_UNIX/SOCK_SEQPACKET socket;
  • sends ordinary AMY wire protocol commands only;
  • configures raw sine oscillator 0 and sets AMY global output gain to V2.0;
  • waits 30 ms for setup to be committed, then plays C4..C5;
  • shows C scale complete after the sequence is sent.

JNI in the demo is only a tiny client-side Unix-socket shim. It never calls AMY. Musical control remains AMY wire over amy.sock. The demo is one example client of the generic Android AMY service; the service itself has no dependency on this app or on any UI framework.

Cold-start/readiness behavior

The generic Android service publishes amy.sock only after Oboe has started and its realtime callback has executed at least once. Successful socket connection is therefore the readiness boundary for clients rather than a fixed Android startup delay.

The hello-world additionally leaves 30 ms between oscillator setup and the first note so initial synth configuration and C4 cannot be collapsed into the same first command-drain interval on a fresh AMY instance.

Audio routing diagnostics

The generic Android service logs Oboe's actual output device ID plus negotiated stream properties. AmyService resolves the Oboe device ID through Android AudioDeviceInfo and logs a route type such as BUILTIN_SPEAKER, BUILTIN_EARPIECE, Bluetooth, wired headphones, or USB when Android exposes a matching device.

Build/test

The Android workflow:

  • builds amy-service-debug.aar;
  • builds hello-world-debug.apk;
  • uploads both artifacts;
  • boots an Android 35 x86_64 emulator;
  • performs two complete uninstall/install/cold-launch cycles;
  • for each fresh install requires an AMY/Oboe startup, an output-route diagnostic, exactly one C scale complete, no C scale failed, V2.0, and all eight note-on packets 60, 62, 64, 65, 67, 69, 71, 72.

x86_64 is enabled on this demo branch so the same native AMY/Oboe service can run in CI; arm64-v8a remains included for real devices.

This PR is intentionally based on feature/android-unix-socket because it consumes the generic Android AMY service from PR #3.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant