[Stk] peaks in sin wave

Stephen Sinclair sinclair at music.mcgill.ca
Tue Jan 20 09:02:31 PST 2009


Stefanie,

Once in a while an operating system will interrupt processes because
things like disk activity need to take place, or a number of other
things.  Linux is not a "hard real-time" system, so these interrupts
can be expected.  One solution is to try running your app with
"real-time" priority.  You can set the priority to SCHED_FIFO and
hopefully the timing behaviour will be more deterministic.  You need
to run as 'sudo' to get this priority.

Anyways, it's worth a try.  Check the "What to do" section of this
article for info on how to set thread priority:

http://www.linuxdevices.com/articles/AT5997007602.html

Another thing you might try is using JACK instead, and running JACK at
real-time priority.  (Which is as simple as an option in QJackCtl)

Steve


On Tue, Jan 20, 2009 at 10:47 AM,  <steffi at hoxel.org> wrote:
> Hallo,
>
> I have the following problem.
> I record a 50Hz sin wave from an USB soundcard with RtWvIn in a wav
> file. Sometimes I get small peaks in the file, which come not from my
> input wave.
> When the sin has positive gradient the peaks are negative and when the
> sin has negative gradient the peaks are positive.
> For some reason the distance between those peaks equals the "period
> length" or multiple of that. With "period length" I mean the value I
> give to
> RtWvIn :: RtWvIn( unsigned int nChannels, StkFloat sampleRate, int
> device, int          bufferFrames, int nBuffers )
> in the variable "bufferFrames".
> Sometimes my program runs three days without those peaks and then they
> appear for 20 minutes or something.
> On an eee-pc with debian and ALSA version 1.0.16. this peaks appear
> quite often, while I have not seen them on my laptop with debian and
> ALSA version 1.0.12rc1.
>
> Do you have any ideas?
> Thank you, Stefanie Schmidt
>
>
> _______________________________________________
> Stk mailing list
> Stk at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk
>
>
>



More information about the Stk mailing list