Skip to content

Commit 686bddf

Browse files
DSheirerDennis Sheirer
andauthored
#1799 DMR Cap+ & CapMax now track events correctly. Updated Cap+ events to include channel descriptor and frequencies. Corrected Capacity Max talker aliases to combine base and continuation alias fragments into a unified alias identifier. (#1801)
Critical: resolved a thread deadlock issue when the DMR multi-frequency channel rotation thread deadlocks against the UI thread when accessing the current channel's frequency from the frequency controller. This thread deadlock may be the source of multiple users reporting OutOfMemory crashes when running any DMR channel with multiple control frequencies where the decoder was rolling through each frequency checking for activity. Co-authored-by: Dennis Sheirer <[email protected]>
1 parent 1c420b8 commit 686bddf

File tree

11 files changed

+366
-268
lines changed

11 files changed

+366
-268
lines changed

src/main/java/io/github/dsheirer/controller/channel/ChannelProcessingManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* *****************************************************************************
3-
* Copyright (C) 2014-2023 Dennis Sheirer
3+
* Copyright (C) 2014-2024 Dennis Sheirer
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -442,7 +442,7 @@ else if(request.hasChildDecodeEventHistory())
442442

443443
/* Processing Modules */
444444
List<Module> modules = DecoderFactory.getModules(mChannelMapModel, channel, mAliasModel, mUserPreferences,
445-
request.getTrafficChannelManager());
445+
request.getTrafficChannelManager(), request.getChannelDescriptor());
446446
processingChain.addModules(modules);
447447

448448
//Post preload data from the request to the event bus. Modules that can handle preload data will annotate

src/main/java/io/github/dsheirer/identifier/Form.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* *****************************************************************************
3-
* Copyright (C) 2014-2023 Dennis Sheirer
3+
* Copyright (C) 2014-2024 Dennis Sheirer
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -54,7 +54,6 @@ public enum Form
5454
STATE,
5555
SYSTEM,
5656
TALKER_ALIAS,
57-
TALKER_ALIAS_2,
5857
TALKGROUP,
5958
TELEPHONE_NUMBER,
6059
TONE,

src/main/java/io/github/dsheirer/identifier/alias/DmrTalkerAlias2Identifier.java

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/main/java/io/github/dsheirer/identifier/alias/TalkerAlias2Identifier.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/main/java/io/github/dsheirer/module/decode/DecoderFactory.java

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* *****************************************************************************
3-
* Copyright (C) 2014-2023 Dennis Sheirer
3+
* Copyright (C) 2014-2024 Dennis Sheirer
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU General Public License as published by
@@ -23,6 +23,7 @@
2323
import io.github.dsheirer.alias.action.AliasActionManager;
2424
import io.github.dsheirer.audio.AbstractAudioModule;
2525
import io.github.dsheirer.audio.AudioModule;
26+
import io.github.dsheirer.channel.IChannelDescriptor;
2627
import io.github.dsheirer.channel.state.State;
2728
import io.github.dsheirer.controller.channel.Channel;
2829
import io.github.dsheirer.controller.channel.Channel.ChannelType;
@@ -48,7 +49,8 @@
4849
import io.github.dsheirer.module.decode.dmr.DecodeConfigDMR;
4950
import io.github.dsheirer.module.decode.dmr.audio.DMRAudioModule;
5051
import io.github.dsheirer.module.decode.dmr.channel.DMRChannel;
51-
import io.github.dsheirer.module.decode.dmr.channel.DMRTier3Channel;
52+
import io.github.dsheirer.module.decode.dmr.channel.DMRLsn;
53+
import io.github.dsheirer.module.decode.dmr.channel.DmrRestLsn;
5254
import io.github.dsheirer.module.decode.dmr.message.filter.DmrMessageFilterSet;
5355
import io.github.dsheirer.module.decode.event.DecodeEvent;
5456
import io.github.dsheirer.module.decode.fleetsync2.Fleetsync2Decoder;
@@ -123,9 +125,11 @@ public class DecoderFactory
123125
* @return list of configured decoders
124126
*/
125127
public static List<Module> getModules(ChannelMapModel channelMapModel, Channel channel, AliasModel aliasModel,
126-
UserPreferences userPreferences, TrafficChannelManager trafficChannelManager)
128+
UserPreferences userPreferences, TrafficChannelManager trafficChannelManager,
129+
IChannelDescriptor channelDescriptor)
127130
{
128-
List<Module> modules = getPrimaryModules(channelMapModel, channel, aliasModel, userPreferences, trafficChannelManager);
131+
List<Module> modules = getPrimaryModules(channelMapModel, channel, aliasModel, userPreferences,
132+
trafficChannelManager, channelDescriptor);
129133
modules.addAll(getAuxiliaryDecoders(channel.getAuxDecodeConfiguration()));
130134
return modules;
131135
}
@@ -138,10 +142,12 @@ public static List<Module> getModules(ChannelMapModel channelMapModel, Channel c
138142
* @param aliasModel for alias lookups
139143
* @param userPreferences instance
140144
* @param trafficChannelManager optional traffic channel manager to use
145+
* @param channelDescriptor to preload into the decoder state as the current channel.
141146
* @return list of modules to use for a processing chain
142147
*/
143148
public static List<Module> getPrimaryModules(ChannelMapModel channelMapModel, Channel channel, AliasModel aliasModel,
144-
UserPreferences userPreferences, TrafficChannelManager trafficChannelManager)
149+
UserPreferences userPreferences, TrafficChannelManager trafficChannelManager,
150+
IChannelDescriptor channelDescriptor)
145151
{
146152
List<Module> modules = new ArrayList<Module>();
147153

@@ -160,7 +166,7 @@ public static List<Module> getPrimaryModules(ChannelMapModel channelMapModel, Ch
160166
break;
161167
case DMR:
162168
processDMR(channel, userPreferences, modules, aliasList, (DecodeConfigDMR)decodeConfig,
163-
trafficChannelManager);
169+
trafficChannelManager, channelDescriptor);
164170
break;
165171
case NBFM:
166172
processNBFM(channel, modules, aliasList, decodeConfig);
@@ -413,7 +419,7 @@ private static void processAM(Channel channel, List<Module> modules, AliasList a
413419
*/
414420
private static void processDMR(Channel channel, UserPreferences userPreferences, List<Module> modules,
415421
AliasList aliasList, DecodeConfigDMR decodeConfig,
416-
TrafficChannelManager trafficChannelManager)
422+
TrafficChannelManager trafficChannelManager, IChannelDescriptor channelDescriptor)
417423
{
418424
modules.add(new DMRDecoder(decodeConfig));
419425

@@ -437,6 +443,32 @@ private static void processDMR(Channel channel, UserPreferences userPreferences,
437443
DMRDecoderState state1 = new DMRDecoderState(channel, 1, dmrTrafficChannelManager);
438444
DMRDecoderState state2 = new DMRDecoderState(channel, 2, dmrTrafficChannelManager);
439445

446+
//Register the states with each other so that they can pass Cap+ site status messaging to resolve current channel
447+
state1.setSisterDecoderState(state2);
448+
state2.setSisterDecoderState(state1);
449+
450+
//If an LSN is provided, apply it to both of the decoder states.
451+
if(channelDescriptor instanceof DMRLsn lsn)
452+
{
453+
//If this is a REST descriptor, change it to a standard LSN descriptor.
454+
if(channelDescriptor instanceof DmrRestLsn rest)
455+
{
456+
lsn = new DMRLsn(rest.getLsn());
457+
lsn.setTimeslotFrequency(rest.getTimeslotFrequency());
458+
}
459+
460+
if(lsn.getTimeslot() == 1)
461+
{
462+
state1.setCurrentChannel(lsn);
463+
state2.setCurrentChannel(lsn.getSisterTimeslot());
464+
}
465+
else
466+
{
467+
state1.setCurrentChannel(lsn.getSisterTimeslot());
468+
state2.setCurrentChannel(lsn);
469+
}
470+
}
471+
440472
if(decodeConfig.hasChannelGrantEvent())
441473
{
442474
DecodeEvent event = decodeConfig.getChannelGrantEvent();

0 commit comments

Comments
 (0)