Wavpack, Flac as session format

(Mrskytown11) #1

Will ardour ever support wavpack or flac as a session format.

(Seablade) #2

If someone submits a patch it could. This was discussed years ago as I brought up it could help laptop users with small hard drives primarily working on editing sessions on the road. The end result is it probably wouldn’t be difficult to do, but a patch would need to be submitted.

These days though it is even harder for me to make that argument in support, but I wouldn’t be against it existing personally.

(Mrskytown11) #3

I understand, if I could I would lol. I know it’s not a feature that many desire. But how it works is really amazing. Maybe might be More suitable for devices that have a lot of Cpu cores and limited ram and storage spacw, I wonder how higher sample rates session files would be possible in those types of situations.

(Robin Gareus) #4

Ardour does support FLAC (importing/export since at least 3.0, direct recording to FLAC is possible in git, upcoming 6.x).

Keep in mind that Ardour uses libsndfile for all file-I/O. Support for a given format/codec needs to happen there first.

(Seablade) #5

FLAC is a good choice as IIRC the codec is weighted to be easier on decoding than encoding, so it would be better for editing purposes (Not as good for recording, but honestly if that is a concern you should be recording in WAV anyways).

(Robin Gareus) #6

The main use for allowing FLAC is hour-long podcasts.Cases where you have less than a handful of tracks where some of them are completely silent at given times (e.g. remote participants).

Ardour 6 does allow “wet recording”, so you could add a gate before recording. That can greatly reduce required disk-space for those sessions.

(Mrskytown11) #7

Cool, Mixbus just added flac record session so I assume ardour will get it as well. Ardour 6 is a long way but what we’re the main features coming for ardour 6

(Seablade) #8

Yea, as I recall when I was looking for it I was doing audio for archival recordings of church sessions, so hour+ and lots of silence/low level, so yes it makes good sense there especially.

(Mrskytown11) #9

Question, why would low level matter, does it use less resources when using flac as a session format

(Seablade) #10

The best answer I can give in this forum format is to point you to here:

  • FLAC uses linear prediction to convert the audio samples. There are two steps, the predictor and the error coding. The predictor can be one of four types (Zero, Verbatim, Fixed Linear and Finite Impulse Response[ dubiousdiscuss ] (FIR) Linear). The difference between the predictor and the actual sample data is calculated and is known as the residual. The residual is stored efficiently using Golomb-Rice coding. It also uses run-length encoding for blocks of identical samples, such as silent passages.

emphasis added.

So short version is identical quiet/silent passages can be very efficiently encoded to take up a minimal amount of space.

(Mrskytown11) #11

Oh ok so it’s kinda dynamic in how storage is saved, depending on the information that’s happening in the track. Cool. I’m sure this will make working with higher sample rates more easier on storage

(Robin Gareus) #12

Keep in mind that FLAC needs CPU to encode. Doubling the sample-rate doubles the CPU requirement of handling the data.

There’s no benefit to use a higher sample-rates for I/O and on disk (unless you’re a vendor in need to sell new equipment with larger numbers), actually the opposite is true. Higher-sample-rate may be harmful with analog I/O, at least with standard audio equipment you’ll likely get hear some harmonic distortion with default transducers…

(Mrskytown11) #13

Is 96khz the barrier or 48khz

(Robin Gareus) #14

Most analog audio-equipment is spec’ed for 20Hz… 20kHz. That roughly also matches the human hearing range. So sample-rates of 44.1kHz or 48kHz do suffice for I/O.

A starting point that is not too technical is monty’s xiph article. That also has links for further reading.

(Mrskytown11) #15

I understand, ya I remember that link, I guess i was considering higher rates cause I’ve heard from many it makes mixing fx sound more better and eqs more accurate and pitch correction more better as well, but I’m not sure if it’s all really true, I gues I’ll try for myself, I did do the audio test and I did hear some artifacts from playing back the hi res test file.

(Robin Gareus) #16

I have the same issue here, happens with two different soundcards (Presonus 1818VSL and Focusrite Scarlett 18i6), so it’s likely the monitor speakers (2031A): I do hear a faint 3kHz[?] tone (when playing the 30_and_33.wav).

It’s true that some types of plugins can benefit from higher sample-rate, but those plugins usually oversample internally as needed, independently of the session-rate.

(Mrskytown11) #17

So is it still good to use higher rates but somehow use ways to avoid the issues, I know some say when going back from a high sample rate does improve quality

(Mrskytown11) #18

For the raspberry pi which has about 1 gig or ram, when using flac as a session file in wondering if it will allow to use more tracks in a session. Does it load all the tracks into the ram, or does it stream. Cause if a system only has 1 gig of ram would flac make it any better. I know drive speed is also important. But what’s better

(Robin Gareus) #19

Some also say you should put some chakra pebbles on your output transformers :slight_smile:

(Robin Gareus) #20

Probably not. Disk I/O is rarely a bottleneck. A mono stream 32bit wav is 32 [bit/sample] / 8 [bit/byte] * 48000 [samples/second] = 192000 byte/sec = 187 kBytes/sec – modern Hard-disks orders of magnitude faster, in the 40-400 MB/sec range.

Ardour streams from disk, it read audio in chucks and buffers the raw audio. By default a 5 second buffer, configurable in preferences.

FLAC add some CPU overhead when en/decoding files and the RPi’s CPU power is rather limited.

In any case FLAC is mostly useful for long sessions where some tracks are silent (e.g. the aforementioned hour long podcasts) or perhaps for archiving sharing sessions.