Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/new call mgmt #817

Merged
merged 74 commits into from
May 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
16b2025
Group ID Check in Transmission Sink
robotastic May 6, 2023
a975d6c
last voice update
robotastic May 7, 2023
b9fa777
Update main.cc
robotastic May 7, 2023
84bbe86
Update call.h
robotastic May 7, 2023
81b2bff
Update call.h
robotastic May 7, 2023
80190ce
debug
robotastic May 7, 2023
d098383
Update p25_recorder_decode.cc
robotastic May 7, 2023
4557d7c
accurate time diff on writes
robotastic May 7, 2023
2f4520c
Update transmission_sink.cc
robotastic May 7, 2023
f4e9107
Update transmission_sink.cc
robotastic May 7, 2023
52414d9
additional group id spot
robotastic May 7, 2023
19d31e3
Update transmission_sink.cc
robotastic May 7, 2023
eca65e5
no Forecasts!
robotastic May 7, 2023
eff608e
Revert "no Forecasts!"
robotastic May 7, 2023
5363074
let it rip
robotastic May 7, 2023
e0e0a3d
Update transmission_sink.cc
robotastic May 7, 2023
35ef35b
Update transmission_sink.cc
robotastic May 8, 2023
12d149a
removed record_more stuff
robotastic May 8, 2023
0169abd
better dbug
robotastic May 8, 2023
5cb487a
Update main.cc
robotastic May 8, 2023
a62d41d
Update main.cc
robotastic May 8, 2023
183119d
fixed loop
robotastic May 8, 2023
f325c60
fix grp compare for smartnet and p25
robotastic May 8, 2023
94d94eb
Update call_impl.cc
robotastic May 8, 2023
7f3c01c
Update transmission_sink.cc
robotastic May 8, 2023
b044d2e
Update transmission_sink.cc
robotastic May 8, 2023
19371ab
Merge branch 'master' into new_call_mgmt
robotastic May 8, 2023
6bf8ae5
Update p25_recorder_decode.cc
robotastic May 8, 2023
42d7deb
Update main.cc
robotastic May 8, 2023
712d043
print out state of recorder during group mismatch
robotastic May 8, 2023
8b57bbe
Update transmission_sink.cc
robotastic May 8, 2023
3afe89d
count Termination tooo
robotastic May 9, 2023
d9b01be
Update transmission_sink.cc
robotastic May 9, 2023
797cced
Update main.cc
robotastic May 10, 2023
c99ed5e
Update main.cc
robotastic May 10, 2023
6912709
Update main.cc
robotastic May 10, 2023
1ff3574
Update main.cc
robotastic May 10, 2023
42c7390
Update main.cc
robotastic May 10, 2023
db1c4dd
Update main.cc
robotastic May 10, 2023
1d42395
Update transmission_sink.cc
robotastic May 10, 2023
62c6f1c
Update main.cc
robotastic May 10, 2023
5b7f2c6
Update main.cc
robotastic May 10, 2023
6675421
refining the messages
robotastic May 14, 2023
40d03a8
Switching back to processing UPDATEs as UPDATEs
robotastic May 15, 2023
0741958
Update p25p1_fdma.cc
robotastic May 19, 2023
f61ccd7
Update transmission_sink.cc
robotastic May 19, 2023
e901e4d
I am going to totally forget to set this back
robotastic May 19, 2023
e59f408
Update main.cc
robotastic May 19, 2023
007de8a
different messages
robotastic May 20, 2023
0379a1a
Update main.cc
robotastic May 20, 2023
da084e3
Update main.cc
robotastic May 20, 2023
6dff4fd
upgrades
robotastic May 20, 2023
471721e
Update main.cc
robotastic May 20, 2023
8155351
Update transmission_sink.cc
robotastic May 20, 2023
8df01a9
might clear the buffer of blocks on stop
robotastic May 20, 2023
faf65df
Update p25_recorder_impl.cc
robotastic May 20, 2023
ed9ce7d
not clean
robotastic May 22, 2023
6943c70
adding latency manager
robotastic May 22, 2023
c057f1c
only start recording when the correct group ID is seen
robotastic May 22, 2023
6f79f4a
Ignore TG Mismatch
robotastic May 22, 2023
6428bf5
Latency measurements
robotastic May 23, 2023
18bb29c
slight fixes
robotastic May 24, 2023
b0d7496
new FSK4
robotastic May 24, 2023
84fa670
different
robotastic May 24, 2023
f05aa64
cleaned up
robotastic May 25, 2023
4950e0a
Update p25_recorder_decode.cc
robotastic May 25, 2023
aa5d67a
not having Updates start Calls
robotastic May 25, 2023
aed4036
or maybe we should do updates
robotastic May 25, 2023
8bb09af
update FLL Band Edge
robotastic May 26, 2023
81f4eb3
backed out most of the debugging
robotastic May 26, 2023
0f91c6a
clean up for compiling
robotastic May 26, 2023
1ef1b49
Update p25p2_tdma.cc
robotastic May 27, 2023
4a5776f
Merge branch 'master' into release/new-call-mgmt
robotastic May 27, 2023
5b97b3d
Config Option to turn on/off new calls from UPDATE
robotastic May 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ list(APPEND trunk_recorder_sources
trunk-recorder/call_concluder/call_concluder.cc

lib/lfsr/lfsr.cxx
lib/gr-latency/latency_probe.cc
lib/gr-latency/latency_tagger.cc
lib/gr-latency-manager/lib/latency_manager_impl.cc
lib/gr-latency-manager/lib/tag_to_msg_impl.cc
trunk-recorder/gr_blocks/freq_xlating_fft_filter.cc
trunk-recorder/gr_blocks/transmission_sink.cc
trunk-recorder/gr_blocks/decoders/fsync_decode.cc
Expand Down Expand Up @@ -334,7 +338,7 @@ add_subdirectory(plugins/rdioscanner_uploader)

add_subdirectory(plugins/simplestream)

add_executable(trunk-recorder trunk-recorder/main.cc ${trunk_recorder_sources})
add_executable(trunk-recorder trunk-recorder/main.cc) # ${trunk_recorder_sources})

target_link_libraries(trunk-recorder git trunk_recorder_library gnuradio-op25_repeater ${CMAKE_DL_LIBS} ssl crypto ${CURL_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_PMT_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_DIGITAL_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} ${GNURADIO_AUDIO_LIBRARIES} ${GNURADIO_UHD_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_OSMOSDR_LIBRARIES} ) # gRPC::grpc++_reflection protobuf::libprotobuf)

Expand Down
4 changes: 2 additions & 2 deletions docs/CONFIGURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ Here is a map of the different sections of the *config.json* file:
| debugRecorder | | true | **true** / **false** | Will attach a debug recorder to each Source. The debug recorder will allow you to examine the channel of a call be recorded. There is a single Recorder per Source. It will monitor a recording and when it is done, it will monitor the next recording started. The information is sent over a network connection and can be viewed using the `udp-debug.grc` graph in GnuRadio Companion |
| debugRecorderPort | | 1234 | number | The network port that the Debug Recorders will start on. For each Source an additional Debug Recorder will be added and the port used will be one higher than the last one. For example the ports for a system with 3 Sources would be: 1234, 12345, 1236. |
| debugRecorderAddress | | "127.0.0.1" | string | The network address of the computer that will be monitoring the Debug Recorders. UDP packets will be sent from Trunk Recorder to this computer. The default is *"127.0.0.1"* which is the address used for monitoring on the same computer as Trunk Recorder. |
| audioStreaming | | false | **true** / **false** | whether or not to enable the audio streaming callbacks for plugins. |

| audioStreaming | | false | **true** / **false** | Whether or not to enable the audio streaming callbacks for plugins. |
| newCallFromUpdate | | true | **true** / **false** | Allow for UPDATE trunking messages to start a new Call, in addition to GRANT messages. This may result in more Calls with no transmisions, and use more Recorders. The flipside is that it may catch parts of a Call that would have otherwise been missed. Turn this off if you are running out of Recorders. |


#### Source Object
Expand Down
2 changes: 2 additions & 0 deletions docs/notes/CALL-HANDLING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Use [Mermaid Live](https://mermaid.live/) to edit the charts.

```mermaid
flowchart TD
A[Control Channel] -->|GRANT| B["handle_call_grant()"]
Expand Down
15 changes: 15 additions & 0 deletions lib/gr-latency-manager/include/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2011,2012 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-latency_manager
#
# SPDX-License-Identifier: GPL-3.0-or-later
#

########################################################################
# Install public header files
########################################################################
install(FILES
api.h
DESTINATION include/gnuradio/latency_manager
)
22 changes: 22 additions & 0 deletions lib/gr-latency-manager/include/api.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright 2011 Free Software Foundation, Inc.
*
* This file was generated by gr_modtool, a tool from the GNU Radio framework
* This file is a part of gr-latency_manager
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/

#ifndef INCLUDED_LATENCY_MANAGER_API_H
#define INCLUDED_LATENCY_MANAGER_API_H

#include <gnuradio/attributes.h>

#ifdef gnuradio_latency_manager_EXPORTS
#define LATENCY_MANAGER_API __GR_ATTR_EXPORT
#else
#define LATENCY_MANAGER_API __GR_ATTR_IMPORT
#endif

#endif /* INCLUDED_LATENCY_MANAGER_API_H */
47 changes: 47 additions & 0 deletions lib/gr-latency-manager/include/latency_manager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/* -*- c++ -*- */
/*
* Copyright 2019 Derek Kozel.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/

#ifndef INCLUDED_LATENCY_MANAGER_LATENCY_MANAGER_H
#define INCLUDED_LATENCY_MANAGER_LATENCY_MANAGER_H

#include "./api.h"
#include <gnuradio/sync_block.h>

namespace gr {
namespace latency_manager {

/*!
* \brief <+description of block+>
* \ingroup latency_manager
*
*/
class LATENCY_MANAGER_API latency_manager : virtual public gr::sync_block
{
public:
typedef std::shared_ptr<latency_manager> sptr;

static sptr make(int max_tags_in_flight, int tag_interval, int itemsize);
};

} // namespace latency_manager
} // namespace gr

#endif /* INCLUDED_LATENCY_MANAGER_LATENCY_MANAGER_H */

74 changes: 74 additions & 0 deletions lib/gr-latency-manager/include/tag_to_msg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/* -*- c++ -*- */
/*
* Copyright 2019 Derek Kozel.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/

#ifndef INCLUDED_LATENCY_MANAGER_TAG_TO_MSG_H
#define INCLUDED_LATENCY_MANAGER_TAG_TO_MSG_H

#include "./api.h"
#include <gnuradio/sync_block.h>

namespace gr {
namespace latency_manager {

/*!
* \brief <+description of block+>
* \ingroup latency_manager
*
*/
class LATENCY_MANAGER_API tag_to_msg : virtual public gr::sync_block
{
public:
typedef std::shared_ptr<tag_to_msg> sptr;

static sptr make(size_t sizeof_stream_item,
const std::string& name,
const std::string& key_filter = "");

/*!
* \brief Returns a vector of tag_t items as of the last call to
* work.
*/
virtual std::vector<tag_t> current_tags() = 0;

/*!
* \brief Return the total number of tags in the tag queue.
*/
virtual int num_tags() = 0;

/*!
* \brief Set the display of tags to stdout on/off.
*/
virtual void set_display(bool d) = 0;

/*!
* \brief Set a new key to filter with.
*/
virtual void set_key_filter(const std::string& key_filter) = 0;

/*!
* \brief Get the current filter key.
*/
virtual std::string key_filter() const = 0;
};
} // namespace latency_manager
} // namespace gr

#endif /* INCLUDED_LATENCY_MANAGER_TAG_TO_MSG_H */

48 changes: 48 additions & 0 deletions lib/gr-latency-manager/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2011,2012,2016,2018,2019 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-latency_manager
#
# SPDX-License-Identifier: GPL-3.0-or-later
#

########################################################################
# Setup library
########################################################################
include(GrPlatform) #define LIB_SUFFIX
list(APPEND latency_manager_sources
tag_to_msg_impl.cc
latency_manager_impl.cc
)

set(latency_manager_sources "${latency_manager_sources}" PARENT_SCOPE)
if(NOT latency_manager_sources)
MESSAGE(STATUS "No C++ sources... skipping lib/")
return()
endif(NOT latency_manager_sources)

add_library(gnuradio-latency_manager SHARED ${latency_manager_sources})
target_link_libraries(gnuradio-latency_manager gnuradio::gnuradio-runtime)
target_include_directories(gnuradio-latency_manager
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
PUBLIC $<INSTALL_INTERFACE:include>
)
set_target_properties(gnuradio-latency_manager PROPERTIES DEFINE_SYMBOL "gnuradio_latency_manager_EXPORTS")

if(APPLE)
set_target_properties(gnuradio-latency_manager PROPERTIES
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
)
endif(APPLE)

########################################################################
# Install built library files
########################################################################
include(GrMiscUtils)
GR_LIBRARY_FOO(gnuradio-latency_manager)

########################################################################
# Print summary
########################################################################
message(STATUS "Using install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Building for version: ${VERSION} / ${LIBVER}")
94 changes: 94 additions & 0 deletions lib/gr-latency-manager/lib/latency_manager_impl.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/* -*- c++ -*- */
/*
* Copyright 2019 Derek Kozel.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <gnuradio/io_signature.h>
#include "latency_manager_impl.h"
#include <boost/thread/thread.hpp>

namespace gr {
namespace latency_manager {

latency_manager::sptr
latency_manager::make(int max_tags_in_flight, int tag_interval, int itemsize)
{
return gnuradio::get_initial_sptr
(new latency_manager_impl(max_tags_in_flight, tag_interval, itemsize));
}

void latency_manager_impl::add_token(pmt::pmt_t msg)
{
d_tokens++;
//std::cout << "Tokens: " << d_tokens << " : Added one\n";
}

latency_manager_impl::latency_manager_impl(int max_tags_in_flight, int tag_interval, int itemsize)
: gr::sync_block("latency_manager",
gr::io_signature::make(1, 1, itemsize),
gr::io_signature::make(1, 1, itemsize)),
d_itemsize(itemsize),
d_tag_interval(tag_interval),
d_tag_phase(0)
{
d_tokens = max_tags_in_flight;
message_port_register_in(pmt::mp("token"));
set_msg_handler(pmt::mp("token"), [this](pmt::pmt_t msg) { this->add_token(msg); });
d_tag.key = pmt::intern("latency_strobe");
d_tag.srcid = alias_pmt();

}

latency_manager_impl::~latency_manager_impl()
{
}

int
latency_manager_impl::work(int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items)
{
const char *in = (const char*) input_items[0];
char *out = (char *) output_items[0];

int copy_count = std::min(noutput_items, d_tag_phase + d_tokens * d_tag_interval);
std::memcpy(out, in, copy_count * d_itemsize);
//std::cout << "Copied: " << copy_count << "\n";
int tag_loc = d_tag_phase;
while (tag_loc < copy_count) {

d_tag.offset = nitems_written(0) + tag_loc;
d_tag.value = pmt::from_long(tag_loc);
//std::cout << "Add Tag: " << tag_loc << " nitems_written: " << nitems_written(0) << "\n";
add_item_tag(0,d_tag);
tag_loc += d_tag_interval;
d_tokens--;
}
d_tag_phase = tag_loc - copy_count;
if(copy_count == 0) {
boost::this_thread::sleep(boost::posix_time::microseconds(long(100)));
}
return copy_count;
}
} /* namespace latency_manager */
} /* namespace gr */

55 changes: 55 additions & 0 deletions lib/gr-latency-manager/lib/latency_manager_impl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/* -*- c++ -*- */
/*
* Copyright 2019 Derek Kozel.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/

#ifndef INCLUDED_LATENCY_MANAGER_LATENCY_MANAGER_IMPL_H
#define INCLUDED_LATENCY_MANAGER_LATENCY_MANAGER_IMPL_H

#include "../include/latency_manager.h"

namespace gr {
namespace latency_manager {

class latency_manager_impl : public latency_manager
{
private:
int d_tokens;
void add_token(pmt::pmt_t tag);
int d_itemsize;
int d_tag_interval;
int d_tag_phase;
tag_t d_tag;

public:
latency_manager_impl(int max_tags_in_flight, int tag_interval, int itemsize);
~latency_manager_impl();

// Where all the action really happens
int work(
int noutput_items,
gr_vector_const_void_star &input_items,
gr_vector_void_star &output_items
);
};

} // namespace latency_manager
} // namespace gr

#endif /* INCLUDED_LATENCY_MANAGER_LATENCY_MANAGER_IMPL_H */

Loading
Loading