# ICAS v1.3: tests and known issues

Package revision 3, 21 September 2026. MIT license added; simulator logic unchanged.

## Test results

Python 3.10.5 on Windows: **5 ASE tests, 15 stack tests and the demo pass**.

From `icas-sim/`:

```sh
python -m tests.test_ase
python -m tests.test_icas
python demo.py
```

The model takes controller capacity and concurrency as inputs. It does not render audio, schedule ISO traffic or test a vendor HAL. `test_m1_two_tones_icas` checks modeled stream states and destinations, not hardware playback.

Android integration, HCI capture and G0/M1 remain pending. The Linux scripts have not been run. ICAS code and documentation are licensed under [MIT](./LICENSE.txt), copyright 2026 Kris Ledel.

## Simulator issues

| Area | Defect | Location |
| --- | --- | --- |
| Microphone | Preemption can replace the selected microphone without creating a source ASE. Switching the microphone changes its label while the old ASE remains active. Unknown or incapable sources are accepted. | `IcasStack._force_call_after_preempt`, `IcasStreamManager.set_uplink_device`, `IcasStack._admit` |
| Focus recovery | Media can stay paused after a call ends, or resume with inconsistent stream/CIG/CIS bindings. | `IcasStack.apply_call_focus`, `IcasStack.end_call` |
| Disconnects | Call end can reactivate disconnected headphones. A separate microphone's disconnect leaves its source ASE active. | `IcasStack.disconnect_device` |
| Resources | Split uplinks undercount sessions under the model's CIG-based accounting. Preemption retries bypass HAL limits. A released split uplink leaves a CIG allocated. | `IcasStack.hal_sessions`, `_force_call_after_preempt`, `_release_stream` |
| ASE errors | Rejected transitions can still overwrite bindings. | `Ase.config_qos`, `enable`, `cis_ready`, `update_metadata` |
| Manager API | Notifications follow media admission. Releasing a call does not restore preempted media. | `IcasStreamManager.create_stream`, `release` |

Reproduce with the [diagnostic script](./icas-review-probes.py):

```sh
python -B icas-review-probes.py /path/to/icas-sim
```

The [recorded output](./icas-review-results.jsonl) contains 15 diagnostic observations. These cases still need fixes and regression assertions.

## Linux prototype issues

The prototype connects virtual playback sinks to existing Bluetooth outputs. Microphone routing, admission policy and LE Audio multi-CIS are not implemented.

- `01-create-icas-sinks.sh` unloads null-sink modules without restricting removal to ICAS-owned modules.
- `04-test-tone.sh` sends WAV data to a raw PCM reader with forced format settings.
- `02-link-to-bluetooth.sh` uses unsupported single-port disconnect syntax and suppresses link failures. See [pw-link syntax](https://docs.pipewire.org/page_man_pw-link_1.html).
- `51-icas-routing.lua` defines rules without a consumer. Its installation path uses Lua configuration removed in [WirePlumber 0.5](https://pipewire.pages.freedesktop.org/wireplumber/daemon/configuration/migration.html).

## Hardware gate

The specification requires dual rendering before P2, while P2 provides the concurrent ownership needed for dual rendering. Clarify this dependency by allowing a minimal native/HAL experiment within G0.

- Record phone, firmware/controller, AOSP revision and sink models.
- Instrument group ownership, codec/HAL sessions and HCI establishment.
- For M1, render different signals for at least 30 seconds and repeat across ten connection cycles. Correlate recordings with CIS/CIG and HAL traces.
- Record controller, timing, native-stack and HAL limitations separately.
- Continue with VoIP, explicit microphone selection, focus, cellular calls and T8–T13 recovery tests.
