Hello, Can someone give me an idea of the memory requirements for using libFLAC? I'm trying to incorporate FLAC support into a player application for the Rio Receiver (see http://rioreceiver.comms.net for details), but I'm having trouble because FLAC__stream_decoder_new() is attempting to allocate 2099828 bytes for an instance of the FLAC__StreamDecoderPrivate struct. Is this accurate, or is there something wrong with my setup? I'm hoping I just have something configured wrong, because this device only has 4 megs of memory and no swap, so allocating 2+ megs isn't going to work so well. Thanks in advance for your help! -Dave
--- Dave Flowerday <davidf@pier13.com> wrote:> Hello, > Can someone give me an idea of the memory requirements for using > libFLAC? > I'm trying to incorporate FLAC support into a player application for > the > Rio Receiver (see http://rioreceiver.comms.net for details), but I'm > having trouble because FLAC__stream_decoder_new() is attempting to > allocate 2099828 bytes for an instance of the > FLAC__StreamDecoderPrivate > struct. Is this accurate, or is there something wrong with my setup? > > I'm hoping I just have something configured wrong, because this > device > only has 4 megs of memory and no swap, so allocating 2+ megs isn't > going > to work so well. Thanks in advance for your help!Something is wrong... in libFLAC. It's a testament to the abundance of memory that this has gone unnoticed for so long. The problem is the size of FLAC__EntropyCodingMethod_PartitionedRice. That structure is too large. Most FLAC streams don't require this much memory so in this case supporting the worst case in overkill. In the worst case the struct is 256k where as the probable case requires only 2k. I will fix this for the next release. Thanks for finding that :) Josh __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com
> I forgot to mention, as a temporary workaround until the next > release, in your development environment you can safely reduce > the requirement by changing the word > 'FLAC__MAX_RICE_PARTITION_ORDER' to '6' in the definition of the > struct FLAC__EntropyCodingMethod_PartitionedRice, in format.h, > if you remember this limitation: it will only support files with > a max partition order of 6. This number corresponds to the value > passed to '-r' in flac. You will notice that 6 is the maximum > used for -r in any of the -0 .. -8 options in flac. Just make > sure you don't release this change anywhere.Thanks for the help. I guess I'll give this another shot tonight.
--- Dave Flowerday <davidf@pier13.com> wrote:> Hello, > Can someone give me an idea of the memory requirements for using > libFLAC? > I'm trying to incorporate FLAC support into a player application for > the > Rio Receiver (see http://rioreceiver.comms.net for details), but I'm > having trouble because FLAC__stream_decoder_new() is attempting to > allocate 2099828 bytes for an instance of the > FLAC__StreamDecoderPrivate > struct. Is this accurate, or is there something wrong with my setup?I forgot to mention, as a temporary workaround until the next release, in your development environment you can safely reduce the requirement by changing the word 'FLAC__MAX_RICE_PARTITION_ORDER' to '6' in the definition of the struct FLAC__EntropyCodingMethod_PartitionedRice, in format.h, if you remember this limitation: it will only support files with a max partition order of 6. This number corresponds to the value passed to '-r' in flac. You will notice that 6 is the maximum used for -r in any of the -0 .. -8 options in flac. Just make sure you don't release this change anywhere. Josh __________________________________________________ Do You Yahoo!? HotJobs - Search Thousands of New Jobs http://www.hotjobs.com