Re: [LAD] A question about audio file interfaces

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Fons Adriaensen <fons@...>
Cc: Linux Audio Developers <linux-audio-dev@...>
Date: Saturday, November 30, 2013 - 11:07 pm

--001a11c37e30f3bd5204ec6d0295
Content-Type: text/plain; charset=ISO-8859-1

On Sat, Nov 30, 2013 at 5:57 PM, Fons Adriaensen wrote:

> These questions are really directed to Paul Davis (as the

(1) libsndfile has a sort-of-plugin architecture that makes it relatively
easy to add support for new formats
(2) it matters quite a lot whether you plan read-only, write-only or
read-write access. but not that much.
(3) my sense is that as long as you buffer adequately in the application,
and do not use a *stupid* filesystem,
most modern kernels + filesystems will perform well enough without
playing any special games. ie.
just seek, read/write, done.
(4) if you want to optimize performance to the maximum possible, then you
need a lot more about
filesystem behaviour, such as block allocation strategy. i don't
believe that this is particular useful
at this point in time, but i may be underestimating its benefits.
(5) i have (in the past) seen the kernel delay disk i/o by several seconds

ardour uses libsndfile as-is, of course (though tries coreaudio's APIs if
libsndfile doesn't work, on OS X, since that provides access to additional
formats like mp3).

--001a11c37e30f3bd5204ec6d0295
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On Sat, Nov 30, 2013 at 5:57 PM, Fons Adriaensen =
<fons@linuxaudi=
o.org
> wrote:
These questions are really directed to Paul =
Davis (as the
main Ardour dev), Erik de Castro Lopo (libsndfile author),
and anyone with experience in this field.

Imagine a real-time audio processing app reading (or writing)
lots of audio files, possibly evaluating a complex timeline
consisting of many separte pieces. To make things work some
(or a lot of) buffering and lookahead will be necessary.

There are at least three distinct places where this can be
done:

1. the file system(s) and kernel
2. any library used to acess audio files,
3. the application itself.

Of these, only (1) will be aware of any hardware related
issues, and only (3) will be aware of what is expected to
happen in the (near) future. (2) sits somewhere between
the two.

In view of this, what is currently the best way for an
app to read/write audio files, the basic read() and write()
calls, or the stdio interface ?

More specifically, if one would write a library to access
a particular audio file format (not supported, or only
partially by e.g. libsndfile), how 'smart' in terms of
buffering, lookahead etc. should that library be, or not
try to be, in order to perform well with apps like e.g.
Ardour ? What form would the preferred API take ?=
(1) libsndfile has a sort-of-plugin architecture that makes it r=
elatively easy to add support for new formats(2) it matters =
quite a lot whether you plan read-only, write-only or read-write access. bu=
t not that much.
(3) my sense is that as long as you buffer adequately in the app=
lication, and do not use a *stupid* filesystem,=A0=A0=A0=A0=
=A0=A0 most modern kernels + filesystems will perform well enough without p=
laying any special games. ie.
=A0=A0=A0=A0=A0=A0 just seek, read/write, done.(4=
) if you want to optimize performance to the maximum possible, then you nee=
d a lot more about=A0=A0=A0=A0=A0=A0 filesystem behaviour, s=
uch as block allocation strategy. i don't believe that this is particul=
ar useful
=A0=A0=A0=A0=A0=A0 at this point in time, but i may be underesti=
mating its benefits.(5) i have (in the past) seen the kernel=
delay disk i/o by several secondsardour uses=
libsndfile as-is, of course (though tries coreaudio's APIs if libsndfi=
le doesn't work, on OS X, since that provides access to additional form=
ats like mp3).
=A0

--001a11c37e30f3bd5204ec6d0295--

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[LAD] A question about audio file interfaces, Fons Adriaensen, (Sat Nov 30, 10:57 pm)
Re: [LAD] A question about audio file interfaces, Fred Gleason, (Sun Dec 1, 3:42 am)
Re: [LAD] A question about audio file interfaces, Erik de Castro Lopo, (Sun Dec 1, 1:43 am)
Re: [LAD] A question about audio file interfaces, Devin Anderson, (Sun Dec 1, 12:32 am)
Re: [LAD] A question about audio file interfaces, Fons Adriaensen, (Sun Dec 1, 11:48 am)
Re: [LAD] A question about audio file interfaces, Paul Davis, (Sun Dec 1, 2:08 pm)
Re: [LAD] A question about audio file interfaces, Fons Adriaensen, (Sun Dec 1, 4:49 pm)
Re: [LAD] A question about audio file interfaces, Paul Davis, (Sun Dec 1, 4:58 pm)
Re: [LAD] A question about audio file interfaces, Fons Adriaensen, (Sun Dec 1, 6:43 pm)
Re: [LAD] A question about audio file interfaces, Paul Davis, (Sat Nov 30, 11:07 pm)