Hi, i'm using xmms-plugin from flac-0.9, i found following problems. Back-seeking cause, that .flac is not played all. It's caused by StreamDecoderPrivate variable samples_decoded and function stream_decoder_frame_sync_, which compare it against whole length of stream. I don't know what is meaning of this varible (samples decoded from last reset or for whole life of decoder). So i samples_decoded set to 0 in stream_decoder_reset. Against stream_decoder.c 205a206,207> if (decoder->guts) > decoder->guts->samples_decoded = 0;Second problem: Visual plugins are slow. It's caused by flac_ip.add_vis_pcm, it gets too many samples (4.5Ksamples) at one call. Solution is in calling this with only 512samples. Against plugin.c 301,305c301,312 < flac_ip.add_vis_pcm(flac_ip.output->written_time(), file_info_.sample_format, file_info_.channels, bytes, reservoir_); < while(flac_ip.output->buffer_free() < (int)bytes && file_info_.is_playing && file_info_.seek_to_in_sec == -1) < xmms_usleep(10000); < if(file_info_.is_playing && file_info_.seek_to_in_sec == -1) < flac_ip.output->write_audio(reservoir_, bytes); ---> unsigned written_bytes = 0, bytes_ = 512 * ((file_info_.bits_per_sample+7)/8) * file_info_.channels; > > while (written_bytes < bytes) { > if (written_bytes + bytes_ > bytes) > bytes_ = bytes - written_bytes; > flac_ip.add_vis_pcm(flac_ip.output->written_time(), file_info_.sample_format, file_info_.channels, bytes_, reservoir_ + written_bytes); > while(flac_ip.output->buffer_free() < (int)bytes_ && file_info_.is_playing && file_info_.seek_to_in_sec == -1) > xmms_usleep(10000); > if(file_info_.is_playing && file_info_.seek_to_in_sec == -1) > flac_ip.output->write_audio(reservoir_ + written_bytes, bytes_); > written_bytes += bytes_; > }-- Miroslav Lichvar mirator@upcase.inf.upol.cz
On Tue, Apr 17, 2001 at 07:48:07PM -0700, Josh Coalson wrote:> the reason I ask has to do with my next question... is 512 a magic > number or it is just smaller and hence better? because RESERVOIR_TEST > sends 576 samples at a time for performance reasons (it's an integral > multiple of the blocksize).Looks like it's just a magic number. See xmms/plugin.h: void (*add_vis_pcm) (int time, AFormat fmt, int nch, int length, void *p tr); /* Send data to the visualization plugins Preferably 512 samples/block */ -- - mdz
On Tue, Apr 17, 2001 at 07:48:07PM -0700, Josh Coalson wrote:> actually, there are two versions of the playback loop, controlled > by a #define currently. can you try compiling with RESERVOIR_TEST > defined and see if that is better?I'm not sure, but it looks there are some missing underscores in plugin.c in part of #else of #ifndef RESERVOIR_TEST, like reservoir_, decoder_. And macro min is missing. Have you ever compiled it? I've not soundcard here, but tomorrow i can tell you, whether is it better. -- Miroslav Lichvar mirator@upcase.inf.upol.cz
Thanks for the info, feedback below... --- Miroslav Lichvar <mirator@upcase.inf.upol.cz> wrote:> i'm using xmms-plugin from flac-0.9, i found following problems. > > Back-seeking cause, that .flac is not played all. It's caused by > StreamDecoderPrivate variable samples_decoded and function > stream_decoder_frame_sync_, which compare it against whole length of > stream.ok, I made the fix, plus there was another place that variable was being set incorrectly. both fixes are in CVS now.> Second problem: Visual plugins are slow. It's caused by > flac_ip.add_vis_pcm, > it gets too many samples (4.5Ksamples) at one call. Solution is in > calling > this with only 512samples. Against plugin.c >actually, there are two versions of the playback loop, controlled by a #define currently. can you try compiling with RESERVOIR_TEST defined and see if that is better? the reason I ask has to do with my next question... is 512 a magic number or it is just smaller and hence better? because RESERVOIR_TEST sends 576 samples at a time for performance reasons (it's an integral multiple of the blocksize). Josh __________________________________________________ Do You Yahoo!? Yahoo! Auctions - buy the things you want at great prices http://auctions.yahoo.com/
On Tue, Apr 17, 2001 at 07:48:07PM -0700, Josh Coalson wrote:> actually, there are two versions of the playback loop, controlled > by a #define currently. can you try compiling with RESERVOIR_TEST > defined and see if that is better?Yes, it goes pretty well. I think #define RESERVOIR_TEST can be default, when that '_' typos are corrected. -- Miroslav Lichvar mirator@upcase.inf.upol.cz