Skip to content

Commit

Permalink
#1799 DMR Cap+ & CapMax now track events correctly. Updated Cap+ even…
Browse files Browse the repository at this point in the history
…ts 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]>
  • Loading branch information
DSheirer and Dennis Sheirer authored Jan 21, 2024
1 parent 1c420b8 commit 686bddf
Show file tree
Hide file tree
Showing 11 changed files with 366 additions and 268 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -442,7 +442,7 @@ else if(request.hasChildDecodeEventHistory())

/* Processing Modules */
List<Module> modules = DecoderFactory.getModules(mChannelMapModel, channel, mAliasModel, mUserPreferences,
request.getTrafficChannelManager());
request.getTrafficChannelManager(), request.getChannelDescriptor());
processingChain.addModules(modules);

//Post preload data from the request to the event bus. Modules that can handle preload data will annotate
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/github/dsheirer/identifier/Form.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -54,7 +54,6 @@ public enum Form
STATE,
SYSTEM,
TALKER_ALIAS,
TALKER_ALIAS_2,
TALKGROUP,
TELEPHONE_NUMBER,
TONE,
Expand Down

This file was deleted.

This file was deleted.

46 changes: 39 additions & 7 deletions src/main/java/io/github/dsheirer/module/decode/DecoderFactory.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -23,6 +23,7 @@
import io.github.dsheirer.alias.action.AliasActionManager;
import io.github.dsheirer.audio.AbstractAudioModule;
import io.github.dsheirer.audio.AudioModule;
import io.github.dsheirer.channel.IChannelDescriptor;
import io.github.dsheirer.channel.state.State;
import io.github.dsheirer.controller.channel.Channel;
import io.github.dsheirer.controller.channel.Channel.ChannelType;
Expand All @@ -48,7 +49,8 @@
import io.github.dsheirer.module.decode.dmr.DecodeConfigDMR;
import io.github.dsheirer.module.decode.dmr.audio.DMRAudioModule;
import io.github.dsheirer.module.decode.dmr.channel.DMRChannel;
import io.github.dsheirer.module.decode.dmr.channel.DMRTier3Channel;
import io.github.dsheirer.module.decode.dmr.channel.DMRLsn;
import io.github.dsheirer.module.decode.dmr.channel.DmrRestLsn;
import io.github.dsheirer.module.decode.dmr.message.filter.DmrMessageFilterSet;
import io.github.dsheirer.module.decode.event.DecodeEvent;
import io.github.dsheirer.module.decode.fleetsync2.Fleetsync2Decoder;
Expand Down Expand Up @@ -123,9 +125,11 @@ public class DecoderFactory
* @return list of configured decoders
*/
public static List<Module> getModules(ChannelMapModel channelMapModel, Channel channel, AliasModel aliasModel,
UserPreferences userPreferences, TrafficChannelManager trafficChannelManager)
UserPreferences userPreferences, TrafficChannelManager trafficChannelManager,
IChannelDescriptor channelDescriptor)
{
List<Module> modules = getPrimaryModules(channelMapModel, channel, aliasModel, userPreferences, trafficChannelManager);
List<Module> modules = getPrimaryModules(channelMapModel, channel, aliasModel, userPreferences,
trafficChannelManager, channelDescriptor);
modules.addAll(getAuxiliaryDecoders(channel.getAuxDecodeConfiguration()));
return modules;
}
Expand All @@ -138,10 +142,12 @@ public static List<Module> getModules(ChannelMapModel channelMapModel, Channel c
* @param aliasModel for alias lookups
* @param userPreferences instance
* @param trafficChannelManager optional traffic channel manager to use
* @param channelDescriptor to preload into the decoder state as the current channel.
* @return list of modules to use for a processing chain
*/
public static List<Module> getPrimaryModules(ChannelMapModel channelMapModel, Channel channel, AliasModel aliasModel,
UserPreferences userPreferences, TrafficChannelManager trafficChannelManager)
UserPreferences userPreferences, TrafficChannelManager trafficChannelManager,
IChannelDescriptor channelDescriptor)
{
List<Module> modules = new ArrayList<Module>();

Expand All @@ -160,7 +166,7 @@ public static List<Module> getPrimaryModules(ChannelMapModel channelMapModel, Ch
break;
case DMR:
processDMR(channel, userPreferences, modules, aliasList, (DecodeConfigDMR)decodeConfig,
trafficChannelManager);
trafficChannelManager, channelDescriptor);
break;
case NBFM:
processNBFM(channel, modules, aliasList, decodeConfig);
Expand Down Expand Up @@ -413,7 +419,7 @@ private static void processAM(Channel channel, List<Module> modules, AliasList a
*/
private static void processDMR(Channel channel, UserPreferences userPreferences, List<Module> modules,
AliasList aliasList, DecodeConfigDMR decodeConfig,
TrafficChannelManager trafficChannelManager)
TrafficChannelManager trafficChannelManager, IChannelDescriptor channelDescriptor)
{
modules.add(new DMRDecoder(decodeConfig));

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

//Register the states with each other so that they can pass Cap+ site status messaging to resolve current channel
state1.setSisterDecoderState(state2);
state2.setSisterDecoderState(state1);

//If an LSN is provided, apply it to both of the decoder states.
if(channelDescriptor instanceof DMRLsn lsn)
{
//If this is a REST descriptor, change it to a standard LSN descriptor.
if(channelDescriptor instanceof DmrRestLsn rest)
{
lsn = new DMRLsn(rest.getLsn());
lsn.setTimeslotFrequency(rest.getTimeslotFrequency());
}

if(lsn.getTimeslot() == 1)
{
state1.setCurrentChannel(lsn);
state2.setCurrentChannel(lsn.getSisterTimeslot());
}
else
{
state1.setCurrentChannel(lsn.getSisterTimeslot());
state2.setCurrentChannel(lsn);
}
}

if(decodeConfig.hasChannelGrantEvent())
{
DecodeEvent event = decodeConfig.getChannelGrantEvent();
Expand Down
Loading

0 comments on commit 686bddf

Please sign in to comment.