From 6e3092dada7682831e1aa48c1b3208b5ecdec236 Mon Sep 17 00:00:00 2001 From: "Ellery J. Durgin" Date: Tue, 20 Jun 2023 02:00:08 -0400 Subject: [PATCH 1/2] fixed conventionalDMR plugin support --- trunk-recorder/recorders/dmr_recorder_impl.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/trunk-recorder/recorders/dmr_recorder_impl.cc b/trunk-recorder/recorders/dmr_recorder_impl.cc index b895a4cc2..131e8aac8 100644 --- a/trunk-recorder/recorders/dmr_recorder_impl.cc +++ b/trunk-recorder/recorders/dmr_recorder_impl.cc @@ -160,6 +160,12 @@ void dmr_recorder_impl::initialize(Source *src) { recording_count = 0; recording_duration = 0; + bool use_streaming = false; + + if (config != NULL) { + use_streaming = config->enable_audio_streaming; + } + state = INACTIVE; timestamp = time(NULL); @@ -241,10 +247,14 @@ void dmr_recorder_impl::initialize(Source *src) { connect(slicer, 0, framer, 0); connect(framer, 0, wav_sink_slot0, 0); connect(framer, 1, wav_sink_slot1, 0); + + if (use_streaming) { + connect(framer, 0, plugin_sink, 0); + } } void dmr_recorder_impl::plugin_callback_handler(int16_t *samples, int sampleCount) { - // plugman_audio_callback(_recorder, samples, sampleCount); + plugman_audio_callback(call, this, samples, sampleCount); } void dmr_recorder_impl::switch_tdma(bool phase2) { From 4a4d7242f5fdeff213588301e44104c9fd4d85f0 Mon Sep 17 00:00:00 2001 From: "Ellery J. Durgin" Date: Tue, 20 Jun 2023 11:42:18 -0400 Subject: [PATCH 2/2] added a plugin sink for slot 1, when testing on a few different systems, encountered partial audio, system was using both slots for same TG --- trunk-recorder/recorders/dmr_recorder_impl.cc | 6 ++++-- trunk-recorder/recorders/dmr_recorder_impl.h | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/trunk-recorder/recorders/dmr_recorder_impl.cc b/trunk-recorder/recorders/dmr_recorder_impl.cc index 131e8aac8..9301afbbb 100644 --- a/trunk-recorder/recorders/dmr_recorder_impl.cc +++ b/trunk-recorder/recorders/dmr_recorder_impl.cc @@ -227,7 +227,8 @@ void dmr_recorder_impl::initialize(Source *src) { framer = gr::op25_repeater::frame_assembler::make("file:///tmp/out1.raw", verbosity, 1, rx_queue); // op25_frame_assembler = gr::op25_repeater::p25_frame_assembler::make(0, silence_frames, udp_host, udp_port, verbosity, do_imbe, do_output, do_msgq, rx_queue, do_audio_output, do_tdma, do_nocrypt); levels = gr::blocks::multiply_const_ff::make(1); - plugin_sink = gr::blocks::plugin_wrapper_impl::make(std::bind(&dmr_recorder_impl::plugin_callback_handler, this, std::placeholders::_1, std::placeholders::_2)); + plugin_sink_slot0 = gr::blocks::plugin_wrapper_impl::make(std::bind(&dmr_recorder_impl::plugin_callback_handler, this, std::placeholders::_1, std::placeholders::_2)); + plugin_sink_slot1 = gr::blocks::plugin_wrapper_impl::make(std::bind(&dmr_recorder_impl::plugin_callback_handler, this, std::placeholders::_1, std::placeholders::_2)); // Squelch DB // on a trunked network where you know you will have good signal, a carrier @@ -249,7 +250,8 @@ void dmr_recorder_impl::initialize(Source *src) { connect(framer, 1, wav_sink_slot1, 0); if (use_streaming) { - connect(framer, 0, plugin_sink, 0); + connect(framer, 0, plugin_sink_slot0, 0); + connect(framer, 1, plugin_sink_slot1, 0); } } diff --git a/trunk-recorder/recorders/dmr_recorder_impl.h b/trunk-recorder/recorders/dmr_recorder_impl.h index fbe336a28..c5b567c77 100644 --- a/trunk-recorder/recorders/dmr_recorder_impl.h +++ b/trunk-recorder/recorders/dmr_recorder_impl.h @@ -195,7 +195,8 @@ class dmr_recorder_impl : public dmr_recorder { gr::blocks::multiply_const_ff::sptr levels; gr::blocks::transmission_sink::sptr wav_sink_slot0; gr::blocks::transmission_sink::sptr wav_sink_slot1; - gr::blocks::plugin_wrapper::sptr plugin_sink; + gr::blocks::plugin_wrapper::sptr plugin_sink_slot0; + gr::blocks::plugin_wrapper::sptr plugin_sink_slot1; }; #endif // ifndef dmr_recorder_H