From aa1eb2d7fc3acda71e9943d63c8ce083bc464bde Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Tue, 22 Nov 2011 03:26:43 +0100 Subject: [PATCH] integrate Odin's ALSA experiments into the Lumiera build requires ALSA as build dependency note: Debian package is libasound2-dev --- src/tool/SConscript | 7 ++++++ src/tool/alsa.c | 27 ++++++++++++++++++++--- src/tool/alsa.h | 54 +++++++++++++++++++++++++++++++++++++++++++++ src/tool/main.c | 28 ++++++++++++++++++++++- 4 files changed, 112 insertions(+), 4 deletions(-) create mode 100644 src/tool/alsa.h diff --git a/src/tool/SConscript b/src/tool/SConscript index 85a858d5e..2d326feea 100644 --- a/src/tool/SConscript +++ b/src/tool/SConscript @@ -10,12 +10,19 @@ envSvg = env.Clone() envSvg.mergeConf(['librsvg-2.0']) envSvg.Append(LIBS=support_lib) +envSnd = env.Clone() +envSnd.mergeConf(['alsa']) + + +outputProbe = envSnd.Program('lumiera-output-probe' + , ['main.c', 'alsa.c'] + core, install=True) ## Odin's ALSA experiments luidgen = env.Program('luidgen', ['luidgen.c'] + support_lib, install=True) ## for generating Lumiera-UIDs rsvg = envSvg.Program('rsvg-convert','rsvg-convert.c') ## for rendering SVG icons (uses librsvg) # build additional test and administrative tools.... tools = [ env.Program('hello-world','hello.c', install=True) #### hello world (checks C build) + + outputProbe #### for output connection tests + luidgen + rsvg ] diff --git a/src/tool/alsa.c b/src/tool/alsa.c index e6c4afbba..d210693dd 100644 --- a/src/tool/alsa.c +++ b/src/tool/alsa.c @@ -1,6 +1,27 @@ -#include -#include -#include +/* + ALSA - sound output backend using the Advanced Linux Sound Architecture + + Copyright (C) Lumiera.org + 2011, Odin Omdal Hørthe + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "alsa.h" #include diff --git a/src/tool/alsa.h b/src/tool/alsa.h new file mode 100644 index 000000000..30fdb75f7 --- /dev/null +++ b/src/tool/alsa.h @@ -0,0 +1,54 @@ +/* + ALSA.h - sound output backend using the Advanced Linux Sound Architecture + + Copyright (C) Lumiera.org + 2011, Odin Omdal Hørthe + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/** @file alsa.h + ** Interfacing to ALSA sound output. + ** + ** @todo for now this header defines some functions used for experimentation with ALSA + ** + ** @see output-slot.hpp + */ + + +#ifndef TOOL_ALSA_H +#define TOOL_ALSA_H + + +#include + + + +size_t audio_offset(); + + +void audio_init(); + + +size_t audio_write(const void* data, size_t amount); + + +void audio_start(unsigned int rate, unsigned int channel_count); + + +void audio_stop(); + +#endif // TOOL_ALSA_H diff --git a/src/tool/main.c b/src/tool/main.c index 4e6b1adc6..e8a684705 100644 --- a/src/tool/main.c +++ b/src/tool/main.c @@ -1,6 +1,32 @@ +/* + OutputProbe - tool to investigate external output connections + + Copyright (C) Lumiera.org + 2011, Odin Omdal Hørthe + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +#include "alsa.h" + #include #include -#include "alsa.c" +#include + #define SAMPLE_RATE 44100