P25 conventional decode mode + conventional-channel attribution (node-26#24, #20)
op25-container
- generate-config takes p25_mode "conventional" + conv_channels [{frequency,
name, nac}]. It builds fixed fsk4 channels (up to 2 on one non-tunable SDR,
DC spike kept off the channels) with no control channel to hunt. Two
channels send audio to UDP 23456/23457, and audio.py -2 + amplify(2) keeps
levels.
- tk_drb_conv.py (a tk_p25.rx_ctl subclass, copied into OP25 apps) reports
voice / NAC / encryption (LC service options + LDU2 ESS algid/keyid) for
conventional channels and applies the per-channel NAC filter, which stock
tk_p25 does not. Analog uses it too.
- Trunked P25 config is unchanged when p25_mode is absent.
drb-edge-node
- radio_config: system kind from type + config.mode (missing = trunked).
- conventional.py normalizes the console: a distinctive LC TGID, else the
channel's last TGID (30 s), else a synthetic per-channel id (freq/100 Hz).
Encrypted rows are never talkers. With exactly one conventional channel,
orphan audio is attributed to it at close, which fixes analog recording
(#20). The synthetic id and the real TGID on one channel never split.
- Health/dashboard: P25 conventional listen tab (/api/listen p25conv), and
conventional decode + encryption checks. The checkin carries radio_channels.
- Tests: edge 296 pass; op25-container 18 (new CI job). Reviewed by
drb-audio-review (findings fixed; simultaneous two-channel mixdown filed
as #26) and drb-qa-review.
Not verified on SDR hardware.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
1e1dab66b1
commit
d07d312e92
@@ -8,7 +8,8 @@ import json
|
||||
import threading
|
||||
from collections import deque
|
||||
from typing import Optional
|
||||
from models import ConfigGenerator, DecodeMode, ChannelConfig, DeviceConfig, TrunkingConfig, TrunkingChannelConfig, TerminalConfig, MetadataConfig, MetadataStreamConfig, HARDWARE_PRESETS
|
||||
from models import ConfigGenerator, DecodeMode, P25Mode, ChannelConfig, DeviceConfig, TrunkingConfig, TrunkingChannelConfig, TerminalConfig, MetadataConfig, MetadataStreamConfig, HARDWARE_PRESETS
|
||||
from internal.conventional_config import build_conventional_config, CONVENTIONAL_TRUNKING_MODULE
|
||||
from internal.logger import create_logger
|
||||
from internal.op25_config_utls import save_talkgroup_tags, save_whitelist, del_none_in_dict, get_current_system_from_config
|
||||
from internal.liquidsoap_config_utils import generate_liquid_script
|
||||
@@ -178,7 +179,20 @@ def create_op25_router():
|
||||
@router.post("/generate-config")
|
||||
async def generate_config(generator: ConfigGenerator):
|
||||
try:
|
||||
if generator.type == DecodeMode.P25:
|
||||
if generator.type == DecodeMode.P25 and generator.p25_mode == P25Mode.CONVENTIONAL:
|
||||
# node-26#24: fixed voice channels, no control channel to hunt.
|
||||
preset = HARDWARE_PRESETS.get(generator.hardware_preset, HARDWARE_PRESETS["other"])
|
||||
ppm = generator.ppm_override if generator.ppm_override is not None else preset["ppm"]
|
||||
try:
|
||||
config_dict, two_channel = build_conventional_config(
|
||||
generator.systemName, generator.conv_channels, preset["gains"], ppm,
|
||||
)
|
||||
except ValueError as e:
|
||||
raise HTTPException(status_code=400, detail=str(e))
|
||||
if generator.icecastConfig:
|
||||
generate_liquid_script(generator.icecastConfig, two_channel=two_channel)
|
||||
|
||||
elif generator.type == DecodeMode.P25:
|
||||
preset = HARDWARE_PRESETS.get(generator.hardware_preset, HARDWARE_PRESETS["other"])
|
||||
ppm = generator.ppm_override if generator.ppm_override is not None else preset["ppm"]
|
||||
channels = [ChannelConfig(
|
||||
@@ -236,9 +250,9 @@ def create_op25_router():
|
||||
preset = HARDWARE_PRESETS.get(generator.hardware_preset, HARDWARE_PRESETS["other"])
|
||||
ppm = generator.ppm_override if generator.ppm_override is not None else preset["ppm"]
|
||||
freq = int(float(generator.channels[0]))
|
||||
# One fixed conventional channel: no trunking section, so
|
||||
# multi_rx adds its default tk_p25 with no chans and reports
|
||||
# the channel as `conventional` on the HTTP terminal.
|
||||
# One fixed conventional channel: a trunking module with no
|
||||
# chans, so the channel is reported as `conventional` on the
|
||||
# HTTP terminal.
|
||||
channels = [ChannelConfig(
|
||||
name=generator.systemName,
|
||||
trunking_sysname="",
|
||||
@@ -259,6 +273,11 @@ def create_op25_router():
|
||||
config_dict = {
|
||||
"channels": [channel.dict() for channel in channels],
|
||||
"devices": [device.dict() for device in devices],
|
||||
# Same module as P25 conventional (node-26#24): it reports
|
||||
# the channel as `conventional` whatever tk_p25 version the
|
||||
# image was built with, which is what the edge node's
|
||||
# single-channel attribution keys on (node-26#20).
|
||||
"trunking": {"module": CONVENTIONAL_TRUNKING_MODULE, "chans": []},
|
||||
"terminal": TerminalConfig().dict(),
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user