Standalone Client Computer

Status
Not open for further replies.

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
Although this thread is a little stale I thought I would add that I am streaming a mono feed using a Raspberry Pi model “B”:
Register interest for your @Raspberry_Pi.
and it is working very well. I followed these instructions:
Live mp3 streaming from audio-in with DarkIce and Icecast2 on Raspberry Pi
(and also these):
Live Audio/Ubuntu Darkice - The RadioReference Wiki
to set up darkice:
darkice - DarkIce is a live audio streamer. - Google Project Hosting
on a Raspberry Pi using the Raspbian “wheezy” image:
Downloads | Raspberry Pi
Total cost for the feed computer then was under (US) $60 even including shipping. If you have a 4 gig SD card and/or USB charger already then it would even be less. And as a bonus the RPi only uses 5 watts and is silent (no fan). Not bad considering that the computer it replaced used 115 watts or more and put out more heat than the exhaust on a double tractor trailer rig.

My setup is a Raspberry Pi running headless (no keyboard or mouse) with 700 ma USB power supply (an old Motorola phone charger). It is connected to my router / cable modem with an Ethernet cable (i.e. not using USB WiFi dongle). The scanner audio output is fed to a USB soundcard like this one:
New Sound Card 5 1 USB 2 0 to 3D Audio Adapter External Virtual SA88 | eBay
that is plugged directly into the Raspberry Pi. They only cost a few dollars if you don’t mind waiting on them to arrive from China. Since no other USB devices are in use the Pi does not have any trouble powering it and therefore a powered USB hub is not required. The Pi recognized the USB sound card without any problem.

I connect to the Raspberry Pi from my Windows machine using Putty:
PuTTY: a free telnet/ssh client
via SSH protocol however I have also tried to run it at the local terminal with the X11 GUI and a bit torrent server (with reduced bandwidth) also running. The system and feed were still stable and CPU use averaged 25-33 percent. Be warned however the the USB and Ethernet share the bandwidth so if you are doing some heavy network activity while also using USB sound input then you might have some problems.

While the steps to recompile darkice are not too difficult there are a few things that were not real clear to someone unfamiliar with the method. You should still give it a go if you have a RPi to use for streaming. If there is any interest I could try to provide a modified version of the OS image so you would not have to recompile darkice. I could also offer a simple setup guide that should get most people up and running with almost no knowledge of Linux (of course it would just be a re-write of all the great information already online). The hardest part would be getting your hands on a Raspberry Pi since they are so popular that the suppliers cannot keep up with demand. In fact, I am on the waiting list now for a second one.

It should be easy enough to make a stereo feed as I believe that the USB sound device supports stereo. In my case I have no need in trying to do sterea however. Note that if you use two USB sound devices, and / or a key board and mouse, then you will no doubt need a powered USB hub and that adds $15-25 or more.
 
Last edited:

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
Livecaster based on Beaglebone - photos on page.
Broadcast radio scanner output to Internet
Livecaster based on Beaglebone.
BeagleBoard.org - Livebone

BeagleBoard Projects
BeagleBoard.org - project

That BeagleBoard is cool but the RasPi is cheaper. In fact they just released the model A in Europe for US $25 ! It should be available in the US soon and I don't see any reason why it would not work for streaming, you would however need to add a USB network device so that negates some or all of the cost savings over a model B on Ethernet.

I need to get local archiving of the feed working since the RasPi can do it!

Any chance you could send the script that does it on the BB to me?
(I would imagine that its GNU or CC license, and not closed source)

@Bellingham_Scanner.. I thought you were running a feed on a RasPi too....
 
Last edited:

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
Well MtnBiker2005 informed me that he is not using the BeagleBoard or the script to save the audio. So… today I got local file archiving working on the RasPi thanks to the good work of Matt Rock MattRock was HERE!! | MattRock's 2¢

The scanner audio is fed from DarkIce to the RadioReference / Broadcastify server and at the same time saved in a local file on disk (actually the RasPi SD Card). Once an hour the audio file is time stamped and saved to a folder using routines called “RadioPlay” originally written by Matt to archive College Radio shows. http://wsum.wisc.edu/

Average load is still staying under 20 percent for the most part. Good Pi.

Still TO DO:

General cleanup and debugging
Add ID3 tags
Make script more configurable
Add routine to limit disk use based on user preferences
(Delete old files, compress newer files, etc)
Right now I have 9 ½ days until the 4 gig SD card is filled up.

Note that Matt’s original script saved the files to remote location so that would be easy to do.
 

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
Thanks IrdellMon. I plan on doing this eventually.. assuming I can get my hands on a Raspi.

You should maybe go ahead and order from Newark/element14.. I ordered on the first of this month and currently they expect to ship mine on Feb 18th. No charge to CC until it ships. Also they have pretty nice cases (unless you need access to the GPIO pins) for a little more than $7 (two for $21.29 including tax and shipping). Thats less than most any place else unless you use the cardstock cutout template which is almost free ; ) I wish I had ordered two pi's to start with also!

Note however they did not respect my request to ship that cases and pi at one time so they charged me for shipping the cases and will charge me shipping again for the pi. No way to get out of paying tax either : (
Do you want the scripts I am using? If so let me know when you get your RasPi (PM is best) and what your level os Linux experience is.

ID3 tagging has been added and next will work on auto-purging function. Maybe then stripping silence from the files!
 

Attachments

  • P2060002.JPG
    P2060002.JPG
    180.9 KB · Views: 1,398
  • P2060003.JPG
    P2060003.JPG
    177.9 KB · Views: 1,363

ReddHead

Member
Joined
Sep 16, 2011
Messages
25
Location
Barnegat, NJ
You should maybe go ahead and order from Newark/element14.. I ordered on the first of this month and currently they expect to ship mine on Feb 18th. No charge to CC until it ships. Also they have pretty nice cases (unless you need access to the GPIO pins) for a little more than $7 (two for $21.29 including tax and shipping). Thats less than most any place else unless you use the cardstock cutout template which is almost free ; ) I wish I had ordered two pi's to start with also!

Note however they did not respect my request to ship that cases and pi at one time so they charged me for shipping the cases and will charge me shipping again for the pi. No way to get out of paying tax either : (
Do you want the scripts I am using? If so let me know when you get your RasPi (PM is best) and what your level os Linux experience is.

ID3 tagging has been added and next will work on auto-purging function. Maybe then stripping silence from the files!


Very cool looking. And compact. I wonder if I have enough empty space inside the body of my scanner to squeeze one in there lol. I haven't used Linux in a while but am pretty familiar with it. I'll take whatever custom scripts you've written.
 

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
Very cool looking. And compact. I wonder if I have enough empty space inside the body of my scanner to squeeze one in there lol.

I had mine on top of the scanner at first but I had problems.. seemed like the scanner was picking up RFI, which is logical since the Pi is not shielded. Moving it only six inches away seemed to help. BTW, I hear people are working on turning the Pi in to an actual radio scanner.. but that's way above my pay grade!

First make sure sound is working on the RasPi using alsa utilities arecord and aplay (and alsamixer to adjust volume).. this was hard for me because I didn't know anything about using "alsa" or "plug" in Linux, but trial and error got me to the right "arecord" command option (-D plughw:1,0) which is also used in the darkice configuration file.

Then try recompiling darkice to support mp3's see:
Live mp3 streaming from audio-in with DarkIce and Icecast2 on Raspberry Pi
and note there is no need to install icecast on the pi unless you want it for your own purposes beyond streaming the scanner feed. Also read the comments, esp #24 if you (like me) have not used debchange before.

Back to work now.. the "purging files" function is well on it's way to being done.

UPDATE on Newark / Element 14 shipping policy: I just found out that there is a oft missed box on the web order page marked Ship Complete (or similar) and if you check that they will not ship multiple packages (at added cost). So since they didn't see the request in the notes be sure to check the box if you want to save on shipping.

Also you can use Voucher code is NEW2P to save 15% on many items. They said, "it can be used as many times as you would like through February 28th, 2013, feel free to share with whomever you would like." I am pretty sure it is not valid for the RasPi but might be for cases and accessories.
 
Last edited:

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
Raspberry Pi, a $35 computer feeding scanner audio!

As mentioned above, the Raspberry Pi can be a very inexpensive solution for feeding scanner (or other) audio.

I have prepared detailed instructions on exactly how to do it. They are written for someone with my level of knowledge of Linux, which is quite basic.

The files are attached here and are also at:

https://sites.google.com/site/glyman3home/scannerfeed

** Any updates will be posted to the above site only! **
Therefore check the site for the latest versions.

If you download the file “scannerfeed.tar.gz.txt” from this post it will need to have the “.txt” extension removed. The proper file name is used on the above site. Then in either case you need to unpack it according to the directions in the PDF file.

This information in this guide and the scripts and files will largely apply to any system running a Linux operating system, especially the Debian version.
 

Attachments

  • scannerfeed.tar.gz.txt
    4.6 KB · Views: 250
  • Scannerfeedhowto_online_ver.pdf
    939.2 KB · Views: 3,035

Uplink

Member
Joined
Feb 17, 2006
Messages
444
Location
Los Angeles County
Thanks for all the writeups guys. I am running this same setup, with the C-Media USB dongle, 1.8 amp power supply, and followed the instructions from the Steffen's T-3 node website. I'm don't have a lot of experience with linux, but I have Darkice up and running.
The problem is I'm getting hit with BUFFER OVERRUN errors and garbled audio everytime I start the stream. Anybody seen this? Overclock, doesn't help, and only seeing about 25% cpu draw. Running 16bps, and 11025 sample rate. Any suggestions appreciated in advance!
 
Last edited:

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
1. Where are you seeing the error? If in a log file which one and and what is the complete message?
2. Can you post (or attach) your darkice.cfg file?
3. What else is attached to USB?
4. Do you have any other things running that use network or USB?
5. What is the output of this command: dpkg -l | grep darkice

I have a suspect in mind but I will wait for more evidence to make the accusation.

Thanks for all the writeups guys. I am running this same setup, with the C-Media USB dongle, 1.8 amp power supply, and followed the instructions from the Steffen's T-3 node website. I'm don't have a lot of experience with linux, but I have Darkice up and running.
The problem is I'm getting hit with BUFFER OVERRUN errors and garbled audio everytime I start the stream. Anybody seen this? Overclock, doesn't help, and only seeing about 25% cpu draw. Running 16bps, and 11025 sample rate. Any suggestions appreciated in advance!
 
Last edited:

Uplink

Member
Joined
Feb 17, 2006
Messages
444
Location
Los Angeles County
1. Where are you seeing the error? If in a log file which one and and what is the complete message?
2. Can you post (or attach) your darkice.cfg file?
3. What else is attached to USB?
4. Do you have any other things running that use network or USB?
5. What is the output of this command: dpkg -l | grep darkice

I have a suspect in mind but I will wait for more evidence to make the accusation.

thanks IredellMon
buffer overrun comes up as soon as darkice is started, repeats every minute or so.
Nothing else but the C-media USB dongle and the keyboard on USB, tried with and without the keyboard to no avail.
Nothing else on the network, tried it with a buddy's network, compiled another SD card, and another USB dongle same results.
Tried without keyboard plugged in, same results.
I'm using the same config as Steffen's, tried cbr, and vbr, different quality settings, all to no avail.

My next step is to start all over again, and try a powered USB hub, and yet another SD card.

Go ahead and accuse away!, :D I'll try any suggestions, right or wrong, doesn't matter, you won't hurt my feelings :D
 
Last edited:

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
I would still like to see:

A: Can you post (or attach) your darkice.cfg file?

B:What is the output of this command: dpkg -l | grep darkice

C: And Output of these commands: lsusb and uname -a

Something is different from your setup to mine, just trying to find out what it is without going through every little detail. Are you running anything else that uses more than a little network or USB bandwidth?
(A torrent server with default settings for example will often cripple a pi, while (light use of) sshd is not a problem)
Confirm you are using the hard float version of Raspbian wheezy.
 
Last edited:

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
Update on using the Raspberry Pi as a scanner feed computer

I have added code to create an archive copy of the scanner recordings with all of the dead air (silence) removed. If you are already feeding scanner audio then this is a great way to quickly review the overnight action in minutes.

For example, on this quiet Saturday afternoon a full length recording for 59 minutes (shown on the bottom) was 6916 kB while the copy with the dead air removed (shown on top) was only one minute 32 seconds (1:32) and 359 kB.

This code is currently undergoing “T&T” (testing and tweaking ; )
When it’s ready for prime time I will post it on the website.

The basic steps are:
- Install sox with mp3 support: sudo apt-get install sox libsox-fmt-mp3
- Add a few lines of code to the “Radioplay” script to remove the dead air from the archive file. For me this works…
sox infile.mp3 outfile.mp3 silence -l 1 .1 4% -1 .7 3%
(after filter name “silence” it’s a lower case “L”, then numbers “1”, “.1”, “4%”, “-1”, “.7” and “3%” with a single space between each.)
Then save the trimmed version.

https://sites.google.com/site/glyman3home/scannerfeed
 

Attachments

  • ArchiveTrim.jpg
    ArchiveTrim.jpg
    68.4 KB · Views: 1,138
Joined
Mar 21, 2010
Messages
237
Location
Bellingham Washington
The basic steps are:
- Install sox with mp3 support: sudo apt-get install sox libsox-fmt-mp3
- Add a few lines of code to the “Radioplay” script to remove the dead air from the archive file. For me this works…
sox infile.mp3 outfile.mp3 silence -l 1 .1 4% -1 .7 3%
(after filter name “silence” it’s a lower case “L”, then numbers “1”, “.1”, “4%”, “-1”, “.7” and “3%” with a single space between each.)

Now this sounds great as I have had several listeners ask about archives. I have even downloaded the RR archives and given them to people.

I have a question.

I currently have darkice and icecast running streaming to RR and also hosting my feeds locally. I skimmed through your R-Pi setup document and am see that Radioplay handles ID3 tags. My old scanner does not have tags.

Can I make the archiving work and remove the dead air without Radioplay?

Also I have never had to compile darkice, simply using aptget or synaptic installs a version that works with RR. Maybe the Rasbien repositories are different I am running Xubuntu on my streamer.
 

IredellMon

Member
Joined
Jan 23, 2012
Messages
90
Location
North Carolina
...
I have a question.
....

Archiving: “Radioplay” uses a feature of darkice of which I was able to find almost no documentation, and which I do not fully understand. It seems that that the author(s) of darkice provide a feature so that if you are saving audio to a file and you send it a SIGUSR1 (kill -10), it then saves the current file? and then restarts recording to the file. The original Radioplay archiving script uses this feature and was written by Matt Rockwell, see:
How to use station_archive.module without stream ripping? | Drupal Groups

So… you set up "streaming to a file" in the darkice.cfg file, start darkice, then run a cron script to copy, save and restart the file that is being streamed. I hope that helps but to repeat myself, I don’t fully understand the mechanism, so I followed Matt’s code. It should be easy enough to adapt it to other Linux systems.
-----------
ID3 tags: Radioplay does no more that use a program called “id3v2” to add some metadata tags to the files. It does not take any information from the scanner (or anywhere else) other than whatever tags you put in the conf file to be added to the archive files. For example, from the command line, this would add a tag to foo.mp3 describing the song name as “TitleIsThis”:

/usr/bin/id3v2 --song " TitleIsThis" foo.mp3 (Of course change path if needed for your system)

No doubt a really talented programmer could get info from a scanner with appropriate interface and create ID3 tags from that.

(A funny aside.. when my Windows box looks up the tags I have used it thinks that my recording is some sort of rap music.. oh well, so much for the ID3 database!)
------
Removing dead air: This is almost at simple as ID3 tags, thanks to “sox,” the Swiss Army Knife of audio manipulation. I owe all my success with this effort to Jason Navarrete. See his post:
The SoX of Silence

At first I only got output files that were almost the same as the originals. I had to do some trial and error to get the values that I mentioned and now it’s working very well. The files that I have checked have all of the original transmissions although it is very possible that some radio traffic might be dropped at times depending on the thresholds that are used with the “sox” command. You can run “sox” on the command line or use an automated process (i.e. cron script) as I have done.

(Of course you lose the actual time of the radio transmissions when compressing the files but I can live with that for now.)
---------
Compiling darkice with mp3 support: It is my understanding that Debian (on which the Rasp Pi distribution that I used is based) has not included mp3 support with darkice due to the cloudiness of the mp3 license. They took the conservative approach. Other Linux distributions might not need to be recompiled.
----------
I hope this is somewhat helpful. I am pretty much a novice at Linux but I would love to see you use these techniques and will offer any help I can. Keep me posted.

It looks like it will be only a few days until the rewrite of RadioPlay is ready and tested with an option to save full recordings, recordings with dead air removed, both, or neither. I will post it soon.


73 !
 
Status
Not open for further replies.
Top