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

From: Jeremy <jeremybubs@email-addr-hidden>
Date: Fri Jun 18 2010 - 03:09:43 EEST

On Thu, Jun 17, 2010 at 8:05 PM, Jeremy <jeremybubs@email-addr-hidden> wrote:

>
>
> On Thu, Jun 17, 2010 at 5:06 PM, <fons@email-addr-hidden> 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@email-addr-hidden
>> 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
>

After doing some more experimenting, I realize that SDL does not in fact
cause any xruns if I don't ask it to refresh.

Jeremy

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Fri Jun 18 04:15:02 2010

This archive was generated by hypermail 2.1.8 : Fri Jun 18 2010 - 04:15:03 EEST