integrate Odin's ALSA experiments into the Lumiera build

requires ALSA as build dependency
note: Debian package is libasound2-dev
This commit is contained in:
Fischlurch 2011-11-22 03:26:43 +01:00
parent d2f83523ca
commit aa1eb2d7fc
4 changed files with 112 additions and 4 deletions

View file

@ -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
]

View file

@ -1,6 +1,27 @@
#include <err.h>
#include <math.h>
#include <stdlib.h>
/*
ALSA - sound output backend using the Advanced Linux Sound Architecture
Copyright (C) Lumiera.org
2011, Odin Omdal Hørthe <odin.omdal@gmail.com>
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 <alsa/asoundlib.h>

54
src/tool/alsa.h Normal file
View file

@ -0,0 +1,54 @@
/*
ALSA.h - sound output backend using the Advanced Linux Sound Architecture
Copyright (C) Lumiera.org
2011, Odin Omdal Hørthe <odin.omdal@gmail.com>
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 <stdlib.h>
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

View file

@ -1,6 +1,32 @@
/*
OutputProbe - tool to investigate external output connections
Copyright (C) Lumiera.org
2011, Odin Omdal Hørthe <odin.omdal@gmail.com>
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 <unistd.h>
#include <stdint.h>
#include "alsa.c"
#include <stdio.h>
#define SAMPLE_RATE 44100