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

From: Johannes Kroll <jkroll@email-addr-hidden>
Date: Fri Jun 18 2010 - 20:10:15 EEST

On Thu, 17 Jun 2010 00:29:44 -0400
Jeremy <jeremybubs@email-addr-hidden> wrote:

> Hi,
>
> When I'm programming, I find it immensely helpful to be able to plot audio
> data at different points in its processing, for debugging, and to test new
> ideas.
>
> Essentially I want an oscilloscope, which plots each chunk of 1024 samples.
>
> I've tried using libplot, but it seems too slow. It's causing constant
> xruns, even when I only plot every 5th sample.
>
> I thought that maybe libplot was too abstract, and that I needed to draw the
> pixels on the screen directly. I tried using SDL, but it caused excessive
> xruns also. Simply setting 48000 pixels per second was enough to cause the
> flow of xruns. This is *not* erasing the screen, just drawing the points.
> I'd expect that erasing the screen is the slow part, but apparently not.

How did you write your SDL program? Don't use any Setpixel functions.
Draw your pixels to a memory buffer/surface with the same pixel format
as the screen and flip that to the screen. Or try OpenGL. Use GL Arrays
if glBegin()/glEnd() is too slow.

The hardware shouldn't be a bottleneck if you don't use a system
older than 10 years or so. If you use OpenGL, you need an accelerated
driver of course, else it's useless.

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

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