Re: [linux-audio-dev] "simple" way to handle multi-GB files :-)

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] "simple" way to handle multi-GB files :-)
From: Benno Senoner (sbenno_AT_gardena.net)
Date: ke helmi  09 2000 - 09:45:29 EST


On Wed, 09 Feb 2000, Paul Barton-Davis wrote:
> >My idea is to:
> >- determine the max filesize usable by the filesystem (2GB in the ext2 case)
> >- handle a large audio "file" in chunks of 2GB.
> >- provide functions to open , read , write to these virtual files, which
> > use mmap() / munmap() , mapping and unmapping only relatively small blocks in
> > memory ( I'd say 0.5-2MB at time) in order to avoid running of out virtual
> >mem.
>
> one problem with mmap() is that its more difficult to control
> read-ahead. but yes, i like this idea. I did implement something
> fairly similar to this called a MappedFile (a C++ object, of course :)
> I gave up when I ran into problems with read-ahead. I still have the
> object around, and I might return to it at some point.

What was the problem of read-ahead exactly ?
Actually mmap() gives me better performance on multitrack HD playback
than regular read().
mmap() could be problematic when reading very small chunks,
in this case read() might win, but we are talking about
multi GB files, and almost certainly the apps which handle these big files
will read fairly large chunks.
Therefore I see no problem using mmap().

>
> >I think that such a lib would be another nice goal for MuCos,
> >since if such a lib existed, programmers would use it.
>
> I don't think it has much to do with MuCoS, but I do agree that people
> would use it. However, if *I* ever implement it in full, I'm afraid it
> will be in C++ ...

:-)
but it will be easy to provide "low-level" C functions and provide a C++ Object
wrapper, so that everyone is happy.
:-)

If you want I could try ho hack together a quick and simple trial API which
allows open,read,write and mmap, so you can tell me if you like the idea.

>
> --p

Benno.


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : pe maalis 10 2000 - 07:23:27 EST