Re: Recording specific channels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

[What exactly…]

 

See below.

 

[Space…]

 

The first thing I checked, of course. My laptop: 398G. The machine at school: 980G. We use an external 1T hard drive and never fill it more than 200G just to avoid errors like this. But these recordings often stop after 2 seconds, or 40 seconds. Hardly a storage issue.

 

[How exactly…]

 

We use Logic to record the CAF files. It’s an option in preferences.

 

We restart logic with a macro that very quickly presses space (stop), return (return to beginning), R (start recording). Logic starts a new batch of stereo pair CAF files and we split, then move the older ones.

 

As far as I understand, we could record endless CAF files, but that would be pretty inefficient once they get really large.

 

[How exactly are you splitting… ]

 

I have predefined blocks. Every hour up to 7:30, then 7:30 to 10:00 (concerts). When the script runs it checks the time. Finds the previous block (e.g., if splitting at 8:02, it splits 7 to 8). We use SoX in combination with the start time of the file to precisely cut each hour block (trim). They can then be recombined without losing any material. It’s extremely accurate. They are saved to another hard drive as aif.

 

[Is that a limitation… ]

 

I appreciate the cynicism, but yes, that was the first thing we checked, letting Logic record till it stops, around 13 hours. There are a number of articles if you want to search, but we did try it. I think the limitation is something stupid, like the number of measures it can accommodate.

 

[Limitation to CAF…]

 

From Wikipedia, hundreds of years: “.caf container can contain many different audio formats, metadata tracks, and much more data. Like the RF64, it is not limited to a 4 GB file size and a single .caf file can theoretically save hundreds of years of recorded audio due to its use of 64-bit file offsets.”

 

That’s why we use it rather than AIF or WAV. We would have to split those up every 3 hours and that would create more problematic seams.

 

[How do you record 24/7…]

 

I said 24/7, but we don’t go overnight because there’s no point, but we could. We let Logic run about 10 hours, then reset it using the space, return, R macro. We lose 400ms with that operation, but we have two redundant machines and if there is a concert or a take at that split we go to the other machine (which splits at a different time). But we’ve also found we can edit the 400ms gap.

 

[You would be better off… ]

 

EXACTLY! That’s what I’m trying to do. I’m partway there, but I’m not going to rely on it if it stops after 20 seconds.

 

[0 * * * * $... ]

 

I tried this and the trim didn’t have any affect I could see. It simply recorded and continued recording. (I used trim 10 rather than 3600.) If I could get sox to record 4 stereo files split at the hour and not stop after 20 seconds I’d switch tomorrow. Something like three terminal windows, each with a command:

 

% rec -c 2 1 hall1.aif trim 3600;

 

% rec -c 2 3 hall1.aif trim 3600;

 

% rec -c 2 5 hall1.aif trim 3600;

 

Where the second variable is the starting channel (2 channels starting at 1, then 3, then 5). And the 3600 splits the file at the sample level but also ***starts a new file without killing the old one. I just did a test and was able to do two windows with a recording. That would be ideal. I just don’t know SoX that well.

 

[So why everything all the time… ]

 

Because we don’t know when there will be someone in a room practicing, doing a session (they’ve come to rely on this system), or recording video with a phone then they pull our higher quality audio to sync it. We’ve been doing this for 15 years and it’s revolutionized how students and faculty work. They can get a recording of anything they do anytime. Some students just see an empty room or hall, walk in, play for a half hour and request the recordings. Organists practice at 6am. If they nail a Bach, they have a recording. (Or maybe they just want to listen to how it sounded with the acoustic curtains up or down.) FWIW, we’ve won a few awards. And we NEVER miss a concert. Even if it was changed to a different room or time at the last minute.

 

[Long pause… ]

 

I actually worked with Roni Music and talked them into allowing 10 minutes of silence before shutting off. We also put the threshold at -64 dB. After a few years it was pretty well fine tuned. But as I said, OS X’s crack down made use rethink the whole system (and I spent a few weeks trying to get SoX to work), then moved to Logic, and it works pretty well. It’s been flakey lately, so I’m looking into SoX again. About once a year I look for another method and we’ve even pitched this system for commercialization with the IP people at the school (everyone loves it, they are just used to millions, not hundreds of thousands, which they say it would make).

 

[Is some timestamp… ]

 

No, we just use the creation date and calculate from there. It’s very precise.

 

[Human operator… ]

 

No. But human operators interact with the system daily, checking for quality or errors, or if Logic crashes (about once every 4 months, it sends an email to three engineers if something looks wrong, like a change date longer than 2 seconds on the audio files folder) or we get digital faults from the interfaces running too long (about twice a year, if we forget to restart them about once a month), or sometimes for several hours. For example an important concert we sit and watch monitor it or if we are hired to do a session and they want someone there monitoring the entire time, then they just sit down and monitor the recordings that are already happening. (But also, they may make modifications, like put two mics on the floor and change the inputs for the particular session.) I even have a few faculty who understand the system well enough to go into a hall (a wind quartet this last week), do a screen share to check the recordings and levels, start takes, work for 6 hours, pull the files, go home. Engineer cost: $0. Other schools: $600. Times four days. Us: $0. Other schools: $2400. Just to have someone sit there and watch the flashing lights.

 

[The biggest advantage… starting another]

 

Yes, exactly, but I need it to do 8 stereo pairs to separate files on two Mac Minis but most important, split the files at the sample level, no gaps. I’m not sure command lines can be that precise. Unless there is a split after x minutes. If so, that would solve it. I tried the rec file.aif trim 10, but didn’t work the way I would expect (splitting every 10 seconds, creating a new file).

 

[rec -V5…]

 

Looks like buffer overrun. This stopped after 25 seconds.

 

minion-2-recording:~ minion$ ~/sox/rec -c 8 -b 16 -r 48k /Volumes/CAF3/test.caf

/Users/minion/sox/rec WARN formats: can't set 8 channels; using 18

 

Input File     : 'default' (coreaudio)

Channels       : 18

Sample Rate    : 48000

Precision      : 32-bit

Sample Encoding: 32-bit Signed Integer PCM

 

In:0.00% 00:00:25.69 [00:00:00.00] Out:1.23M [      |      ]        Clip:0    /Users/minion/sox/rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

/Users/minion/sox/rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

/Users/minion/sox/rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

/Users/minion/sox/rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

/Users/minion/sox/rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

/Users/minion/sox/rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

/Users/minion/sox/rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

/Users/minion/sox/rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

/Users/minion/sox/rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

/Users/minion/sox/rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

/Users/minion/sox/rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

/Users/minion/sox/rec WARN coreaudio: coreaudio: unhandled buffer overrun.  Data discarded.

In:0.00% 00:00:25.71 [00:00:00.00] Out:1.23M [      |      ]        Clip:0    

Done.

 

 

5/12/24, 14:02, "Jan Stary" <hans@xxxxxxxx>:

 

On May 12 18:49:57, D.Cottle@xxxxxxxx wrote:
> I pretty much got it to work, but new question: SoX stops on its own. I can’t see any reason. This has happened when recording from the interface to my laptop, from my internal speaker on laptop, and on our Mac Minis at school. After about 30 minutes of recording 8 channels to a single file, it simply stops and returns “done.” Why would this happen?

What exactly is the sox command line?
Is there enough space where you are writing?

> Yes, I split the .CAF files with a script (AppleScript that sends
> a shell script with sox) every hour to aif.

Hwo exactly are you recording the CAF files in the first place?
How are you restarting this CAF recording? Surely you don't record
one endless file.

How exactly are you splitting the caf files to the aif files?

> We then save the .CAF files just in case for a few days.
> Our staff works with the aif files and hardly ever deals with the .CAF.
> The odd limitation is that Logic can only record about 13 hours.
> I don’t know why there is this limitation where CAFs can run for days,
> if I understand correctly.

Is that a limitaion of Logic for sure?
Could that be a limitation of the CAF format?
(BTW, why are you uisng CAF?)

> We reset Logic once every day
> (with scripts, and lose about 400 ms).

How do you records 24/7 then,
if the recording stops after 13 hours?

You would imho be better off recording with sox directly,
putting something like

0 * * * * $PATH/rec -c 8 /some/where/$DATE-HOUR.caf trim 3600

in your crontab and leave the Logic Pro scripting out of it.

> We also record silence but then use sox to analyze the hour blocks
and throw away silent hours. This is slightly inefficient, since there
might only be 3 minutes of usable material in an otherwise silent file.

So why are you recording everything all the time?

> Before Logic we used Audio Companion, which allows you to turn
> the recording on and off based on silence,

sox can do that to.
but then a long pause in a compostion might fool the recording.

> The Logic method allows exact time frames.

Is some timestamp stored in the CAF file?

> It could be that SoX will do everything we need. That’s why I’m investigating it. We know Logic. It gives us meters for every room, with peak indicators, which we can check visually or remotely using screen share.

You mean, there is a human operator overseeing the recording?
What is the point in automatizing the one recording command?

> It has an input monitor so we can listen to each room individually.
> Most important I can pick and choose what input streams it records
> and it outputs individual stereo tracks.

You said you record all the rooms 24/7 ...

> Mostly my staff understands Logic and while SoX might allow similar functionality, I don’t understand it as well, and we know Logic.

The biggest advantage os using sox for this, imho,
is that it's a commandline tool, trivialy scriptable;
recording one hour, saving it in a file appropriately named,
and starting another, is a crontab oneliner.

> rec -c 8 -b 16 -r 48k /Volumes/CAF3/test.caf
> Oddly, it gives me this error:
> rec WARN formats: can't set 8 channels; using 18
> And it reports:
> Input File     : 'default' (coreaudio)
> Channels       : 18
> Sample Rate    : 48000
> Precision      : 32-bit
> Sample Encoding: 32-bit Signed Integer PCM
> Even so, it does record just 8 channels at 16 bit.

I believe the error message means SoX was unable to set the
audio device itself to be providing 8 channels, and is getting
the whole 18 channels instead; but it creates an 8ch file out
of it (using the first 8), as instructed.

In other words, without the -c 8, SoX would be writing 1n 18ch file,
using what it is given.

> I then split it with another terminal window and:
> ~/sox/sox /Volumes/CAF3/test.caf /Volumes/CAF3/test2.aif remix 1 2 trim 0 60

You can put that in your crontab too,
so that this happens after every chunk recording is finished.

> So proof of concept, but: My current issue: why does SoX stop on its own?

No idea. Run it with rec -V5 and post the debug messages.




_______________________________________________
Sox-users mailing list
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users

_______________________________________________
Sox-users mailing list
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users

[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux