[linux-audio-dev] snapshot of laaga implementation

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] snapshot of laaga implementation
From: Paul Davis (pbd_AT_Op.Net)
Date: Tue Jun 12 2001 - 08:06:48 EEST


http://www.op.net/~pbd/audioengine-0.0.1.tar.gz

this is snapshot of the current state of things:

     * cmdline engine runs
     * cmdline client runs
     * port registration works
     * process() callback works
     * signalling system works

not done (amongst other things) but mostly conceptualized at code level:

     * port deregistration
     * port inter-connections
     * proper tracking of client existence
     * flow graph sorting
     * multiple port buffer segments (may be necessary)
     * driver-side for engine (e.g. ALSA)
     * timebase stuff (as described today on LAD)
     * in-process support (partially done)
                   
its about 100kB total, including the automake/autoconf system. about
1000 lines of code total. comments/improvements/suggestions welcome.
i have a few myself :)

more tomorrow.

--p

ps. the engine app looks like this:

----------------------------------------------------------------------
#include <stdio.h>
#include "audioengine_internal.h"

int
main (int argc, char *argv[])

{
        audioengine_t *engine;

        if ((engine = audioengine_new (20)) == 0) {
                fprintf (stderr, "cannot create engine\n");
                return 1;
        }

        audioengine_run (engine);
        audioengine_wait (engine);

        return 0;
}

----------------------------------------------------------------------

the do-nothing client is like this:

----------------------------------------------------------------------
#include <stdio.h>
#include "audioengine.h"

audioengine_port_t *my_input_port;
audioengine_port_t *my_output_port;

int
process (nframes_t nframes)

{
// printf ("%d in process(%u)\n", getpid(), nframes);
        return 0;
}

int
bufsize (nframes_t nframes)

{
        printf ("the maximum buffer size is now %u\n", nframes);
        return 0;
}

int
srate (nframes_t nframes)

{
        printf ("the sample rate is now %u/sec\n", nframes);
        return 0;
}

main ()

{
        if (audioengine_open ("myname", process, bufsize, srate) < 0) {
                fprintf (stderr, "audioengine server not running?\n");
                return 1;
        }

        printf ("connected to the audioengine, sample rate = %u, maximum buffer size = %u\n",
                audioengine_get_sample_rate(),
                audioengine_get_buffer_size ());

        my_input_port = audioengine_port_register ("myinput", AUDIOENGINE_DEFAULT_AUDIO_TYPE, PortIsInput, 0);
        my_output_port = audioengine_port_register ("myoutput", AUDIOENGINE_DEFAULT_AUDIO_TYPE, PortIsOutput, 0);
        
        pause ();
}

----------------------------------------------------------------------


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Tue Jun 12 2001 - 09:44:58 EEST