TwoToneDetect New TwoToneDetect in the works - Python based

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
Anyone know why I'm getting this issue? Running TwoToneDetect71d on a Raspberry Pi 4.

I compiled FFMPEG myself using instructions here, which include AMR support: https://gist.github.com/jjangsangy/058456fe2d04e3c5f6107d62b60542e3 (done as I am also running trunk-recorder on the same Raspberry Pi)

Code:
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, wav, from './audio/Station_8_2020_05_04_09_44_20.wav':
  Duration: 00:00:50.99, bitrate: 176 kb/s
    Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 11025 Hz, mono, s16, 176 kb/s
Automatic encoder selection failed for output stream #0:0. Default encoder for format amr (codec amr_nb) is probably disabled. Please choose an encoder manually.
Error selecting an encoder for stream 0:0
done converting to AMR Vernon Township Fire - Station 8 09:45:17 on 05/04/20
going to try to copy files now
Traceback (most recent call last):
  File "/home/pi/TTD/TwoToneDetect71d.py", line 1897, in alert
  File "/usr/lib/python2.7/shutil.py", line 153, in copy2
    copyfile(src, dst)
IOError: [Errno 2] No such file or directory: './audio/Station_8_2020_05_04_09_44_20.amr'
Successfully retrieved local tone info at 10:25:54 on 05/04/20

Two things to note:
1) None of my tone configurations are using AMR, so why is TTD trying to convert to AMR?
2) TTD successfully recorded/converted to MP3 and WAV. However, the MP3 is not sent via email. So, when converting to AMR fails, the entire send/process seems to fail. Is this intended behavior?
That's strange. If you followed those ffmpeg build instructions you should be good. You can verify whether ffmpeg is set up for AMR by simply typing "ffmpeg" at the command line and checking to make sure this is in the printed output: --enable-libopencore-amrnb

To answer your specific questions:
1) It converts to AMR and MP3 every time regardless or recipient list. Should it? Eh...maybe not...but it does.
2) It's expected, though not necessarily intended. This is an area that will be cleaned up in a future release. It's not been an issue in the past because the default FFMPEG builds have always included both mp3 and AMR. Now that AMR appears to have been removed by default this is cropping up.

Andy
 

aliby19

Member
Feed Provider
Joined
Mar 10, 2005
Messages
147
Location
Indianapolis, IN
Thanks Andy. Strangely --enable-libopencore-amrnb does not show up in my ffmpeg output.

Even though it shows as being enabled in the script itself/being compiled in (--enable-libopencore-amrnb and --enable-libopencore-amrwb)...
 
Last edited:

aliby19

Member
Feed Provider
Joined
Mar 10, 2005
Messages
147
Location
Indianapolis, IN
Thanks Andy. Strangely --enable-libopencore-amrnb does not show up in my ffmpeg output.

Even though it shows as being enabled in the script itself/being compiled in (--enable-libopencore-amrnb and --enable-libopencore-amrwb)...

Update: This was my own fault. I had an old version of ffmpeg I tried compiling by hand and my Raspberry Pi kept trying to use it. Removed the old one, updated $PATH, and now I have a version of ffmpeg that has enable-libopencore-amrnb listed.
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
I think that Buster for the pi4 includes ffmpeg. Should be no reason to have to build it.
I don't remember for certain, but I think the build of ffmpeg that's now shipping with Buster may not include amr support, necessitating a build from source. Maybe I'm thinking of Ubuntu...I'm easily confused.

Andy
 

davidVT

Member
Feed Provider
Joined
Aug 29, 2010
Messages
138
Location
Washington County,Vermont
I have the latest buster on a pi4 and find it will not create the amr files as suspected.
I am ‘burning the paint’ off the new pi4 trying to successfully compile a new ffmpeg. On about my 5th try from various sources.
Is there a good trusted binary source for an appropriate ffmpeg ? (Buster Raspian on pi4)
Thank you
 

davidVT

Member
Feed Provider
Joined
Aug 29, 2010
Messages
138
Location
Washington County,Vermont
Last try to compile FFmpeg for Pi4 buster latest version (Feb2020) worked. I followed this link -
It added thing I don’t need but it works and is not too large.
The FFmpeg delivered with raspian buster(Feb2020) did work for the MP3 emails but not the amr files for texting.
I just did a real test tone via dispatch and all worked as expected.
 

lwiltenb

Member
Joined
Dec 19, 2002
Messages
25
Good day all. Pi/Linux newby here.

I'm getting the following error when TTD is trying to record the audio after recognizing a set of tones:

Traceback (most recent call last):
File "/home/pi/TTD/TwoToneDetect71d.py", line 1533, in alert
File "/usr/lib/python2.7/dist-packages/pyaudio.py", line 750, in open
IOError: [Errno -9985] Device unavailable

I am running three USB audio cards, one for TTD and two for scanners. TTD was recording the audio properly but now something had changed. I am not familiar at all with how the audio works between Alsa and Pulse and TTD. Does anybody have any thoughts you can share?

Thanks
L.
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,305
Are you setting the PULSE_SOURCE when starting TTD? I'd recommend doing so whenever running multiple sound cards. See the "Running Multiple TwoToneDetect Instances" section of this page to see how.
 

lwiltenb

Member
Joined
Dec 19, 2002
Messages
25
Are you setting the PULSE_SOURCE when starting TTD? I'd recommend doing so whenever running multiple sound cards. See the "Running Multiple TwoToneDetect Instances" section of this page to see how.
Thank you very much! Of course I was messing around with all of the settings and I forgot I removed this command from my TTD startup script. I have added it back in and it is working well.

I appreciate the quick feedback!

L.
 

celltech25

Member
Joined
Feb 5, 2006
Messages
84
Location
Benton
anyone got a fix for v71c so i dont have to remember to close and restart the app every 3 or 4 days. It just stops working after 3-4 days with no warning until a call comes in and it will have a failure trying to send the msg, restart the app and it will work fine for 3-4 days
 

jhsands

Member
Feed Provider
Joined
Sep 6, 2006
Messages
557
Location
Texarkana, Arkansas
anyone got a fix for v71c so i dont have to remember to close and restart the app every 3 or 4 days. It just stops working after 3-4 days with no warning until a call comes in and it will have a failure trying to send the msg, restart the app and it will work fine for 3-4 days

I haven't touched any four of mine since the 'rona hit except for adding/deleting users.
 

Reconrider

Inside the Galaxy
Joined
Sep 26, 2017
Messages
1,970
Location
Radio Galaxy
Is 71c for windows a command line only tool? I can't get the program to open a GUI like the website says. Any help will be great
 

Reconrider

Inside the Galaxy
Joined
Sep 26, 2017
Messages
1,970
Location
Radio Galaxy
I didn't know that's how I used the program. On the website I seen it had a gui, let me take a look at the localhost.

----------------------------------

Edit1: So I opened the program after putting the FFMPEG file the step by step says to and the log at the top says "
FFMPEG FOUND
using audio device from config.cfg"

Inorder to close the program, I have to use task manager(can't see a program open | cmd pops up when I open the exe and it goes away in 1 second)

Localhost does not work either

-------------------

I closed the program and reopened it, it worked that time. Going to try and play with it to see if it works like it should.
 
Last edited:

jhsands

Member
Feed Provider
Joined
Sep 6, 2006
Messages
557
Location
Texarkana, Arkansas
Must be nice I have to reset mine every 5 days, Was told by the developer this is due to how its coded

Yeahhhh... kinda forgot I use a script that checks every minute to ensure the program is running.
OKAY, TTD71.exe running/responsive at Wed 05/06/2020 17:51:01.83
ERROR, Restarting TTD71.exe at Wed 05/06/2020 17:52:00.38


 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,586
Location
Massachusetts
Must be nice I have to reset mine every 5 days, Was told by the developer this is due to how its coded
Mine is the raspberry pi version. TTD shuts down daily at 4 AM and restarts via systemd. It is down 7 sec. i don’t remember the last time I had to touch it due to a problem.
 

celltech25

Member
Joined
Feb 5, 2006
Messages
84
Location
Benton
Mine is the raspberry pi version. TTD shuts down daily at 4 AM and restarts via systemd. It is down 7 sec. i don’t remember the last time I had to touch it due to a problem.

So you automated the shutdown and reopen so you dont have to touch it, You would think the Developer could write the code where it didnt need a frequent close/open for it to work
 

BigRedBox80

Member
Feed Provider
Joined
Apr 23, 2015
Messages
170
I may be searching using the wrong terms but, looking at my audio folder, it seems there is only 20 days worth of MP3's in the folder. Does TTD automatically delete files after so long? If so, is it possible to stop that? If not, I assume I can just run a script to move the files after they are sent (most aren't even sent) to a folder that isn't under TTD.
 
Top