m1n1/proxyclient/experiments
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
..
addrdump.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00
aes.py proxyclient/experiments/aes.py: Add t8110 DART support 2022-06-28 01:41:24 +09:00
agx_1tri.py experiments/agx_1tri.py: Updates for new structs 2022-08-17 13:46:07 +09:00
agx_boot.py m1n1.fw.agx: WIP generate initdata 2022-05-21 03:52:43 +09:00
agx_cancel.py experiments: Add misc AGX experiments 2022-08-17 15:00:00 +09:00
agx_deps.py experiments: Add misc AGX experiments 2022-08-17 15:00:00 +09:00
agx_dumpstructs.py experiments/agx_dumpstructs.py: Dump microsequence 2022-09-27 06:02:28 +09:00
agx_parallel.py experiments: Add misc AGX experiments 2022-08-17 15:00:00 +09:00
agx_renderframe.py experiments/agx_renderframe.py: Rework based on the other demos 2022-09-27 06:02:28 +09:00
agx_tlb.py experiments: Add misc AGX experiments 2022-08-17 15:00:00 +09:00
agx_tracetimings.py experiments: Add misc AGX experiments 2022-08-17 15:00:00 +09:00
aic_test.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00
amcc_err_handler.py experiments/amcc_err_handler.py: New old thing to dump AMCC errors 2022-04-19 23:32:11 +09:00
aop.py experiments/aop.py: Extend AOP experiment, add tracer 2022-11-04 12:36:49 +09:00
audio_capture.py experiments/audio_capture.py: Demonstrate audio capture 2022-02-08 14:18:20 +09:00
chickens.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00
cpu_pstate_latencies.py experiments/cpu_pstate_latencies.py: Support t8112 2022-06-28 01:47:02 +09:00
cpu_pstates.py Set missing execute bits in proxyclient/{experiments|tools}/*.py 2021-11-23 01:23:11 +09:00
dart_dump.py experiments/dart_dump.py: Use DART.from_adt() 2022-02-24 23:55:46 +09:00
dcp.py experiments/dcp.py: replace image loading with rainbow 2022-08-30 22:32:30 +09:00
dcp_iboot.py m1n1.fw.dcp: Support multi-unit EPIC services, refactor, add stuff 2022-08-30 21:38:45 +09:00
dcpext_iboot.py experiments/dcpext_iboot.py: displayRequest() works now 2022-08-31 02:32:35 +09:00
find_sprr_regs.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00
fptest.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00
hacr_trap_bits.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00
i2c.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00
jpeg.py jpeg: Unbreak encode for RGB formats 2022-04-16 19:40:44 +09:00
jpeg_doc.md jpeg: Add documentation 2022-04-16 19:40:44 +09:00
memdump.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00
mmio_sweep.py experiments/mmio_sweep.py: Add MMIO sweep tool 2022-05-30 23:26:31 +09:00
mtp.py experiments/mtp.py: Dump info 2022-07-11 20:14:48 +09:00
ohmmeter.py m1n1.hw.codecs.cs42l84: File the ohmmeter codec regmap 2022-06-21 17:20:30 +09:00
pcie_enable_devices.py Make scripts executable 2022-04-16 19:17:33 +09:00
prores.py prores: test 36-bit iova; fix tracer 2022-05-30 18:05:16 +09:00
scaler.py scaler: Can scale W larger 2022-11-04 12:32:23 +09:00
smc.py experiments/smc.py: Turn into SMC key dumper 2022-02-15 14:05:13 +09:00
speaker_amp.py experiments/speaker_amp.py: Fix AUDIO_P power-domain index 2022-08-30 22:29:41 +09:00
spi.py m1n1: move SPI register to m1n1.hw 2022-03-11 12:06:01 +09:00
sprr_test_permissions.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00
timer_test.py proxyclient: Big cleanup/move to module 2021-06-10 19:40:48 +09:00