Inject Talker Alias on HBP bridge/repeat via standalone DMRA packets
and embedded LC in forwarded DMRD voice (FLCO 4–7) for MMDVMHost/
DMRGateway. UTF-8 encoding (format 2) and LC/TA superframe alternation
for the full stream; clear embed state on VTERM.
DMR **Talker Alias** (ETSI TS 102 361-2, 2016) carries a short alphanumeric label in the voice stream. On the Homebrew Protocol (HBP) it appears as separate **`DMRA`** UDP packets (15 bytes each, up to four per transmission).
This is **not** the same as subscriber ID aliases in `subscriber_ids.json` used for logs and the monitor UI. Talker Alias is embedded signaling intended for **radio displays** (OLED, Hytera/MD380tools, etc.).
See also: [Configuration](configuration.md#talker-alias-global).
---
## How ADN handles Talker Alias
When enabled on a **MASTER** system, the server can:
| Mode | Behaviour |
|------|-----------|
| **`both`** (default) | Pass through TA from the source hotspot/radio when all four `DMRA` blocks were received; otherwise inject from `subscriber_ids` + template. |
| **`inject`** | Always build TA from the configured template and alias data. |
On **bridge forward** at voice header (`VHEAD`), the server sends four `DMRA` packets to each HBP target (**MASTER** peers or **PEER** upstream) once per stream, then forwards `DMRD` as usual.
**MMDVMHost / DMRGateway (Pi-Star, WPSD):** stock MMDVMHost does **not** consume standalone downlink `DMRA` UDP; it decodes Talker Alias from **embedded LC inside `DMRD` voice** (FLCO 4–7). When TA is enabled, ADN injects TA into the embedded LC of voice bursts **B–E** (dtype 1–4) on **bridge forward** to HBP targets, in addition to optional standalone `DMRA` packets for clients that support them.
On the **same MASTER**, when **`REPEAT`** copies group voice to other logged-in hotspots, the server also sends those four `DMRA` packets on `VHEAD` (excluding the transmitting peer). Bridge forwarding to the same system shares the same once-per-stream dedupe, so TA is not sent twice.
**Not supported:** OpenBridge legs (no standard `DMRA` on OBP/DMRE wire). Legacy ADN never implemented TA beyond debug logging.
---
## Configuration
Under **`GLOBAL`** (optional per-system override with the same keys):
```yaml
GLOBAL:
TALKER_ALIAS: false
TALKER_ALIAS_MODE: both
TALKER_ALIAS_FORMAT: "{callsign} {fname}"
```
| Key | Meaning |
|-----|---------|
| **TALKER_ALIAS** | Master switch (`false` by default). |
| **TALKER_ALIAS_MODE** | `both`, `passthrough`, or `inject`. Default **`both`** if omitted. |
Maximum string length is **29 characters** (ETSI / MMDVMHost). This limit is fixed in code and is **not** configurable, to avoid incompatible payloads on radios and hotspots.
Subscriber JSON may include `fname`, `surname`, or a dedicated `talker_alias` field per record.
Embedded TA in `DMRD` voice alternates superframes: one cycle (bursts B–E) with the normal group embedded LC, the next with a TA block (FLCO 4–7), repeating until the stream ends.
---
## Pi-Star / MMDVM operator settings
For TA to reach the **local RF radio**:
| Setting | Recommendation |
|---------|----------------|
| **DMR DumpTAData** | `1` (on, Pi-Star default): write embedded Talker Alias to the MMDVM log — required for Pi-Star dashboard / log-based tools to show TA; with `0` nothing appears there. This does **not** block TA on RF. |
| **DMR EmbeddedLCOnly** | `off` (default). If `on`, Talker Alias from the network is disabled. |
Pi-Star’s web dashboard does not show TA; use the radio OLED, MD380tools, or tools such as [pistar-lastqso](https://github.com/kencormack/pistar-lastqso).
**Radio compatibility:** Hytera PD6/7/9 and MD380tools firmware generally work. Many Motorola radios do not support TA; some older firmware may show audio issues when TA is present.
The **adn-monitor proxy** already forwards `DMRA` to the master unchanged.
---
## Limitations and follow-up work
| Topic | Status |
|-------|--------|
| TA on **OpenBridge** targets | Not available (no `DMRA` on standard OBP wire). |
| **Monitor dashboard** live TA column | Separate work (monitor uses DB aliases, not live `DMRA`). |
| Unrelated **`RuntimeError`** in bridge iteration | Tracked as a separate fix. |
---
## References
- [ETSI TS 102 361-2](http://www.etsi.org/deliver/etsi_ts/102300_102399/10236102/02.03.01_60/ts_10236102v020301p.pdf) (Talker Alias format)
El **Talker Alias** DMR (ETSI TS 102 361-2, 2016) transporta una etiqueta alfanumérica corta en el flujo de voz. En el protocolo Homebrew (HBP) aparece como paquetes UDP **`DMRA`** (15 bytes cada uno, hasta cuatro por transmisión).
**No** es lo mismo que los alias de IDs en `subscriber_ids.json` usados en logs y en el monitor. Talker Alias es señalización embebida para **pantallas de radio** (OLED, Hytera/MD380tools, etc.).
Ver también: [Configuración](configuration.md#talker-alias-global).
---
## Cómo lo gestiona ADN
Con la función activada en un sistema **MASTER**, el servidor puede:
| Modo | Comportamiento |
|------|----------------|
| **`both`** (por defecto) | Passthrough del TA del hotspot/radio origen si se recibieron los cuatro bloques `DMRA`; si no, inyección desde `subscriber_ids` + plantilla. |
| **`passthrough`** | Solo reenvía `DMRA` bufferizado. |
| **`inject`** | Siempre genera TA desde la plantilla y datos de alias. |
En el **reenvío por bridge** en cabecera de voz (`VHEAD`), el servidor envía cuatro paquetes `DMRA` a cada destino HBP (**MASTER** peers o **PEER** upstream) una vez por stream, y después reenvía `DMRD` como siempre.
**MMDVMHost / DMRGateway (Pi-Star, WPSD):** el MMDVMHost estándar **no** procesa `DMRA` UDP independiente en downlink; decodifica Talker Alias desde la **LC embebida en voz `DMRD`** (FLCO 4–7). Con TA activado, ADN inyecta el TA en la LC embebida de los bursts **B–E** (dtype 1–4) en el **reenvío por bridge** hacia destinos HBP, alternando LC de grupo y bloques TA durante todo el stream, además de los paquetes `DMRA` opcionales para clientes que los soporten.
En el **mismo MASTER**, cuando **`REPEAT`** copia voz de grupo a otros hotspots registrados, el servidor también envía esos cuatro `DMRA` en `VHEAD` (excluyendo el peer que transmite). Si el bridge apunta al mismo system, comparten la misma deduplicación por stream y el TA no se envía dos veces.
**No soportado:** tramos OpenBridge (no hay `DMRA` estándar en OBP/DMRE). El ADN legacy nunca implementó TA más allá de logs de depuración.
---
## Configuración
Bajo **`GLOBAL`** (opcional override por sistema con las mismas claves):
```yaml
GLOBAL:
TALKER_ALIAS: false
TALKER_ALIAS_MODE: both
TALKER_ALIAS_FORMAT: "{callsign} {fname}"
```
| Clave | Significado |
|-------|-------------|
| **TALKER_ALIAS** | Interruptor maestro (`false` por defecto). |
| **TALKER_ALIAS_MODE** | `both`, `passthrough` o `inject`. Por defecto **`both`** si se omite. |
La longitud máxima es **29 caracteres** (ETSI / MMDVMHost). Este límite está fijado en código y **no** es configurable, para evitar payloads incompatibles en radios y hotspots.
El JSON de suscriptores puede incluir `fname`, `surname` o un campo `talker_alias` por registro.
---
## Formato HBP `DMRA`
| Offset | Campo |
|--------|--------|
| 0–3 | `DMRA` |
| 4–6 | ID DMR origen (3 bytes, big-endian) |
| 7 | Índice de bloque 0–3 |
| 8–14 | 7 bytes de payload |
La codificación usa **formato UTF-8** (formato 2), igual que MMDVMHost `DMRTA.cpp`.
El TA embebido en voz `DMRD` alterna supertramas: un ciclo (bursts B–E) con la LC de grupo normal y el siguiente con un bloque TA (FLCO 4–7), repitiendo hasta el fin del stream.
---
## Ajustes Pi-Star / MMDVM
Para que el TA llegue a la **radio RF local**:
| Ajuste | Recomendación |
|--------|----------------|
| **DMR DumpTAData** | `1` (activado, valor por defecto en Pi-Star): escribe el Talker Alias embebido en el log MMDVM — necesario para que el dashboard de Pi-Star y herramientas basadas en log muestren TA; con `0` no aparece nada ahí. **No** bloquea el TA hacia RF. |
| **DMR EmbeddedLCOnly** | `off` (por defecto). Si está `on`, se desactiva el Talker Alias recibido de la red. |
El panel web de Pi-Star no muestra TA; use OLED de la radio, MD380tools o herramientas como [pistar-lastqso](https://github.com/kencormack/pistar-lastqso).
**Compatibilidad de radios:** Hytera PD6/7/9 y firmware MD380tools suelen funcionar. Muchas Motorola no soportan TA; firmware antiguo puede dar problemas de audio con TA presente.
El **proxy adn-monitor** ya reenvía `DMRA` al master sin modificar.
---
## Limitaciones y trabajo pendiente
| Tema | Estado |
|------|--------|
| TA en destinos **OpenBridge** | No disponible (sin `DMRA` estándar en OBP). |
| Columna TA en vivo en el **monitor** | Trabajo aparte (el monitor usa alias de BD, no `DMRA` en vivo). |
| **`RuntimeError`** no relacionado en iteración de bridges | Fix en rama separada. |