[LAD] [LAU] cancelling I/O with libsndfile

Dan Muresan danmbox at gmail.com
Mon Jul 4 11:58:20 UTC 2011


>> > I never much liked the VIO layer. It was only ever added because
>> > a large number of people requested it. I think its fragile and
>> > it exposes too much of libsndfile internals to the user.

There is one remaining issue that I have discovered while writing
jack-file, and which can only be addressed via a VIO layer of some
sort. While reading a FLAC file, the sndfile request size stream looks
like

8188, 8188, 8188, 8192 etc (bytes)

This is with the user continuously requesting 16384 frames. You will
notice that these are uneven block sizes. If I understand correctly
e.g. the stat(2) page, these are inefficient syscalls:

"The st_blksize field [of a struct stat] gives  the "preferred"
blocksize for efficient file system I/O. (Writing to a file in smaller
chunks may cause an inefficient read-modify-rewrite.)"

Without a VIO layer (or a libsndfile user-space cache), this is not
solvable by the user at higher abstraction layers.


-- Dan



More information about the Linux-audio-dev mailing list