TwoToneDetect TwoToneDetect on a Raspberry Pi - How To

Status
Not open for further replies.

kenmaples

Member
Joined
Feb 1, 2010
Messages
73
Location
Port Orchard, WA
I will try to test with the command with the original version after I finish getting this device built.

Last night I was able to compile the latest version of ffmpeg and it seems to be working currently, at least at the moment. This is a very lengthy process to make and install on a Pie2.

sudo apt-get install libx264-dev
sudo apt-get install libmp3lame-dev
sudo apt-get install libopencore-amrnb-dev libopencore-amrwb-dev -y
mkdir ~/Downloads/
cd ~/Downloads
wget https://ffmpeg.org/releases/ffmpeg-3.2.2.tar.bz2
cd ~/Downloads/ffmpeg
tar xvjf ffmpeg-3.2.2.tar.bz2
cd ~/Downloads/ffmpeg-3.2.2
./configure --prefix=/usr --enable-gpl --enable-libx264 --enable-nonfree --enable-shared --disable-static --enable-nonfree --enable-libmp3lame --enable-postproc --enable-swscale --enable-pthreads --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb
make
sudo make install


Thank you!
 

Refleks

Newbie
Joined
Jan 13, 2017
Messages
4
I've been running TTD on the laptop successfully, just got my Pi in today and will attempt to start configuring that.

I'm going to start scanning this thread for information and maybe solutions to problems I encounter, but as I'm doing that, does anyone know how up to date these pages are?

TwoToneDetect on a Raspberry Pi | TwoToneDetect
TwoToneDetect Pi Image | TwoToneDetect

Specifically, on the second link the info about VNC (Step #4) is no longer working. Would it save a lot of trouble configuring by going through monitor + keyboard vs. SSH?

Regards
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,554
Location
Massachusetts
Things got really muddied when the RPi 2 and then RPi3 came out running Raspbian Jessie. Yes, the information at the above two links is rather dated now and may not work on a RPi 2 or 3. Specifically, the second link you posted references a Model B or B+. These are both predecessors to the RPi2.

For your reference, I am attaching my notes on how to make TTD run on Raspbian Jessie Lite. This is the version without a GUI, it is all command line stuff. I make no guarantees on how complete or understandable these notes are as I haven't run TTD on a newer version pi in some time.

A second option is to image a card with the Ubuntu MATE version of TTD. If you do a search either in this thread or in this category of the forum for Ubuntu MATE I think that you will find a post with a link to the image. This also comes with it own set of challenges.

Here is the post containing the link:

http://forums.radioreference.com/st...nedetect-raspberry-pi-how-30.html#post2633102

If you can find an old Model B original Pi, those run TTD basically flawlessly.
 
Last edited:

kenmaples

Member
Joined
Feb 1, 2010
Messages
73
Location
Port Orchard, WA
Attached is my build script that I put together in the last two weeks. This is for Jessie Lite. I am running everything (TTD) in crontab. The script only has the base build, You will need to copy TTD and create a start script. I can share all of my scripts if you decide that you want to go that route.

My script only works due to the help from others in the thread. So, I take no credit but will try to help as I can if you go this route.

This script has been used (5 or 6 times this week) to build on a Pi2, but I have moved the card to a Pi3 and all was running as expected.

My Pi2 is currently running TTD V68 (pi), darkice and icecast2, and my Unifi controller.
 

Attachments

  • Lite.txt
    1.4 KB · Views: 82
Last edited:

Dygear

Member
Joined
Nov 18, 2010
Messages
74
Location
Levittown, NY
Attached is my build script that I put together in the last two weeks. This is for Jessie Lite. I am running everything (TTD) in crontab. The script only has the base build, You will need to copy TTD and create a start script. I can share all of my scripts if you decide that you want to go that route.

My script only works due to the help from others in the thread. So, I take no credit but will try to help as I can if you go this route.

This script has been used (5 or 6 times this week) to build on a Pi2, but I have moved the card to a Pi3 and all was running as expected.

My Pi2 is currently running TTD V68 (pi), darkice and icecast2, and my Unifi controller.

TTD, DarkIce, Icecast2 AND A UniFi controller. Oh yeah baby, that's a sweet setup! Didn't know UniFi had a ARM build. That's awesome.

If you could share your InitD scripts and where you placed them in the system that would be awesome. :).

I'm currently running a RaspPi3 using Pixel with a full GUI, but I'm gonna pick up another Pi today to dedicate to TTD / SDR stuff, I guess I'll put the script you used here to work for that. I'll let you guy know if I needed to make any changes to get that working.
 

kenmaples

Member
Joined
Feb 1, 2010
Messages
73
Location
Port Orchard, WA
I am running everything from crontab:

crontab -e:
@reboot /home/pi/TTD.sh
*/2 * * * * /home/pi/TTD.sh
00 1 * * * /home/pi/TTDPurge.sh
59 1 * * * sudo reboot

Attached is my startup script TTD.sh. You will see that I define my pulse audio sources\sinks each time on start up as this is running as root, logging in as pi to see the values is looking at the wrong instance of pulseaudio. TTD playback during record is working, but I have garbled audio for some reason. I have not yet spent time to figure out why that is. My recordings and audio streams are both working fine.

Please tear it apart, improve it, and share what you find!

If anyone cares, UniFi is a simple install:
sudo apt-get install mongodb-server -y
echo 'ENABLE_MONGODB=no' | sudo tee -a /etc/mongodb.conf > /dev/null
sudo apt-get install oracle-java8-jdk -y
sudo apt-get install jsvc -y
mkdir ~/Downloads
cd ~/Downloads
wget https://www.ubnt.com/downloads/unifi/5.5.1-cf74f8320e/unifi_sysvinit_all.deb
sudo dpkg -i unifi_sysvinit_all.deb
 

Attachments

  • TTD.sh.txt
    1.7 KB · Views: 74

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,554
Location
Massachusetts
I am running everything from crontab:
!

If anyone cares, UniFi is a simple install:
sudo apt-get install mongodb-server -y
echo 'ENABLE_MONGODB=no' | sudo tee -a /etc/mongodb.conf > /dev/null
sudo apt-get install oracle-java8-jdk -y
sudo apt-get install jsvc -y
mkdir ~/Downloads
cd ~/Downloads
wget https://www.ubnt.com/downloads/unifi/5.5.1-cf74f8320e/unifi_sysvinit_all.deb
sudo dpkg -i unifi_sysvinit_all.deb

Ken, you TTD setup sounds good. Now, can you give us a one-paragraph layman's description of what Unifi would do for us on the RPi? All that i can find on their website is geek-speak: "UniFi®is the revolutionary Wi-Fi system that combines Enterprise performance, unlimited scalability, a central management controller and disruptive pricing." Why would i want it on my pi? What do you use it for?

Thanks
Jim
 

kenmaples

Member
Joined
Feb 1, 2010
Messages
73
Location
Port Orchard, WA
Sorry for the confusion. UniFi controller has no benefits to TTD or the RPi. It is my wifi controller. This is just another service that I need to run and wanted to merge into the same RPi that I was already running TTD on.
 

ffryan76

Member
Feed Provider
Joined
Nov 28, 2004
Messages
175
Location
South central, In
Has any one had a problem with the AMR files recently? I'm not sure what exactly the issue is but the file is not able to be opened when sent. I'm using a RPI 3 with DC31 Ubuntu mate. The only error I can see in the log file is this: "UnboundLocalError: local variable 'lowtime' referenced before assignment".

If it is the ffmpeg conversion, how to I re-download it to the RPI3 ?
Thanks for the insight
 

firemedicmcse

Member
Joined
Dec 19, 2002
Messages
26
Location
Mentone, AL
I have 3 RPi3 running the Ubuntu Mate and all of them in the past several days have started sending a 0 second AMR file. I re-imaged one and fixed it, but I don't know how long it will stay working. Would love to hear some ideas on what happened. It's almost like ffmpeg stopped working.
 

ffryan76

Member
Feed Provider
Joined
Nov 28, 2004
Messages
175
Location
South central, In
I have 3 RPi3 running the Ubuntu Mate and all of them in the past several days have started sending a 0 second AMR file. I re-imaged one and fixed it, but I don't know how long it will stay working. Would love to hear some ideas on what happened. It's almost like ffmpeg stopped working.
That's what mine was doing as well. I am watching for a answer as well.
 

aaknitt

Member
Feed Provider
Joined
Aug 27, 2005
Messages
1,303
I have 3 RPi3 running the Ubuntu Mate and all of them in the past several days have started sending a 0 second AMR file. I re-imaged one and fixed it, but I don't know how long it will stay working. Would love to hear some ideas on what happened. It's almost like ffmpeg stopped working.

Any chance your SD card is full?

Andy
 

ffryan76

Member
Feed Provider
Joined
Nov 28, 2004
Messages
175
Location
South central, In
Well how about that. Didn't think about that.
That makes total sense. Is there a script or crontab that erases the files on a schedule?
 

firemedicmcse

Member
Joined
Dec 19, 2002
Messages
26
Location
Mentone, AL
That was what I thought at first, but I am running a 32 Gig SD card on one of them and still had over 10gig free. I even tried clearing out the audio files and still did not resolve the issue. Only thing that has resolved it so far is reimaging the SD card with my backup image.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,554
Location
Massachusetts
Well how about that. Didn't think about that.
That makes total sense. Is there a script or crontab that erases the files on a schedule?

Here is my crontab line that deletes files from the audio folder more than one day old daily at 20:00 hours.

0 20 * * * find /home/pi/TTD/audio/* -mtime +0 -exec rm {} \;

The +0 entry is the number of days. If you want to delete those older than five days, try +4. That is the Linux way of counting. Of, course you will need to adjust the path to your files. As i recall, i ran into issues on the Ubuntu image of whether it was a user crontab or a root crontab. If yours doesn't seem to work as expected, investigate this.
 

firemedicmcse

Member
Joined
Dec 19, 2002
Messages
26
Location
Mentone, AL
Is there a logfile for the conversion process to see if that failed for some reason? I looked in my audio directory and the AMR file is there but it is 0 bytes.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,554
Location
Massachusetts
Is there a logfile for the conversion process to see if that failed for some reason? I looked in my audio directory and the AMR file is there but it is 0 bytes.

There should be a logfile directory under your main TTD directory. Mine is /home/pi/TTD/logfiles. It maintains the last 15 days as text files.
 

firemedicmcse

Member
Joined
Dec 19, 2002
Messages
26
Location
Mentone, AL
Does anyone have any idea why I would be getting a 0 byte AMR file, but the MP3 file is of normal size? Do I need to remove and reinstall ffmpeg? If so, can I get a little direction on how? Also, would updating to v69 help with this issue?
 
Status
Not open for further replies.
Top