LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-10-2008, 07:48 PM   #1
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Rep: Reputation: 34
Seamless Split Recording


I'm the Communications Officer for my local group of fire brigades - we have a problem at the moment that only our main despatch channel is recorded and archived (in case something goes bad). We also have "fireground" channels that are used locally for operations at a fire, but they're arguably more important to record than the despatch channel.

What I want to do is get a little PC stashed in a corner somewhere, with a line in and big hard drive. Plug in a radio / scanner and record the line input constantly.

1) The files will need to be split for obvious reasons, as well as point 2. I'm not sure how to split the files seamlessly. Ie, stop recording and start a recording to a new file instantly. The gap between the 2 files has to be 0 otherwise knowing my luck, it will be that half a second that didn't get recorded that the whole investigation revolves around. (The "do not" in "do not enter that area" could be lost in half a second on the radio)
2) Given that disk space is a finite resource, and I don't want to have to manually dump files every X period, I want a rolling 24 - 48 hours of audio. Possibly more depending on the available disk space, but minimum 24 - 48 hours. If something 'bad' does happen, then we have 24 - 48 hours to scrape the needed recordings off the box. If the recording are split in to different files every hour (or 30 minutes) then this will be easy to do.

Ideally a command line based solution would be good; Add the command to rc.local so it starts at boot. Have an hourly cronjob that deletes the oldest recordings. Easy!

Any input or ideas would be great. Ultimately I'd investigate putting it all together in to a Carputer (Truckputer?) and mounting in the actual fire trucks as well as at the station.
 
Old 12-11-2008, 06:47 AM   #2
lynnevan
Member
 
Registered: Mar 2006
Location: boise, id
Distribution: windoz, fedora, archlinux, mandriva, ubuntu, suse
Posts: 65

Rep: Reputation: 15
There was a windows prog called cool edit by a company named syntrillium that recorded from the aux in to the hard drive (meant only for music as far as I know, but so what). That company had since died and the program/patent went to Adobe and the same $30 dollar prog now costs around $250 from Adobe.
The reason I bring this up is because I'm about to ask if there's a simular GPF prog. If there is, maybe you can adapt it to yr needs. I don't have the experience to suggest any kind of code.

If you were using windows, I'd say google cool 96. You would be in for a happy surprise I think.

Re the split, I'm not sure I understand. If the despatch channel is already being recorded and archived, leave it. Set up yr other little pc to continuously record the fireground channel and do as you said earlier - cronjob set up to delete whatever necessary as whatever interval - a problem might be stopping it and saving the info if something comes up you'll need later. How is that going to be handled?

And I thing yr going to have to record constantly - anything voice activated WILL have a time lag.

My post will be called "How to rip from aux in"

good luck
 
Old 12-11-2008, 03:48 PM   #3
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by lynnevan View Post
There was a windows prog called cool edit by a company named syntrillium that recorded from the aux in to the hard drive (meant only for music as far as I know, but so what). That company had since died and the program/patent went to Adobe and the same $30 dollar prog now costs around $250 from Adobe.
The reason I bring this up is because I'm about to ask if there's a simular GPF prog. If there is, maybe you can adapt it to yr needs. I don't have the experience to suggest any kind of code.

If you were using windows, I'd say google cool 96. You would be in for a happy surprise I think.
I actually have a copy of Adobe Audition for audio editing - but trying to keep it light-weight and stable, I'd like to do it from Linux command prompt if possible

Quote:
Originally Posted by lynnevan View Post
Re the split, I'm not sure I understand. If the despatch channel is already being recorded and archived, leave it. Set up yr other little pc to continuously record the fireground channel and do as you said earlier
When I say split, I just mean splitting the files, not recoridng multiple radio channels or anything

Quote:
Originally Posted by lynnevan View Post
cronjob set up to delete whatever necessary as whatever interval - a problem might be stopping it and saving the info if something comes up you'll need later. How is that going to be handled?
If the proverbial hits the fan and we need the recordings, we will have 24 - 48 hours (or whatever the rotate timeframe is) to scrape the recordings. There'll be no problem getting that done in time.

Quote:
Originally Posted by lynnevan View Post
And I thing yr going to have to record constantly - anything voice activated WILL have a time lag.
That's the intention - that's why I'm worried about the disk space.

This is what I've come up with so far, which I'll be testing today (if I get time at work!)
Code:
mkfifo /tmp/audio
arecord --format cd --file-type raw > /tmp/audio
while true ; do
   FNAME=`date +%Y%m%d-%a-%H00_%s`
   oggenc /tmp/audio -r -o $FNAME.ogg
   OGGENC_PID=$!
   sleep 3600
   kill $OGGENC_PID
done
Using the fifo buffer means that while oggenc is restarting with a new filename, all the incoming audio is buffered until it's ready again

My problem now is that I need it to cycle the filename on the hour, not 1 hour from when the script was started. (ie, if it starts at 9:20am, then it needs to run until 9:59:59am and then start with the 10:00am file, NOT run until 10:20am before changing files)

If there was a way for the script to catch a SIGUSR1 or similar, and change filenames when it receives that signal, then I could just start the script, and crontab a `kill -SIGUSR1 <PID>` every hour but I'm not sure how to catch a signal in a bash script...

I might start a new thread for that...
 
Old 12-11-2008, 09:59 PM   #4
lynnevan
Member
 
Registered: Mar 2006
Location: boise, id
Distribution: windoz, fedora, archlinux, mandriva, ubuntu, suse
Posts: 65

Rep: Reputation: 15
fukawi2,

Looks like you're way ahead of me. Are you really using "Adobe Audition" in linux?

In any case, I have a program that you might be able to use instead of "sleep 3600".
Quote:
\>> etime

Current EPOCH time is 1229052871
Current REAL time is Thu Dec 11 20:34:31 2008
Trunc Real Time is Dec 11 20:34
If you could write a script that 'greps' current, and then only pays attention to the time, ignoring hours, days, months and years, you might trigger off that xx:59:59 to restart your PID.

That means of course you would need to be running 'etime' once a second. The program is about 7.5k and I use it like this:

Quote:
alias etime='perl /usr/lib/perl5/5.8.8/etime'
If you're interested, let me know.
 
Old 12-11-2008, 10:40 PM   #5
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Original Poster
Rep: Reputation: 34
Thanks lynnevan - I've managed to get around that now by writing it in perl and catching signals (crontab kill -SIGUSR1 every hour, and the perl script changes filenames when it catches that signal)

A different problem is occuring now though... I've started a new thread:
http://www.linuxquestions.org/questi...aviour-689969/
 
Old 12-11-2008, 10:55 PM   #6
fukawi2
Member
 
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449

Original Poster
Rep: Reputation: 34
Quote:
Originally Posted by lynnevan View Post
Looks like you're way ahead of me. Are you really using "Adobe Audition" in linux?
Sorry, nearly missed this!

No, I don't have Audition running in Linux. I have a dedicated Audio editing Windows XP machine that runs it.

It has a static IP address on my network and the first rule in my firewall is "REJECT ALL FROM <insert xp ip address here>"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Seamless proxy authentication using Squid antomac Linux - Server 2 10-30-2015 04:40 PM
Need help with seamless virtualization vinceo03 Ubuntu 1 06-20-2007 10:57 PM
How to split file , .. awk or split ERBRMN Linux - General 9 08-15-2006 12:02 AM
Ubuntu and IBM Notebook:: Seamless Integration barton LinuxQuestions.org Member Success Stories 1 10-01-2005 10:11 PM
Seamless Tile Image Generator Azmeen Linux - Software 0 08-22-2003 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration