TwoToneDetect New TwoToneDetect in the works - Python based

miles16

Member
Joined
Mar 17, 2009
Messages
10
Reaction score
1
I have an interesting error on debugging which is causing not to pass audio to v75. I have several instances of TTD running but only one of the v75 is having this issue. I rolled back to v74 for this instance.

EDIT: This is both on Windows 11 and Raspberry Pi 64 bit Bookworm.


Code:
Exception in thread Thread-1 (setup_handler):
Traceback (most recent call last):
  File "threading.py", line 1073, in _bootstrap_inner
  File "threading.py", line 1010, in run
  File "pystray\_base.py", line 398, in setup_handler
  File "TwoToneDetect.py", line 5162, in setup
  File "TwoToneDetect.py", line 5055, in start
ValueError: operands could not be broadcast together with shapes (3,) (43,)
The client is using an unsupported version of the Socket.IO or Engine.IO protocols (further occurrences of this error will be logged with level INFO)
 

Muxlow

Super Secret
Joined
Aug 16, 2005
Messages
1,945
Reaction score
472
Location
Middlesex County
FTP Remote Path
What do i put in this section for pushover to work? Copied my settings from V70 and it is decoding the tones and saving the audio file but not sending them out to pushover so my guess is because iv left this section empty?
 

Forts

Mentor
Database Admin
Joined
Dec 19, 2002
Messages
7,071
Reaction score
1,375
Location
Ontario, Canada
My config file has:
upload_ftp_remote_path =/

Are your pushover_record_group_key fields still populated properly in tones.cfg?
 

putterizer

Feed Provider
Joined
Jul 29, 2009
Messages
81
Reaction score
1
Location
WI
Andy-
I have been running v75 for about a month now. The first couple weeks it ran fine. Now, for the past couple weeks, out of the blue, with no changes made to any software, hardware, or computer settings, I am now getting some blank audio recordings. Some tone set instances will record as they should, others are blank. I have restarted the computer and software multiple times and that does not seem to change anything.

Attached is a snippet from the logs of a detection with blank audio. I have also attached the audio file.
 

Attachments

  • WSFR_2025_11_29_09_17_28.zip
    28.5 KB · Views: 2
  • TTD.txt
    24.2 KB · Views: 9

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,324
Reaction score
117
Andy-
I have been running v75 for about a month now. The first couple weeks it ran fine. Now, for the past couple weeks, out of the blue, with no changes made to any software, hardware, or computer settings, I am now getting some blank audio recordings. Some tone set instances will record as they should, others are blank. I have restarted the computer and software multiple times and that does not seem to change anything.

Attached is a snippet from the logs of a detection with blank audio. I have also attached the audio file.
As best I can tell, it looks like the IaR Prealert API call is taking a long time to complete and is blocking the recording from starting. By the time the recording starts the voice dispatch is already complete. This is an area of the code that could use some work to prevent this type of thing. But the IaR Prealert API call should not take that long to complete, it should be nearly instant. I'm not sure if there might be an internet issue on your end or if this is an issue with the IaR API. I would suggest changing your log level from INFO to DEBUG to get more detailed log files and then open a support ticket with IaR. Mention that you've already been in contact with me in the support ticket so that I get flagged on it.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,643
Reaction score
183
Location
Massachusetts
As best I can tell, it looks like the IaR Prealert API call is taking a long time to complete and is blocking the recording from starting. By the time the recording starts the voice dispatch is already complete. This is an area of the code that could use some work to prevent this type of thing. But the IaR Prealert API call should not take that long to complete, it should be nearly instant. I'm not sure if there might be an internet issue on your end or if this is an issue with the IaR API. I would suggest changing your log level from INFO to DEBUG to get more detailed log files and then open a support ticket with IaR. Mention that you've already been in contact with me in the support ticket so that I get flagged on it.
it looks also like the Alert API call is taking a long time. 09:18:40 until 09:19:23

2025-11-29 09:18:40 - TwoToneDetect - INFO - TwoToneDetect.py:3606 - IaR audio alert sent for WSFR
2025-11-29 09:18:40 - TwoToneDetect - INFO - TwoToneDetect.py:3049 - using prealert_id to send audio
2025-11-29 09:18:40 - TwoToneDetect - INFO - TwoToneDetect.py:4083 - RECORDING COMPLETE for Alert(1 groups: WSFR) at 1764429520.4634936
2025-11-29 09:18:40 - TwoToneDetect - INFO - TwoToneDetect.py:4114 - Removed Alert(1 groups: WSFR) from alert list
2025-11-29 09:19:03 - TwoToneDetect - INFO - TwoToneDetect.py:3147 - MP3 Group Email sent to "***"<******@gmail.com> via smtp.gmail.com on port 587 using STARTTLS WSFR Page Received at 09:17:28 on 11/29/25 09:19:03 on 11/29/25
2025-11-29 09:19:23 - TwoToneDetect - INFO - TwoToneDetect.py:3060 - succesfully sent IaR audio alert

in my v75 the prealerts and the alerts both report back success within a second or two:

2025-10-30 15:45:32 - TwoToneDetect - INFO - TwoToneDetect.py:3615 - IaR audio alert sent for Orange Station 1 - 62b9c23bfb24d950e0f9f7d4
2025-10-30 15:45:32 - TwoToneDetect - INFO - TwoToneDetect.py:3047 - using prealert_id to send audio
2025-10-30 15:45:32 - TwoToneDetect - INFO - TwoToneDetect.py:3615 - IaR audio alert sent for Orange Station 2 - 62b9c25a54fe7eb22d43bfc4
2025-10-30 15:45:32 - TwoToneDetect - INFO - TwoToneDetect.py:3047 - using prealert_id to send audio
2025-10-30 15:45:32 - TwoToneDetect - INFO - TwoToneDetect.py:4085 - RECORDING COMPLETE for Alert(2 groups: Orange Station 1 - 62b9c23bfb24d950e0f9f7d4, Orange Station 2 - 62b9c25a54fe7eb22d43bfc4) at 1761853532.6282055
2025-10-30 15:45:32 - TwoToneDetect - INFO - TwoToneDetect.py:4116 - Removed Alert(2 groups: Orange Station 1 - 62b9c23bfb24d950e0f9f7d4, Orange Station 2 - 62b9c25a54fe7eb22d43bfc4) from alert list
2025-10-30 15:45:34 - TwoToneDetect - INFO - TwoToneDetect.py:3058 - succesfully sent IaR audio alert
2025-10-30 15:45:34 - TwoToneDetect - INFO - TwoToneDetect.py:3058 - succesfully sent IaR audio alert
 

putterizer

Feed Provider
Joined
Jul 29, 2009
Messages
81
Reaction score
1
Location
WI
As best I can tell, it looks like the IaR Prealert API call is taking a long time to complete and is blocking the recording from starting. By the time the recording starts the voice dispatch is already complete. This is an area of the code that could use some work to prevent this type of thing. But the IaR Prealert API call should not take that long to complete, it should be nearly instant. I'm not sure if there might be an internet issue on your end or if this is an issue with the IaR API. I would suggest changing your log level from INFO to DEBUG to get more detailed log files and then open a support ticket with IaR. Mention that you've already been in contact with me in the support ticket so that I get flagged on it.
Thanks for the reply. I appreciate it. I was chasing this issue on a prior version around 6+ months ago as well. It would detect the tones and start recording the audio after the dispatch voice was done. I was in touch with IaR tech and we never really found a problem or resolution. I've had the same hardware and PC running for 5+ years with no issues.

If there is an internet issue on my end, I'm not sure what it'd be. I can have it drop a tone set one time and have it work flawlessly, then 2 minutes later the second page comes out and it acts up. It is intermittent and those are the most difficult issues to pinpoint.

I have turned on debugging log and will monitor going forward.
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,324
Reaction score
117
TTD v76 Available
Version 76 is available for Windows, Pi, and Ubuntu from the IaR site.

Release notes:
  • Add 5 tone detection capability
    • Not much documentation is available on this since it's not widely used, but essentially the functionality of the really old unmaintained 5ToneDetect was brought into TTD for those few areas/agencies that use it.
    • If you want to use this feature with IaR please message me, it's doable but not documented.
  • Add automatic audio squelch threshold
    • Feedback welcome on this. It should eliminate having to manually set the audio squelch slider.
  • Fix blocking IaR prealert call that could delay start of audio recording

 

03msc

RF is RF
Premium Subscriber
Joined
Jun 3, 2011
Messages
4,226
Reaction score
1,289
Location
The Natural State
Nice! Will the automatic audio squelch threshold automatically adjust once or is it a continuous adjustment? For some reason, the standby audio on my scanners sometimes fluctuates and I may get it set once and then look in a few days and it is too low and TTD is 'hearing' the standby audio instead of in standby/listen state.
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,324
Reaction score
117
Nice! Will the automatic audio squelch threshold automatically adjust once or is it a continuous adjustment? For some reason, the standby audio on my scanners sometimes fluctuates and I may get it set once and then look in a few days and it is too low and TTD is 'hearing' the standby audio instead of in standby/listen state.
It adjusts continuously. There are a couple parameters in the configuration that you can fiddle with to change how quickly it adjusts up vs. down but I'm hoping the defaults are good enough that most people shouldn't have to touch them.
 

putterizer

Feed Provider
Joined
Jul 29, 2009
Messages
81
Reaction score
1
Location
WI
TTD v76 Available
Version 76 is available for Windows, Pi, and Ubuntu from the IaR site.

Release notes:
  • Add 5 tone detection capability
    • Not much documentation is available on this since it's not widely used, but essentially the functionality of the really old unmaintained 5ToneDetect was brought into TTD for those few areas/agencies that use it.
    • If you want to use this feature with IaR please message me, it's doable but not documented.
  • Add automatic audio squelch threshold
    • Feedback welcome on this. It should eliminate having to manually set the audio squelch slider.
  • Fix blocking IaR prealert call that could delay start of audio recording
Thanks @aaknitt -
For what it's worth, I had v75 running in full debug mode since your reply on Sunday in hopes of getting some more info for you. Up until now, it detected tones 32 times and recorded full clean audio just as it should for all, so I have no debug info to provide.
I have v76 installed and running right now. I will advise of the results.

Thanks for the prompt reply and release!
 

jhsands

Member
Feed Provider
Joined
Sep 6, 2006
Messages
568
Reaction score
109
Location
Texarkana, Arkansas
TTD v76 Available
Version 76 is available for Windows, Pi, and Ubuntu from the IaR site.

Release notes:
  • Add 5 tone detection capability
    • Not much documentation is available on this since it's not widely used, but essentially the functionality of the really old unmaintained 5ToneDetect was brought into TTD for those few areas/agencies that use it.
    • If you want to use this feature with IaR please message me, it's doable but not documented.
  • Add automatic audio squelch threshold
    • Feedback welcome on this. It should eliminate having to manually set the audio squelch slider.
  • Fix blocking IaR prealert call that could delay start of audio recording
All the links go to 404.
 

pei006

Member
Joined
May 21, 2003
Messages
17
Reaction score
6
Does redundant.cfg still work in TTD v76 ?
Haven't used redundant in a while but wanted to use it again. setup is "local"
What is happening : when a call comes in on the secondary radio, the program processes
"redundant_delay = x" and waits to check the "tone tracking file" ( i have been using 15 seconds). But recording is not beginning until after it has checked the tone tracking file, so by the time the software realizes the primary radio has not sent the call it has missed recording the first x seconds of the message. So the recording i get from the secondary instance is tail end of a long message or usually dead air.

Thanks

example piece of the log
2025-12-17 21:22:02 - TwoToneDetect - INFO - TwoToneDetect.py:5662 - CHTN DISTRICT 2 Tone Set Found
2025-12-17 21:22:02 - TwoToneDetect - INFO - TwoToneDetect.py:4567 - Alert detected: CHTN DISTRICT 2 at 21:22:02 on 12/17/25
2025-12-17 21:22:02 - TwoToneDetect - INFO - TwoToneDetect.py:4601 - Scheduled tone reactivation for 'CHTN DISTRICT 2' after 5 seconds
2025-12-17 21:22:02 - TwoToneDetect - INFO - TwoToneDetect.py:4654 - Checking for redundant tone detection: waiting 15 seconds to check C:\TTD\redundant_tones.txt
2025-12-17 21:22:02 - TwoToneDetect - INFO - TwoToneDetect.py:5647 - 559.8791804878048 32767 1766020922.8554537

\\\\\\\\\\\\ 15 seconds later
2025-12-17 21:22:17 - TwoToneDetect - INFO - TwoToneDetect.py:4664 - Checking local C:\TTD\redundant_tones.txt for duplicate of CHTN DISTRICT 2
2025-12-17 21:22:17 - TwoToneDetect - INFO - TwoToneDetect.py:4716 - starting new alert at 1766020937.611292
2025-12-17 21:22:17 - TwoToneDetect - INFO - TwoToneDetect.py:4201 - Opened PyAudio recording stream for alert: CHTN DISTRICT 2 with sample rate 8000Hz
 

portroyalbirdy

Member
Premium Subscriber
Joined
Feb 17, 2010
Messages
290
Reaction score
27
Location
Central PA
I don't mean to sound like "one of those guys", but is V75 still okay to use/run for now? I'm running that currently and have no issues. Is there a time when V75 will become unsupported? I may download V76 at some point to test, but I'm at the "If it's not broke, don't miss with it" part. Haha!
 

03msc

RF is RF
Premium Subscriber
Joined
Jun 3, 2011
Messages
4,226
Reaction score
1,289
Location
The Natural State
I don't mean to sound like "one of those guys", but is V75 still okay to use/run for now? I'm running that currently and have no issues. Is there a time when V75 will become unsupported? I may download V76 at some point to test, but I'm at the "If it's not broke, don't miss with it" part. Haha!

I think you should be fine to stay on it. I suspect it’ll work for quite a while. You can always go back to it if you want.
 

portroyalbirdy

Member
Premium Subscriber
Joined
Feb 17, 2010
Messages
290
Reaction score
27
Location
Central PA
I think you should be fine to stay on it. I suspect it’ll work for quite a while. You can always go back to it if you want.
Actually, I stand corrected on that, after double checking, and remoting into the PC that hosts my/our TTD, I'm current running 74i. Is that still okay to run now?
 
Top