From 90dadaaf9782a140e417032d800aa335941d490d Mon Sep 17 00:00:00 2001 From: Danny Lloyd Date: Sat, 26 Oct 2024 09:05:06 -0500 Subject: [PATCH] chan_usrp: Add TX/RX debug messages (#413) * chan_usrp: Add TX/RX debug messages This updates chan_usrp to have debug message for TX and RX on and off. The messages closely match those in chan_simpleusb and chan_usbradio. This indication is needed to help users troubleshoot problems when using this driver. I also added a queue overflow warning message should the internal queue overflow. This should never happen, but if it does, it needs to be reported. * chan_usrp: Add TX/RX debug messages Changed the queue overflow to show the actual threshold. --- channels/chan_usrp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/channels/chan_usrp.c b/channels/chan_usrp.c index a75a4b3..e8d1a6b 100644 --- a/channels/chan_usrp.c +++ b/channels/chan_usrp.c @@ -371,9 +371,11 @@ static int usrp_indicate(struct ast_channel *ast, int cond, const void *data, si switch (cond) { case AST_CONTROL_RADIO_KEY: p->txkey = 1; + ast_debug(1, "Channel %s: ACRK TX ON.\n", ast_channel_name(ast)); break; case AST_CONTROL_RADIO_UNKEY: p->txkey = 0; + ast_debug(1, "Channel %s: ACRUK TX OFF.\n", ast_channel_name(ast)); break; case AST_CONTROL_HANGUP: return -1; @@ -593,6 +595,7 @@ static int usrp_xwrite(struct ast_channel *ast, struct ast_frame *frame) remque((struct qelem *) qp); ast_free(qp); } + ast_log(LOG_WARNING, "Channel %s: Receive queue exceeds the threshold of %lu\n", ast_channel_name(ast), USRP_VOICE_FRAME_SIZE); if (pvt->rxkey) { pvt->rxkey = 1; } @@ -610,6 +613,7 @@ static int usrp_xwrite(struct ast_channel *ast, struct ast_frame *frame) fr.delivery.tv_sec = 0; fr.delivery.tv_usec = 0; ast_queue_frame(ast, &fr); + ast_debug(1, "Channel %s: RX ON\n", ast_channel_name(ast)); } pvt->rxkey = MAX_RXKEY_TIME; qp = pvt->rxq.qe_forw; @@ -662,6 +666,7 @@ static int usrp_xwrite(struct ast_channel *ast, struct ast_frame *frame) fr.delivery.tv_sec = 0; fr.delivery.tv_usec = 0; ast_queue_frame(ast, &fr); + ast_debug(1, "Channel %s: RX OFF\n", ast_channel_name(ast)); } /* Decrement the receive key counter. * This ensures that we do not get stuck in receive mode.