[LAD] Real-time plotting of audio/ oscilloscope.

Jeremy jeremybubs at gmail.com
Fri Jun 18 00:05:17 UTC 2010


On Thu, Jun 17, 2010 at 5:06 PM, <fons at kokkinizita.net> wrote:

> On Thu, Jun 17, 2010 at 10:53:31PM +0200, Nick Copeland wrote:
> >
> > How do the other scopes work? If you really want to get a good image of
> > a waveform on a screen then you might want to totally divorce the
> sampling
> > rate from the screen drawing:
>
> Yes. For a soft scope you have two options: a horizontal scale
> caibrated in 'samples' (a pixel corresponds to an integer number
> of samples), or one that maps to time (in ms or us).
>
> > To actually see a waveform and how it develops then you really need the
> scope
> > to sync to it. The way the oscilloscopes worked was a detection level at
> which
> > to start painting (positive edge zero crossing for example but other
> levels are
> > equally acceptable) and a delay time before searching again (blanking
> period,
> > more or less).
>
> In a digital scope finding the sync point requires upsampling by a least
> a factor of four, then you can interpolate linearly. After that, to
> display the actual waveform correctly aligned to the sync point you may
> have to interpolate even to a finer level. It's not at all a simple
> thing.
>
> Ciao,
>
> --
> FA
>
> O tu, che porte, correndo si ?
> E guerra e morte !
> _______________________________________________
> Linux-audio-dev mailing list
> Linux-audio-dev at lists.linuxaudio.org
> http://lists.linuxaudio.org/listinfo/linux-audio-dev
>

I don't need to sync the oscilloscope.  I don't need to interpolate.  I
don't need to get a good image of the waveform.  I just need to draw a few
pixels on the screen.  I had it working fine with libplot, and I would have
been more than happy with how it displayed, except it caused xruns.

I thought that something like SDL was direct memory access.  The pixel
setting method I used only called one SDL function, to map RGB to an
integer.  The rest of it was just some basic arithmetic to figure out where
to point to, and then dereferencing a pointer.

Anyway, is there any library that provides me with an array to write to, and
it handles refreshing the screen?  That way I would essentially just be
writing to an array, which should be really fast inside the realtime loop.
 I thought that is what SDL does, but I guess not.

Jeremy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20100617/425b0070/attachment.html>


More information about the Linux-audio-dev mailing list