Re: OT(ish): Strange coding problem (audio related)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 28, 2011 at 3:00 AM, Gabriel M. Beddingfield
<gabrbedd@xxxxxxxxx> wrote:
> Hi James,
>
> You always know how to nerd snipe me!
>
> On Thursday, January 27, 2011 06:35:08 pm James Stone wrote:
>> I have been working on the Neil tracker program recently,
>> and hit a weird bug that seems to affect only my
>> computer! I get a segfault when trying to use fft.h
>
> Not just you. ÂIt segfaults for me, too. ÂUbuntu 10.04 with Core Duo
> processor.
>
> With the patch below (to fft.h) I detect that p2r and p2i overrun the
> buffer when k==11, j==0, i==0. ÂHowever, k was supposed to STOP when
> it reached 11 = log(2048)/log(2).
>
> My guess is that is that the integer k is promoted to a float and the
> comparison is performed. ÂWhen I replace:
>
> Â for (k = 0, le = 2; k < log(fftFrameSize)/log(2.); k++) {
>
> with:
>
> Â long ITERS = log(fftFrameSize)/log(2.0) + 0.5;
> Â for (k = 0, le = 2; k < ITERS; k++) {
>
> ...the code doesn't crash on me. ÂHere's a sample program that
> illustrates what's happening.
>

Wow! Gabriel, thanks for this! :) Excellent and very speedy work!!

James
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@xxxxxxxxxxxxxxxxxxxx
http://lists.linuxaudio.org/listinfo/linux-audio-user



[Index of Archives]     [Linux Sound]     [ALSA Users]     [Pulse Audio]     [ALSA Devel]     [Sox Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux