# macsinspace/mib-cluster-map architecture

> Architecture diagram of the GitHub repository macsinspace/mib-cluster-map, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/macsinspace/mib-cluster-map
- Repository: https://github.com/macsinspace/mib-cluster-map

## Overview

MIB Cluster Map places phone-projection maps on a compatible Volkswagen-group instrument cluster, with Android Auto video forwarding and a separate CarPlay integration. The main runtime path is projection video capture, local forwarding, and cluster playback; CarPlay has its own receiver path, with a Java bridge for cockpit-wheel zoom. The README also describes firmware-aware installation and settings, but installer implementation is not represented in the supplied tree. Some internal connections below are documented by headers or the README; unverified implementation links are dashed.

Main entry points: [`thirdparty/mhi2_altscreen_carplay/libaltscreen111_gen2.c`](https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/libaltscreen111_gen2.c) (CarPlay receiver), [`src/video_sink_hook.c`](https://github.com/macsinspace/mib-cluster-map/blob/main/src/video_sink_hook.c) (Video sink hook), [`java/navasiazoom/src/de/audi/tghu/navasia/app/NavAsiaModelListener.java`](https://github.com/macsinspace/mib-cluster-map/blob/main/java/navasiazoom/src/de/audi/tghu/navasia/app/NavAsiaModelListener.java) (Navigation model listener), [`src/vc_stream_out.c`](https://github.com/macsinspace/mib-cluster-map/blob/main/src/vc_stream_out.c) (Video stream output)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_projection["Android Auto projection"]
  node_sink_hook["Video sink hook<br/>[video_sink_hook.c]"]
  node_gal_hook["GAL hook<br/>[gal_hook.c]"]
  node_stream_out["Video stream output<br/>[vc_stream_out.c]"]
  node_focus["Focus control<br/>[focus_ctl.c]"]
  node_player["Stream player manager<br/>[vc_player_mgr.c]"]
  node_player_gpu["GPU player<br/>[opengl_gpu.cc]"]
end

subgraph group_carplay["CarPlay integration"]
  node_carplay_launch["CarPlay launcher<br/>[carplay_launcher.c]"]
  node_alt_receiver["CarPlay receiver"]
  node_alt_core["CarPlay stream core<br/>[alt111.h]"]
  node_alt_video["CarPlay video<br/>[alt111_video.c]"]
  node_alt_control["CarPlay control<br/>[alt111_control.c]"]
  node_alt_profile["CarPlay profile<br/>[alt111_profile.c]"]
  node_alt_resync["CarPlay resync<br/>[alt111_resync.c]"]
end

subgraph group_navigation["Navigation controls"]
  node_nav_listener["Navigation model listener"]
  node_nav_zoom["Asia zoom routing<br/>[NavAsiaZoom.java]"]
  node_wheel_zoom["Wheel zoom bridge<br/>[WheelZoom.java]"]
  node_zoom_timer["Zoom delay timer"]
  node_hmi_models["HMI model interfaces"]
end

subgraph group_platform["Head-unit adaptation"]
  node_firmware["Firmware profiles"]
  node_nav_translate["Navigation translation<br/>[nav_translate.c]"]
  node_dmdt["Display flush<br/>[dmdt_flush.c]"]
  node_install["Firmware-aware install"]
end

node_driver(("Driver"))
node_phone(("Phone projection"))

node_phone -.->|"sends video"| node_sink_hook
node_sink_hook -.->|"forwards frames"| node_stream_out
node_stream_out -.->|"serves stream"| node_player
node_player -.->|"starts playback"| node_player_gpu
node_focus -.->|"coordinates delivery"| node_stream_out
node_driver -.->|"turns roller"| node_nav_listener
node_nav_listener -->|"routes increments"| node_nav_zoom
node_nav_zoom -->|"forwards steps"| node_wheel_zoom
node_zoom_timer -->|"uses bridge"| node_wheel_zoom
node_nav_listener -->|"uses models"| node_hmi_models
node_phone -.->|"projects map"| node_alt_receiver
node_alt_receiver -->|"uses protocol core"| node_alt_core
node_alt_receiver -.->|"delegates video"| node_alt_video
node_alt_receiver -.->|"delegates control"| node_alt_control
node_alt_receiver -.->|"uses profile"| node_alt_profile
node_alt_receiver -.->|"uses resync"| node_alt_resync
node_sink_hook -->|"uses hook API"| node_gal_hook
node_sink_hook -.->|"selects profiles"| node_firmware
node_sink_hook -.->|"uses translation"| node_nav_translate
node_driver -.->|"runs SD update"| node_install
node_install -.->|"checks compatibility"| node_firmware
node_install -.->|"installs arrows option"| node_nav_translate
node_dmdt -.->|"flushes display"| node_gal_hook

click node_sink_hook "https://github.com/macsinspace/mib-cluster-map/blob/main/src/video_sink_hook.c"
click node_gal_hook "https://github.com/macsinspace/mib-cluster-map/blob/main/src/gal_hook.c"
click node_stream_out "https://github.com/macsinspace/mib-cluster-map/blob/main/src/vc_stream_out.c"
click node_focus "https://github.com/macsinspace/mib-cluster-map/blob/main/src/focus_ctl.c"
click node_player "https://github.com/macsinspace/mib-cluster-map/blob/main/src/vc_player_mgr.c"
click node_player_gpu "https://github.com/macsinspace/mib-cluster-map/blob/main/player/opengl_gpu.cc"
click node_carplay_launch "https://github.com/macsinspace/mib-cluster-map/blob/main/carplay/carplay_launcher.c"
click node_alt_receiver "https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/libaltscreen111_gen2.c"
click node_alt_core "https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/include/alt111.h"
click node_alt_video "https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/src/alt111_video.c"
click node_alt_control "https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/src/alt111_control.c"
click node_alt_profile "https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/src/alt111_profile.c"
click node_alt_resync "https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/src/alt111_resync.c"
click node_nav_listener "https://github.com/macsinspace/mib-cluster-map/blob/main/java/navasiazoom/src/de/audi/tghu/navasia/app/NavAsiaModelListener.java"
click node_nav_zoom "https://github.com/macsinspace/mib-cluster-map/blob/main/java/navasiazoom/src/local/clustermap/NavAsiaZoom.java"
click node_wheel_zoom "https://github.com/macsinspace/mib-cluster-map/blob/main/java/wheelzoom/src/local/clustermap/WheelZoom.java"
click node_zoom_timer "https://github.com/macsinspace/mib-cluster-map/blob/main/java/wheelzoom/src/de/audi/tghu/navi/app/map/CtxShown%24ZoomUpdateDelayTimer.java"
click node_hmi_models "https://github.com/macsinspace/mib-cluster-map/tree/main/java/navasiazoom/stubs/de/audi/atip/hmi/model"
click node_firmware "https://github.com/macsinspace/mib-cluster-map/blob/main/src/firmware_profiles.h"
click node_nav_translate "https://github.com/macsinspace/mib-cluster-map/blob/main/src/nav_translate.c"
click node_dmdt "https://github.com/macsinspace/mib-cluster-map/blob/main/dmdt_flush/dmdt_flush.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sink_hook,node_gal_hook,node_stream_out,node_focus,node_player,node_player_gpu toneBlue
class node_carplay_launch,node_alt_receiver,node_alt_core,node_alt_video,node_alt_control,node_alt_profile,node_alt_resync toneAmber
class node_nav_listener,node_nav_zoom,node_wheel_zoom,node_zoom_timer,node_hmi_models toneMint
class node_firmware,node_nav_translate,node_dmdt,node_install toneRose
class node_driver,node_phone toneIndigo
```

## Components

### Android Auto projection

- [Video sink hook](https://github.com/macsinspace/mib-cluster-map/blob/main/src/video_sink_hook.c): `src/video_sink_hook.c`
- [GAL hook](https://github.com/macsinspace/mib-cluster-map/blob/main/src/gal_hook.c): `src/gal_hook.c`
- [Video stream output](https://github.com/macsinspace/mib-cluster-map/blob/main/src/vc_stream_out.c): `src/vc_stream_out.c`
- [Focus control](https://github.com/macsinspace/mib-cluster-map/blob/main/src/focus_ctl.c): `src/focus_ctl.c`
- [Stream player manager](https://github.com/macsinspace/mib-cluster-map/blob/main/src/vc_player_mgr.c): `src/vc_player_mgr.c`
- [GPU player](https://github.com/macsinspace/mib-cluster-map/blob/main/player/opengl_gpu.cc): `player/opengl_gpu.cc`

### CarPlay integration

- [CarPlay launcher](https://github.com/macsinspace/mib-cluster-map/blob/main/carplay/carplay_launcher.c): `carplay/carplay_launcher.c`
- [CarPlay receiver](https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/libaltscreen111_gen2.c): `thirdparty/mhi2_altscreen_carplay/libaltscreen111_gen2.c`
- [CarPlay stream core](https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/include/alt111.h): `thirdparty/mhi2_altscreen_carplay/include/alt111.h`
- [CarPlay video](https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/src/alt111_video.c): `thirdparty/mhi2_altscreen_carplay/src/alt111_video.c`
- [CarPlay control](https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/src/alt111_control.c): `thirdparty/mhi2_altscreen_carplay/src/alt111_control.c`
- [CarPlay profile](https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/src/alt111_profile.c): `thirdparty/mhi2_altscreen_carplay/src/alt111_profile.c`
- [CarPlay resync](https://github.com/macsinspace/mib-cluster-map/blob/main/thirdparty/mhi2_altscreen_carplay/src/alt111_resync.c): `thirdparty/mhi2_altscreen_carplay/src/alt111_resync.c`

### Navigation controls

- [Navigation model listener](https://github.com/macsinspace/mib-cluster-map/blob/main/java/navasiazoom/src/de/audi/tghu/navasia/app/NavAsiaModelListener.java): `java/navasiazoom/src/de/audi/tghu/navasia/app/NavAsiaModelListener.java`
- [Asia zoom routing](https://github.com/macsinspace/mib-cluster-map/blob/main/java/navasiazoom/src/local/clustermap/NavAsiaZoom.java): `java/navasiazoom/src/local/clustermap/NavAsiaZoom.java`
- [Wheel zoom bridge](https://github.com/macsinspace/mib-cluster-map/blob/main/java/wheelzoom/src/local/clustermap/WheelZoom.java): `java/wheelzoom/src/local/clustermap/WheelZoom.java`
- [Zoom delay timer](https://github.com/macsinspace/mib-cluster-map/blob/main/java/wheelzoom/src/de/audi/tghu/navi/app/map/CtxShown%24ZoomUpdateDelayTimer.java): `java/wheelzoom/src/de/audi/tghu/navi/app/map/CtxShown$ZoomUpdateDelayTimer.java`
- [HMI model interfaces](https://github.com/macsinspace/mib-cluster-map/tree/main/java/navasiazoom/stubs/de/audi/atip/hmi/model): `java/navasiazoom/stubs/de/audi/atip/hmi/model`

### Head-unit adaptation

- [Firmware profiles](https://github.com/macsinspace/mib-cluster-map/blob/main/src/firmware_profiles.h): `src/firmware_profiles.h`
- [Navigation translation](https://github.com/macsinspace/mib-cluster-map/blob/main/src/nav_translate.c): `src/nav_translate.c`
- [Display flush](https://github.com/macsinspace/mib-cluster-map/blob/main/dmdt_flush/dmdt_flush.c): `dmdt_flush/dmdt_flush.c`
- **Firmware-aware install**

### Other components

- **Driver**
- **Phone projection**

## Connections

- Phone projection → Video sink hook: sends video (evidence: `README.md`)
- Video sink hook → Video stream output: forwards frames (evidence: `src/video_sink_hook.c`)
- Video stream output → Stream player manager: serves stream
- Stream player manager → GPU player: starts playback
- Focus control → Video stream output: coordinates delivery
- Driver → Navigation model listener: turns roller (evidence: `java/navasiazoom/src/de/audi/tghu/navasia/app/NavAsiaModelListener.java`)
- Navigation model listener → Asia zoom routing: routes increments (evidence: `java/navasiazoom/src/de/audi/tghu/navasia/app/NavAsiaModelListener.java`)
- Asia zoom routing → Wheel zoom bridge: forwards steps (evidence: `java/navasiazoom/src/local/clustermap/NavAsiaZoom.java`)
- Zoom delay timer → Wheel zoom bridge: uses bridge (evidence: `java/wheelzoom/src/de/audi/tghu/navi/app/map/CtxShown$ZoomUpdateDelayTimer.java`)
- Navigation model listener → HMI model interfaces: uses models (evidence: `java/navasiazoom/src/de/audi/tghu/navasia/app/NavAsiaModelListener.java`)
- Phone projection → CarPlay receiver: projects map (evidence: `README.md`)
- CarPlay receiver → CarPlay stream core: uses protocol core (evidence: `thirdparty/mhi2_altscreen_carplay/libaltscreen111_gen2.c`)
- CarPlay receiver → CarPlay video: delegates video
- CarPlay receiver → CarPlay control: delegates control
- CarPlay receiver → CarPlay profile: uses profile
- CarPlay receiver → CarPlay resync: uses resync
- Video sink hook → GAL hook: uses hook API (evidence: `src/video_sink_hook.c`)
- Video sink hook → Firmware profiles: selects profiles (evidence: `src/video_sink_hook.c`)
- Video sink hook → Navigation translation: uses translation (evidence: `src/video_sink_hook.c`)
- Driver → Firmware-aware install: runs SD update (evidence: `README.md`)
- Firmware-aware install → Firmware profiles: checks compatibility (evidence: `README.md`)
- Firmware-aware install → Navigation translation: installs arrows option (evidence: `README.md`)
- Display flush → GAL hook: flushes display
