m1n1/proxyclient/m1n1
Martin Povišer fc66046d76 experiments/aop.py: Extend AOP experiment, add tracer
The AOP uses an 'EPIC' protocol similar to the one other coprocessor
firmware is using but not in the exact same version. Add code for
tracing the AOP calls and extend the aop.py experiment with the client
side of it. Include description of audio calls and some other calls
related to sensor discovery.

Furthermore, in experiments/aop.py, do some AOP audio setup. Once that
is done we can start streaming samples from the internal microphones by
making what AOP considers power state adjustment calls. That is, we
adjust the power state of a 'hpai' device, first to a 'pw1 ' stage,
then to 'pwrd' stage.

So, to see microphone samples, enter the AOP experiment shell first:

  $ M1N1DEVICE=/dev/ttyACM0 experiments/aop.py

Within the shell, adjust the power state of 'hpai':

  >>> aop_set_audio_pstate('hpai', 'pw1 ')

At that point /arm-io/admac-aop-audio powers up. In parallel to the AOP
shell, we can start tools/admac_stream.py on the just powered-up ADMAC
instance:

  $ M1N1HEAP=0x10010000000 M1N1DEVICE=/dev/ttyACM1 tools/admac_stream.py \
        --node admac-aop-audio --channel 1 -v | xxd -g 4 -c 12 -e

Returning back to the AOP shell, we can then set 'hpai' to 'pwrd' state
to kick off the streaming:

  >>> aop_set_audio_pstate('hpai', 'pwrd')

By that point, we should see samples coming out on the ADMAC end. The
samples are 32-bit floats packed in groups of three in a frame, e.g.

00000000: ba7ac6a7 ba32d3c3 baa17ae2  ..z...2..z..
0000000c: 38ccea5f b99c1a37 ba0c4bb1  _..87....K..
00000018: 39d2354f 3964b5ff 39b209fb  O5.9..d9...9
00000024: b96a1d1f 39c8503f 3958fc4f  ..j.?P.9O.X9
00000030: b6b1f5ff 39c72b8f 39bbe017  .....+.9...9
0000003c: 3a912de5 36dd4f7f 37f1147f  .-.:.O.6...7

This has been tested and will to some degree be specific to 2021 Macbook
Pro (t6000). Differences on other models TBD (at the very least the
number of microphones can be presumed different).

Signed-off-by: Martin Povišer <povik@protonmail.com>
2022-11-04 12:36:49 +09:00
..
agx m1n1.agx.cmdqueue: Rename Timestamp to TimeStamp 2022-09-27 06:02:28 +09:00
fw experiments/aop.py: Extend AOP experiment, add tracer 2022-11-04 12:36:49 +09:00
hv hv_exc: Pass through TLBI OS instructions 2022-10-17 22:14:21 +09:00
hw m1n1.hw.dart: Pass in kwargs arguments of from_adt() 2022-11-04 12:36:49 +09:00
trace m1n1.trace: Drop stale super().__init__() call 2022-11-04 12:36:49 +09:00
__init__.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00
adt.py m1n1.hw.adt: Add prop parsing rules related to AOP audio 2022-11-04 12:36:49 +09:00
asm.py m1n1.asm: Fix missing DEFAULT_ARCH on Darwin 2022-08-30 22:29:41 +09:00
constructutils.py m1n1.constructutils: Add offsetof() 2022-09-27 06:02:28 +09:00
find_regs.py proxyclient: removed unused code 2021-09-22 19:00:34 +09:00
gpiola.py m1n1.gpiola: Support explicitly telling the LA thread to exit 2022-08-17 13:42:59 +09:00
hostutils.py m1n1.hostutils: Support accesses wider than kernel granule 2022-08-30 22:29:41 +09:00
loadobjs.py m1n1.hw.loadobjs: Accept queer call methods 2022-05-30 23:26:31 +09:00
macho.py proxyclient/m1n1/macho: Support demangling symbols 2022-08-30 22:41:58 +09:00
malloc.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00
proxy.py m1n1.proxy: increase p.call max args to 5 to match proxy.c 2022-10-11 22:55:53 +09:00
proxyutils.py m1n1.proxyutils: Accept M1N1HEAP environment variable 2022-11-04 12:36:49 +09:00
setup.py m1n1.setup: Always reset PMU boot error counters 2022-08-17 13:42:59 +09:00
shell.py m1n1.shell: Add poll_func hook 2022-07-11 19:02:21 +09:00
sysreg.py m1n1.sysreg & co: Add support for op-like sysregs (e.g. TLBI) 2022-08-17 14:01:07 +09:00
tgtypes.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00
utils.py m1n1.utils: Accept 'base' in chexundump 2022-11-04 12:36:49 +09:00
xnutools.py m1n1.xnutools: Update decode_debugger_state() for 12.0 2021-09-15 23:26:45 +09:00