RadioReference on Facebook   RadioReference on Twitter   RadioReference Blog
 

Go Back   The RadioReference.com Forums > Computer Aided Monitoring and Programming > Streaming / Broadcasting / Audio Recording


Streaming / Broadcasting / Audio Recording - Interested in putting your scanner online for others to hear? Want to listen to other radios on the internet. This forum is here for you to discuss these topics related to streaming scanners online.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #41 (permalink)  
Old 04-06-2013, 8:44 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 810
Default My setup

As promised here are more details.

Two recordings of the same dispatch one from a Dell desktop with internal sound card, one from the Pi with the USB sound card described above.

http://dl.dropbox.com/u/96733977/Dell_.mp3
http://dl.dropbox.com/u/96733977/Pi_.mp3

To describe the setup a little I have the Pi powered by an iPad charger (10A). The only other item plugged into the Pi is a 7 port powered USB hub. Into that hub are plugged a USB wireless adapter to access the internet and the above described USB sound card. A 1/8 in stereo audio cable connects the external speaker output of the scanner to the Line In port on the sound card.

Here is a photo of the arrangement:

http://dl.dropbox.com/u/96733977/pi%20photo.JPG

The tweaks done in pavucontrol are shown in the following two screen shots.

http://dl.dropbox.com/u/96733977/pav...%20config.tiff

http://dl.dropbox.com/u/96733977/pav...l%20input.tiff

The volume on the scanner is turned about halfway up.

Audio threshold in config.cfg is set at 500. Using LevelMeter the audio reading with no input from the scanner is around 200-300 and with audio being fed from the scanner is about 10000.

I am not sure that I am finished tweaking it yet but this setup gives much better results than I had been getting previously.

Jim
Reply With Quote
Sponsored links
  #42 (permalink)  
Old 04-07-2013, 8:59 PM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Aug 2005
Posts: 1,052
Default

Awesome, thanks for the update!

Not sure if anyone here will be interested in this, but I've been working on an offshoot project using a lot of the same code to turn a Pi into a two tone paging simplex repeater. When it hears the page, it records it, then replays to a transmitter while using the Pi's GPIO to key the transmitter. These sorts of things are used to provide "fill in" coverage to dead spots, indoor locations, or fringe areas. I've also included a second GPIO output to activate an antenna relay to switch between RX and TX antennas (indoor/outdoor), if desired.

I did a successful test tonight. A few more improvements to make before I put a wrapper on it, but it works! Next step is a traditional simplex repeater version (VOX and/or COR based) without the two tone stuff.

Andy
__________________
Using TwoToneDetect? Show us where! Add yourself to the user map here or PM me with your location and I'll add you.

If you need help with TwoToneDetect please read this post first
Reply With Quote
  #43 (permalink)  
Old 04-07-2013, 11:09 PM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Aug 2005
Posts: 1,052
Default

Quote:
Originally Posted by DC31 View Post
As promised here are more details.

Two recordings of the same dispatch one from a Dell desktop with internal sound card, one from the Pi with the USB sound card described above.

http://dl.dropbox.com/u/96733977/Dell_.mp3
http://dl.dropbox.com/u/96733977/Pi_.mp3

To describe the setup a little I have the Pi powered by an iPad charger (10A). The only other item plugged into the Pi is a 7 port powered USB hub. Into that hub are plugged a USB wireless adapter to access the internet and the above described USB sound card. A 1/8 in stereo audio cable connects the external speaker output of the scanner to the Line In port on the sound card.

Here is a photo of the arrangement:

http://dl.dropbox.com/u/96733977/pi%20photo.JPG

The tweaks done in pavucontrol are shown in the following two screen shots.

http://dl.dropbox.com/u/96733977/pav...%20config.tiff

http://dl.dropbox.com/u/96733977/pav...l%20input.tiff

The volume on the scanner is turned about halfway up.

Audio threshold in config.cfg is set at 500. Using LevelMeter the audio reading with no input from the scanner is around 200-300 and with audio being fed from the scanner is about 10000.

I am not sure that I am finished tweaking it yet but this setup gives much better results than I had been getting previously.

Jim
Are you able to get good audio out of that sound card with USB still running at 2.0 speeds or did you have to throttle it back to 1.0 get get good results?

Andy
__________________
Using TwoToneDetect? Show us where! Add yourself to the user map here or PM me with your location and I'll add you.

If you need help with TwoToneDetect please read this post first
Reply With Quote
  #44 (permalink)  
Old 04-08-2013, 3:57 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 810
Default

Quote:
Originally Posted by aaknitt View Post
Are you able to get good audio out of that sound card with USB still running at 2.0 speeds or did you have to throttle it back to 1.0 get get good results?

Andy
I haven't gone back to make that change to try 2.0. It is still set up as it was originally.
Reply With Quote
  #45 (permalink)  
Old 04-13-2013, 5:00 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 810
Default Sd card image for the RPi

Is there anyone else out there experimenting with TTD on the Pi or considering using one for this purpose?

I have saved the image from SD card. Using this image to flash your new card could save a lot of steps and headaches if you are not a regular Linux user. You will still need to edit the tones and config files but the loading of all components is done.

The compressed image is 26.5 mb. If you would like a copy, post a note here and i will send you a link to it. I would suggest a minimum 8 gb sd card.

USB audio quality is particularly challenging with the Pi. See my previous post about the sound card i am using that seems to have helped.

Jim
Reply With Quote
Sponsored links
  #46 (permalink)  
Old 04-25-2013, 7:28 PM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 810
Default Another quick update

Quote:
Originally Posted by aaknitt View Post
Hi everyone,

I finally had some time to put together a page showing how I got TwoToneDetect running on a Raspberry Pi. Along with a cheap receiver, this could allow you to have a TTD setup up and running that uses very little power for under $100.

I'm by no means a Linux guru, so if you run into problems trying to duplicate this I'm not sure how much help I'll be, but feel free to post here if you'd like. I thought I'd start a new thread to keep the Linux stuff separate from the main Windows version of TTD.

Regards,

Andy
I have been running v59pi TTD for about a month now on a model B pi. Lots of challenges originally getting sound card to work well, etc. then i started experiencing the pi crashing periodically, sometimes days apart, sometimes hours apart. I tried numerous things and none seemed to solve this problem ( hub, no hub, wifi, wired, different power supplies, different SD cards). So i ordered another pi and it came along with two model A pis. I was thinking maybe a memory leak problem so i tried a modelA with half the RAM thinking that it would show up twice as quickly. So far, the A has been running flawlessly...

So that answers another question, it will run on an A. I have never reliably ruled out power supply problems as being the cause of the crashes. I am now wondering if the A pulls less power and that is causing the improvement. (BTW, my order was for one model B pi and two $5 power supplies. In the box came a modelB and 2 A's ($25 each), but alas no power supplies.)
Reply With Quote
  #47 (permalink)  
Old 04-26-2013, 9:37 AM
Member
  Amateur Radio Operator
Amateur Radio
 
Join Date: Jun 2012
Location: Utah
Posts: 4
Default

Quote:
Originally Posted by DC31 View Post
Is there anyone else out there experimenting with TTD on the Pi or considering using one for this purpose?

I have saved the image from SD card. Using this image to flash your new card could save a lot of steps and headaches if you are not a regular Linux user. You will still need to edit the tones and config files but the loading of all components is done.

The compressed image is 26.5 mb. If you would like a copy, post a note here and i will send you a link to it. I would suggest a minimum 8 gb sd card.

USB audio quality is particularly challenging with the Pi. See my previous post about the sound card i am using that seems to have helped.

Jim
Jim,

I would love to get a copy of your SD Card. I am installing now, but would like to have a working copy.

Regards,

Chris Andrist
Reply With Quote
  #48 (permalink)  
Old 04-27-2013, 3:42 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 810
Default The python daemon keeps it running

You need to set it up as a "daemon," which is something that runs continually in the background. See Python script as linux service/daemon - Stack Overflow . Ignore the question, and skip to the first answer. ("What the above upstart conf says is to start this service on reboots and also restart it if it dies.")

Modify the first block of code to reflect the location of your script. This will require changing the chdir and exec lines (to, say, /home/pi/ and /home/pi/script.pyc, or where ever you've placed the script.) The other lines are OK.

Save the first block of code to /etc/init/script.conf (replace script with a better name if you want). You will probably need "sudo" to be able to write to /etc/init/

Then run the second block of code in the terminal window. The first you can run as-is. For the second line, replace "script" with whatever you used for [script].conf earlier.

Two possible pitfalls:
1) The PI may not have upstart installed. If you get errors when you run the second block of code that imply it doesn't know where to find "initctl", try running "sudo apt-get install upstart".
2) The "exec" line in the first block of code may not work for a PYC file. If "sudo start script" fails, or if it appears to work but nothing happens, try changing that line to "exec python /home/pi/script.pyc" and see what happens. You will need to run both lines in the second block again.
Reply With Quote
  #49 (permalink)  
Old 04-27-2013, 3:51 AM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 810
Default

Quote:
Originally Posted by kc7wsu View Post
Jim,

I would love to get a copy of your SD Card. I am installing now, but would like to have a working copy.

Regards,

Chris Andrist
See if you can grab it here:

https://dl.dropboxusercontent.com/u/...TD12Apr.img.gz

Username and password are the same as your Pi was shipped with. I have stripped out my email username and password from config.cfg and have stripped out my Tones.cfg info. It is also set for a static IP address to facilitate using SSH. Use ifconfig to determine the address. Send me a PM if you need any help.

I have found my pi to be very sensitive to power supply problems. I am finding it difficult to maintain something above 4.8 volts across TP1-TP2. Most stable appears thus far to be an Apple iPad charger that gets me 4.9 volts.
Good luck

Jim
Reply With Quote
  #50 (permalink)  
Old 04-29-2013, 7:30 PM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 810
Default invalid no. of channels

Andy,

Do you have any idea what is causing this error?

From log.txt:

Succesfully retrieved local tone info
Succesfully retrieved local tone info
Tone1
Tone2
Tone3
Tone4
Tone5
Tone6
Tone7
Tone8
Tone9
Tone10
Tone11
Tone12
Tone13
Tone14
Tone15
Tone16
Tone17
Tone18
Tone19
Tone20
Tone21
Tone22
Tone23
Tone24
Tone25
Tone26
Tone27
Tone28
Longtone1
defaultdict(<type 'list'>, {'Pi Shelburne EMS 56': array([ 1800., 1800., 1344., 1344., 1344., 1344., 1344.]), 'Pi SDFD all call 56': array([ 1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2,
1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2,
1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2,
1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2,
1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2,
1063.2, 1063.2, 1063.2, 1063.2, 1063.2]), 'Pi Leyden FD 56': array([ 1251.4, 1251.4, 1425. , 1425. , 1425. , 1425. , 1425. ]), 'Pi Sunderland Fire EMS 56': array([ 1120., 1120., 950., 9$
defaultdict(<type 'list'>, {'Pi Shelburne EMS 56': 2, 'Pi SDFD all call 56': 28, 'Pi Leyden FD 56': 26, 'Pi Sunderland Fire EMS 56': 12, 'Pi Deerfield EMS 56': 20, 'Pi SFFD 56': 11, 'Pi Shelburne Fire 56': 0,$
Traceback (most recent call last):
File "TwoToneDetect59Pi.py", line 661, in <module>
File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 747, in open
stream = Stream(self, *args, **kwargs)
IOError: [Errno Invalid number of channels] -9998


I am trying to run TTD59pi with a daemon script that starts it automatically. When I start TTD normally at the command line it works fine, but when the deamon starts it, I get this error message.

Thanks

Jim
Reply With Quote
  #51 (permalink)  
Old 04-29-2013, 7:38 PM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Aug 2005
Posts: 1,052
Default

Quote:
Originally Posted by DC31 View Post
Andy,

Do you have any idea what is causing this error?

From log.txt:

Succesfully retrieved local tone info
Succesfully retrieved local tone info
Tone1
Tone2
Tone3
Tone4
Tone5
Tone6
Tone7
Tone8
Tone9
Tone10
Tone11
Tone12
Tone13
Tone14
Tone15
Tone16
Tone17
Tone18
Tone19
Tone20
Tone21
Tone22
Tone23
Tone24
Tone25
Tone26
Tone27
Tone28
Longtone1
defaultdict(<type 'list'>, {'Pi Shelburne EMS 56': array([ 1800., 1800., 1344., 1344., 1344., 1344., 1344.]), 'Pi SDFD all call 56': array([ 1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2,
1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2,
1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2,
1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2,
1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2, 1063.2,
1063.2, 1063.2, 1063.2, 1063.2, 1063.2]), 'Pi Leyden FD 56': array([ 1251.4, 1251.4, 1425. , 1425. , 1425. , 1425. , 1425. ]), 'Pi Sunderland Fire EMS 56': array([ 1120., 1120., 950., 9$
defaultdict(<type 'list'>, {'Pi Shelburne EMS 56': 2, 'Pi SDFD all call 56': 28, 'Pi Leyden FD 56': 26, 'Pi Sunderland Fire EMS 56': 12, 'Pi Deerfield EMS 56': 20, 'Pi SFFD 56': 11, 'Pi Shelburne Fire 56': 0,$
Traceback (most recent call last):
File "TwoToneDetect59Pi.py", line 661, in <module>
File "/usr/local/lib/python2.7/dist-packages/pyaudio.py", line 747, in open
stream = Stream(self, *args, **kwargs)
IOError: [Errno Invalid number of channels] -9998


I am trying to run TTD59pi with a daemon script that starts it automatically. When I start TTD normally at the command line it works fine, but when the deamon starts it, I get this error message.

Thanks

Jim
The error means that it can't find any input devices for the selected audio device. I think you may be stumbling into an issue with pulseaudio. Normally pulseaudio is only run on a per-user basis, not for the entire system. I'm wondering if you need to run it in system mode for it to work with the daemon script. See here:

freedesktop.org - Software/PulseAudio/Documentation/User/SystemWide

It could also be the "2 vs 3" issue with pulseaudio. In one of my other projects I changed the code to search for the audio device named "pulse" and use that one, regardless of the index number. I should bake that into the Pi version of TTD...I'll put that on my to do list...if you can't get this resolved let me know and I'll bump it up in priority.

Andy
__________________
Using TwoToneDetect? Show us where! Add yourself to the user map here or PM me with your location and I'll add you.

If you need help with TwoToneDetect please read this post first
Reply With Quote
  #52 (permalink)  
Old 04-30-2013, 8:29 PM
Member
  Audio Feed Provider
Audio Feed Provider
Amateur Radio Operator
Amateur Radio
 
Join Date: Nov 2005
Location: Marceline, Missouri
Posts: 48
Default

Quote:
Originally Posted by DC31 View Post
See if you can grab it here:

https://dl.dropboxusercontent.com/u/...TD12Apr.img.gz

Username and password are the same as your Pi was shipped with. I have stripped out my email username and password from config.cfg and have stripped out my Tones.cfg info. It is also set for a static IP address to facilitate using SSH. Use ifconfig to determine the address. Send me a PM if you need any help.

I have found my pi to be very sensitive to power supply problems. I am finding it difficult to maintain something above 4.8 volts across TP1-TP2. Most stable appears thus far to be an Apple iPad charger that gets me 4.9 volts.
Good luck

Jim

Jim,

Thanks for including the link for the image. I just got my TTD program up and going on a windows machine last night and have ordered a Pi to try out. I have zero experience with a Raspery Pi so this should get interesting. LOL

Mike
Reply With Quote
  #53 (permalink)  
Old 04-30-2013, 8:37 PM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 810
Default

Quote:
Originally Posted by emt603 View Post
Jim,

Thanks for including the link for the image. I just got my TTD program up and going on a windows machine last night and have ordered a Pi to try out. I have zero experience with a Raspery Pi so this should get interesting. LOL

Mike
You will find the Pi a whole new experience. I seem to still be experiencing power supply problems. I have ordered a new power supply and hope that will make it more stable. I leave it on all the time and sometimes it will go a week before it crashes and other times only an hour or so.

If you don't know Linux you will start learning.
Reply With Quote
  #54 (permalink)  
Old 05-01-2013, 5:02 PM
Member
  Audio Feed Provider
Audio Feed Provider
Amateur Radio Operator
Amateur Radio
 
Join Date: Nov 2005
Location: Marceline, Missouri
Posts: 48
Default

Jim, How do i get your image burned to the sd card? do i have to use an ISO image program?

Bare with me, i'm totally green when it comes to Raspery Pi


Mike
Reply With Quote
  #55 (permalink)  
Old 05-01-2013, 5:57 PM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 810
Default

Unzip or extract the files from the file you got from my link (TTD12Apr.img.gz). This should give you a .img file.

Then follow the instructions at this page:
An easier way to create the bootable SD card with Windows | Arc Software Consultancy using the Raspberry Pi

If you are on a Mac: PiCloner | Free Security & Utilities software downloads at SourceForge.net

substituting the file name above for the one that they discuss. this should give you all the add-ins that you need as well as the TTD program.

When the prompt says that "this may take a while" they mean it. Start it and then go to bed for the night. Maybe even 5 hours.

Username and password same as if you downloaded the Raspbian image.


Yeah, I was greenhorn to the pi, Linux, and Python only a couple months ago.
Reply With Quote
  #56 (permalink)  
Old 05-02-2013, 10:07 PM
davidVT's Avatar
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Aug 2010
Location: Washington County,Vermont
Posts: 86
Thumbs up Image post

Jim
Thank you for posting the image file.
That was just enough incentive for me to order a PI.
David
Reply With Quote
  #57 (permalink)  
Old 05-05-2013, 1:15 PM
Member
  Audio Feed Provider
Audio Feed Provider
Amateur Radio Operator
Amateur Radio
 
Join Date: Nov 2005
Location: Marceline, Missouri
Posts: 48
Default

Jim, When i try and unzip the image using win7zip i get a : Data Error in 'TTD12Apr.img'. File is Broken. What am i doing wrong?


Mike
Reply With Quote
  #58 (permalink)  
Old 05-05-2013, 3:59 PM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 810
Default

Quote:
Originally Posted by emt603 View Post
Jim, When i try and unzip the image using win7zip i get a : Data Error in 'TTD12Apr.img'. File is Broken. What am i doing wrong?


Mike
It may be operator error on my end. I used picloner on a Mac to make the image. Maybe it is only supposed to work with the companion piwriter. Do you have access to a Mac? Those programs are a Free download. Otherwise, let me research it.
Reply With Quote
  #59 (permalink)  
Old 05-05-2013, 6:45 PM
Member
  Audio Feed Provider
Audio Feed Provider
 
Join Date: Feb 2011
Location: Massachusetts
Posts: 810
Default

Quote:
Originally Posted by emt603 View Post
Jim, When i try and unzip the image using win7zip i get a : Data Error in 'TTD12Apr.img'. File is Broken. What am i doing wrong?


Mike
Mike, check this out:

How to Extract a Gz File: 6 Steps - wikiHow

That may help. when I tested it out I must have used the Linux that resides on the mac.
Reply With Quote
  #60 (permalink)  
Old 05-05-2013, 8:18 PM
Member
  Premium Subscriber
Premium Subscriber
 
Join Date: Aug 2005
Posts: 1,052
Default

For those playing with this, I posted a new (v60) version for the Pi this afternoon. See the main thread for the release notes. In addition to what's listed there, this new version will automatically select the "pulse" audio device so you don't need to specify any audio input or output devices in config.cfg.

Andy
__________________
Using TwoToneDetect? Show us where! Add yourself to the user map here or PM me with your location and I'll add you.

If you need help with TwoToneDetect please read this post first
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:19 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
All information here is Copyright 2012 by RadioReference.com LLC and Lindsay C. Blanton III.Ad Management by RedTyger
Copyright 2015 by RadioReference.com LLC Privacy Policy  |  Terms and Conditions