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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
12-10-2008, 07:48 PM
|
#1
|
Member
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449
Rep:
|
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.
|
|
|
12-11-2008, 06:47 AM
|
#2
|
Member
Registered: Mar 2006
Location: boise, id
Distribution: windoz, fedora, archlinux, mandriva, ubuntu, suse
Posts: 65
Rep:
|
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
|
|
|
12-11-2008, 03:48 PM
|
#3
|
Member
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449
Original Poster
Rep:
|
Quote:
Originally Posted by lynnevan
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
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
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
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...
|
|
|
12-11-2008, 09:59 PM
|
#4
|
Member
Registered: Mar 2006
Location: boise, id
Distribution: windoz, fedora, archlinux, mandriva, ubuntu, suse
Posts: 65
Rep:
|
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.
|
|
|
12-11-2008, 10:40 PM
|
#5
|
Member
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449
Original Poster
Rep:
|
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/
|
|
|
12-11-2008, 10:55 PM
|
#6
|
Member
Registered: Oct 2006
Location: Melbourne, Australia
Distribution: ArchLinux, ArchServer, Fedora, CentOS
Posts: 449
Original Poster
Rep:
|
Quote:
Originally Posted by lynnevan
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>"
|
|
|
All times are GMT -5. The time now is 07:52 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|