diff options
author | Michael Gilbert <mgilbert@debian.org> | 2012-12-16 01:04:52 +0000 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2013-05-03 21:08:44 +0400 |
commit | 76c556de8989df3905e066f13cd91190093402ff (patch) | |
tree | f417353f49aa7ad35745c6cdd6148f1651b0a903 | |
parent | 1058def8e7827e56ce4a70afb4aeacb5dc44148f (diff) | |
download | oss4-76c556de8989df3905e066f13cd91190093402ff.tar.gz |
Imported Debian patch 4.2-build2006-2+deb7u1debian/4.2-build2006-2+deb7u1
81 files changed, 10676 insertions, 0 deletions
diff --git a/debian/30oss4-pm b/debian/30oss4-pm new file mode 100644 index 0000000..3f7d0fd --- /dev/null +++ b/debian/30oss4-pm @@ -0,0 +1,26 @@ +#!/bin/sh +# +# 99oss4-pm: Restart sound on suspend/resumt + +case "$1" in + hibernate|suspend) + # We need to force unload in order + # to quit applications that are using oss4.. + if which invoke-rc.d >/dev/null 2>&1; then + invoke-rc.d oss4-base force-unload + else + /etc/init.d/oss4-base force-unload + fi + ;; + thaw|resume) + if which invoke-rc.d >/dev/null 2>&1; then + invoke-rc.d oss4-base start + else + /etc/init.d/oss4-base start + fi + ;; + *) exit $NA + ;; +esac + + diff --git a/debian/README.Debian b/debian/README.Debian new file mode 100644 index 0000000..5079eae --- /dev/null +++ b/debian/README.Debian @@ -0,0 +1,4 @@ +To compile oss4's modules, you should install the oss4-dkms package, which automate the +module build. + + -- Romain Beauxis <toots@rastageeks.org> Sun, 22 Aug 2010 23:01:02 -0500 diff --git a/debian/alsa.pc.in b/debian/alsa.pc.in new file mode 100644 index 0000000..1511c8f --- /dev/null +++ b/debian/alsa.pc.in @@ -0,0 +1,13 @@ +prefix=/usr +exec_prefix=/usr +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: alsa +Description: Advanced Linux Sound Architecture (ALSA) - Library +Version: 1.0.5 +Requires: +Libs: -L${libdir} -lasound +# -I${includedir}/alsa below is just for backward compatibility +# (it was set so mistakely in the older version) +Cflags: -I${includedir} -I${includedir}/alsa diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..0208ab9 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,211 @@ +oss4 (4.2-build2006-2+deb7u1) testing-proposed-updates; urgency=medium + + * Non-maintainer upload. + * Drop linux-sound-base dependency, break and replace it (closes: #690574) + - Directly include OSS-module-list and ALSA-module-list. + * Use integer arithmetic in vmix (closes: #694631). + + -- Michael Gilbert <mgilbert@debian.org> Sun, 16 Dec 2012 01:04:52 +0000 + +oss4 (4.2-build2006-2) unstable; urgency=low + + * Fix non-Linux builds: generate alsa.pc from the libsalsa build rule. + + -- Samuel Thibault <sthibault@debian.org> Thu, 17 May 2012 18:07:38 +0200 + +oss4 (4.2-build2006-1) unstable; urgency=low + + [ Sebastien NOEL ] + * New upstream release. + * control: Bump Standards-Version to 3.9.3 (no changes). + + [ Samuel Thibault ] + * control: Set liboss4-salsa2 and liboss4-salsa-asound2 mult-arch: same. Set + liboss4-salsa-asound2 architecture: any to build symlink for each arch. + Update my email address. + * alsa.pc: rename to alsa.pc.in + * liboss4-salsa-dev.install: Remove library rules. + * liboss4-salsa-asound2.links: Remove. + * liboss4-salsa2.install: Remove. + * liboss4-salsa-dev.links: Remove + * oss4-base.install: Do not use braces, this is actually not supported. + * rules: Install libraries to multiarch path. Add multiarch path to alsa.pc. + Remove alsa.pc on clean. Put back libOSS.so to private (but multiarched) + directory. + + -- Samuel Thibault <sthibault@debian.org> Mon, 26 Mar 2012 01:05:03 +0200 + +oss4 (4.2-build2005-3) unstable; urgency=low + + * Enable build of liboss4-salsa-dev on !linux only. + + -- Samuel Thibault <sthibault@debian.org> Sat, 18 Feb 2012 13:08:30 +0100 + +oss4 (4.2-build2005-2) unstable; urgency=low + + [ Sebastien NOEL ] + * Merge Samuel Thibault 's changes in debian/rules: do not prepare oss4 + on hurd-any. Should fixes FTBFS on hurd-any. + * Reintroduce an oss4-source package. I realy dislike DKMS. + * Fix oss4-dkms's install failure, thanks to Michel Briand + (closes: #653374). + * Fix compilation on i386, closes: #645537. + + [ Samuel Thibault ] + * debian/control: Make oss4-gtk depend on oss4-base on linux-any only + (closes: #647271). + * debian/rules: Remove debian/oss4-dkms.dkms on clean. + + -- Sebastien NOEL <sebastien@twolife.org> Thu, 29 Dec 2011 21:22:42 +0100 + +oss4 (4.2-build2005-1) unstable; urgency=low + + [ Sebastien NOEL ] + * New upstream release. + * debian/patches/os_cmd: add a new option to ossdetect to choose + the devices nodes' owner (Closes: #632296). + * add debian/patches/gcc-4.6.patch (Closes: #625398). + * add debian/patches/kfreebsd-gnu.patch to build liboss4-salsa2 + and oss4-gtk on GNU/kFreeBSD, thanks to Robert Millan! (Closes: #636631). + * debian/control: stop providing libasound-dev (Closes: #644685). + * debian/create-ma-tree.sh: fix oss4-dkms installation (Closes: #640829). + + -- Sebastien NOEL <sebastien@twolife.org> Sat, 15 Oct 2011 15:22:51 +0200 + +oss4 (4.2-build2004-1) unstable; urgency=low + + [ Samuel Thibault ] + * debian/control: Add liboss4-salsa2, liboss4-salsa-dev and + liboss4-salsa-asound2 packages, equivalent to (and will replace) those from + the oss-libsalsa package (Closes: #589127). + * debian/patches/liboss4-salsa.patch: New patch to rename libsalsa into + liboss4-salsa to avoid conflicts in the archive for no good reason. + * debian/rules: Make in libOSSlib and libsalsa. + * debian/liboss4-salsa-dev.install, debian/liboss4-salsa2.install, + debian/liboss4-salsa-asound2.links, debian/liboss4-salsa-dev.links: + Install liboss4-salsa libraries like was done in the oss-libsalsa package. + * include-alsa: Add a copy of ALSA 1.0.5 headers: Cf ALSA_1.0.* symbols in + libsalsa, this is the roughly supported version. + * debian/copyright: Update for new include-alsa files. + * alsa.pc: New file for compatibility with libasound-dev. + * debian/control: + - Add Vcs-Browser and Vcs-Svn fields. + - Use linux-any instead of the list of Linux archs (Closes: #604679). + - Make dkms dependency linux-any only. + * debian/patches/hurd_iot.patch: New patch to fix soundcard.h usage in + libsalsa on hurd-i386. + * debian/patches/libsalsa_fixes.patch: New patch to fix some printf usages + and ioctl declaration in libsalsa. + * debian/patches/no_EBADE.patch: New patch to cope with hurd-i386 not having + EBADE. + * debian/patches/CFLAGS.patch: New patch to make oss4 take debian/rules + CFLAGS into account. + * debian/patches/snd_asoundlib_version.patch: New patch to add + snd_asoundlib_version(). + * debian/patches/generic_srccconf.patch: New patch to fix source + configuration on unknown archs. + + [ Romain Beauxis ] + * Fixed README.Debian to only mention dkms' modules. + * Switch to dpkg-source 3.0 (quilt) format + * Added DM-Upload-Allowed: yes + + [ Sebastien NOEL ] + * New upstream release (Closes: #595298, #619272). + * Fix typo in initscript (Closes: #627149). + * debian/control: adjust linux-headers dependencies (Closes: #628879). + + -- Romain Beauxis <toots@rastageeks.org> Tue, 14 Jun 2011 10:06:56 -0500 + +oss4 (4.2-build2003-1) unstable; urgency=high + + * New upstream release. + * Removed oss4-source, set oss4-dmks as the + only way to compile the drivers. + * Reload modules in oss4-dmks' postinst when + called with action "configure". + Closes: #558034 + * Added soundon and soundoff script to survive + a suspend/resume cycle. Added Recommends: pm-utils. + Closes: #565709 + * Added explicit dependency on linux-headers to make sure + the modules' build symklink is present. + Closes: #587191 + * Bumped standards-version. + + -- Romain Beauxis <toots@rastageeks.org> Wed, 14 Jul 2010 21:16:03 -0500 + +oss4 (4.2-build2002-3) unstable; urgency=low + + * Switched to dh_dkms. + Closes: #564202 + * Bumped standards-version. + + -- Romain Beauxis <toots@rastageeks.org> Wed, 24 Mar 2010 18:43:54 -0500 + +oss4 (4.2-build2002-2) unstable; urgency=low + + [ Sebastien NOEL ] + * oss4-source: fix debian/rules permissions. Closes: #563692. + + -- Sebastien NOEL <sebastien@twolife.org> Wed, 06 Jan 2010 11:57:19 +0100 + +oss4 (4.2-build2002-1) unstable; urgency=low + + [ Sebastien NOEL ] + * New upstream release. + - drop patches/sharedlib.patch + * #491551 was fixed a long time ago, remove duplicate modprobe.d rules + (Closes: #558407). + + [ Romain Beauxis ] + * Added DKMS modules. + * Do not execute oss4-base init.d script + if the package is not installed. + + -- Romain Beauxis <toots@rastageeks.org> Mon, 07 Dec 2009 14:52:21 -0600 + +oss4 (4.2-build2000-6) unstable; urgency=low + + * Fixed FTBFS on hppa. + + -- Romain Beauxis <toots@rastageeks.org> Sun, 29 Nov 2009 15:57:05 -0600 + +oss4 (4.2-build2000-5) unstable; urgency=low + + * Fixed FTBFS on powerpc and s390. + + -- Romain Beauxis <toots@rastageeks.org> Sun, 29 Nov 2009 09:22:39 -0600 + +oss4 (4.2-build2000-4) unstable; urgency=low + + * Fixed patches against FTBFS, this time for good.. + + -- Romain Beauxis <toots@rastageeks.org> Fri, 27 Nov 2009 19:03:50 -0600 + +oss4 (4.2-build2000-3) unstable; urgency=low + + * Fixed incorrect character in patch. + + -- Romain Beauxis <toots@rastageeks.org> Fri, 27 Nov 2009 02:33:47 -0600 + +oss4 (4.2-build2000-2) unstable; urgency=low + + * Switched patch system to quilt via cdbs. + * Added patch to support sh4 arch, thanks to Nobuhiro Iwamatsu + Closes: #557909 + * Adapted one of the above patch to also fix FTBFS on sparc and mips. + * Added patch to fix FTBFS due to an invalid printf. + Closes: #557866 + * Added README.Debian to explain how to build the kernel modules. + * Removed hurd-i386, kfreebsd-amd64 and kfreebsd-i386 from the + list of target archs. A better solution should be investigated later.. + + -- Romain Beauxis <toots@rastageeks.org> Thu, 26 Nov 2009 23:45:32 -0600 + +oss4 (4.2-build2000-1) unstable; urgency=low + + * Initial release (Closes: #483856) + + -- Sebastien NOEL <sebastien@twolife.org> Tue, 15 Sep 2009 16:41:55 +0200 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..4d446d8 --- /dev/null +++ b/debian/compat @@ -0,0 +1,2 @@ +7 + diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..b986362 --- /dev/null +++ b/debian/control @@ -0,0 +1,103 @@ +Source: oss4 +Section: sound +Priority: optional +Maintainer: Debian OSS4 Maintainers <pkg-oss4-maintainers@lists.alioth.debian.org> +Uploaders: Sebastien NOEL <sebastien@twolife.org>, Romain Beauxis <toots@rastageeks.org>, Samuel Thibault <sthibault@debian.org> +DM-Upload-Allowed: yes +Build-Depends: + debhelper (>= 7), cdbs, gawk, + libgtk2.0-dev, txt2man, quilt, patchutils, + libtool, dkms [linux-any] +Vcs-Browser: http://svn.debian.org/wsvn/pkg-oss4/oss4/ +Vcs-Svn: svn://svn.debian.org/pkg-oss4/oss4/ +Standards-Version: 3.9.3 + +Package: oss4-base +Architecture: linux-any +Depends: ${shlibs:Depends}, ${misc:Depends} +Breaks: linux-sound-base +Replaces: linux-sound-base +Recommends: pm-utils +Suggests: oss4-modules +Description: Open Sound System - base package + Open Sound System (OSS) is an attempt in unifying + the digital audio architecture for UNIX. + . + This package contains various utilities for configuring + and using OSS + . + For OSS to work on a system with a given sound card, there must be + an OSS driver for that card in the kernel. For Linux, + a custom oss4-modules package can be built from the sources + in the oss4-source package using the module-assistant utility. + +Package: oss4-gtk +Architecture: linux-any kfreebsd-any +Depends: oss4-base [linux-any], ${shlibs:Depends}, ${misc:Depends} +Description: Open Sound System - simple GTK2-based mixer control + Open Sound System (OSS) is an attempt in unifying + the digital audio architecture for UNIX. + . + This package contains a GTK2-based mixer control program. + +Package: oss4-dkms +Section: kernel +Architecture: linux-any +Depends: ${misc:Depends}, oss4-base, dkms, linux-headers-686-pae | linux-headers-amd64 | linux-headers-generic | linux-headers +Provides: oss4-modules +Description: Open Sound System - DKMS module sources + This package contains the source for the OSS4 kernel modules, + packaged with approriate configuration for DKMS to build new + modules dynamically. + +Package: oss4-source +Architecture: linux-any +Depends: ${misc:Depends}, make, debhelper, module-assistant +Description: Open Sound System - drivers sources + This package provides the source code for the OSS4 kernel modules, + in a form suitable for use by module-assistant. + +Package: oss4-dev +Architecture: all +Section: devel +Depends: ${misc:Depends} +Description: Open Sound System - development files + This package provides the header for OSS 4.x development. + You need this file if you want to build programs which use + the OSS 4.x API. + +Package: liboss4-salsa2 +Section: libs +Architecture: any +Multi-arch: same +Depends: ${misc:Depends}, ${shlibs:Depends} +Pre-Depends: ${misc:Pre-Depends} +Description: OSS to Alsa compatibility library + Liboss4-salsa is a library providing an ALSA interface on top of OSS. + +Package: liboss4-salsa-dev +Provides: libasound2-dev, liboss-salsa-dev +Conflicts: libasound2-dev, liboss-salsa-dev +Section: libdevel +Architecture: kfreebsd-any hurd-any +Depends: ${misc:Depends}, liboss4-salsa2 (= ${binary:Version}) +Description: OSS to Alsa compatibility library -- development files + Liboss4-salsa is a library providing an ALSA interface on top of OSS. + . + This package contains the development part of liboss4-salsa, which permit + to build application using alsa on architectures which do not have libasound. + +Package: liboss4-salsa-asound2 +Section: libs +Architecture: any +Provides: libasound2 +Conflicts: libasound2 +Multi-arch: same +Depends: ${misc:Depends}, liboss4-salsa2 +Pre-Depends: ${misc:Pre-Depends} +Description: OSS to Alsa compatibility library - binary compatibility symlink + Liboss4-salsa is a library providing an ALSA interface on top of OSS. + . + This package contains a symbolic link that makes applications already compiled + with ALSA use liboss4-salsa. + diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..e6f4f57 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,162 @@ +This package was debianized by Sebastien NOEL <sebastien@twolife.org> on +Sun, 13 Jul 2008 18:52:58 +0200. + +It was downloaded from http://www.4front-tech.com/developer/sources/stable/gpl/ + +Copyright: + +Files in lib/libsalsa/ have the following copyright: + Copyright © 2004 by Hannu Savolainen < hannu@opensound.com> + +The file oss/lib/flashsupport.c has the following copyright: + Copyright © 2006 Adobe Systems Incorporated. + +The file attic/drv/oss_allegro/id.h has copyright: + © 1998-1998 ESS Technology, Inc. + +The files attic/drv/oss_allegro/{allegro_code.h,kernelbn.inc,kernel.h} +have copyright: + Copyright © 1997-1999, ESS Technology, Inc. + +The files in attic/drv/oss_allegro/{hckernel.h,hardware.h,port.h,srcmgr.inc} +have copyright: + Copyright © 1992-2000 Don Kim (don.kim@esstech.com) + +The files in setup/Linux/oss/cuckoo/ have copyright: + Copyright © 2004 Hannu Savolainen (hannu@voimakentta.net). + +The file kernel/drv/oss_ymf7xx/ymf7xx.h has copyright: + Copyright © 4Front Technologies 1996-2008. + Copyright © 1997 Yamaha Corporation. + +The files kernel/drv/oss_sbxfi/{hwaccess.h,20k1reg.h} have copyright: + Copyright © Creative Technology, Ltd., 2007. + +The files tutorials/sndkit/dsp/{recplay.c,help.c} have copyright: + Copyright by Hannu Savolainen 1993-2004 + +The files include-alsa/alsa/*.h include-alsa/alsa/sound/*.h have copyright: + + Copyright (c) + Jaroslav Kysela <perex@suse.cz> + Abramo Bagnara <abramo@alsa-project.org> + Takashi Iwai <tiwai@suse.de> + Uros Bizjak <uros@kss-loka.si> + Thomas Charbonnel (thomas@undata.org) + Hannu Savolainen < hannu@opensound.com> + +Other files have the following copyright: + Copyright © 1996-2009 4Front Technologies + +License: + +The files in lib/libsalsa/ have the following license: + + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 2.1 as + * published by the Free Software Foundation. + +This part of the code is not compiled in the binary packages at the moment. + + +The files in setup/Linux/oss/cuckoo/ have the following license: + + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License. + +This part of the code is not used in the packages at the moment. + + +The file oss/lib/flashsupport.c has the following license: + + Adobe Systems Incorporated(r) Source Code License Agreement + Copyright(c) 2006 Adobe Systems Incorporated. All rights reserved. + + Please read this Source Code License Agreement carefully before using + the source code. + + Adobe Systems Incorporated grants to you a perpetual, worldwide, + non-exclusive, no-charge, royalty-free, irrevocable copyright license, + to reproduce, prepare derivative works of, publicly display, publicly + perform, and distribute this source code and such derivative works in + source or object code form without any attribution requirements. + + The name "Adobe Systems Incorporated" must not be used to endorse or + promote products derived from the source code without prior written + permission. + + You agree to indemnify, hold harmless and defend Adobe Systems + Incorporated from and against any loss, damage, claims or lawsuits, + including attorney's fees that arise or result from your use or + distribution of the source code. + + THIS SOURCE CODE IS PROVIDED "AS IS" AND "WITH ALL FAULTS", WITHOUT ANY + TECHNICAL SUPPORT OR ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT + NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ALSO, THERE IS NO WARRANTY OF + NON-INFRINGEMENT, TITLE OR QUIET ENJOYMENT. IN NO EVENT SHALL MACROMEDIA + OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOURCE CODE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + The Sound detection routines, ESD and PulseAudio backends have + been writen by Jean-Michel Dault <jmdault@revolutionlinux.com and + are Copyright (c) 2006 Revolution Linux inc. All rights reserved. + The code is licenced with the same terms as the rest of the Adobe + code. + +This file is not compiled in the current package. + + +The files tutorials/sndkit/dsp/{recplay.c,help.c} have the following license: + + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. 2. + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + +This part of the code is not compiled in the binary packages at the moment. + + +The files tutorials/sndkit/softsynth/*.c are released in the public domain. + + +The files include-alsa/alsa/*.h include-alsa/alsa/sound/*.h come from ALSA 1.0.5 +and have the following license: + + This library is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation; either version 2.1 of + the License, or (at your option) any later version. + + +All other files are released under GPL v2 license (no other versions). + + +On Debian GNU/Linux systems, the complete text of the GNU General Public +License version 2 can be found in + /usr/share/common-licenses/GPL-2, +the text of the GNU General Public License version 2.1 can be found in + /usr/share/common-licenses/GPL-2.1 + diff --git a/debian/create-ma-tree.sh b/debian/create-ma-tree.sh new file mode 100644 index 0000000..ac9ff56 --- /dev/null +++ b/debian/create-ma-tree.sh @@ -0,0 +1,139 @@ +#!/bin/bash +# Extract OSS4.2 core & drivers modules. +# based on http://www.arklinux.org/~bero/oss2kconfig + +usage() { + [ -z "$1" ] || echo $1 + echo "Usage:" + echo "$0 PATH_TO_NEWDIR PATH_TO_OSS" + exit 1 +} + +[ "$#" != 2 ] && usage +#[ ! -f "$1"/Kbuild ] && usage "$1 does not appear to be a kernel source tree" +[ ! -d "$2"/oss ] && usage "$2 does not appear to be a OSS source tree" + +NEWDIR=`pwd`"/$1" +OSSDIR=`pwd`"/$2" + +mkdir -p $NEWDIR/core $NEWDIR/drivers $NEWDIR/include + +cd $OSSDIR + +# Remove sparc/solaris stuff +rm -rf kernel/drv/osscore +rm -rf kernel/drv/oss_audiocs +rm -rf kernel/drv/oss_sadasupport + +# Move bits into the kernel tree... +cp -L include/soundcard.h "$NEWDIR"/include +cp -L include/oss_userdev_exports.h "$NEWDIR"/include + +cp -L kernel/OS/Linux/*.[ch] "$NEWDIR"/core/ +cp -L kernel/OS/Linux/wrapper/*.[ch] "$NEWDIR"/core/ +cp -L setup/Linux/oss/build/*.inc "$NEWDIR"/drivers/ +cp -L setup/Linux/oss/build/* "$NEWDIR"/core/ +rm "$NEWDIR"/core/*.inc +rm "$NEWDIR"/core/install.sh +cp -rL kernel/framework/include/* "$NEWDIR"/core/ +mv "$NEWDIR"/core/osscore.c "$NEWDIR"/core/oss_core.c + +SOURCES="" +SRCCOUNT=0 +for i in ac97 audio midi midi_stubs mixer osscore remux sndstat uart401 vmix_core; do + i="kernel/framework/$i" + [ -d "$i" ] || continue + NAME="`basename $i`" + pushd "$i" + for j in `ls *.c`; do + SOURCES="$SOURCES $j" + SRCCOUNT=$((SRCCOUNT + 1)) + done + popd + rm -f "$i"/*.man "$i"/Makefile + cp -L "$i"/* "$NEWDIR"/core/ +done +OBJS="os_linux.o `echo $SOURCES |sed -e 's,\.c,.o,g'`" +cat >"$NEWDIR"/core/Makefile <<EOF +MULTIARCH_PATH = /usr/include/\$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) +EXTRA_CFLAGS = -I\$(KBUILD_EXTMOD) -mhard-float -isystem /usr/include -isystem \$(MULTIARCH_PATH) +obj-m += osscore.o +osscore-objs := oss_core.o $OBJS +EOF + +# This is somewhat ugly, but unavoidable -- parts of OSS need those defines and +# access to system includes while osscore.c can't be compiled with them... +for i in $OBJS; do + echo "CFLAGS_$i = -isystem /usr/include -isystem \$(MULTIARCH_PATH) -D_KERNEL" >>"$NEWDIR"/core/Makefile +done + + +cat >"$NEWDIR"/drivers/Makefile <<EOF +osscore_symbols.inc: + echo "static const struct modversion_info ____versions[]" >> osscore_symbols.inc + echo " __attribute__((used))" >> osscore_symbols.inc + echo "__attribute__((section(\"__versions\"))) = {" >> osscore_symbols.inc + sed -e "s:^:{:" -e "s:\t:, \":" -e "s:\t\(.\)*:\"},:" < Module.symvers >> osscore_symbols.inc + echo "};" >> osscore_symbols.inc + +MULTIARCH_PATH = /usr/include/\$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) +EXTRA_CFLAGS=-D_KERNEL -I\$(KBUILD_EXTMOD)/../core -I\$(KBUILD_EXTMOD) -isystem /usr/include -isystem \$(MULTIARCH_PATH) -mhard-float +EOF + +# Merge the drivers... +for i in kernel/drv/*; do + [ -d "$i" ] || continue + NAME="`basename $i`" + DEV="`echo $NAME | tr a-z A-Z`" + pushd $i + SOURCES="" + SRCCOUNT=0 + for j in `ls *.c`; do + if [ "$j" = "$NAME.c" ]; then + mv $j ${NAME}driver.c + SOURCES="$SOURCES ${NAME}driver.c" + else + SOURCES="$SOURCES $j" + fi + SRCCOUNT=$((SRCCOUNT + 1)) + done + popd + if [ -e target/build/"$NAME".c ]; then + cp target/build/"$NAME".c "$NEWDIR"/drivers/${NAME}module.c + SOURCES="$SOURCES ${NAME}module.c" + SRCCOUNT=$((SRCCOUNT + 1)) + fi + + rm -f "$i"/*.man "$i"/Makefile + cp -L "$i"/* "$NEWDIR"/drivers/ + if [ "$SRCCOUNT" = "1" ]; then + echo "obj-m += ${SOURCES/.c/.o}" >>"$NEWDIR"/drivers/Makefile + else + echo "obj-m += $NAME.o" >>"$NEWDIR"/drivers/Makefile + echo "$NAME-objs := `echo $SOURCES |sed -e 's,\.c,.o,g'`" >>"$NEWDIR"/drivers/Makefile + fi +done +rm -rf "$NEWDIR"/drivers/*.o + + +# Main Makefile +#echo 'obj-m += core/ drivers/ ' > "$NEWDIR"/Makefile + +# Adjust OSS files to some changed header file locations +find "$NEWDIR"/ -type f |xargs sed -i -e 's,"soundcard.h","../include/soundcard.h",g;s,../include/internals/,,g;s,"../include/sys/soundcard.h","../include/soundcard.h",g' +find "$NEWDIR"/ -type f |xargs sed -i -e 's,<oss_userdev_exports.h>,"../include/oss_userdev_exports.h",g' +find "$NEWDIR"/ -type f |xargs sed -i -e 's,"oss_exports.h",<ossddk/oss_exports.h>,g' +find "$NEWDIR"/ -type f |xargs sed -i -e 's,"ossddk.h",<ossddk/ossddk.h>,g' +sed -i -e 's,kernel/OS/Linux/wrapper/wrap.h,wrap.h,g' "$NEWDIR"/core/os.h +sed -i -e 's,#include "ubuntu_version_hack.inc",,g' "$NEWDIR"/core/oss_core.c + +# Don't trust OSS_LITTLE_ENDIAN & OSS_BIG_ENDIAN +sed -i -e '/^#define AUDIO_CORE_H/a\#include <endian.h>' "$NEWDIR"/core/audio_core.h +find "$NEWDIR"/ -type f |xargs sed -i -e 's,#ifdef OSS_BIG_ENDIAN,#if __BYTE_ORDER == __BIG_ENDIAN,g' +find "$NEWDIR"/ -type f |xargs sed -i -e 's,#ifndef OSS_BIG_ENDIAN,#if __BYTE_ORDER != __BIG_ENDIAN,g' +find "$NEWDIR"/ -type f |xargs sed -i -e 's,#ifdef OSS_LITTLE_ENDIAN,#if __BYTE_ORDER == __LITTLE_ENDIAN,g' +find "$NEWDIR"/ -type f |xargs sed -i -e 's,#ifndef OSS_LITTLE_ENDIAN,#if __BYTE_ORDER != __LITTLE_ENDIAN,g' + +# OSS4 drivers need to depend on OSS4 core and not OSS3 from the kernel +ln -sf ../core/Module.symvers "$NEWDIR"/drivers/Module.symvers + diff --git a/debian/include-alsa/alsa/alisp.h b/debian/include-alsa/alsa/alisp.h new file mode 100644 index 0000000..4deb4d2 --- /dev/null +++ b/debian/include-alsa/alsa/alisp.h @@ -0,0 +1,55 @@ +/* + * ALSA lisp implementation + * Copyright (c) 2003 by Jaroslav Kysela <perex@suse.cz> + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +struct alisp_cfg { + int verbose: 1, + warning: 1, + debug: 1; + snd_input_t *in; /* program code */ + snd_output_t *out; /* program output */ + snd_output_t *eout; /* error output */ + snd_output_t *vout; /* verbose output */ + snd_output_t *wout; /* warning output */ + snd_output_t *dout; /* debug output */ +}; + +struct alisp_instance; +struct alisp_object; +struct alisp_seq_iterator; + +struct alisp_cfg *alsa_lisp_default_cfg(snd_input_t *input); +void alsa_lisp_default_cfg_free(struct alisp_cfg *cfg); +int alsa_lisp(struct alisp_cfg *cfg, struct alisp_instance **instance); +void alsa_lisp_free(struct alisp_instance *instance); +int alsa_lisp_function(struct alisp_instance *instance, struct alisp_seq_iterator **result, + const char *id, const char *args, ...) +#ifndef DOC_HIDDEN + __attribute__ ((format (printf, 4, 5))) +#endif + ; +void alsa_lisp_result_free(struct alisp_instance *instance, + struct alisp_seq_iterator *result); +int alsa_lisp_seq_first(struct alisp_instance *instance, const char *id, + struct alisp_seq_iterator **seq); +int alsa_lisp_seq_next(struct alisp_seq_iterator **seq); +int alsa_lisp_seq_count(struct alisp_seq_iterator *seq); +int alsa_lisp_seq_integer(struct alisp_seq_iterator *seq, long *val); +int alsa_lisp_seq_pointer(struct alisp_seq_iterator *seq, const char *ptr_id, void **ptr); diff --git a/debian/include-alsa/alsa/asoundef.h b/debian/include-alsa/alsa/asoundef.h new file mode 100644 index 0000000..97991fd --- /dev/null +++ b/debian/include-alsa/alsa/asoundef.h @@ -0,0 +1,252 @@ +/** + * \file <alsa/asoundef.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Definitions of constants for the ALSA driver + */ +/* + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_ASOUNDEF_H +#define __ALSA_ASOUNDEF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup Digital_Audio_Interface Constants for Digital Audio Interfaces + * AES/IEC958 channel status bits. + * \{ + */ + +#define IEC958_AES0_PROFESSIONAL (1<<0) /**< 0 = consumer, 1 = professional */ +#define IEC958_AES0_NONAUDIO (1<<1) /**< 0 = audio, 1 = non-audio */ +#define IEC958_AES0_PRO_EMPHASIS (7<<2) /**< mask - emphasis */ +#define IEC958_AES0_PRO_EMPHASIS_NOTID (0<<2) /**< emphasis not indicated */ +#define IEC958_AES0_PRO_EMPHASIS_NONE (1<<2) /**< no emphasis */ +#define IEC958_AES0_PRO_EMPHASIS_5015 (3<<2) /**< 50/15us emphasis */ +#define IEC958_AES0_PRO_EMPHASIS_CCITT (7<<2) /**< CCITT J.17 emphasis */ +#define IEC958_AES0_PRO_FREQ_UNLOCKED (1<<5) /**< source sample frequency: 0 = locked, 1 = unlocked */ +#define IEC958_AES0_PRO_FS (3<<6) /**< mask - sample frequency */ +#define IEC958_AES0_PRO_FS_NOTID (0<<6) /**< fs not indicated */ +#define IEC958_AES0_PRO_FS_44100 (1<<6) /**< 44.1kHz */ +#define IEC958_AES0_PRO_FS_48000 (2<<6) /**< 48kHz */ +#define IEC958_AES0_PRO_FS_32000 (3<<6) /**< 32kHz */ +#define IEC958_AES0_CON_NOT_COPYRIGHT (1<<2) /**< 0 = copyright, 1 = not copyright */ +#define IEC958_AES0_CON_EMPHASIS (7<<3) /**< mask - emphasis */ +#define IEC958_AES0_CON_EMPHASIS_NONE (0<<3) /**< no emphasis */ +#define IEC958_AES0_CON_EMPHASIS_5015 (1<<3) /**< 50/15us emphasis */ +#define IEC958_AES0_CON_MODE (3<<6) /**< mask - mode */ +#define IEC958_AES1_PRO_MODE (15<<0) /**< mask - channel mode */ +#define IEC958_AES1_PRO_MODE_NOTID (0<<0) /**< mode not indicated */ +#define IEC958_AES1_PRO_MODE_STEREOPHONIC (2<<0) /**< stereophonic - ch A is left */ +#define IEC958_AES1_PRO_MODE_SINGLE (4<<0) /**< single channel */ +#define IEC958_AES1_PRO_MODE_TWO (8<<0) /**< two channels */ +#define IEC958_AES1_PRO_MODE_PRIMARY (12<<0) /**< primary/secondary */ +#define IEC958_AES1_PRO_MODE_BYTE3 (15<<0) /**< vector to byte 3 */ +#define IEC958_AES1_PRO_USERBITS (15<<4) /**< mask - user bits */ +#define IEC958_AES1_PRO_USERBITS_NOTID (0<<4) /**< user bits not indicated */ +#define IEC958_AES1_PRO_USERBITS_192 (8<<4) /**< 192-bit structure */ +#define IEC958_AES1_PRO_USERBITS_UDEF (12<<4) /**< user defined application */ +#define IEC958_AES1_CON_CATEGORY 0x7f /**< consumer category */ +#define IEC958_AES1_CON_GENERAL 0x00 /**< general category */ +#define IEC958_AES1_CON_EXPERIMENTAL 0x40 /**< experimental category */ +#define IEC958_AES1_CON_SOLIDMEM_MASK 0x0f /**< ??? */ +#define IEC958_AES1_CON_SOLIDMEM_ID 0x08 /**< ??? */ +#define IEC958_AES1_CON_BROADCAST1_MASK 0x07 /**< ??? */ +#define IEC958_AES1_CON_BROADCAST1_ID 0x04 /**< ??? */ +#define IEC958_AES1_CON_DIGDIGCONV_MASK 0x07 /**< digital<->digital converter mask */ +#define IEC958_AES1_CON_DIGDIGCONV_ID 0x02 /**< digital<->digital converter id */ +#define IEC958_AES1_CON_ADC_COPYRIGHT_MASK 0x1f /**< ADC Copyright mask */ +#define IEC958_AES1_CON_ADC_COPYRIGHT_ID 0x06 /**< ADC Copyright ID */ +#define IEC958_AES1_CON_ADC_MASK 0x1f /**< ADC Mask */ +#define IEC958_AES1_CON_ADC_ID 0x16 /**< ADC ID */ +#define IEC958_AES1_CON_BROADCAST2_MASK 0x0f /**< Broadcast mask */ +#define IEC958_AES1_CON_BROADCAST2_ID 0x0e /**< Broadcast ID */ +#define IEC958_AES1_CON_LASEROPT_MASK 0x07 /**< Laser-optical mask */ +#define IEC958_AES1_CON_LASEROPT_ID 0x01 /**< Laser-optical ID */ +#define IEC958_AES1_CON_MUSICAL_MASK 0x07 /**< Musical device mask */ +#define IEC958_AES1_CON_MUSICAL_ID 0x05 /**< Musical device ID */ +#define IEC958_AES1_CON_MAGNETIC_MASK 0x07 /**< Magnetic device mask */ +#define IEC958_AES1_CON_MAGNETIC_ID 0x03 /**< Magnetic device ID */ +#define IEC958_AES1_CON_IEC908_CD (IEC958_AES1_CON_LASEROPT_ID|0x00) /**< IEC958 CD compatible device */ +#define IEC958_AES1_CON_NON_IEC908_CD (IEC958_AES1_CON_LASEROPT_ID|0x08) /**< non-IEC958 CD compatible device */ +#define IEC958_AES1_CON_PCM_CODER (IEC958_AES1_CON_DIGDIGCONV_ID|0x00) /**< PCM coder */ +#define IEC958_AES1_CON_SAMPLER (IEC958_AES1_CON_DIGDIGCONV_ID|0x20) /**< PCM sampler */ +#define IEC958_AES1_CON_MIXER (IEC958_AES1_CON_DIGDIGCONV_ID|0x10) /**< Mixer */ +#define IEC958_AES1_CON_RATE_CONVERTER (IEC958_AES1_CON_DIGDIGCONV_ID|0x18) /**< Rate converter */ +#define IEC958_AES1_CON_SYNTHESIZER (IEC958_AES1_CON_MUSICAL_ID|0x00) /**< Synthesizer */ +#define IEC958_AES1_CON_MICROPHONE (IEC958_AES1_CON_MUSICAL_ID|0x08) /**< Microphone */ +#define IEC958_AES1_CON_DAT (IEC958_AES1_CON_MAGNETIC_ID|0x00) /**< Digital Audio Tape */ +#define IEC958_AES1_CON_VCR (IEC958_AES1_CON_MAGNETIC_ID|0x08) /**< Video recorder */ +#define IEC958_AES1_CON_ORIGINAL (1<<7) /**< this bits depends on the category code */ +#define IEC958_AES2_PRO_SBITS (7<<0) /**< mask - sample bits */ +#define IEC958_AES2_PRO_SBITS_20 (2<<0) /**< 20-bit - coordination */ +#define IEC958_AES2_PRO_SBITS_24 (4<<0) /**< 24-bit - main audio */ +#define IEC958_AES2_PRO_SBITS_UDEF (6<<0) /**< user defined application */ +#define IEC958_AES2_PRO_WORDLEN (7<<3) /**< mask - source word length */ +#define IEC958_AES2_PRO_WORDLEN_NOTID (0<<3) /**< source word length not indicated */ +#define IEC958_AES2_PRO_WORDLEN_22_18 (2<<3) /**< 22-bit or 18-bit */ +#define IEC958_AES2_PRO_WORDLEN_23_19 (4<<3) /**< 23-bit or 19-bit */ +#define IEC958_AES2_PRO_WORDLEN_24_20 (5<<3) /**< 24-bit or 20-bit */ +#define IEC958_AES2_PRO_WORDLEN_20_16 (6<<3) /**< 20-bit or 16-bit */ +#define IEC958_AES2_CON_SOURCE (15<<0) /**< mask - source number */ +#define IEC958_AES2_CON_SOURCE_UNSPEC (0<<0) /**< source number unspecified */ +#define IEC958_AES2_CON_CHANNEL (15<<4) /**< mask - channel number */ +#define IEC958_AES2_CON_CHANNEL_UNSPEC (0<<4) /**< channel number unspecified */ +#define IEC958_AES3_CON_FS (15<<0) /**< mask - sample frequency */ +#define IEC958_AES3_CON_FS_44100 (0<<0) /**< 44.1kHz */ +#define IEC958_AES3_CON_FS_48000 (2<<0) /**< 48kHz */ +#define IEC958_AES3_CON_FS_32000 (3<<0) /**< 32kHz */ +#define IEC958_AES3_CON_CLOCK (3<<4) /**< mask - clock accuracy */ +#define IEC958_AES3_CON_CLOCK_1000PPM (0<<4) /**< 1000 ppm */ +#define IEC958_AES3_CON_CLOCK_50PPM (1<<4) /**< 50 ppm */ +#define IEC958_AES3_CON_CLOCK_VARIABLE (2<<4) /**< variable pitch */ + +/** \} */ + +/** + * \defgroup MIDI_Interface Constants for MIDI v1.0 + * Constants for MIDI v1.0. + * \{ + */ + +#define MIDI_CHANNELS 16 /**< Number of channels per port/cable. */ +#define MIDI_GM_DRUM_CHANNEL (10-1) /**< Channel number for GM drums. */ + +/** + * \defgroup MIDI_Commands MIDI Commands + * MIDI command codes. + * \{ + */ + +#define MIDI_CMD_NOTE_OFF 0x80 /**< note off */ +#define MIDI_CMD_NOTE_ON 0x90 /**< note on */ +#define MIDI_CMD_NOTE_PRESSURE 0xa0 /**< key pressure */ +#define MIDI_CMD_CONTROL 0xb0 /**< control change */ +#define MIDI_CMD_PGM_CHANGE 0xc0 /**< program change */ +#define MIDI_CMD_CHANNEL_PRESSURE 0xd0 /**< channel pressure */ +#define MIDI_CMD_BENDER 0xe0 /**< pitch bender */ + +#define MIDI_CMD_COMMON_SYSEX 0xf0 /**< sysex (system exclusive) begin */ +#define MIDI_CMD_COMMON_MTC_QUARTER 0xf1 /**< MTC quarter frame */ +#define MIDI_CMD_COMMON_SONG_POS 0xf2 /**< song position */ +#define MIDI_CMD_COMMON_SONG_SELECT 0xf3 /**< song select */ +#define MIDI_CMD_COMMON_TUNE_REQUEST 0xf6 /**< tune request */ +#define MIDI_CMD_COMMON_SYSEX_END 0xf7 /**< end of sysex */ +#define MIDI_CMD_COMMON_CLOCK 0xf8 /**< clock */ +#define MIDI_CMD_COMMON_START 0xfa /**< start */ +#define MIDI_CMD_COMMON_CONTINUE 0xfb /**< continue */ +#define MIDI_CMD_COMMON_STOP 0xfc /**< stop */ +#define MIDI_CMD_COMMON_SENSING 0xfe /**< active sensing */ +#define MIDI_CMD_COMMON_RESET 0xff /**< reset */ + +/** \} */ + +/** + * \defgroup MIDI_Controllers MIDI Controllers + * MIDI controller numbers. + * \{ + */ + +#define MIDI_CTL_MSB_BANK 0x00 /**< Bank selection */ +#define MIDI_CTL_MSB_MODWHEEL 0x01 /**< Modulation */ +#define MIDI_CTL_MSB_BREATH 0x02 /**< Breath */ +#define MIDI_CTL_MSB_FOOT 0x04 /**< Foot */ +#define MIDI_CTL_MSB_PORTAMENTO_TIME 0x05 /**< Portamento time */ +#define MIDI_CTL_MSB_DATA_ENTRY 0x06 /**< Data entry */ +#define MIDI_CTL_MSB_MAIN_VOLUME 0x07 /**< Main volume */ +#define MIDI_CTL_MSB_BALANCE 0x08 /**< Balance */ +#define MIDI_CTL_MSB_PAN 0x0a /**< Panpot */ +#define MIDI_CTL_MSB_EXPRESSION 0x0b /**< Expression */ +#define MIDI_CTL_MSB_EFFECT1 0x0c /**< Effect1 */ +#define MIDI_CTL_MSB_EFFECT2 0x0d /**< Effect2 */ +#define MIDI_CTL_MSB_GENERAL_PURPOSE1 0x10 /**< General purpose 1 */ +#define MIDI_CTL_MSB_GENERAL_PURPOSE2 0x11 /**< General purpose 2 */ +#define MIDI_CTL_MSB_GENERAL_PURPOSE3 0x12 /**< General purpose 3 */ +#define MIDI_CTL_MSB_GENERAL_PURPOSE4 0x13 /**< General purpose 4 */ +#define MIDI_CTL_LSB_BANK 0x20 /**< Bank selection */ +#define MIDI_CTL_LSB_MODWHEEL 0x21 /**< Modulation */ +#define MIDI_CTL_LSB_BREATH 0x22 /**< Breath */ +#define MIDI_CTL_LSB_FOOT 0x24 /**< Foot */ +#define MIDI_CTL_LSB_PORTAMENTO_TIME 0x25 /**< Portamento time */ +#define MIDI_CTL_LSB_DATA_ENTRY 0x26 /**< Data entry */ +#define MIDI_CTL_LSB_MAIN_VOLUME 0x27 /**< Main volume */ +#define MIDI_CTL_LSB_BALANCE 0x28 /**< Balance */ +#define MIDI_CTL_LSB_PAN 0x2a /**< Panpot */ +#define MIDI_CTL_LSB_EXPRESSION 0x2b /**< Expression */ +#define MIDI_CTL_LSB_EFFECT1 0x2c /**< Effect1 */ +#define MIDI_CTL_LSB_EFFECT2 0x2d /**< Effect2 */ +#define MIDI_CTL_LSB_GENERAL_PURPOSE1 0x30 /**< General purpose 1 */ +#define MIDI_CTL_LSB_GENERAL_PURPOSE2 0x31 /**< General purpose 2 */ +#define MIDI_CTL_LSB_GENERAL_PURPOSE3 0x32 /**< General purpose 3 */ +#define MIDI_CTL_LSB_GENERAL_PURPOSE4 0x33 /**< General purpose 4 */ +#define MIDI_CTL_SUSTAIN 0x40 /**< Sustain pedal */ +#define MIDI_CTL_PORTAMENTO 0x41 /**< Portamento */ +#define MIDI_CTL_SUSTENUTO 0x42 /**< Sostenuto */ +#define MIDI_CTL_SOFT_PEDAL 0x43 /**< Soft pedal */ +#define MIDI_CTL_LEGATO_FOOTSWITCH 0x44 /**< Legato foot switch */ +#define MIDI_CTL_HOLD2 0x45 /**< Hold2 */ +#define MIDI_CTL_SC1_SOUND_VARIATION 0x46 /**< SC1 Sound Variation */ +#define MIDI_CTL_SC2_TIMBRE 0x47 /**< SC2 Timbre */ +#define MIDI_CTL_SC3_RELEASE_TIME 0x48 /**< SC3 Release Time */ +#define MIDI_CTL_SC4_ATTACK_TIME 0x49 /**< SC4 Attack Time */ +#define MIDI_CTL_SC5_BRIGHTNESS 0x4a /**< SC5 Brightness */ +#define MIDI_CTL_SC6 0x4b /**< SC6 */ +#define MIDI_CTL_SC7 0x4c /**< SC7 */ +#define MIDI_CTL_SC8 0x4d /**< SC8 */ +#define MIDI_CTL_SC9 0x4e /**< SC9 */ +#define MIDI_CTL_SC10 0x4f /**< SC10 */ +#define MIDI_CTL_GENERAL_PURPOSE5 0x50 /**< General purpose 5 */ +#define MIDI_CTL_GENERAL_PURPOSE6 0x51 /**< General purpose 6 */ +#define MIDI_CTL_GENERAL_PURPOSE7 0x52 /**< General purpose 7 */ +#define MIDI_CTL_GENERAL_PURPOSE8 0x53 /**< General purpose 8 */ +#define MIDI_CTL_PORTAMENTO_CONTROL 0x54 /**< Portamento control */ +#define MIDI_CTL_E1_REVERB_DEPTH 0x5b /**< E1 Reverb Depth */ +#define MIDI_CTL_E2_TREMOLO_DEPTH 0x5c /**< E2 Tremolo Depth */ +#define MIDI_CTL_E3_CHORUS_DEPTH 0x5d /**< E3 Chorus Depth */ +#define MIDI_CTL_E4_DETUNE_DEPTH 0x5e /**< E4 Detune Depth */ +#define MIDI_CTL_E5_PHASER_DEPTH 0x5f /**< E5 Phaser Depth */ +#define MIDI_CTL_DATA_INCREMENT 0x60 /**< Data Increment */ +#define MIDI_CTL_DATA_DECREMENT 0x61 /**< Data Decrement */ +#define MIDI_CTL_NONREG_PARM_NUM_LSB 0x62 /**< Non-registered parameter number */ +#define MIDI_CTL_NONREG_PARM_NUM_MSB 0x63 /**< Non-registered parameter number */ +#define MIDI_CTL_REGIST_PARM_NUM_LSB 0x64 /**< Registered parameter number */ +#define MIDI_CTL_REGIST_PARM_NUM_MSB 0x65 /**< Registered parameter number */ +#define MIDI_CTL_ALL_SOUNDS_OFF 0x78 /**< All sounds off */ +#define MIDI_CTL_RESET_CONTROLLERS 0x79 /**< Reset Controllers */ +#define MIDI_CTL_LOCAL_CONTROL_SWITCH 0x7a /**< Local control switch */ +#define MIDI_CTL_ALL_NOTES_OFF 0x7b /**< All notes off */ +#define MIDI_CTL_OMNI_OFF 0x7c /**< Omni off */ +#define MIDI_CTL_OMNI_ON 0x7d /**< Omni on */ +#define MIDI_CTL_MONO1 0x7e /**< Mono1 */ +#define MIDI_CTL_MONO2 0x7f /**< Mono2 */ + +/** \} */ + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_ASOUNDEF_H */ diff --git a/debian/include-alsa/alsa/asoundlib.h b/debian/include-alsa/alsa/asoundlib.h new file mode 100644 index 0000000..10a545b --- /dev/null +++ b/debian/include-alsa/alsa/asoundlib.h @@ -0,0 +1,62 @@ +/** + * \file <alsa/asoundlib.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ASOUNDLIB_H +#define __ASOUNDLIB_H + +#include <unistd.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <fcntl.h> +#include <assert.h> +#include <endian.h> +#include <sys/poll.h> +#include <errno.h> +#include <stdarg.h> + +#include <alsa/asoundef.h> +#include <alsa/version.h> +#include <alsa/global.h> +#include <alsa/input.h> +#include <alsa/output.h> +#include <alsa/error.h> +#include <alsa/conf.h> +#include <alsa/pcm.h> +#include <alsa/rawmidi.h> +#include <alsa/timer.h> +#include <alsa/hwdep.h> +#include <alsa/control.h> +#include <alsa/mixer.h> +#include <alsa/seq_event.h> +#include <alsa/seq.h> +#include <alsa/seqmid.h> +#include <alsa/seq_midi_event.h> +#include <alsa/conv.h> +#include <alsa/instr.h> + +#endif /* __ASOUNDLIB_H */ diff --git a/debian/include-alsa/alsa/conf.h b/debian/include-alsa/alsa/conf.h new file mode 100644 index 0000000..e55385e --- /dev/null +++ b/debian/include-alsa/alsa/conf.h @@ -0,0 +1,180 @@ +/** + * \file <alsa/conf.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + */ +/* + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_CONF_H +#define __ALSA_CONF_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup Config Configuration Interface + * The configuration functions and types allow you to read, enumerate, + * modify and write the contents of ALSA configuration files. + * \{ + */ + +/** \brief \c dlsym version for the config evaluate callback. */ +#define SND_CONFIG_DLSYM_VERSION_EVALUATE _dlsym_config_evaluate_001 +/** \brief \c dlsym version for the config hook callback. */ +#define SND_CONFIG_DLSYM_VERSION_HOOK _dlsym_config_hook_001 + +/** Configuration node type. */ +typedef enum _snd_config_type { + /** Integer number. */ + SND_CONFIG_TYPE_INTEGER, + /** 64 bit Integer number. */ + SND_CONFIG_TYPE_INTEGER64, + /** Real number. */ + SND_CONFIG_TYPE_REAL, + /** Character string. */ + SND_CONFIG_TYPE_STRING, + /** Pointer (runtime only, cannot be saved). */ + SND_CONFIG_TYPE_POINTER, + /** Compound node. */ + SND_CONFIG_TYPE_COMPOUND = 1024 +} snd_config_type_t; + +/** + * \brief Internal structure for a configuration node object. + * + * The ALSA library uses a pointer to this structure as a handle to a + * configuration node. Applications don't access its contents directly. + */ +typedef struct _snd_config snd_config_t; +/** + * \brief Type for a configuration compound iterator. + * + * The ALSA library uses this pointer type as a handle to a configuration + * compound iterator. Applications don't directly access the contents of + * the structure pointed to by this type. + */ +typedef struct _snd_config_iterator *snd_config_iterator_t; +/** + * \brief Internal structure for a configuration private update object. + * + * The ALSA library uses this structure to save private update information. + */ +typedef struct _snd_config_update snd_config_update_t; + +extern snd_config_t *snd_config; + +int snd_config_top(snd_config_t **config); + +int snd_config_load(snd_config_t *config, snd_input_t *in); +int snd_config_load_override(snd_config_t *config, snd_input_t *in); +int snd_config_save(snd_config_t *config, snd_output_t *out); +int snd_config_update(void); +int snd_config_update_r(snd_config_t **top, snd_config_update_t **update, const char *path); +int snd_config_update_free(snd_config_update_t *update); +int snd_config_update_free_global(void); + +int snd_config_search(snd_config_t *config, const char *key, + snd_config_t **result); +int snd_config_searchv(snd_config_t *config, + snd_config_t **result, ...); +int snd_config_search_definition(snd_config_t *config, + const char *base, const char *key, + snd_config_t **result); + +int snd_config_expand(snd_config_t *config, snd_config_t *root, + const char *args, snd_config_t *private_data, + snd_config_t **result); +int snd_config_evaluate(snd_config_t *config, snd_config_t *root, + snd_config_t *private_data, snd_config_t **result); + +int snd_config_add(snd_config_t *config, snd_config_t *leaf); +int snd_config_delete(snd_config_t *config); +int snd_config_delete_compound_members(const snd_config_t *config); +int snd_config_copy(snd_config_t **dst, snd_config_t *src); + +int snd_config_make(snd_config_t **config, const char *key, + snd_config_type_t type); +int snd_config_make_integer(snd_config_t **config, const char *key); +int snd_config_make_integer64(snd_config_t **config, const char *key); +int snd_config_make_real(snd_config_t **config, const char *key); +int snd_config_make_string(snd_config_t **config, const char *key); +int snd_config_make_pointer(snd_config_t **config, const char *key); +int snd_config_make_compound(snd_config_t **config, const char *key, int join); + +int snd_config_imake_integer(snd_config_t **config, const char *key, const long value); +int snd_config_imake_integer64(snd_config_t **config, const char *key, const long long value); +int snd_config_imake_real(snd_config_t **config, const char *key, const double value); +int snd_config_imake_string(snd_config_t **config, const char *key, const char *ascii); +int snd_config_imake_pointer(snd_config_t **config, const char *key, const void *ptr); + +snd_config_type_t snd_config_get_type(const snd_config_t *config); + +int snd_config_set_id(snd_config_t *config, const char *id); +int snd_config_set_integer(snd_config_t *config, long value); +int snd_config_set_integer64(snd_config_t *config, long long value); +int snd_config_set_real(snd_config_t *config, double value); +int snd_config_set_string(snd_config_t *config, const char *value); +int snd_config_set_ascii(snd_config_t *config, const char *ascii); +int snd_config_set_pointer(snd_config_t *config, const void *ptr); +int snd_config_get_id(const snd_config_t *config, const char **value); +int snd_config_get_integer(const snd_config_t *config, long *value); +int snd_config_get_integer64(const snd_config_t *config, long long *value); +int snd_config_get_real(const snd_config_t *config, double *value); +int snd_config_get_ireal(const snd_config_t *config, double *value); +int snd_config_get_string(const snd_config_t *config, const char **value); +int snd_config_get_ascii(const snd_config_t *config, char **value); +int snd_config_get_pointer(const snd_config_t *config, const void **value); +int snd_config_test_id(const snd_config_t *config, const char *id); + +snd_config_iterator_t snd_config_iterator_first(const snd_config_t *node); +snd_config_iterator_t snd_config_iterator_next(const snd_config_iterator_t iterator); +snd_config_iterator_t snd_config_iterator_end(const snd_config_t *node); +snd_config_t *snd_config_iterator_entry(const snd_config_iterator_t iterator); + +/** + * \brief Helper macro to iterate over the children of a compound node. + * \param pos Iterator variable for the current node. + * \param next Iterator variable for the next node. + * \param node Handle to the compound configuration node to iterate over. + * + * This macro is designed to permit the removal of the current node. + */ +#define snd_config_for_each(pos, next, node) \ + for (pos = snd_config_iterator_first(node), next = snd_config_iterator_next(pos); pos != snd_config_iterator_end(node); pos = next, next = snd_config_iterator_next(pos)) + +/* Misc functions */ + +int snd_config_get_bool_ascii(const char *ascii); +int snd_config_get_bool(const snd_config_t *conf); +int snd_config_get_ctl_iface_ascii(const char *ascii); +int snd_config_get_ctl_iface(const snd_config_t *conf); + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_CONF_H */ + diff --git a/debian/include-alsa/alsa/control.h b/debian/include-alsa/alsa/control.h new file mode 100644 index 0000000..73c10b3 --- /dev/null +++ b/debian/include-alsa/alsa/control.h @@ -0,0 +1,516 @@ +/** + * \file <alsa/control.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_CONTROL_H +#define __ALSA_CONTROL_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup Control Control Interface + * The control interface. + * See \ref control page for more details. + * \{ + */ + +/** dlsym version for interface entry callback */ +#define SND_CONTROL_DLSYM_VERSION _dlsym_control_001 + +/** IEC958 structure */ +typedef struct snd_aes_iec958 { + unsigned char status[24]; /**< AES/IEC958 channel status bits */ + unsigned char subcode[147]; /**< AES/IEC958 subcode bits */ + unsigned char pad; /**< nothing */ + unsigned char dig_subframe[4]; /**< AES/IEC958 subframe bits */ +} snd_aes_iec958_t; + +/** CTL card info container */ +typedef struct _snd_ctl_card_info snd_ctl_card_info_t; + +/** CTL element identifier container */ +typedef struct _snd_ctl_elem_id snd_ctl_elem_id_t; + +/** CTL element identifier list container */ +typedef struct _snd_ctl_elem_list snd_ctl_elem_list_t; + +/** CTL element info container */ +typedef struct _snd_ctl_elem_info snd_ctl_elem_info_t; + +/** CTL element value container */ +typedef struct _snd_ctl_elem_value snd_ctl_elem_value_t; + +/** CTL event container */ +typedef struct _snd_ctl_event snd_ctl_event_t; + +/** CTL element type */ +typedef enum _snd_ctl_elem_type { + /** Invalid type */ + SND_CTL_ELEM_TYPE_NONE = 0, + /** Boolean contents */ + SND_CTL_ELEM_TYPE_BOOLEAN, + /** Integer contents */ + SND_CTL_ELEM_TYPE_INTEGER, + /** Enumerated contents */ + SND_CTL_ELEM_TYPE_ENUMERATED, + /** Bytes contents */ + SND_CTL_ELEM_TYPE_BYTES, + /** IEC958 (S/PDIF) setting content */ + SND_CTL_ELEM_TYPE_IEC958, + /** 64-bit integer contents */ + SND_CTL_ELEM_TYPE_INTEGER64, + SND_CTL_ELEM_TYPE_LAST = SND_CTL_ELEM_TYPE_INTEGER64 +} snd_ctl_elem_type_t; + +/** CTL related interface */ +typedef enum _snd_ctl_elem_iface { + /** Card level */ + SND_CTL_ELEM_IFACE_CARD = 0, + /** Hardware dependent device */ + SND_CTL_ELEM_IFACE_HWDEP, + /** Mixer */ + SND_CTL_ELEM_IFACE_MIXER, + /** PCM */ + SND_CTL_ELEM_IFACE_PCM, + /** RawMidi */ + SND_CTL_ELEM_IFACE_RAWMIDI, + /** Timer */ + SND_CTL_ELEM_IFACE_TIMER, + /** Sequencer */ + SND_CTL_ELEM_IFACE_SEQUENCER, + SND_CTL_ELEM_IFACE_LAST = SND_CTL_ELEM_IFACE_SEQUENCER +} snd_ctl_elem_iface_t; + +/** Event class */ +typedef enum _snd_ctl_event_type { + /** Elements related event */ + SND_CTL_EVENT_ELEM = 0, + SND_CTL_EVENT_LAST = SND_CTL_EVENT_ELEM +}snd_ctl_event_type_t; + +/** Element has been removed (Warning: test this first and if set don't + * test the other masks) \hideinitializer */ +#define SND_CTL_EVENT_MASK_REMOVE (~0U) +/** Element value has been changed \hideinitializer */ +#define SND_CTL_EVENT_MASK_VALUE (1<<0) +/** Element info has been changed \hideinitializer */ +#define SND_CTL_EVENT_MASK_INFO (1<<1) +/** Element has been added \hideinitializer */ +#define SND_CTL_EVENT_MASK_ADD (1<<2) + +/** CTL name helper */ +#define SND_CTL_NAME_NONE "" +/** CTL name helper */ +#define SND_CTL_NAME_PLAYBACK "Playback " +/** CTL name helper */ +#define SND_CTL_NAME_CAPTURE "Capture " + +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_NONE "" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_SWITCH "Switch" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_VOLUME "Volume" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_DEFAULT "Default" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_MASK "Mask" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_CON_MASK "Con Mask" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_PRO_MASK "Pro Mask" +/** CTL name helper */ +#define SND_CTL_NAME_IEC958_PCM_STREAM "PCM Stream" +/** Element name for IEC958 (S/PDIF) */ +#define SND_CTL_NAME_IEC958(expl,direction,what) "IEC958 " expl SND_CTL_NAME_##direction SND_CTL_NAME_IEC958_##what + +/** Mask for the major Power State identifier */ +#define SND_CTL_POWER_MASK 0xff00 +/** ACPI/PCI Power State D0 */ +#define SND_CTL_POWER_D0 0x0000 +/** ACPI/PCI Power State D1 */ +#define SND_CTL_POWER_D1 0x0100 +/** ACPI/PCI Power State D2 */ +#define SND_CTL_POWER_D2 0x0200 +/** ACPI/PCI Power State D3 */ +#define SND_CTL_POWER_D3 0x0300 +/** ACPI/PCI Power State D3hot */ +#define SND_CTL_POWER_D3hot (SND_CTL_POWER_D3|0x0000) +/** ACPI/PCI Power State D3cold */ +#define SND_CTL_POWER_D3cold (SND_CTL_POWER_D3|0x0001) + +/** CTL type */ +typedef enum _snd_ctl_type { + /** Kernel level CTL */ + SND_CTL_TYPE_HW, + /** Shared memory client CTL */ + SND_CTL_TYPE_SHM, + /** INET client CTL (not yet implemented) */ + SND_CTL_TYPE_INET +} snd_ctl_type_t; + +/** Non blocking mode (flag for open mode) \hideinitializer */ +#define SND_CTL_NONBLOCK 0x0001 + +/** Async notification (flag for open mode) \hideinitializer */ +#define SND_CTL_ASYNC 0x0002 + +/** Read only (flag for open mode) \hideinitializer */ +#define SND_CTL_READONLY 0x0004 + +/** CTL handle */ +typedef struct _snd_ctl snd_ctl_t; + +/** Don't destroy the ctl handle when close */ +#define SND_SCTL_NOFREE 0x0001 + +/** SCTL type */ +typedef struct _snd_sctl snd_sctl_t; + +int snd_card_load(int card); +int snd_card_next(int *card); +int snd_card_get_index(const char *name); +int snd_card_get_name(int card, char **name); +int snd_card_get_longname(int card, char **name); + +int snd_ctl_open(snd_ctl_t **ctl, const char *name, int mode); +int snd_ctl_open_lconf(snd_ctl_t **ctl, const char *name, int mode, snd_config_t *lconf); +int snd_ctl_close(snd_ctl_t *ctl); +int snd_ctl_nonblock(snd_ctl_t *ctl, int nonblock); +int snd_async_add_ctl_handler(snd_async_handler_t **handler, snd_ctl_t *ctl, + snd_async_callback_t callback, void *private_data); +snd_ctl_t *snd_async_handler_get_ctl(snd_async_handler_t *handler); +int snd_ctl_poll_descriptors_count(snd_ctl_t *ctl); +int snd_ctl_poll_descriptors(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int space); +int snd_ctl_poll_descriptors_revents(snd_ctl_t *ctl, struct pollfd *pfds, unsigned int nfds, unsigned short *revents); +int snd_ctl_subscribe_events(snd_ctl_t *ctl, int subscribe); +int snd_ctl_card_info(snd_ctl_t *ctl, snd_ctl_card_info_t *info); +int snd_ctl_elem_list(snd_ctl_t *ctl, snd_ctl_elem_list_t * list); +int snd_ctl_elem_info(snd_ctl_t *ctl, snd_ctl_elem_info_t *info); +int snd_ctl_elem_read(snd_ctl_t *ctl, snd_ctl_elem_value_t *value); +int snd_ctl_elem_write(snd_ctl_t *ctl, snd_ctl_elem_value_t *value); +int snd_ctl_elem_lock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id); +int snd_ctl_elem_unlock(snd_ctl_t *ctl, snd_ctl_elem_id_t *id); +int snd_ctl_hwdep_next_device(snd_ctl_t *ctl, int * device); +int snd_ctl_hwdep_info(snd_ctl_t *ctl, snd_hwdep_info_t * info); +int snd_ctl_pcm_next_device(snd_ctl_t *ctl, int *device); +int snd_ctl_pcm_info(snd_ctl_t *ctl, snd_pcm_info_t * info); +int snd_ctl_pcm_prefer_subdevice(snd_ctl_t *ctl, int subdev); +int snd_ctl_rawmidi_next_device(snd_ctl_t *ctl, int * device); +int snd_ctl_rawmidi_info(snd_ctl_t *ctl, snd_rawmidi_info_t * info); +int snd_ctl_rawmidi_prefer_subdevice(snd_ctl_t *ctl, int subdev); +int snd_ctl_set_power_state(snd_ctl_t *ctl, unsigned int state); +int snd_ctl_get_power_state(snd_ctl_t *ctl, unsigned int *state); + +int snd_ctl_read(snd_ctl_t *ctl, snd_ctl_event_t *event); +int snd_ctl_wait(snd_ctl_t *ctl, int timeout); +const char *snd_ctl_name(snd_ctl_t *ctl); +snd_ctl_type_t snd_ctl_type(snd_ctl_t *ctl); + +const char *snd_ctl_elem_type_name(snd_ctl_elem_type_t type); +const char *snd_ctl_elem_iface_name(snd_ctl_elem_iface_t iface); +const char *snd_ctl_event_type_name(snd_ctl_event_type_t type); + +unsigned int snd_ctl_event_elem_get_mask(const snd_ctl_event_t *obj); +unsigned int snd_ctl_event_elem_get_numid(const snd_ctl_event_t *obj); +void snd_ctl_event_elem_get_id(const snd_ctl_event_t *obj, snd_ctl_elem_id_t *ptr); +snd_ctl_elem_iface_t snd_ctl_event_elem_get_interface(const snd_ctl_event_t *obj); +unsigned int snd_ctl_event_elem_get_device(const snd_ctl_event_t *obj); +unsigned int snd_ctl_event_elem_get_subdevice(const snd_ctl_event_t *obj); +const char *snd_ctl_event_elem_get_name(const snd_ctl_event_t *obj); +unsigned int snd_ctl_event_elem_get_index(const snd_ctl_event_t *obj); + +int snd_ctl_elem_list_alloc_space(snd_ctl_elem_list_t *obj, unsigned int entries); +void snd_ctl_elem_list_free_space(snd_ctl_elem_list_t *obj); + +size_t snd_ctl_elem_id_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_ctl_elem_id_t using standard alloca + * \param ptr returned pointer + */ +#define snd_ctl_elem_id_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_elem_id_t *) alloca(snd_ctl_elem_id_sizeof()); memset(*ptr, 0, snd_ctl_elem_id_sizeof()); } while (0) +int snd_ctl_elem_id_malloc(snd_ctl_elem_id_t **ptr); +void snd_ctl_elem_id_free(snd_ctl_elem_id_t *obj); +void snd_ctl_elem_id_clear(snd_ctl_elem_id_t *obj); +void snd_ctl_elem_id_copy(snd_ctl_elem_id_t *dst, const snd_ctl_elem_id_t *src); +unsigned int snd_ctl_elem_id_get_numid(const snd_ctl_elem_id_t *obj); +snd_ctl_elem_iface_t snd_ctl_elem_id_get_interface(const snd_ctl_elem_id_t *obj); +unsigned int snd_ctl_elem_id_get_device(const snd_ctl_elem_id_t *obj); +unsigned int snd_ctl_elem_id_get_subdevice(const snd_ctl_elem_id_t *obj); +const char *snd_ctl_elem_id_get_name(const snd_ctl_elem_id_t *obj); +unsigned int snd_ctl_elem_id_get_index(const snd_ctl_elem_id_t *obj); +void snd_ctl_elem_id_set_numid(snd_ctl_elem_id_t *obj, unsigned int val); +void snd_ctl_elem_id_set_interface(snd_ctl_elem_id_t *obj, snd_ctl_elem_iface_t val); +void snd_ctl_elem_id_set_device(snd_ctl_elem_id_t *obj, unsigned int val); +void snd_ctl_elem_id_set_subdevice(snd_ctl_elem_id_t *obj, unsigned int val); +void snd_ctl_elem_id_set_name(snd_ctl_elem_id_t *obj, const char *val); +void snd_ctl_elem_id_set_index(snd_ctl_elem_id_t *obj, unsigned int val); + +size_t snd_ctl_card_info_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_ctl_card_info_t using standard alloca + * \param ptr returned pointer + */ +#define snd_ctl_card_info_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_card_info_t *) alloca(snd_ctl_card_info_sizeof()); memset(*ptr, 0, snd_ctl_card_info_sizeof()); } while (0) +int snd_ctl_card_info_malloc(snd_ctl_card_info_t **ptr); +void snd_ctl_card_info_free(snd_ctl_card_info_t *obj); +void snd_ctl_card_info_clear(snd_ctl_card_info_t *obj); +void snd_ctl_card_info_copy(snd_ctl_card_info_t *dst, const snd_ctl_card_info_t *src); +int snd_ctl_card_info_get_card(const snd_ctl_card_info_t *obj); +const char *snd_ctl_card_info_get_id(const snd_ctl_card_info_t *obj); +const char *snd_ctl_card_info_get_driver(const snd_ctl_card_info_t *obj); +const char *snd_ctl_card_info_get_name(const snd_ctl_card_info_t *obj); +const char *snd_ctl_card_info_get_longname(const snd_ctl_card_info_t *obj); +const char *snd_ctl_card_info_get_mixername(const snd_ctl_card_info_t *obj); +const char *snd_ctl_card_info_get_components(const snd_ctl_card_info_t *obj); + +size_t snd_ctl_event_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_ctl_event_t using standard alloca + * \param ptr returned pointer + */ +#define snd_ctl_event_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_event_t *) alloca(snd_ctl_event_sizeof()); memset(*ptr, 0, snd_ctl_event_sizeof()); } while (0) +int snd_ctl_event_malloc(snd_ctl_event_t **ptr); +void snd_ctl_event_free(snd_ctl_event_t *obj); +void snd_ctl_event_clear(snd_ctl_event_t *obj); +void snd_ctl_event_copy(snd_ctl_event_t *dst, const snd_ctl_event_t *src); +snd_ctl_event_type_t snd_ctl_event_get_type(const snd_ctl_event_t *obj); + +size_t snd_ctl_elem_list_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_ctl_elem_list_t using standard alloca + * \param ptr returned pointer + */ +#define snd_ctl_elem_list_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_elem_list_t *) alloca(snd_ctl_elem_list_sizeof()); memset(*ptr, 0, snd_ctl_elem_list_sizeof()); } while (0) +int snd_ctl_elem_list_malloc(snd_ctl_elem_list_t **ptr); +void snd_ctl_elem_list_free(snd_ctl_elem_list_t *obj); +void snd_ctl_elem_list_clear(snd_ctl_elem_list_t *obj); +void snd_ctl_elem_list_copy(snd_ctl_elem_list_t *dst, const snd_ctl_elem_list_t *src); +void snd_ctl_elem_list_set_offset(snd_ctl_elem_list_t *obj, unsigned int val); +unsigned int snd_ctl_elem_list_get_used(const snd_ctl_elem_list_t *obj); +unsigned int snd_ctl_elem_list_get_count(const snd_ctl_elem_list_t *obj); +void snd_ctl_elem_list_get_id(const snd_ctl_elem_list_t *obj, unsigned int idx, snd_ctl_elem_id_t *ptr); +unsigned int snd_ctl_elem_list_get_numid(const snd_ctl_elem_list_t *obj, unsigned int idx); +snd_ctl_elem_iface_t snd_ctl_elem_list_get_interface(const snd_ctl_elem_list_t *obj, unsigned int idx); +unsigned int snd_ctl_elem_list_get_device(const snd_ctl_elem_list_t *obj, unsigned int idx); +unsigned int snd_ctl_elem_list_get_subdevice(const snd_ctl_elem_list_t *obj, unsigned int idx); +const char *snd_ctl_elem_list_get_name(const snd_ctl_elem_list_t *obj, unsigned int idx); +unsigned int snd_ctl_elem_list_get_index(const snd_ctl_elem_list_t *obj, unsigned int idx); + +size_t snd_ctl_elem_info_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_ctl_elem_info_t using standard alloca + * \param ptr returned pointer + */ +#define snd_ctl_elem_info_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_elem_info_t *) alloca(snd_ctl_elem_info_sizeof()); memset(*ptr, 0, snd_ctl_elem_info_sizeof()); } while (0) +int snd_ctl_elem_info_malloc(snd_ctl_elem_info_t **ptr); +void snd_ctl_elem_info_free(snd_ctl_elem_info_t *obj); +void snd_ctl_elem_info_clear(snd_ctl_elem_info_t *obj); +void snd_ctl_elem_info_copy(snd_ctl_elem_info_t *dst, const snd_ctl_elem_info_t *src); +snd_ctl_elem_type_t snd_ctl_elem_info_get_type(const snd_ctl_elem_info_t *obj); +int snd_ctl_elem_info_is_readable(const snd_ctl_elem_info_t *obj); +int snd_ctl_elem_info_is_writable(const snd_ctl_elem_info_t *obj); +int snd_ctl_elem_info_is_volatile(const snd_ctl_elem_info_t *obj); +int snd_ctl_elem_info_is_inactive(const snd_ctl_elem_info_t *obj); +int snd_ctl_elem_info_is_locked(const snd_ctl_elem_info_t *obj); +int snd_ctl_elem_info_is_owner(const snd_ctl_elem_info_t *obj); +pid_t snd_ctl_elem_info_get_owner(const snd_ctl_elem_info_t *obj); +unsigned int snd_ctl_elem_info_get_count(const snd_ctl_elem_info_t *obj); +long snd_ctl_elem_info_get_min(const snd_ctl_elem_info_t *obj); +long snd_ctl_elem_info_get_max(const snd_ctl_elem_info_t *obj); +long snd_ctl_elem_info_get_step(const snd_ctl_elem_info_t *obj); +long long snd_ctl_elem_info_get_min64(const snd_ctl_elem_info_t *obj); +long long snd_ctl_elem_info_get_max64(const snd_ctl_elem_info_t *obj); +long long snd_ctl_elem_info_get_step64(const snd_ctl_elem_info_t *obj); +unsigned int snd_ctl_elem_info_get_items(const snd_ctl_elem_info_t *obj); +void snd_ctl_elem_info_set_item(snd_ctl_elem_info_t *obj, unsigned int val); +const char *snd_ctl_elem_info_get_item_name(const snd_ctl_elem_info_t *obj); +int snd_ctl_elem_info_get_dimensions(const snd_ctl_elem_info_t *obj); +int snd_ctl_elem_info_get_dimension(const snd_ctl_elem_info_t *obj, unsigned int idx); +void snd_ctl_elem_info_get_id(const snd_ctl_elem_info_t *obj, snd_ctl_elem_id_t *ptr); +unsigned int snd_ctl_elem_info_get_numid(const snd_ctl_elem_info_t *obj); +snd_ctl_elem_iface_t snd_ctl_elem_info_get_interface(const snd_ctl_elem_info_t *obj); +unsigned int snd_ctl_elem_info_get_device(const snd_ctl_elem_info_t *obj); +unsigned int snd_ctl_elem_info_get_subdevice(const snd_ctl_elem_info_t *obj); +const char *snd_ctl_elem_info_get_name(const snd_ctl_elem_info_t *obj); +unsigned int snd_ctl_elem_info_get_index(const snd_ctl_elem_info_t *obj); +void snd_ctl_elem_info_set_id(snd_ctl_elem_info_t *obj, const snd_ctl_elem_id_t *ptr); +void snd_ctl_elem_info_set_numid(snd_ctl_elem_info_t *obj, unsigned int val); +void snd_ctl_elem_info_set_interface(snd_ctl_elem_info_t *obj, snd_ctl_elem_iface_t val); +void snd_ctl_elem_info_set_device(snd_ctl_elem_info_t *obj, unsigned int val); +void snd_ctl_elem_info_set_subdevice(snd_ctl_elem_info_t *obj, unsigned int val); +void snd_ctl_elem_info_set_name(snd_ctl_elem_info_t *obj, const char *val); +void snd_ctl_elem_info_set_index(snd_ctl_elem_info_t *obj, unsigned int val); + +size_t snd_ctl_elem_value_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_ctl_elem_value_t using standard alloca + * \param ptr returned pointer + */ +#define snd_ctl_elem_value_alloca(ptr) do { assert(ptr); *ptr = (snd_ctl_elem_value_t *) alloca(snd_ctl_elem_value_sizeof()); memset(*ptr, 0, snd_ctl_elem_value_sizeof()); } while (0) +int snd_ctl_elem_value_malloc(snd_ctl_elem_value_t **ptr); +void snd_ctl_elem_value_free(snd_ctl_elem_value_t *obj); +void snd_ctl_elem_value_clear(snd_ctl_elem_value_t *obj); +void snd_ctl_elem_value_copy(snd_ctl_elem_value_t *dst, const snd_ctl_elem_value_t *src); +void snd_ctl_elem_value_get_id(const snd_ctl_elem_value_t *obj, snd_ctl_elem_id_t *ptr); +unsigned int snd_ctl_elem_value_get_numid(const snd_ctl_elem_value_t *obj); +snd_ctl_elem_iface_t snd_ctl_elem_value_get_interface(const snd_ctl_elem_value_t *obj); +unsigned int snd_ctl_elem_value_get_device(const snd_ctl_elem_value_t *obj); +unsigned int snd_ctl_elem_value_get_subdevice(const snd_ctl_elem_value_t *obj); +const char *snd_ctl_elem_value_get_name(const snd_ctl_elem_value_t *obj); +unsigned int snd_ctl_elem_value_get_index(const snd_ctl_elem_value_t *obj); +void snd_ctl_elem_value_set_id(snd_ctl_elem_value_t *obj, const snd_ctl_elem_id_t *ptr); +void snd_ctl_elem_value_set_numid(snd_ctl_elem_value_t *obj, unsigned int val); +void snd_ctl_elem_value_set_interface(snd_ctl_elem_value_t *obj, snd_ctl_elem_iface_t val); +void snd_ctl_elem_value_set_device(snd_ctl_elem_value_t *obj, unsigned int val); +void snd_ctl_elem_value_set_subdevice(snd_ctl_elem_value_t *obj, unsigned int val); +void snd_ctl_elem_value_set_name(snd_ctl_elem_value_t *obj, const char *val); +void snd_ctl_elem_value_set_index(snd_ctl_elem_value_t *obj, unsigned int val); +int snd_ctl_elem_value_get_boolean(const snd_ctl_elem_value_t *obj, unsigned int idx); +long snd_ctl_elem_value_get_integer(const snd_ctl_elem_value_t *obj, unsigned int idx); +long long snd_ctl_elem_value_get_integer64(const snd_ctl_elem_value_t *obj, unsigned int idx); +unsigned int snd_ctl_elem_value_get_enumerated(const snd_ctl_elem_value_t *obj, unsigned int idx); +unsigned char snd_ctl_elem_value_get_byte(const snd_ctl_elem_value_t *obj, unsigned int idx); +void snd_ctl_elem_value_set_boolean(snd_ctl_elem_value_t *obj, unsigned int idx, long val); +void snd_ctl_elem_value_set_integer(snd_ctl_elem_value_t *obj, unsigned int idx, long val); +void snd_ctl_elem_value_set_integer64(snd_ctl_elem_value_t *obj, unsigned int idx, long long val); +void snd_ctl_elem_value_set_enumerated(snd_ctl_elem_value_t *obj, unsigned int idx, unsigned int val); +void snd_ctl_elem_value_set_byte(snd_ctl_elem_value_t *obj, unsigned int idx, unsigned char val); +void snd_ctl_elem_set_bytes(snd_ctl_elem_value_t *obj, void *data, size_t size); +const void * snd_ctl_elem_value_get_bytes(const snd_ctl_elem_value_t *obj); +void snd_ctl_elem_value_get_iec958(const snd_ctl_elem_value_t *obj, snd_aes_iec958_t *ptr); +void snd_ctl_elem_value_set_iec958(snd_ctl_elem_value_t *obj, const snd_aes_iec958_t *ptr); + +/** + * \defgroup HControl High level Control Interface + * \ingroup Control + * The high level control interface. + * See \ref hcontrol page for more details. + * \{ + */ + +/** HCTL element handle */ +typedef struct _snd_hctl_elem snd_hctl_elem_t; + +/** HCTL handle */ +typedef struct _snd_hctl snd_hctl_t; + +/** + * \brief Compare function for sorting HCTL elements + * \param e1 First element + * \param e2 Second element + * \return -1 if e1 < e2, 0 if e1 == e2, 1 if e1 > e2 + */ +typedef int (*snd_hctl_compare_t)(const snd_hctl_elem_t *e1, + const snd_hctl_elem_t *e2); +int snd_hctl_compare_fast(const snd_hctl_elem_t *c1, + const snd_hctl_elem_t *c2); +/** + * \brief HCTL callback function + * \param hctl HCTL handle + * \param mask event mask + * \param elem related HCTL element (if any) + * \return 0 on success otherwise a negative error code + */ +typedef int (*snd_hctl_callback_t)(snd_hctl_t *hctl, + unsigned int mask, + snd_hctl_elem_t *elem); +/** + * \brief HCTL element callback function + * \param elem HCTL element + * \param mask event mask + * \return 0 on success otherwise a negative error code + */ +typedef int (*snd_hctl_elem_callback_t)(snd_hctl_elem_t *elem, + unsigned int mask); + +int snd_hctl_open(snd_hctl_t **hctl, const char *name, int mode); +int snd_hctl_open_ctl(snd_hctl_t **hctlp, snd_ctl_t *ctl); +int snd_hctl_close(snd_hctl_t *hctl); +int snd_hctl_nonblock(snd_hctl_t *hctl, int nonblock); +int snd_hctl_poll_descriptors_count(snd_hctl_t *hctl); +int snd_hctl_poll_descriptors(snd_hctl_t *hctl, struct pollfd *pfds, unsigned int space); +int snd_hctl_poll_descriptors_revents(snd_hctl_t *ctl, struct pollfd *pfds, unsigned int nfds, unsigned short *revents); +unsigned int snd_hctl_get_count(snd_hctl_t *hctl); +int snd_hctl_set_compare(snd_hctl_t *hctl, snd_hctl_compare_t hsort); +snd_hctl_elem_t *snd_hctl_first_elem(snd_hctl_t *hctl); +snd_hctl_elem_t *snd_hctl_last_elem(snd_hctl_t *hctl); +snd_hctl_elem_t *snd_hctl_find_elem(snd_hctl_t *hctl, const snd_ctl_elem_id_t *id); +void snd_hctl_set_callback(snd_hctl_t *hctl, snd_hctl_callback_t callback); +void snd_hctl_set_callback_private(snd_hctl_t *hctl, void *data); +void *snd_hctl_get_callback_private(snd_hctl_t *hctl); +int snd_hctl_load(snd_hctl_t *hctl); +int snd_hctl_free(snd_hctl_t *hctl); +int snd_hctl_handle_events(snd_hctl_t *hctl); +const char *snd_hctl_name(snd_hctl_t *hctl); +int snd_hctl_wait(snd_hctl_t *hctl, int timeout); +snd_ctl_t *snd_hctl_ctl(snd_hctl_t *hctl); + +snd_hctl_elem_t *snd_hctl_elem_next(snd_hctl_elem_t *elem); +snd_hctl_elem_t *snd_hctl_elem_prev(snd_hctl_elem_t *elem); +int snd_hctl_elem_info(snd_hctl_elem_t *elem, snd_ctl_elem_info_t * info); +int snd_hctl_elem_read(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value); +int snd_hctl_elem_write(snd_hctl_elem_t *elem, snd_ctl_elem_value_t * value); + +snd_hctl_t *snd_hctl_elem_get_hctl(snd_hctl_elem_t *elem); + +void snd_hctl_elem_get_id(const snd_hctl_elem_t *obj, snd_ctl_elem_id_t *ptr); +unsigned int snd_hctl_elem_get_numid(const snd_hctl_elem_t *obj); +snd_ctl_elem_iface_t snd_hctl_elem_get_interface(const snd_hctl_elem_t *obj); +unsigned int snd_hctl_elem_get_device(const snd_hctl_elem_t *obj); +unsigned int snd_hctl_elem_get_subdevice(const snd_hctl_elem_t *obj); +const char *snd_hctl_elem_get_name(const snd_hctl_elem_t *obj); +unsigned int snd_hctl_elem_get_index(const snd_hctl_elem_t *obj); +void snd_hctl_elem_set_callback(snd_hctl_elem_t *obj, snd_hctl_elem_callback_t val); +void * snd_hctl_elem_get_callback_private(const snd_hctl_elem_t *obj); +void snd_hctl_elem_set_callback_private(snd_hctl_elem_t *obj, void * val); + +/** \} */ + +/** \} */ + +/** + * \defgroup SControl Setup Control Interface + * \ingroup Control + * The setup control interface - set or modify control elements from a configuration file. + * \{ + */ + +int snd_sctl_build(snd_sctl_t **ctl, snd_ctl_t *handle, snd_config_t *config, + snd_config_t *private_data, int mode); +int snd_sctl_free(snd_sctl_t *handle); +int snd_sctl_install(snd_sctl_t *handle); +int snd_sctl_remove(snd_sctl_t *handle); + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_CONTROL_H */ diff --git a/debian/include-alsa/alsa/conv.h b/debian/include-alsa/alsa/conv.h new file mode 100644 index 0000000..a326898 --- /dev/null +++ b/debian/include-alsa/alsa/conv.h @@ -0,0 +1,57 @@ +/** + * \file <file/conv.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + */ +/* + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_CONV_H +#define __ALSA_CONV_H + +/** + * \defgroup BConv Binary Value Conversion + * Helper macros to convert binary values to/from a specific byte order. + * \{ + */ + +/** Converts a 16-bit value from host to little endian byte order. */ +#define snd_host_to_LE_16(val) __cpu_to_le16(val) +/** Converts a 16-bit value from little endian to host byte order. */ +#define snd_LE_to_host_16(val) __le16_to_cpu(val) +/** Converts a 32-bit value from host to little endian byte order. */ +#define snd_host_to_LE_32(val) __cpu_to_le32(val) +/** Converts a 32-bit value from little endian to host byte order. */ +#define snd_LE_to_host_32(val) __le32_to_cpu(val) +/** Converts a 16-bit value from host to big endian byte order. */ +#define snd_host_to_BE_16(val) __cpu_to_be16(val) +/** Converts a 16-bit value from big endian to host byte order. */ +#define snd_BE_to_host_16(val) __be16_to_cpu(val) +/** Converts a 32-bit value from host to big endian byte order. */ +#define snd_host_to_BE_32(val) __cpu_to_be32(val) +/** Converts a 32-bit value from big endian to host byte order. */ +#define snd_BE_to_host_32(val) __be32_to_cpu(val) + +/** \} */ + +#endif /* __ALSA_CONV_H */ + diff --git a/debian/include-alsa/alsa/error.h b/debian/include-alsa/alsa/error.h new file mode 100644 index 0000000..b3413a1 --- /dev/null +++ b/debian/include-alsa/alsa/error.h @@ -0,0 +1,78 @@ +/** + * \file <alsa/error.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + */ +/* + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_ERROR_H +#define __ALSA_ERROR_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup Error Error handling + * Error handling macros and functions. + * \{ + */ + +#define SND_ERROR_BEGIN 500000 /**< Lower boundary of sound error codes. */ +#define SND_ERROR_INCOMPATIBLE_VERSION (SND_ERROR_BEGIN+0) /**< Kernel/library protocols are not compatible. */ +#define SND_ERROR_ALISP_NIL (SND_ERROR_BEGIN+1) /**< Lisp encountered an error during acall. */ + +const char *snd_strerror(int errnum); + +/** + * \brief Error handler callback. + * \param file Source file name. + * \param line Line number. + * \param function Function name. + * \param err Value of \c errno, or 0 if not relevant. + * \param fmt \c printf(3) format. + * \param ... \c printf(3) arguments. + * + * A function of this type is called by the ALSA library when an error occurs. + * This function usually shows the message on the screen, and/or logs it. + */ +typedef void (*snd_lib_error_handler_t)(const char *file, int line, const char *function, int err, const char *fmt, ...) /* __attribute__ ((format (printf, 5, 6))) */; +extern snd_lib_error_handler_t snd_lib_error; +extern int snd_lib_error_set_handler(snd_lib_error_handler_t handler); + +#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 95) +#define SNDERR(...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, __VA_ARGS__) /**< Shows a sound error message. */ +#define SYSERR(...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, __VA_ARGS__) /**< Shows a system error message (related to \c errno). */ +#else +#define SNDERR(args...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, 0, ##args) /**< Shows a sound error message. */ +#define SYSERR(args...) snd_lib_error(__FILE__, __LINE__, __FUNCTION__, errno, ##args) /**< Shows a system error message (related to \c errno). */ +#endif + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_ERROR_H */ + diff --git a/debian/include-alsa/alsa/global.h b/debian/include-alsa/alsa/global.h new file mode 100644 index 0000000..9a91803 --- /dev/null +++ b/debian/include-alsa/alsa/global.h @@ -0,0 +1,141 @@ +/** + * \file <alsa/global.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_GLOBAL_H_ +#define __ALSA_GLOBAL_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup Global Global defines and functions + * Global defines and functions. + * \par + * The ALSA library implementation uses these macros and functions. + * Most applications probably do not need them. + * \{ + */ + +const char *snd_asoundlib_version(void); + +#ifndef ATTRIBUTE_UNUSED +/** do not print warning (gcc) when function parameter is not used */ +#define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#endif + +#ifdef PIC /* dynamic build */ + +/** \hideinitializer \brief Helper macro for #SND_DLSYM_BUILD_VERSION. */ +#define __SND_DLSYM_VERSION(name, version) _ ## name ## version +/** + * \hideinitializer + * \brief Appends the build version to the name of a versioned dynamic symbol. + */ +#define SND_DLSYM_BUILD_VERSION(name, version) char __SND_DLSYM_VERSION(name, version); + +#else /* static build */ + +struct snd_dlsym_link { + struct snd_dlsym_link *next; + const char *dlsym_name; + const void *dlsym_ptr; +}; + +extern struct snd_dlsym_link *snd_dlsym_start; + +/** \hideinitializer \brief Helper macro for #SND_DLSYM_BUILD_VERSION. */ +#define __SND_DLSYM_VERSION(prefix, name, version) _ ## prefix ## name ## version +/** + * \hideinitializer + * \brief Appends the build version to the name of a versioned dynamic symbol. + */ +#define SND_DLSYM_BUILD_VERSION(name, version) \ + static struct snd_dlsym_link __SND_DLSYM_VERSION(snd_dlsym_, name, version); \ + void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) __attribute__ ((constructor)); \ + void __SND_DLSYM_VERSION(snd_dlsym_constructor_, name, version) (void) { \ + __SND_DLSYM_VERSION(snd_dlsym_, name, version).next = snd_dlsym_start; \ + __SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_name = # name; \ + __SND_DLSYM_VERSION(snd_dlsym_, name, version).dlsym_ptr = (void *)&name; \ + snd_dlsym_start = &__SND_DLSYM_VERSION(snd_dlsym_, name, version); \ + } + +#endif + +#ifndef __STRING +/** \brief Return 'x' argument as string */ +#define __STRING(x) #x +#endif + +/** \brief Returns the version of a dynamic symbol as a string. */ +#define SND_DLSYM_VERSION(version) __STRING(version) + +void *snd_dlopen(const char *file, int mode); +void *snd_dlsym(void *handle, const char *name, const char *version); +int snd_dlclose(void *handle); + + +/** + * \brief Internal structure for an async notification client handler. + * + * The ALSA library uses a pointer to this structure as a handle to an async + * notification object. Applications don't access its contents directly. + */ +typedef struct _snd_async_handler snd_async_handler_t; + +/** + * \brief Async notification callback. + * + * See the #snd_async_add_handler function for details. + */ +typedef void (*snd_async_callback_t)(snd_async_handler_t *handler); + +int snd_async_add_handler(snd_async_handler_t **handler, int fd, + snd_async_callback_t callback, void *private_data); +int snd_async_del_handler(snd_async_handler_t *handler); +int snd_async_handler_get_fd(snd_async_handler_t *handler); +int snd_async_handler_get_signo(snd_async_handler_t *handler); +void *snd_async_handler_get_callback_private(snd_async_handler_t *handler); + +struct snd_shm_area *snd_shm_area_create(int shmid, void *ptr); +struct snd_shm_area *snd_shm_area_share(struct snd_shm_area *area); +int snd_shm_area_destroy(struct snd_shm_area *area); + +int snd_user_file(const char *file, char **result); + +/** Timestamp */ +typedef struct timeval snd_timestamp_t; +/** Hi-res timestamp */ +typedef struct timespec snd_htimestamp_t; + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_GLOBAL_H */ diff --git a/debian/include-alsa/alsa/hwdep.h b/debian/include-alsa/alsa/hwdep.h new file mode 100644 index 0000000..929eaa4 --- /dev/null +++ b/debian/include-alsa/alsa/hwdep.h @@ -0,0 +1,154 @@ +/** + * \file <alsa/hwdep.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_HWDEP_H +#define __ALSA_HWDEP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup HwDep Hardware Dependant Interface + * The Hardware Dependant Interface. + * \{ + */ + +/** dlsym version for interface entry callback */ +#define SND_HWDEP_DLSYM_VERSION _dlsym_hwdep_001 + +/** HwDep information container */ +typedef struct _snd_hwdep_info snd_hwdep_info_t; + +/** HwDep DSP status container */ +typedef struct _snd_hwdep_dsp_status snd_hwdep_dsp_status_t; + +/** HwDep DSP image container */ +typedef struct _snd_hwdep_dsp_image snd_hwdep_dsp_image_t; + +/** HwDep interface */ +typedef enum _snd_hwdep_iface { + SND_HWDEP_IFACE_OPL2 = 0, /**< OPL2 raw driver */ + SND_HWDEP_IFACE_OPL3, /**< OPL3 raw driver */ + SND_HWDEP_IFACE_OPL4, /**< OPL4 raw driver */ + SND_HWDEP_IFACE_SB16CSP, /**< SB16CSP driver */ + SND_HWDEP_IFACE_EMU10K1, /**< EMU10K1 driver */ + SND_HWDEP_IFACE_YSS225, /**< YSS225 driver */ + SND_HWDEP_IFACE_ICS2115, /**< ICS2115 driver */ + SND_HWDEP_IFACE_SSCAPE, /**< Ensoniq SoundScape ISA card (MC68EC000) */ + SND_HWDEP_IFACE_VX, /**< Digigram VX cards */ + SND_HWDEP_IFACE_MIXART, /**< Digigram miXart cards */ + SND_HWDEP_IFACE_USX2Y, /**< Tascam US122, US224 & US428 usb */ + SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_USX2Y /**< last know hwdep interface */ +} snd_hwdep_iface_t; + +/** open for reading */ +#define SND_HWDEP_OPEN_READ (O_RDONLY) +/** open for writing */ +#define SND_HWDEP_OPEN_WRITE (O_WRONLY) +/** open for reading and writing */ +#define SND_HWDEP_OPEN_DUPLEX (O_RDWR) +/** open mode flag: open in nonblock mode */ +#define SND_HWDEP_OPEN_NONBLOCK (O_NONBLOCK) + +/** HwDep handle type */ +typedef enum _snd_hwdep_type { + /** Kernel level HwDep */ + SND_HWDEP_TYPE_HW, + /** Shared memory client HwDep (not yet implemented) */ + SND_HWDEP_TYPE_SHM, + /** INET client HwDep (not yet implemented) */ + SND_HWDEP_TYPE_INET +} snd_hwdep_type_t; + +/** HwDep handle */ +typedef struct _snd_hwdep snd_hwdep_t; + +int snd_hwdep_open(snd_hwdep_t **hwdep, const char *name, int mode); +int snd_hwdep_close(snd_hwdep_t *hwdep); +int snd_hwdep_poll_descriptors(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int space); +int snd_hwdep_poll_descriptors_revents(snd_hwdep_t *hwdep, struct pollfd *pfds, unsigned int nfds, unsigned short *revents); +int snd_hwdep_nonblock(snd_hwdep_t *hwdep, int nonblock); +int snd_hwdep_info(snd_hwdep_t *hwdep, snd_hwdep_info_t * info); +int snd_hwdep_dsp_status(snd_hwdep_t *hwdep, snd_hwdep_dsp_status_t *status); +int snd_hwdep_dsp_load(snd_hwdep_t *hwdep, snd_hwdep_dsp_image_t *block); +int snd_hwdep_ioctl(snd_hwdep_t *hwdep, unsigned int request, void * arg); +ssize_t snd_hwdep_write(snd_hwdep_t *hwdep, const void *buffer, size_t size); +ssize_t snd_hwdep_read(snd_hwdep_t *hwdep, void *buffer, size_t size); + +size_t snd_hwdep_info_sizeof(void); +/** allocate #snd_hwdep_info_t container on stack */ +#define snd_hwdep_info_alloca(ptr) do { assert(ptr); *ptr = (snd_hwdep_info_t *) alloca(snd_hwdep_info_sizeof()); memset(*ptr, 0, snd_hwdep_info_sizeof()); } while (0) +int snd_hwdep_info_malloc(snd_hwdep_info_t **ptr); +void snd_hwdep_info_free(snd_hwdep_info_t *obj); +void snd_hwdep_info_copy(snd_hwdep_info_t *dst, const snd_hwdep_info_t *src); + +unsigned int snd_hwdep_info_get_device(const snd_hwdep_info_t *obj); +int snd_hwdep_info_get_card(const snd_hwdep_info_t *obj); +const char *snd_hwdep_info_get_id(const snd_hwdep_info_t *obj); +const char *snd_hwdep_info_get_name(const snd_hwdep_info_t *obj); +snd_hwdep_iface_t snd_hwdep_info_get_iface(const snd_hwdep_info_t *obj); +void snd_hwdep_info_set_device(snd_hwdep_info_t *obj, unsigned int val); + +size_t snd_hwdep_dsp_status_sizeof(void); +/** allocate #snd_hwdep_dsp_status_t container on stack */ +#define snd_hwdep_dsp_status_alloca(ptr) do { assert(ptr); *ptr = (snd_hwdep_dsp_status_t *) alloca(snd_hwdep_dsp_status_sizeof()); memset(*ptr, 0, snd_hwdep_dsp_status_sizeof()); } while (0) +int snd_hwdep_dsp_status_malloc(snd_hwdep_dsp_status_t **ptr); +void snd_hwdep_dsp_status_free(snd_hwdep_dsp_status_t *obj); +void snd_hwdep_dsp_status_copy(snd_hwdep_dsp_status_t *dst, const snd_hwdep_dsp_status_t *src); + +unsigned int snd_hwdep_dsp_status_get_version(const snd_hwdep_dsp_status_t *obj); +const char *snd_hwdep_dsp_status_get_id(const snd_hwdep_dsp_status_t *obj); +unsigned int snd_hwdep_dsp_status_get_num_dsps(const snd_hwdep_dsp_status_t *obj); +unsigned int snd_hwdep_dsp_status_get_dsp_loaded(const snd_hwdep_dsp_status_t *obj); +unsigned int snd_hwdep_dsp_status_get_chip_ready(const snd_hwdep_dsp_status_t *obj); + +size_t snd_hwdep_dsp_image_sizeof(void); +/** allocate #snd_hwdep_dsp_image_t container on stack */ +#define snd_hwdep_dsp_image_alloca(ptr) do { assert(ptr); *ptr = (snd_hwdep_dsp_image_t *) alloca(snd_hwdep_dsp_image_sizeof()); memset(*ptr, 0, snd_hwdep_dsp_image_sizeof()); } while (0) +int snd_hwdep_dsp_image_malloc(snd_hwdep_dsp_image_t **ptr); +void snd_hwdep_dsp_image_free(snd_hwdep_dsp_image_t *obj); +void snd_hwdep_dsp_image_copy(snd_hwdep_dsp_image_t *dst, const snd_hwdep_dsp_image_t *src); + +unsigned int snd_hwdep_dsp_image_get_index(const snd_hwdep_dsp_image_t *obj); +const char *snd_hwdep_dsp_image_get_name(const snd_hwdep_dsp_image_t *obj); +const void *snd_hwdep_dsp_image_get_image(const snd_hwdep_dsp_image_t *obj); +size_t snd_hwdep_dsp_image_get_length(const snd_hwdep_dsp_image_t *obj); + +void snd_hwdep_dsp_image_set_index(snd_hwdep_dsp_image_t *obj, unsigned int index); +void snd_hwdep_dsp_image_set_name(snd_hwdep_dsp_image_t *obj, const char *name); +void snd_hwdep_dsp_image_set_image(snd_hwdep_dsp_image_t *obj, void *buffer); +void snd_hwdep_dsp_image_set_length(snd_hwdep_dsp_image_t *obj, size_t length); + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_HWDEP_H */ + diff --git a/debian/include-alsa/alsa/iatomic.h b/debian/include-alsa/alsa/iatomic.h new file mode 100644 index 0000000..d4b12c1 --- /dev/null +++ b/debian/include-alsa/alsa/iatomic.h @@ -0,0 +1,1106 @@ +#ifndef __ALSA_IATOMIC_H +#define __ALSA_IATOMIC_H + +#if defined(__i386__) || defined(__x86_64__) + +/* + * Atomic operations that C can't guarantee us. Useful for + * resource counting etc.. + */ + +#define ATOMIC_SMP_LOCK "lock ; " + +/* + * Make sure gcc doesn't try to be clever and move things around + * on us. We need to use _exactly_ the address the user gave us, + * not some alias that contains the same information. + */ +typedef struct { volatile int counter; } atomic_t; + +#define ATOMIC_INIT(i) { (i) } + +/** + * atomic_read - read atomic variable + * @v: pointer of type atomic_t + * + * Atomically reads the value of @v. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +#define atomic_read(v) ((v)->counter) + +/** + * atomic_set - set atomic variable + * @v: pointer of type atomic_t + * @i: required value + * + * Atomically sets the value of @v to @i. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +#define atomic_set(v,i) (((v)->counter) = (i)) + +/** + * atomic_add - add integer to atomic variable + * @i: integer value to add + * @v: pointer of type atomic_t + * + * Atomically adds @i to @v. Note that the guaranteed useful range + * of an atomic_t is only 24 bits. + */ +static __inline__ void atomic_add(int i, atomic_t *v) +{ + __asm__ __volatile__( + ATOMIC_SMP_LOCK "addl %1,%0" + :"=m" (v->counter) + :"ir" (i), "m" (v->counter)); +} + +/** + * atomic_sub - subtract the atomic variable + * @i: integer value to subtract + * @v: pointer of type atomic_t + * + * Atomically subtracts @i from @v. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +static __inline__ void atomic_sub(int i, atomic_t *v) +{ + __asm__ __volatile__( + ATOMIC_SMP_LOCK "subl %1,%0" + :"=m" (v->counter) + :"ir" (i), "m" (v->counter)); +} + +/** + * atomic_sub_and_test - subtract value from variable and test result + * @i: integer value to subtract + * @v: pointer of type atomic_t + * + * Atomically subtracts @i from @v and returns + * true if the result is zero, or false for all + * other cases. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +static __inline__ int atomic_sub_and_test(int i, atomic_t *v) +{ + unsigned char c; + + __asm__ __volatile__( + ATOMIC_SMP_LOCK "subl %2,%0; sete %1" + :"=m" (v->counter), "=qm" (c) + :"ir" (i), "m" (v->counter) : "memory"); + return c; +} + +/** + * atomic_inc - increment atomic variable + * @v: pointer of type atomic_t + * + * Atomically increments @v by 1. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +static __inline__ void atomic_inc(atomic_t *v) +{ + __asm__ __volatile__( + ATOMIC_SMP_LOCK "incl %0" + :"=m" (v->counter) + :"m" (v->counter)); +} + +/** + * atomic_dec - decrement atomic variable + * @v: pointer of type atomic_t + * + * Atomically decrements @v by 1. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +static __inline__ void atomic_dec(atomic_t *v) +{ + __asm__ __volatile__( + ATOMIC_SMP_LOCK "decl %0" + :"=m" (v->counter) + :"m" (v->counter)); +} + +/** + * atomic_dec_and_test - decrement and test + * @v: pointer of type atomic_t + * + * Atomically decrements @v by 1 and + * returns true if the result is 0, or false for all other + * cases. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +static __inline__ int atomic_dec_and_test(atomic_t *v) +{ + unsigned char c; + + __asm__ __volatile__( + ATOMIC_SMP_LOCK "decl %0; sete %1" + :"=m" (v->counter), "=qm" (c) + :"m" (v->counter) : "memory"); + return c != 0; +} + +/** + * atomic_inc_and_test - increment and test + * @v: pointer of type atomic_t + * + * Atomically increments @v by 1 + * and returns true if the result is zero, or false for all + * other cases. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +static __inline__ int atomic_inc_and_test(atomic_t *v) +{ + unsigned char c; + + __asm__ __volatile__( + ATOMIC_SMP_LOCK "incl %0; sete %1" + :"=m" (v->counter), "=qm" (c) + :"m" (v->counter) : "memory"); + return c != 0; +} + +/** + * atomic_add_negative - add and test if negative + * @v: pointer of type atomic_t + * @i: integer value to add + * + * Atomically adds @i to @v and returns true + * if the result is negative, or false when + * result is greater than or equal to zero. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +static __inline__ int atomic_add_negative(int i, atomic_t *v) +{ + unsigned char c; + + __asm__ __volatile__( + ATOMIC_SMP_LOCK "addl %2,%0; sets %1" + :"=m" (v->counter), "=qm" (c) + :"ir" (i), "m" (v->counter) : "memory"); + return c; +} + +/* These are x86-specific, used by some header files */ +#define atomic_clear_mask(mask, addr) \ +__asm__ __volatile__(ATOMIC_SMP_LOCK "andl %0,%1" \ +: : "r" (~(mask)),"m" (*addr) : "memory") + +#define atomic_set_mask(mask, addr) \ +__asm__ __volatile__(ATOMIC_SMP_LOCK "orl %0,%1" \ +: : "r" (mask),"m" (*addr) : "memory") + +/* + * Force strict CPU ordering. + * And yes, this is required on UP too when we're talking + * to devices. + * + * For now, "wmb()" doesn't actually do anything, as all + * Intel CPU's follow what Intel calls a *Processor Order*, + * in which all writes are seen in the program order even + * outside the CPU. + * + * I expect future Intel CPU's to have a weaker ordering, + * but I'd also expect them to finally get their act together + * and add some real memory barriers if so. + */ + +#ifdef __i386__ +#define mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory") +#define rmb() mb() +#define wmb() __asm__ __volatile__ ("": : :"memory") +#else +#define mb() asm volatile("mfence":::"memory") +#define rmb() asm volatile("lfence":::"memory") +#define wmb() asm volatile("sfence":::"memory") +#endif + +#undef ATOMIC_SMP_LOCK + +#define IATOMIC_DEFINED 1 + +#endif /* __i386__ */ + +#ifdef __ia64__ + +/* + * On IA-64, counter must always be volatile to ensure that that the + * memory accesses are ordered. + */ +typedef struct { volatile int counter; } atomic_t; + +#define ATOMIC_INIT(i) ((atomic_t) { (i) }) + +#define atomic_read(v) ((v)->counter) +#define atomic_set(v,i) (((v)->counter) = (i)) + +/* stripped version - we need only 4byte version */ +#define ia64_cmpxchg(sem,ptr,old,new,size) \ +({ \ + __typeof__(ptr) _p_ = (ptr); \ + __typeof__(new) _n_ = (new); \ + unsigned long _o_, _r_; \ + _o_ = (unsigned int) (long) (old); \ + __asm__ __volatile__ ("mov ar.ccv=%0;;" :: "rO"(_o_)); \ + __asm__ __volatile__ ("cmpxchg4."sem" %0=[%1],%2,ar.ccv" \ + : "=r"(_r_) : "r"(_p_), "r"(_n_) : "memory"); \ + (__typeof__(old)) _r_; \ +}) + +static __inline__ int +ia64_atomic_add (int i, atomic_t *v) +{ + int old, new; + // CMPXCHG_BUGCHECK_DECL + + do { + // CMPXCHG_BUGCHECK(v); + old = atomic_read(v); + new = old + i; + } while (ia64_cmpxchg("acq", v, old, old + i, sizeof(atomic_t)) != old); + return new; +} + +static __inline__ int +ia64_atomic_sub (int i, atomic_t *v) +{ + int old, new; + // CMPXCHG_BUGCHECK_DECL + + do { + // CMPXCHG_BUGCHECK(v); + old = atomic_read(v); + new = old - i; + } while (ia64_cmpxchg("acq", v, old, new, sizeof(atomic_t)) != old); + return new; +} + +#define IA64_FETCHADD(tmp,v,n,sz) \ +({ \ + switch (sz) { \ + case 4: \ + __asm__ __volatile__ ("fetchadd4.rel %0=[%1],%2" \ + : "=r"(tmp) : "r"(v), "i"(n) : "memory"); \ + break; \ + \ + case 8: \ + __asm__ __volatile__ ("fetchadd8.rel %0=[%1],%2" \ + : "=r"(tmp) : "r"(v), "i"(n) : "memory"); \ + break; \ + } \ +}) + +#define ia64_fetch_and_add(i,v) \ +({ \ + unsigned long _tmp; \ + volatile __typeof__(*(v)) *_v = (v); \ + switch (i) { \ + case -16: IA64_FETCHADD(_tmp, _v, -16, sizeof(*(v))); break; \ + case -8: IA64_FETCHADD(_tmp, _v, -8, sizeof(*(v))); break; \ + case -4: IA64_FETCHADD(_tmp, _v, -4, sizeof(*(v))); break; \ + case -1: IA64_FETCHADD(_tmp, _v, -1, sizeof(*(v))); break; \ + case 1: IA64_FETCHADD(_tmp, _v, 1, sizeof(*(v))); break; \ + case 4: IA64_FETCHADD(_tmp, _v, 4, sizeof(*(v))); break; \ + case 8: IA64_FETCHADD(_tmp, _v, 8, sizeof(*(v))); break; \ + case 16: IA64_FETCHADD(_tmp, _v, 16, sizeof(*(v))); break; \ + } \ + (__typeof__(*v)) (_tmp + (i)); /* return new value */ \ +}) + +/* + * Atomically add I to V and return TRUE if the resulting value is + * negative. + */ +static __inline__ int +atomic_add_negative (int i, atomic_t *v) +{ + return ia64_atomic_add(i, v) < 0; +} + +#define atomic_add_return(i,v) \ + ((__builtin_constant_p(i) && \ + ( (i == 1) || (i == 4) || (i == 8) || (i == 16) \ + || (i == -1) || (i == -4) || (i == -8) || (i == -16))) \ + ? ia64_fetch_and_add(i, &(v)->counter) \ + : ia64_atomic_add(i, v)) + +#define atomic_sub_return(i,v) \ + ((__builtin_constant_p(i) && \ + ( (i == 1) || (i == 4) || (i == 8) || (i == 16) \ + || (i == -1) || (i == -4) || (i == -8) || (i == -16))) \ + ? ia64_fetch_and_add(-(i), &(v)->counter) \ + : ia64_atomic_sub(i, v)) + +#define atomic_dec_return(v) atomic_sub_return(1, (v)) +#define atomic_inc_return(v) atomic_add_return(1, (v)) + +#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0) +#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) +#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) != 0) + +#define atomic_add(i,v) atomic_add_return((i), (v)) +#define atomic_sub(i,v) atomic_sub_return((i), (v)) +#define atomic_inc(v) atomic_add(1, (v)) +#define atomic_dec(v) atomic_sub(1, (v)) + +/* + * Macros to force memory ordering. In these descriptions, "previous" + * and "subsequent" refer to program order; "visible" means that all + * architecturally visible effects of a memory access have occurred + * (at a minimum, this means the memory has been read or written). + * + * wmb(): Guarantees that all preceding stores to memory- + * like regions are visible before any subsequent + * stores and that all following stores will be + * visible only after all previous stores. + * rmb(): Like wmb(), but for reads. + * mb(): wmb()/rmb() combo, i.e., all previous memory + * accesses are visible before all subsequent + * accesses and vice versa. This is also known as + * a "fence." + * + * Note: "mb()" and its variants cannot be used as a fence to order + * accesses to memory mapped I/O registers. For that, mf.a needs to + * be used. However, we don't want to always use mf.a because (a) + * it's (presumably) much slower than mf and (b) mf.a is supported for + * sequential memory pages only. + */ +#define mb() __asm__ __volatile__ ("mf" ::: "memory") +#define rmb() mb() +#define wmb() mb() + +#define IATOMIC_DEFINED 1 + +#endif /* __ia64__ */ + +#ifdef __alpha__ + +/* + * Atomic operations that C can't guarantee us. Useful for + * resource counting etc... + * + * But use these as seldom as possible since they are much slower + * than regular operations. + */ + + +/* + * Counter is volatile to make sure gcc doesn't try to be clever + * and move things around on us. We need to use _exactly_ the address + * the user gave us, not some alias that contains the same information. + */ +typedef struct { volatile int counter; } atomic_t; + +#define ATOMIC_INIT(i) ( (atomic_t) { (i) } ) + +#define atomic_read(v) ((v)->counter) +#define atomic_set(v,i) ((v)->counter = (i)) + +/* + * To get proper branch prediction for the main line, we must branch + * forward to code at the end of this object's .text section, then + * branch back to restart the operation. + */ + +static __inline__ void atomic_add(int i, atomic_t * v) +{ + unsigned long temp; + __asm__ __volatile__( + "1: ldl_l %0,%1\n" + " addl %0,%2,%0\n" + " stl_c %0,%1\n" + " beq %0,2f\n" + ".subsection 2\n" + "2: br 1b\n" + ".previous" + :"=&r" (temp), "=m" (v->counter) + :"Ir" (i), "m" (v->counter)); +} + +static __inline__ void atomic_sub(int i, atomic_t * v) +{ + unsigned long temp; + __asm__ __volatile__( + "1: ldl_l %0,%1\n" + " subl %0,%2,%0\n" + " stl_c %0,%1\n" + " beq %0,2f\n" + ".subsection 2\n" + "2: br 1b\n" + ".previous" + :"=&r" (temp), "=m" (v->counter) + :"Ir" (i), "m" (v->counter)); +} + +/* + * Same as above, but return the result value + */ +static __inline__ long atomic_add_return(int i, atomic_t * v) +{ + long temp, result; + __asm__ __volatile__( + "1: ldl_l %0,%1\n" + " addl %0,%3,%2\n" + " addl %0,%3,%0\n" + " stl_c %0,%1\n" + " beq %0,2f\n" + " mb\n" + ".subsection 2\n" + "2: br 1b\n" + ".previous" + :"=&r" (temp), "=m" (v->counter), "=&r" (result) + :"Ir" (i), "m" (v->counter) : "memory"); + return result; +} + +static __inline__ long atomic_sub_return(int i, atomic_t * v) +{ + long temp, result; + __asm__ __volatile__( + "1: ldl_l %0,%1\n" + " subl %0,%3,%2\n" + " subl %0,%3,%0\n" + " stl_c %0,%1\n" + " beq %0,2f\n" + " mb\n" + ".subsection 2\n" + "2: br 1b\n" + ".previous" + :"=&r" (temp), "=m" (v->counter), "=&r" (result) + :"Ir" (i), "m" (v->counter) : "memory"); + return result; +} + +#define atomic_dec_return(v) atomic_sub_return(1,(v)) +#define atomic_inc_return(v) atomic_add_return(1,(v)) + +#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0) +#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) + +#define atomic_inc(v) atomic_add(1,(v)) +#define atomic_dec(v) atomic_sub(1,(v)) + +#define mb() \ +__asm__ __volatile__("mb": : :"memory") + +#define rmb() \ +__asm__ __volatile__("mb": : :"memory") + +#define wmb() \ +__asm__ __volatile__("wmb": : :"memory") + +#define IATOMIC_DEFINED 1 + +#endif /* __alpha__ */ + +#ifdef __powerpc__ + +typedef struct { volatile int counter; } atomic_t; + +#define ATOMIC_INIT(i) { (i) } + +#define atomic_read(v) ((v)->counter) +#define atomic_set(v,i) (((v)->counter) = (i)) + +extern void atomic_clear_mask(unsigned long mask, unsigned long *addr); +extern void atomic_set_mask(unsigned long mask, unsigned long *addr); + +#define SMP_ISYNC "\n\tisync" + +static __inline__ void atomic_add(int a, atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%3 # atomic_add\n\ + add %0,%2,%0\n\ + stwcx. %0,0,%3\n\ + bne- 1b" + : "=&r" (t), "=m" (v->counter) + : "r" (a), "r" (&v->counter), "m" (v->counter) + : "cc"); +} + +static __inline__ int atomic_add_return(int a, atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%2 # atomic_add_return\n\ + add %0,%1,%0\n\ + stwcx. %0,0,%2\n\ + bne- 1b" + SMP_ISYNC + : "=&r" (t) + : "r" (a), "r" (&v->counter) + : "cc", "memory"); + + return t; +} + +static __inline__ void atomic_sub(int a, atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%3 # atomic_sub\n\ + subf %0,%2,%0\n\ + stwcx. %0,0,%3\n\ + bne- 1b" + : "=&r" (t), "=m" (v->counter) + : "r" (a), "r" (&v->counter), "m" (v->counter) + : "cc"); +} + +static __inline__ int atomic_sub_return(int a, atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%2 # atomic_sub_return\n\ + subf %0,%1,%0\n\ + stwcx. %0,0,%2\n\ + bne- 1b" + SMP_ISYNC + : "=&r" (t) + : "r" (a), "r" (&v->counter) + : "cc", "memory"); + + return t; +} + +static __inline__ void atomic_inc(atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%2 # atomic_inc\n\ + addic %0,%0,1\n\ + stwcx. %0,0,%2\n\ + bne- 1b" + : "=&r" (t), "=m" (v->counter) + : "r" (&v->counter), "m" (v->counter) + : "cc"); +} + +static __inline__ int atomic_inc_return(atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%1 # atomic_inc_return\n\ + addic %0,%0,1\n\ + stwcx. %0,0,%1\n\ + bne- 1b" + SMP_ISYNC + : "=&r" (t) + : "r" (&v->counter) + : "cc", "memory"); + + return t; +} + +static __inline__ void atomic_dec(atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%2 # atomic_dec\n\ + addic %0,%0,-1\n\ + stwcx. %0,0,%2\n\ + bne- 1b" + : "=&r" (t), "=m" (v->counter) + : "r" (&v->counter), "m" (v->counter) + : "cc"); +} + +static __inline__ int atomic_dec_return(atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%1 # atomic_dec_return\n\ + addic %0,%0,-1\n\ + stwcx. %0,0,%1\n\ + bne- 1b" + SMP_ISYNC + : "=&r" (t) + : "r" (&v->counter) + : "cc", "memory"); + + return t; +} + +#define atomic_sub_and_test(a, v) (atomic_sub_return((a), (v)) == 0) +#define atomic_dec_and_test(v) (atomic_dec_return((v)) == 0) + +/* + * Atomically test *v and decrement if it is greater than 0. + * The function returns the old value of *v minus 1. + */ +static __inline__ int atomic_dec_if_positive(atomic_t *v) +{ + int t; + + __asm__ __volatile__( +"1: lwarx %0,0,%1 # atomic_dec_if_positive\n\ + addic. %0,%0,-1\n\ + blt- 2f\n\ + stwcx. %0,0,%1\n\ + bne- 1b" + SMP_ISYNC + "\n\ +2:" : "=&r" (t) + : "r" (&v->counter) + : "cc", "memory"); + + return t; +} + +/* + * Memory barrier. + * The sync instruction guarantees that all memory accesses initiated + * by this processor have been performed (with respect to all other + * mechanisms that access memory). The eieio instruction is a barrier + * providing an ordering (separately) for (a) cacheable stores and (b) + * loads and stores to non-cacheable memory (e.g. I/O devices). + * + * mb() prevents loads and stores being reordered across this point. + * rmb() prevents loads being reordered across this point. + * wmb() prevents stores being reordered across this point. + * + * We can use the eieio instruction for wmb, but since it doesn't + * give any ordering guarantees about loads, we have to use the + * stronger but slower sync instruction for mb and rmb. + */ +#define mb() __asm__ __volatile__ ("sync" : : : "memory") +#define rmb() __asm__ __volatile__ ("sync" : : : "memory") +#define wmb() __asm__ __volatile__ ("eieio" : : : "memory") + +#define IATOMIC_DEFINED 1 + +#endif /* __powerpc__ */ + +#ifdef __mips__ + +typedef struct { volatile int counter; } atomic_t; + +#define ATOMIC_INIT(i) { (i) } + +/* + * atomic_read - read atomic variable + * @v: pointer of type atomic_t + * + * Atomically reads the value of @v. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +#define atomic_read(v) ((v)->counter) + +/* + * atomic_set - set atomic variable + * @v: pointer of type atomic_t + * @i: required value + * + * Atomically sets the value of @v to @i. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +#define atomic_set(v,i) ((v)->counter = (i)) + +/* + * for MIPS II and better we can use ll/sc instruction, and kernel 2.4.3+ + * will emulate it on MIPS I. + */ + +/* + * atomic_add - add integer to atomic variable + * @i: integer value to add + * @v: pointer of type atomic_t + * + * Atomically adds @i to @v. Note that the guaranteed useful range + * of an atomic_t is only 24 bits. + */ +extern __inline__ void atomic_add(int i, atomic_t * v) +{ + unsigned long temp; + + __asm__ __volatile__( + ".set push \n" + ".set mips2 \n" + "1: ll %0, %1 # atomic_add\n" + " addu %0, %2 \n" + " sc %0, %1 \n" + " beqz %0, 1b \n" + ".set pop \n" + : "=&r" (temp), "=m" (v->counter) + : "Ir" (i), "m" (v->counter)); +} + +/* + * atomic_sub - subtract the atomic variable + * @i: integer value to subtract + * @v: pointer of type atomic_t + * + * Atomically subtracts @i from @v. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +extern __inline__ void atomic_sub(int i, atomic_t * v) +{ + unsigned long temp; + + __asm__ __volatile__( + ".set push \n" + ".set mips2 \n" + "1: ll %0, %1 # atomic_sub\n" + " subu %0, %2 \n" + " sc %0, %1 \n" + " beqz %0, 1b \n" + ".set pop \n" + : "=&r" (temp), "=m" (v->counter) + : "Ir" (i), "m" (v->counter)); +} + +/* + * Same as above, but return the result value + */ +extern __inline__ int atomic_add_return(int i, atomic_t * v) +{ + unsigned long temp, result; + + __asm__ __volatile__( + ".set push # atomic_add_return\n" + ".set noreorder \n" + ".set mips2 \n" + "1: ll %1, %2 \n" + " addu %0, %1, %3 \n" + " sc %0, %2 \n" + " beqz %0, 1b \n" + " addu %0, %1, %3 \n" + ".set pop \n" + : "=&r" (result), "=&r" (temp), "=m" (v->counter) + : "Ir" (i), "m" (v->counter) + : "memory"); + + return result; +} + +extern __inline__ int atomic_sub_return(int i, atomic_t * v) +{ + unsigned long temp, result; + + __asm__ __volatile__( + ".set push \n" + ".set mips2 \n" + ".set noreorder # atomic_sub_return\n" + "1: ll %1, %2 \n" + " subu %0, %1, %3 \n" + " sc %0, %2 \n" + " beqz %0, 1b \n" + " subu %0, %1, %3 \n" + ".set pop \n" + : "=&r" (result), "=&r" (temp), "=m" (v->counter) + : "Ir" (i), "m" (v->counter) + : "memory"); + + return result; +} + +#define atomic_dec_return(v) atomic_sub_return(1,(v)) +#define atomic_inc_return(v) atomic_add_return(1,(v)) + +/* + * atomic_sub_and_test - subtract value from variable and test result + * @i: integer value to subtract + * @v: pointer of type atomic_t + * + * Atomically subtracts @i from @v and returns + * true if the result is zero, or false for all + * other cases. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +#define atomic_sub_and_test(i,v) (atomic_sub_return((i), (v)) == 0) + +/* + * atomic_inc_and_test - increment and test + * @v: pointer of type atomic_t + * + * Atomically increments @v by 1 + * and returns true if the result is zero, or false for all + * other cases. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +#define atomic_inc_and_test(v) (atomic_inc_return(1, (v)) == 0) + +/* + * atomic_dec_and_test - decrement by 1 and test + * @v: pointer of type atomic_t + * + * Atomically decrements @v by 1 and + * returns true if the result is 0, or false for all other + * cases. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) + +/* + * atomic_inc - increment atomic variable + * @v: pointer of type atomic_t + * + * Atomically increments @v by 1. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +#define atomic_inc(v) atomic_add(1,(v)) + +/* + * atomic_dec - decrement and test + * @v: pointer of type atomic_t + * + * Atomically decrements @v by 1. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + */ +#define atomic_dec(v) atomic_sub(1,(v)) + +/* + * atomic_add_negative - add and test if negative + * @v: pointer of type atomic_t + * @i: integer value to add + * + * Atomically adds @i to @v and returns true + * if the result is negative, or false when + * result is greater than or equal to zero. Note that the guaranteed + * useful range of an atomic_t is only 24 bits. + * + * Currently not implemented for MIPS. + */ + +#define mb() \ +__asm__ __volatile__( \ + "# prevent instructions being moved around\n\t" \ + ".set\tnoreorder\n\t" \ + "# 8 nops to fool the R4400 pipeline\n\t" \ + "nop;nop;nop;nop;nop;nop;nop;nop\n\t" \ + ".set\treorder" \ + : /* no output */ \ + : /* no input */ \ + : "memory") +#define rmb() mb() +#define wmb() mb() + +#define IATOMIC_DEFINED 1 + +#endif /* __mips__ */ + +#ifdef __arm__ + +/* + * FIXME: bellow code is valid only for SA11xx + */ + +/* + * Save the current interrupt enable state & disable IRQs + */ +#define local_irq_save(x) \ + ({ \ + unsigned long temp; \ + __asm__ __volatile__( \ + "mrs %0, cpsr @ local_irq_save\n" \ +" orr %1, %0, #128\n" \ +" msr cpsr_c, %1" \ + : "=r" (x), "=r" (temp) \ + : \ + : "memory"); \ + }) + +/* + * restore saved IRQ & FIQ state + */ +#define local_irq_restore(x) \ + __asm__ __volatile__( \ + "msr cpsr_c, %0 @ local_irq_restore\n" \ + : \ + : "r" (x) \ + : "memory") + +#define __save_flags_cli(x) local_irq_save(x) +#define __restore_flags(x) local_irq_restore(x) + +typedef struct { volatile int counter; } atomic_t; + +#define ATOMIC_INIT(i) { (i) } + +#define atomic_read(v) ((v)->counter) +#define atomic_set(v,i) (((v)->counter) = (i)) + +static __inline__ void atomic_add(int i, volatile atomic_t *v) +{ + unsigned long flags; + + __save_flags_cli(flags); + v->counter += i; + __restore_flags(flags); +} + +static __inline__ void atomic_sub(int i, volatile atomic_t *v) +{ + unsigned long flags; + + __save_flags_cli(flags); + v->counter -= i; + __restore_flags(flags); +} + +static __inline__ void atomic_inc(volatile atomic_t *v) +{ + unsigned long flags; + + __save_flags_cli(flags); + v->counter += 1; + __restore_flags(flags); +} + +static __inline__ void atomic_dec(volatile atomic_t *v) +{ + unsigned long flags; + + __save_flags_cli(flags); + v->counter -= 1; + __restore_flags(flags); +} + +static __inline__ int atomic_dec_and_test(volatile atomic_t *v) +{ + unsigned long flags; + int result; + + __save_flags_cli(flags); + v->counter -= 1; + result = (v->counter == 0); + __restore_flags(flags); + + return result; +} + +static inline int atomic_add_negative(int i, volatile atomic_t *v) +{ + unsigned long flags; + int result; + + __save_flags_cli(flags); + v->counter += i; + result = (v->counter < 0); + __restore_flags(flags); + + return result; +} + +static __inline__ void atomic_clear_mask(unsigned long mask, unsigned long *addr) +{ + unsigned long flags; + + __save_flags_cli(flags); + *addr &= ~mask; + __restore_flags(flags); +} + +#define mb() __asm__ __volatile__ ("" : : : "memory") +#define rmb() mb() +#define wmb() mb() + +#define IATOMIC_DEFINED 1 + +#endif /* __arm__ */ + +#ifndef IATOMIC_DEFINED +/* + * non supported architecture. + */ +#warning "Atomic operations are not supported on this architecture." + +typedef struct { volatile int counter; } atomic_t; + +#define ATOMIC_INIT(i) { (i) } + +#define atomic_read(v) ((v)->counter) +#define atomic_set(v,i) (((v)->counter) = (i)) +#define atomic_add(i,v) (((v)->counter) += (i)) +#define atomic_sub(i,v) (((v)->counter) -= (i)) +#define atomic_inc(v) (((v)->counter)++) +#define atomic_dec(v) (((v)->counter)--) + +#define mb() +#define rmb() +#define wmb() + +#define IATOMIC_DEFINED 1 + +#endif /* IATOMIC_DEFINED */ + +/* + * Atomic read/write + * Copyright (c) 2001 by Abramo Bagnara <abramo@alsa-project.org> + */ + +/* Max number of times we must spin on a spin-lock calling sched_yield(). + After MAX_SPIN_COUNT iterations, we put the calling thread to sleep. */ + +#ifndef MAX_SPIN_COUNT +#define MAX_SPIN_COUNT 50 +#endif + +/* Duration of sleep (in nanoseconds) when we can't acquire a spin-lock + after MAX_SPIN_COUNT iterations of sched_yield(). + This MUST BE > 2ms. + (Otherwise the kernel does busy-waiting for real-time threads, + giving other threads no chance to run.) */ + +#ifndef SPIN_SLEEP_DURATION +#define SPIN_SLEEP_DURATION 2000001 +#endif + +typedef struct { + unsigned int begin, end; +} snd_atomic_write_t; + +typedef struct { + volatile const snd_atomic_write_t *write; + unsigned int end; +} snd_atomic_read_t; + +void snd_atomic_read_wait(snd_atomic_read_t *t); + +static inline void snd_atomic_write_init(snd_atomic_write_t *w) +{ + w->begin = 0; + w->end = 0; +} + +static inline void snd_atomic_write_begin(snd_atomic_write_t *w) +{ + w->begin++; + wmb(); +} + +static inline void snd_atomic_write_end(snd_atomic_write_t *w) +{ + wmb(); + w->end++; +} + +static inline void snd_atomic_read_init(snd_atomic_read_t *r, snd_atomic_write_t *w) +{ + r->write = w; +} + +static inline void snd_atomic_read_begin(snd_atomic_read_t *r) +{ + r->end = r->write->end; + rmb(); +} + +static inline int snd_atomic_read_ok(snd_atomic_read_t *r) +{ + rmb(); + return r->end == r->write->begin; +} + +#endif /* __ALSA_IATOMIC_H */ diff --git a/debian/include-alsa/alsa/input.h b/debian/include-alsa/alsa/input.h new file mode 100644 index 0000000..105b128 --- /dev/null +++ b/debian/include-alsa/alsa/input.h @@ -0,0 +1,83 @@ +/** + * \file <alsa/input.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + */ +/* + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_INPUT_H +#define __ALSA_INPUT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup Input Input Interface + * + * The input functions present an interface similar to the stdio functions + * on top of different underlying input sources. + * + * The #snd_config_load function uses such an input handle to be able to + * load configurations not only from standard files but also from other + * sources, e.g. from memory buffers. + * + * \{ + */ + +/** + * \brief Internal structure for an input object. + * + * The ALSA library uses a pointer to this structure as a handle to an + * input object. Applications don't access its contents directly. + */ +typedef struct _snd_input snd_input_t; + +/** Input type. */ +typedef enum _snd_input_type { + /** Input from a stdio stream. */ + SND_INPUT_STDIO, + /** Input from a memory buffer. */ + SND_INPUT_BUFFER +} snd_input_type_t; + +int snd_input_stdio_open(snd_input_t **inputp, const char *file, const char *mode); +int snd_input_stdio_attach(snd_input_t **inputp, FILE *fp, int _close); +int snd_input_buffer_open(snd_input_t **inputp, const char *buffer, ssize_t size); +int snd_input_close(snd_input_t *input); +int snd_input_scanf(snd_input_t *input, const char *format, ...) +#ifndef DOC_HIDDEN + __attribute__ ((format (scanf, 2, 3))) +#endif + ; +char *snd_input_gets(snd_input_t *input, char *str, size_t size); +int snd_input_getc(snd_input_t *input); +int snd_input_ungetc(snd_input_t *input, int c); + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_INPUT_H */ diff --git a/debian/include-alsa/alsa/instr.h b/debian/include-alsa/alsa/instr.h new file mode 100644 index 0000000..f7eef63 --- /dev/null +++ b/debian/include-alsa/alsa/instr.h @@ -0,0 +1,177 @@ +/** + * \file <file/instr.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_INSTR_H +#define __ALSA_INSTR_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup Instrument Instrument Interface + * The Instrument Interface. + * \{ + */ + +/* instrument get/put */ + +/** container for sequencer instrument header */ +typedef struct _snd_instr_header snd_instr_header_t; + +size_t snd_instr_header_sizeof(void); +#define snd_instr_header_alloca(ptr) \ +do {\ + assert(ptr);\ + *ptr = (snd_instr_header_t *)alloca(snd_instr_header_sizeof());\ + memset(*ptr, 0, snd_instr_header_sizeof());\ +} while (0) /**< allocate instrument header on stack */ +int snd_instr_header_malloc(snd_instr_header_t **ptr, size_t len); +void snd_instr_header_free(snd_instr_header_t *ptr); +void snd_instr_header_copy(snd_instr_header_t *dst, const snd_instr_header_t *src); + +const snd_seq_instr_t *snd_instr_header_get_id(const snd_instr_header_t *info); +snd_seq_instr_cluster_t snd_instr_header_get_cluster(const snd_instr_header_t *info); +unsigned int snd_instr_header_get_cmd(const snd_instr_header_t *info); +size_t snd_instr_header_get_len(const snd_instr_header_t *info); +const char *snd_instr_header_get_name(const snd_instr_header_t *info); +int snd_instr_header_get_type(const snd_instr_header_t *info); +const char *snd_instr_header_get_format(const snd_instr_header_t *info); +const snd_seq_instr_t *snd_instr_header_get_alias(const snd_instr_header_t *info); +void *snd_instr_header_get_data(const snd_instr_header_t *info); +int snd_instr_header_get_follow_alias(const snd_instr_header_t *info); + +void snd_instr_header_set_id(snd_instr_header_t *info, const snd_seq_instr_t *id); +void snd_instr_header_set_cluster(snd_instr_header_t *info, snd_seq_instr_cluster_t cluster); +void snd_instr_header_set_cmd(snd_instr_header_t *info, unsigned int cmd); +void snd_instr_header_set_len(snd_instr_header_t *info, size_t len); +void snd_instr_header_set_name(snd_instr_header_t *info, const char *name); +void snd_instr_header_set_type(snd_instr_header_t *info, int type); +void snd_instr_header_set_format(snd_instr_header_t *info, const char *format); +void snd_instr_header_set_alias(snd_instr_header_t *info, const snd_seq_instr_t *instr); +void snd_instr_header_set_follow_alias(snd_instr_header_t *info, int val); + +/** + * Instrument abstraction layer + * - based on events + */ + +/** instrument types */ +#define SND_SEQ_INSTR_ATYPE_DATA 0 /**< instrument data */ +#define SND_SEQ_INSTR_ATYPE_ALIAS 1 /**< instrument alias */ + +/** instrument ASCII identifiers */ +#define SND_SEQ_INSTR_ID_DLS1 "DLS1" /**< DLS1 */ +#define SND_SEQ_INSTR_ID_DLS2 "DLS2" /**< DLS2 */ +#define SND_SEQ_INSTR_ID_SIMPLE "Simple Wave" /**< Simple Wave */ +#define SND_SEQ_INSTR_ID_SOUNDFONT "SoundFont" /**< SoundFont */ +#define SND_SEQ_INSTR_ID_GUS_PATCH "GUS Patch" /**< Gravis Patch */ +#define SND_SEQ_INSTR_ID_INTERWAVE "Interwave FFFF" /**< InterWave FFFF */ +#define SND_SEQ_INSTR_ID_OPL2_3 "OPL2/3 FM" /**< OPL2/3 FM */ +#define SND_SEQ_INSTR_ID_OPL4 "OPL4" /**< OPL4 */ + +/** instrument types */ +#define SND_SEQ_INSTR_TYPE0_DLS1 (1<<0) /**< MIDI DLS v1 */ +#define SND_SEQ_INSTR_TYPE0_DLS2 (1<<1) /**< MIDI DLS v2 */ +#define SND_SEQ_INSTR_TYPE1_SIMPLE (1<<0) /**< Simple Wave */ +#define SND_SEQ_INSTR_TYPE1_SOUNDFONT (1<<1) /**< EMU SoundFont */ +#define SND_SEQ_INSTR_TYPE1_GUS_PATCH (1<<2) /**< Gravis UltraSound Patch */ +#define SND_SEQ_INSTR_TYPE1_INTERWAVE (1<<3) /**< InterWave FFFF */ +#define SND_SEQ_INSTR_TYPE2_OPL2_3 (1<<0) /**< Yamaha OPL2/3 FM */ +#define SND_SEQ_INSTR_TYPE2_OPL4 (1<<1) /**< Yamaha OPL4 */ + +/** put commands */ +#define SND_SEQ_INSTR_PUT_CMD_CREATE 0 /**< create a new layer */ +#define SND_SEQ_INSTR_PUT_CMD_REPLACE 1 /**< replace the old layer with new one */ +#define SND_SEQ_INSTR_PUT_CMD_MODIFY 2 /**< modify the existing layer */ +#define SND_SEQ_INSTR_PUT_CMD_ADD 3 /**< add one to the existing layer */ +#define SND_SEQ_INSTR_PUT_CMD_REMOVE 4 /**< remove the layer */ + +/** get commands */ +#define SND_SEQ_INSTR_GET_CMD_FULL 0 /**< get the full data stream */ +#define SND_SEQ_INSTR_GET_CMD_PARTIAL 1 /**< get the partial data stream */ + +/* query flags */ +#define SND_SEQ_INSTR_QUERY_FOLLOW_ALIAS (1<<0) /**< follow alias to get the instrument data */ + +/** free commands */ +#define SND_SEQ_INSTR_FREE_CMD_ALL 0 /**< remove all matching instruments */ +#define SND_SEQ_INSTR_FREE_CMD_PRIVATE 1 /**< remove only private instruments */ +#define SND_SEQ_INSTR_FREE_CMD_CLUSTER 2 /**< remove only cluster instruments */ +#define SND_SEQ_INSTR_FREE_CMD_SINGLE 3 /**< remove single instrument */ + + +/** + * FM instrument support + */ + +/** FM instrument data structure */ +typedef void snd_instr_fm_t; + +int snd_instr_fm_convert_to_stream(snd_instr_fm_t *fm, const char *name, snd_instr_header_t **put, size_t *size); +int snd_instr_fm_convert_from_stream(snd_instr_header_t *data, size_t size, snd_instr_fm_t **fm); +int snd_instr_fm_free(snd_instr_fm_t *fm); + + +/** + * Simple Wave support + */ + +/** simple instrument data structure */ +typedef void snd_instr_simple_t; + +int snd_instr_simple_convert_to_stream(snd_instr_simple_t *simple, const char *name, snd_instr_header_t **put, size_t *size); +int snd_instr_simple_convert_from_stream(snd_instr_header_t *data, size_t size, snd_instr_simple_t **simple); +int snd_instr_simple_free(snd_instr_simple_t *simple); + + +/** + * InterWave FFFF support + */ + +/** IW FFFF instrument data structure */ +typedef void snd_instr_iwffff_t; +/** IW FFFF handler */ +typedef struct _snd_iwffff_handle snd_iwffff_handle_t; + +int snd_instr_iwffff_open(snd_iwffff_handle_t **handle, const char *name_fff, const char *name_dta); +int snd_instr_iwffff_open_rom(snd_iwffff_handle_t **handle, int card, int bank, int file); +int snd_instr_iwffff_open_rom_file(snd_iwffff_handle_t **handle, const char *name, int bank, int file); +int snd_instr_iwffff_close(snd_iwffff_handle_t *handle); +int snd_instr_iwffff_load(snd_iwffff_handle_t *handle, int bank, int prg, snd_instr_iwffff_t **iwffff); +int snd_instr_iwffff_convert_to_stream(snd_instr_iwffff_t *iwffff, const char *name, snd_instr_header_t **data, size_t *size); +int snd_instr_iwffff_convert_from_stream(snd_instr_header_t *data, size_t size, snd_instr_iwffff_t **iwffff); +int snd_instr_iwffff_free(snd_instr_iwffff_t *iwffff); + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_INSTR_H */ + diff --git a/debian/include-alsa/alsa/mixer.h b/debian/include-alsa/alsa/mixer.h new file mode 100644 index 0000000..ac55a64 --- /dev/null +++ b/debian/include-alsa/alsa/mixer.h @@ -0,0 +1,255 @@ +/** + * \file <alsa/mixer.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_MIXER_H +#define __ALSA_MIXER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup Mixer Mixer Interface + * The mixer interface. + * \{ + */ + +/** Mixer handle */ +typedef struct _snd_mixer snd_mixer_t; +/** Mixer elements class handle */ +typedef struct _snd_mixer_class snd_mixer_class_t; +/** Mixer element handle */ +typedef struct _snd_mixer_elem snd_mixer_elem_t; + +/** + * \brief Mixer callback function + * \param mixer Mixer handle + * \param mask event mask + * \param elem related mixer element (if any) + * \return 0 on success otherwise a negative error code + */ +typedef int (*snd_mixer_callback_t)(snd_mixer_t *ctl, + unsigned int mask, + snd_mixer_elem_t *elem); + +/** + * \brief Mixer element callback function + * \param elem Mixer element + * \param mask event mask + * \return 0 on success otherwise a negative error code + */ +typedef int (*snd_mixer_elem_callback_t)(snd_mixer_elem_t *elem, + unsigned int mask); + +/** + * \brief Compare function for sorting mixer elements + * \param e1 First element + * \param e2 Second element + * \return -1 if e1 < e2, 0 if e1 == e2, 1 if e1 > e2 + */ +typedef int (*snd_mixer_compare_t)(const snd_mixer_elem_t *e1, + const snd_mixer_elem_t *e2); + +/** Mixer element type */ +typedef enum _snd_mixer_elem_type { + /* Simple (legacy) mixer elements */ + SND_MIXER_ELEM_SIMPLE, + SND_MIXER_ELEM_LAST = SND_MIXER_ELEM_SIMPLE +} snd_mixer_elem_type_t; + +int snd_mixer_open(snd_mixer_t **mixer, int mode); +int snd_mixer_close(snd_mixer_t *mixer); +snd_mixer_elem_t *snd_mixer_first_elem(snd_mixer_t *mixer); +snd_mixer_elem_t *snd_mixer_last_elem(snd_mixer_t *mixer); +int snd_mixer_handle_events(snd_mixer_t *mixer); +int snd_mixer_attach(snd_mixer_t *mixer, const char *name); +int snd_mixer_detach(snd_mixer_t *mixer, const char *name); +int snd_mixer_poll_descriptors_count(snd_mixer_t *mixer); +int snd_mixer_poll_descriptors(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int space); +int snd_mixer_poll_descriptors_revents(snd_mixer_t *mixer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents); +int snd_mixer_load(snd_mixer_t *mixer); +void snd_mixer_free(snd_mixer_t *mixer); +int snd_mixer_wait(snd_mixer_t *mixer, int timeout); +int snd_mixer_set_compare(snd_mixer_t *mixer, snd_mixer_compare_t msort); +void snd_mixer_set_callback(snd_mixer_t *obj, snd_mixer_callback_t val); +void * snd_mixer_get_callback_private(const snd_mixer_t *obj); +void snd_mixer_set_callback_private(snd_mixer_t *obj, void * val); +unsigned int snd_mixer_get_count(const snd_mixer_t *obj); +int snd_mixer_class_unregister(snd_mixer_class_t *clss); + +snd_mixer_elem_t *snd_mixer_elem_next(snd_mixer_elem_t *elem); +snd_mixer_elem_t *snd_mixer_elem_prev(snd_mixer_elem_t *elem); +void snd_mixer_elem_set_callback(snd_mixer_elem_t *obj, snd_mixer_elem_callback_t val); +void * snd_mixer_elem_get_callback_private(const snd_mixer_elem_t *obj); +void snd_mixer_elem_set_callback_private(snd_mixer_elem_t *obj, void * val); +snd_mixer_elem_type_t snd_mixer_elem_get_type(const snd_mixer_elem_t *obj); + + +/** + * \defgroup SimpleMixer Simple Mixer Interface + * \ingroup Mixer + * The simple mixer interface. + * \{ + */ + +/* Simple (legacy) mixer elements API */ + +/** Mixer simple element channel identifier */ +typedef enum _snd_mixer_selem_channel_id { + /** Unknown */ + SND_MIXER_SCHN_UNKNOWN = -1, + /** Front left */ + SND_MIXER_SCHN_FRONT_LEFT = 0, + /** Front right */ + SND_MIXER_SCHN_FRONT_RIGHT, + /** Front center */ + SND_MIXER_SCHN_FRONT_CENTER, + /** Rear left */ + SND_MIXER_SCHN_REAR_LEFT, + /** Rear right */ + SND_MIXER_SCHN_REAR_RIGHT, + /** Woofer */ + SND_MIXER_SCHN_WOOFER, + SND_MIXER_SCHN_LAST = 31, + /** Mono (Front left alias) */ + SND_MIXER_SCHN_MONO = SND_MIXER_SCHN_FRONT_LEFT +} snd_mixer_selem_channel_id_t; + +/** Mixer simple element - register options - abstraction level */ +enum snd_mixer_selem_regopt_abstract { + /** no abstraction - try use all universal controls from driver */ + SND_MIXER_SABSTRACT_NONE = 0, + /** basic abstraction - Master,PCM,CD,Aux,Record-Gain etc. */ + SND_MIXER_SABSTRACT_BASIC, +}; + +/** Mixer simple element - register options */ +struct snd_mixer_selem_regopt { + /** structure version */ + int ver; + /** v1: abstract layer selection */ + enum snd_mixer_selem_regopt_abstract abstract; + /** v1: playback PCM connected to mixer device */ + snd_pcm_t *playback_pcm; + /** v1: playback PCM connected to mixer device */ + snd_pcm_t *capture_pcm; +}; + +/** Mixer simple element identifier */ +typedef struct _snd_mixer_selem_id snd_mixer_selem_id_t; + +const char *snd_mixer_selem_channel_name(snd_mixer_selem_channel_id_t channel); + +int snd_mixer_selem_register(snd_mixer_t *mixer, + struct snd_mixer_selem_regopt *options, + snd_mixer_class_t **classp); +void snd_mixer_selem_get_id(snd_mixer_elem_t *element, + snd_mixer_selem_id_t *id); +const char *snd_mixer_selem_get_name(snd_mixer_elem_t *elem); +unsigned int snd_mixer_selem_get_index(snd_mixer_elem_t *elem); +snd_mixer_elem_t *snd_mixer_find_selem(snd_mixer_t *mixer, + const snd_mixer_selem_id_t *id); + +int snd_mixer_selem_is_active(snd_mixer_elem_t *elem); +int snd_mixer_selem_is_playback_mono(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_playback_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel); +int snd_mixer_selem_is_capture_mono(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_capture_channel(snd_mixer_elem_t *obj, snd_mixer_selem_channel_id_t channel); +int snd_mixer_selem_get_capture_group(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_common_volume(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_playback_volume(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_playback_volume_joined(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_capture_volume(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_capture_volume_joined(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_common_switch(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_playback_switch(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_playback_switch_joined(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_capture_switch(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_capture_switch_joined(snd_mixer_elem_t *elem); +int snd_mixer_selem_has_capture_switch_exclusive(snd_mixer_elem_t *elem); + +int snd_mixer_selem_get_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value); +int snd_mixer_selem_get_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value); +int snd_mixer_selem_get_playback_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value); +int snd_mixer_selem_get_capture_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long *value); +int snd_mixer_selem_get_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value); +int snd_mixer_selem_get_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int *value); +int snd_mixer_selem_set_playback_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value); +int snd_mixer_selem_set_capture_volume(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value); +int snd_mixer_selem_set_playback_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value, int dir); +int snd_mixer_selem_set_capture_dB(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, long value, int dir); +int snd_mixer_selem_set_playback_volume_all(snd_mixer_elem_t *elem, long value); +int snd_mixer_selem_set_capture_volume_all(snd_mixer_elem_t *elem, long value); +int snd_mixer_selem_set_playback_volume_dB(snd_mixer_elem_t *elem, long value, int dir); +int snd_mixer_selem_set_capture_volume_dB(snd_mixer_elem_t *elem, long value, int dir); +int snd_mixer_selem_set_playback_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value); +int snd_mixer_selem_set_capture_switch(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, int value); +int snd_mixer_selem_set_playback_switch_all(snd_mixer_elem_t *elem, int value); +int snd_mixer_selem_set_capture_switch_all(snd_mixer_elem_t *elem, int value); +void snd_mixer_selem_get_playback_volume_range(snd_mixer_elem_t *elem, + long *min, long *max); +void snd_mixer_selem_get_playback_dB_range(snd_mixer_elem_t *elem, + long *min, long *max); +void snd_mixer_selem_set_playback_volume_range(snd_mixer_elem_t *elem, + long min, long max); +void snd_mixer_selem_get_capture_volume_range(snd_mixer_elem_t *elem, + long *min, long *max); +void snd_mixer_selem_get_capture_dB_range(snd_mixer_elem_t *elem, + long *min, long *max); +void snd_mixer_selem_set_capture_volume_range(snd_mixer_elem_t *elem, + long min, long max); + +int snd_mixer_selem_is_enumerated(snd_mixer_elem_t *elem); +int snd_mixer_selem_get_enum_items(snd_mixer_elem_t *elem); +int snd_mixer_selem_get_enum_item_name(snd_mixer_elem_t *elem, unsigned int idx, size_t maxlen, char *str); +int snd_mixer_selem_get_enum_item(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int *idxp); +int snd_mixer_selem_set_enum_item(snd_mixer_elem_t *elem, snd_mixer_selem_channel_id_t channel, unsigned int idx); + +size_t snd_mixer_selem_id_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_mixer_selem_id_t using standard alloca + * \param ptr returned pointer + */ +#define snd_mixer_selem_id_alloca(ptr) do { assert(ptr); *ptr = (snd_mixer_selem_id_t *) alloca(snd_mixer_selem_id_sizeof()); memset(*ptr, 0, snd_mixer_selem_id_sizeof()); } while (0) +int snd_mixer_selem_id_malloc(snd_mixer_selem_id_t **ptr); +void snd_mixer_selem_id_free(snd_mixer_selem_id_t *obj); +void snd_mixer_selem_id_copy(snd_mixer_selem_id_t *dst, const snd_mixer_selem_id_t *src); +const char *snd_mixer_selem_id_get_name(const snd_mixer_selem_id_t *obj); +unsigned int snd_mixer_selem_id_get_index(const snd_mixer_selem_id_t *obj); +void snd_mixer_selem_id_set_name(snd_mixer_selem_id_t *obj, const char *val); +void snd_mixer_selem_id_set_index(snd_mixer_selem_id_t *obj, unsigned int val); + +/** \} */ + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_MIXER_H */ + diff --git a/debian/include-alsa/alsa/mixer_ordinary.h b/debian/include-alsa/alsa/mixer_ordinary.h new file mode 100644 index 0000000..db362a5 --- /dev/null +++ b/debian/include-alsa/alsa/mixer_ordinary.h @@ -0,0 +1,219 @@ +/** + * \file <alsa/mixer_ordinary.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \date 2003 + * + * Application interface library for the ALSA driver. + * See the \ref mixer_ordinary page for more details. + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_MIXER_SIMPLE_H +#define __ALSA_MIXER_SIMPLE_H + +#include <alsa/asoundlib.h> + +/* + * Abbreviations: + * + * FLVOL - Front Left Volume (0-1000) + * FCLVOL - Front Center Left Volume (0-1000) + * FCVOL - Front Center Volume (0-1000) + * FCRVOL - Front Center Right Volume (0-1000) + * FRVOL - Front Right Volume (0-1000) + * FSLVOL - Front Side Left Volume (0-1000) + * FSRVOL - Front Side Right Volume (0-1000) + * RSLVOL - Rear Side Left Volume (0-1000) + * RSRVOL - Rear Side Right Volume (0-1000) + * RLVOL - Rear Left Volume (0-1000) + * RCVOL - Rear Center Volume (0-1000) + * RRVOL - Rear Right Volume (0-1000) + * LFEVOL - Low Frequency Effects (Subwoofer) Volume (0-1000) + * OVRVOL - Overhead Volume (0-1000) + */ + +/** Ordinary Mixer I/O type */ +enum sndo_mixer_io_type { + + /* + * playback section + */ + + /* Master */ + SNDO_MIO_MASTER_FLVOL = 0 * 0x40, + SNDO_MIO_MASTER_FCLVOL, + SNDO_MIO_MASTER_FCVOL, + SNDO_MIO_MASTER_FCRVOL, + SNDO_MIO_MASTER_FRVOL, + SNDO_MIO_MASTER_FSLVOL, + SNDO_MIO_MASTER_FSRVOL, + SNDO_MIO_MASTER_RSLVOL, + SNDO_MIO_MASTER_RSRVOL, + SNDO_MIO_MASTER_RLVOL, + SNDO_MIO_MASTER_RCVOL, + SNDO_MIO_MASTER_RRVOL, + SNDO_MIO_MASTER_LFEVOL, + SNDO_MIO_MASTER_OVRVOL, + + /* PCM */ + SNDO_MIO_PCM_FLVOL = 1 * 0x40, + SNDO_MIO_PCM_FCLVOL, + SNDO_MIO_PCM_FCVOL, + SNDO_MIO_PCM_FCRVOL, + SNDO_MIO_PCM_FRVOL, + SNDO_MIO_PCM_FSLVOL, + SNDO_MIO_PCM_FSRVOL, + SNDO_MIO_PCM_RSLVOL, + SNDO_MIO_PCM_RSRVOL, + SNDO_MIO_PCM_RLVOL, + SNDO_MIO_PCM_RCVOL, + SNDO_MIO_PCM_RRVOL, + SNDO_MIO_PCM_LFEVOL, + SNDO_MIO_PCM_OVRVOL, + + /* LINE */ + SNDO_MIO_LINE_FLVOL = 2 * 0x40, + SNDO_MIO_LINE_FCLVOL, + SNDO_MIO_LINE_FCVOL, + SNDO_MIO_LINE_FCRVOL, + SNDO_MIO_LINE_FRVOL, + SNDO_MIO_LINE_FSLVOL, + SNDO_MIO_LINE_FSRVOL, + SNDO_MIO_LINE_RSLVOL, + SNDO_MIO_LINE_RSRVOL, + SNDO_MIO_LINE_RLVOL, + SNDO_MIO_LINE_RCVOL, + SNDO_MIO_LINE_RRVOL, + SNDO_MIO_LINE_LFEVOL, + SNDO_MIO_LINE_OVRVOL, + + /* MIC */ + SNDO_MIO_MIC_FLVOL = 3 * 0x40, + SNDO_MIO_MIC_FCLVOL, + SNDO_MIO_MIC_FCVOL, + SNDO_MIO_MIC_FCRVOL, + SNDO_MIO_MIC_FRVOL, + SNDO_MIO_MIC_FSLVOL, + SNDO_MIO_MIC_FSRVOL, + SNDO_MIO_MIC_RSLVOL, + SNDO_MIO_MIC_RSRVOL, + SNDO_MIO_MIC_RLVOL, + SNDO_MIO_MIC_RCVOL, + SNDO_MIO_MIC_RRVOL, + SNDO_MIO_MIC_LFEVOL, + SNDO_MIO_MIC_OVRVOL, + + /* CD */ + SNDO_MIO_CD_FLVOL = 4 * 0x40, + SNDO_MIO_CD_FCLVOL, + SNDO_MIO_CD_FCVOL, + SNDO_MIO_CD_FCRVOL, + SNDO_MIO_CD_FRVOL, + SNDO_MIO_CD_FSLVOL, + SNDO_MIO_CD_FSRVOL, + SNDO_MIO_CD_RSLVOL, + SNDO_MIO_CD_RSRVOL, + SNDO_MIO_CD_RLVOL, + SNDO_MIO_CD_RCVOL, + SNDO_MIO_CD_RRVOL, + SNDO_MIO_CD_LFEVOL, + SNDO_MIO_CD_OVRVOL, + + /* AUX */ + SNDO_MIO_AUX_FLVOL = 5 * 0x40, + SNDO_MIO_AUX_FCLVOL, + SNDO_MIO_AUX_FCVOL, + SNDO_MIO_AUX_FCRVOL, + SNDO_MIO_AUX_FRVOL, + SNDO_MIO_AUX_FSLVOL, + SNDO_MIO_AUX_FSRVOL, + SNDO_MIO_AUX_RSLVOL, + SNDO_MIO_AUX_RSRVOL, + SNDO_MIO_AUX_RLVOL, + SNDO_MIO_AUX_RCVOL, + SNDO_MIO_AUX_RRVOL, + SNDO_MIO_AUX_LFEVOL, + SNDO_MIO_AUX_OVRVOL, + + /* + * capture section + */ + + /* capture gain */ + SNDO_MIO_CGAIN_FL = 0x8000, + SNDO_MIO_CGAIN_FCL, + SNDO_MIO_CGAIN_FC, + SNDO_MIO_CGAIN_FCR, + SNDO_MIO_CGAIN_FR, + SNDO_MIO_CGAIN_FSL, + SNDO_MIO_CGAIN_FSR, + SNDO_MIO_CGAIN_RSL, + SNDO_MIO_CGAIN_RSR, + SNDO_MIO_CGAIN_RL, + SNDO_MIO_CGAIN_RC, + SNDO_MIO_CGAIN_RR, + SNDO_MIO_CGAIN_LFE, + SNDO_MIO_CGAIN_OVR, + + /* capture source (0 = off, 1 = on) */ + SNDO_MIO_CSOURCE_MIC = 0x8100, + SNDO_MIO_CSOURCE_LINE, + SNDO_MIO_CSOURCE_CD, + SNDO_MIO_CSOURCE_AUX, + SNDO_MIO_CSOURCE_MIX, + + /* misc */ + SNDO_MIO_STEREO = 0x8200, /* (0 = off, 1 = on) standard stereo source, might be converted to use all outputs */ +}; + +typedef struct sndo_mixer sndo_mixer_t; +struct alisp_cfg; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup Mixer_ordinary Mixer Ordinary Interface + * See the \ref mixer_ordinary page for more details. + * \{ + */ + +int sndo_mixer_open(sndo_mixer_t **pmixer, const char *playback_name, const char *capture_name, struct alisp_cfg *lconf); +int sndo_mixer_open_pcm(sndo_mixer_t **pmixer, snd_pcm_t *playback_pcm, snd_pcm_t *capture_pcm, struct alisp_cfg *lconf); +int sndo_mixer_close(sndo_mixer_t *mixer); +int sndo_mixer_poll_descriptors_count(sndo_mixer_t *mixer); +int sndo_mixer_poll_descriptors(sndo_mixer_t *mixer, struct pollfd *pfds, unsigned int space); +int sndo_mixer_poll_descriptors_revents(sndo_mixer_t *mixer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents); +int sndo_mixer_io_get_name(enum sndo_mixer_io_type type, char **name); +int sndo_mixer_io_get(sndo_mixer_t *mixer, enum sndo_mixer_io_type type, int *val); +int sndo_mixer_io_set(sndo_mixer_t *mixer, enum sndo_mixer_io_type type, int *val); +int sndo_mixer_io_try_set(sndo_mixer_t *mixer, enum sndo_mixer_io_type type, int *val); +int sndo_mixer_io_get_dB(sndo_mixer_t *mixer, enum sndo_mixer_io_type type, int *val); +int sndo_mixer_io_set_dB(sndo_mixer_t *mixer, enum sndo_mixer_io_type type, int *val); +int sndo_mixer_io_try_set_dB(sndo_mixer_t *mixer, enum sndo_mixer_io_type type, int *val); +int sndo_mixer_io_change(sndo_mixer_t *mixer, enum sndo_mixer_io_type *changed, int changed_array_size); + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_MIXER_SIMPLE_H */ diff --git a/debian/include-alsa/alsa/output.h b/debian/include-alsa/alsa/output.h new file mode 100644 index 0000000..6c7fdca --- /dev/null +++ b/debian/include-alsa/alsa/output.h @@ -0,0 +1,86 @@ +/** + * \file <alsa/output.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + */ +/* + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_OUTPUT_H +#define __ALSA_OUTPUT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup Output Output Interface + * + * The output functions present an interface similar to the stdio functions + * on top of different underlying output destinations. + * + * Many PCM debugging functions (\c snd_pcm_xxx_dump_xxx) use such an output + * handle to be able to write not only to the screen but also to other + * destinations, e.g. to files or to memory buffers. + * + * \{ + */ + +/** + * \brief Internal structure for an output object. + * + * The ALSA library uses a pointer to this structure as a handle to an + * output object. Applications don't access its contents directly. + */ +typedef struct _snd_output snd_output_t; + +/** Output type. */ +typedef enum _snd_output_type { + /** Output to a stdio stream. */ + SND_OUTPUT_STDIO, + /** Output to a memory buffer. */ + SND_OUTPUT_BUFFER +} snd_output_type_t; + +int snd_output_stdio_open(snd_output_t **outputp, const char *file, const char *mode); +int snd_output_stdio_attach(snd_output_t **outputp, FILE *fp, int _close); +int snd_output_buffer_open(snd_output_t **outputp); +size_t snd_output_buffer_string(snd_output_t *output, char **buf); +int snd_output_close(snd_output_t *output); +int snd_output_printf(snd_output_t *output, const char *format, ...) +#ifndef DOC_HIDDEN + __attribute__ ((format (printf, 2, 3))) +#endif + ; +int snd_output_vprintf(snd_output_t *output, const char *format, va_list args); +int snd_output_puts(snd_output_t *output, const char *str); +int snd_output_putc(snd_output_t *output, int c); +int snd_output_flush(snd_output_t *output); + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_OUTPUT_H */ + diff --git a/debian/include-alsa/alsa/pcm.h b/debian/include-alsa/alsa/pcm.h new file mode 100644 index 0000000..9ddfe0b --- /dev/null +++ b/debian/include-alsa/alsa/pcm.h @@ -0,0 +1,1302 @@ +/** + * \file <alsa/pcm.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver. + * See the \ref pcm page for more details. + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_PCM_H +#define __ALSA_PCM_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup PCM PCM Interface + * See the \ref pcm page for more details. + * \{ + */ + +/** dlsym version for interface entry callback */ +#define SND_PCM_DLSYM_VERSION _dlsym_pcm_001 + +/** PCM generic info container */ +typedef struct _snd_pcm_info snd_pcm_info_t; +/** PCM hardware configuration space container */ +typedef struct _snd_pcm_hw_params snd_pcm_hw_params_t; +/** PCM software configuration container */ +typedef struct _snd_pcm_sw_params snd_pcm_sw_params_t; +/** PCM status container */ + typedef struct _snd_pcm_status snd_pcm_status_t; +/** PCM access types mask */ +typedef struct _snd_pcm_access_mask snd_pcm_access_mask_t; +/** PCM formats mask */ +typedef struct _snd_pcm_format_mask snd_pcm_format_mask_t; +/** PCM subformats mask */ +typedef struct _snd_pcm_subformat_mask snd_pcm_subformat_mask_t; + +/** PCM class */ +typedef enum _snd_pcm_class { + /** standard device */ + + SND_PCM_CLASS_GENERIC = 0, + /** multichannel device */ + SND_PCM_CLASS_MULTI, + /** software modem device */ + SND_PCM_CLASS_MODEM, + /** digitizer device */ + SND_PCM_CLASS_DIGITIZER, + SND_PCM_CLASS_LAST = SND_PCM_CLASS_DIGITIZER +} snd_pcm_class_t; + +/** PCM subclass */ +typedef enum _snd_pcm_subclass { + /** subdevices are mixed together */ + SND_PCM_SUBCLASS_GENERIC_MIX = 0, + /** multichannel subdevices are mixed together */ + SND_PCM_SUBCLASS_MULTI_MIX, + SND_PCM_SUBCLASS_LAST = SND_PCM_SUBCLASS_MULTI_MIX +} snd_pcm_subclass_t; + +/** PCM stream (direction) */ +typedef enum _snd_pcm_stream { + /** Playback stream */ + SND_PCM_STREAM_PLAYBACK = 0, + /** Capture stream */ + SND_PCM_STREAM_CAPTURE, + SND_PCM_STREAM_LAST = SND_PCM_STREAM_CAPTURE +} snd_pcm_stream_t; + +/** PCM access type */ +typedef enum _snd_pcm_access { + /** mmap access with simple interleaved channels */ + SND_PCM_ACCESS_MMAP_INTERLEAVED = 0, + /** mmap access with simple non interleaved channels */ + SND_PCM_ACCESS_MMAP_NONINTERLEAVED, + /** mmap access with complex placement */ + SND_PCM_ACCESS_MMAP_COMPLEX, + /** snd_pcm_readi/snd_pcm_writei access */ + SND_PCM_ACCESS_RW_INTERLEAVED, + /** snd_pcm_readn/snd_pcm_writen access */ + SND_PCM_ACCESS_RW_NONINTERLEAVED, + SND_PCM_ACCESS_LAST = SND_PCM_ACCESS_RW_NONINTERLEAVED +} snd_pcm_access_t; + +/** PCM sample format */ +typedef enum _snd_pcm_format { + /** Unknown */ + SND_PCM_FORMAT_UNKNOWN = -1, + /** Signed 8 bit */ + SND_PCM_FORMAT_S8 = 0, + /** Unsigned 8 bit */ + SND_PCM_FORMAT_U8, + /** Signed 16 bit Little Endian */ + SND_PCM_FORMAT_S16_LE, + /** Signed 16 bit Big Endian */ + SND_PCM_FORMAT_S16_BE, + /** Unsigned 16 bit Little Endian */ + SND_PCM_FORMAT_U16_LE, + /** Unsigned 16 bit Big Endian */ + SND_PCM_FORMAT_U16_BE, + /** Signed 24 bit Little Endian */ + SND_PCM_FORMAT_S24_LE, + /** Signed 24 bit Big Endian */ + SND_PCM_FORMAT_S24_BE, + /** Unsigned 24 bit Little Endian */ + SND_PCM_FORMAT_U24_LE, + /** Unsigned 24 bit Big Endian */ + SND_PCM_FORMAT_U24_BE, + /** Signed 32 bit Little Endian */ + SND_PCM_FORMAT_S32_LE, + /** Signed 32 bit Big Endian */ + SND_PCM_FORMAT_S32_BE, + /** Unsigned 32 bit Little Endian */ + SND_PCM_FORMAT_U32_LE, + /** Unsigned 32 bit Big Endian */ + SND_PCM_FORMAT_U32_BE, + /** Float 32 bit Little Endian, Range -1.0 to 1.0 */ + SND_PCM_FORMAT_FLOAT_LE, + /** Float 32 bit Big Endian, Range -1.0 to 1.0 */ + SND_PCM_FORMAT_FLOAT_BE, + /** Float 64 bit Little Endian, Range -1.0 to 1.0 */ + SND_PCM_FORMAT_FLOAT64_LE, + /** Float 64 bit Big Endian, Range -1.0 to 1.0 */ + SND_PCM_FORMAT_FLOAT64_BE, + /** IEC-958 Little Endian */ + SND_PCM_FORMAT_IEC958_SUBFRAME_LE, + /** IEC-958 Big Endian */ + SND_PCM_FORMAT_IEC958_SUBFRAME_BE, + /** Mu-Law */ + SND_PCM_FORMAT_MU_LAW, + /** A-Law */ + SND_PCM_FORMAT_A_LAW, + /** Ima-ADPCM */ + SND_PCM_FORMAT_IMA_ADPCM, + /** MPEG */ + SND_PCM_FORMAT_MPEG, + /** GSM */ + SND_PCM_FORMAT_GSM, + /** Special */ + SND_PCM_FORMAT_SPECIAL = 31, + /** Signed 24bit Little Endian in 3bytes format */ + SND_PCM_FORMAT_S24_3LE = 32, + /** Signed 24bit Big Endian in 3bytes format */ + SND_PCM_FORMAT_S24_3BE, + /** Unsigned 24bit Little Endian in 3bytes format */ + SND_PCM_FORMAT_U24_3LE, + /** Unsigned 24bit Big Endian in 3bytes format */ + SND_PCM_FORMAT_U24_3BE, + /** Signed 20bit Little Endian in 3bytes format */ + SND_PCM_FORMAT_S20_3LE, + /** Signed 20bit Big Endian in 3bytes format */ + SND_PCM_FORMAT_S20_3BE, + /** Unsigned 20bit Little Endian in 3bytes format */ + SND_PCM_FORMAT_U20_3LE, + /** Unsigned 20bit Big Endian in 3bytes format */ + SND_PCM_FORMAT_U20_3BE, + /** Signed 18bit Little Endian in 3bytes format */ + SND_PCM_FORMAT_S18_3LE, + /** Signed 18bit Big Endian in 3bytes format */ + SND_PCM_FORMAT_S18_3BE, + /** Unsigned 18bit Little Endian in 3bytes format */ + SND_PCM_FORMAT_U18_3LE, + /** Unsigned 18bit Big Endian in 3bytes format */ + SND_PCM_FORMAT_U18_3BE, + SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_U18_3BE, + +#if __BYTE_ORDER == __LITTLE_ENDIAN + /** Signed 16 bit CPU endian */ + SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_LE, + /** Unsigned 16 bit CPU endian */ + SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_LE, + /** Signed 24 bit CPU endian */ + SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_LE, + /** Unsigned 24 bit CPU endian */ + SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_LE, + /** Signed 32 bit CPU endian */ + SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_LE, + /** Unsigned 32 bit CPU endian */ + SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_LE, + /** Float 32 bit CPU endian */ + SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_LE, + /** Float 64 bit CPU endian */ + SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_LE, + /** IEC-958 CPU Endian */ + SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_LE +#elif __BYTE_ORDER == __BIG_ENDIAN + /** Signed 16 bit CPU endian */ + SND_PCM_FORMAT_S16 = SND_PCM_FORMAT_S16_BE, + /** Unsigned 16 bit CPU endian */ + SND_PCM_FORMAT_U16 = SND_PCM_FORMAT_U16_BE, + /** Signed 24 bit CPU endian */ + SND_PCM_FORMAT_S24 = SND_PCM_FORMAT_S24_BE, + /** Unsigned 24 bit CPU endian */ + SND_PCM_FORMAT_U24 = SND_PCM_FORMAT_U24_BE, + /** Signed 32 bit CPU endian */ + SND_PCM_FORMAT_S32 = SND_PCM_FORMAT_S32_BE, + /** Unsigned 32 bit CPU endian */ + SND_PCM_FORMAT_U32 = SND_PCM_FORMAT_U32_BE, + /** Float 32 bit CPU endian */ + SND_PCM_FORMAT_FLOAT = SND_PCM_FORMAT_FLOAT_BE, + /** Float 64 bit CPU endian */ + SND_PCM_FORMAT_FLOAT64 = SND_PCM_FORMAT_FLOAT64_BE, + /** IEC-958 CPU Endian */ + SND_PCM_FORMAT_IEC958_SUBFRAME = SND_PCM_FORMAT_IEC958_SUBFRAME_BE +#else +#error "Unknown endian" +#endif +} snd_pcm_format_t; + +/** PCM sample subformat */ +typedef enum _snd_pcm_subformat { + /** Standard */ + SND_PCM_SUBFORMAT_STD = 0, + SND_PCM_SUBFORMAT_LAST = SND_PCM_SUBFORMAT_STD +} snd_pcm_subformat_t; + +/** PCM state */ +typedef enum _snd_pcm_state { + /** Open */ + SND_PCM_STATE_OPEN = 0, + /** Setup installed */ + SND_PCM_STATE_SETUP, + /** Ready to start */ + SND_PCM_STATE_PREPARED, + /** Running */ + SND_PCM_STATE_RUNNING, + /** Stopped: underrun (playback) or overrun (capture) detected */ + SND_PCM_STATE_XRUN, + /** Draining: running (playback) or stopped (capture) */ + SND_PCM_STATE_DRAINING, + /** Paused */ + SND_PCM_STATE_PAUSED, + /** Hardware is suspended */ + SND_PCM_STATE_SUSPENDED, + /** Hardware is disconnected */ + SND_PCM_STATE_DISCONNECTED, + SND_PCM_STATE_LAST = SND_PCM_STATE_DISCONNECTED +} snd_pcm_state_t; + +/** PCM start mode */ +typedef enum _snd_pcm_start { + /** Automatic start on data read/write */ + SND_PCM_START_DATA = 0, + /** Explicit start */ + SND_PCM_START_EXPLICIT, + SND_PCM_START_LAST = SND_PCM_START_EXPLICIT +} snd_pcm_start_t; + +/** PCM xrun mode */ +typedef enum _snd_pcm_xrun { + /** Xrun detection disabled */ + SND_PCM_XRUN_NONE = 0, + /** Stop on xrun detection */ + SND_PCM_XRUN_STOP, + SND_PCM_XRUN_LAST = SND_PCM_XRUN_STOP +} snd_pcm_xrun_t; + +/** PCM timestamp mode */ +typedef enum _snd_pcm_tstamp { + /** No timestamp */ + SND_PCM_TSTAMP_NONE = 0, + /** Update mmap'ed timestamp */ + SND_PCM_TSTAMP_MMAP, + SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_MMAP +} snd_pcm_tstamp_t; + +/** Unsigned frames quantity */ +typedef unsigned long snd_pcm_uframes_t; +/** Signed frames quantity */ +typedef long snd_pcm_sframes_t; + +/** Non blocking mode (flag for open mode) \hideinitializer */ +#define SND_PCM_NONBLOCK 0x0001 +/** Async notification (flag for open mode) \hideinitializer */ +#define SND_PCM_ASYNC 0x0002 + +/** PCM handle */ +typedef struct _snd_pcm snd_pcm_t; + +/** PCM type */ +enum _snd_pcm_type { + /** Kernel level PCM */ + SND_PCM_TYPE_HW = 0, + /** Hooked PCM */ + SND_PCM_TYPE_HOOKS, + /** One ore more linked PCM with exclusive access to selected + channels */ + SND_PCM_TYPE_MULTI, + /** File writing plugin */ + SND_PCM_TYPE_FILE, + /** Null endpoint PCM */ + SND_PCM_TYPE_NULL, + /** Shared memory client PCM */ + SND_PCM_TYPE_SHM, + /** INET client PCM (not yet implemented) */ + SND_PCM_TYPE_INET, + /** Copying plugin */ + SND_PCM_TYPE_COPY, + /** Linear format conversion PCM */ + SND_PCM_TYPE_LINEAR, + /** A-Law format conversion PCM */ + SND_PCM_TYPE_ALAW, + /** Mu-Law format conversion PCM */ + SND_PCM_TYPE_MULAW, + /** IMA-ADPCM format conversion PCM */ + SND_PCM_TYPE_ADPCM, + /** Rate conversion PCM */ + SND_PCM_TYPE_RATE, + /** Attenuated static route PCM */ + SND_PCM_TYPE_ROUTE, + /** Format adjusted PCM */ + SND_PCM_TYPE_PLUG, + /** Sharing PCM */ + SND_PCM_TYPE_SHARE, + /** Meter plugin */ + SND_PCM_TYPE_METER, + /** Mixing PCM */ + SND_PCM_TYPE_MIX, + /** Attenuated dynamic route PCM (not yet implemented) */ + SND_PCM_TYPE_DROUTE, + /** Loopback server plugin (not yet implemented) */ + SND_PCM_TYPE_LBSERVER, + /** Linear Integer <-> Linear Float format conversion PCM */ + SND_PCM_TYPE_LINEAR_FLOAT, + /** LADSPA integration plugin */ + SND_PCM_TYPE_LADSPA, + /** Direct Mixing plugin */ + SND_PCM_TYPE_DMIX, + /** Jack Audio Connection Kit plugin */ + SND_PCM_TYPE_JACK, + /** Direct Snooping plugin */ + SND_PCM_TYPE_DSNOOP, + /** Direct Sharing plugin */ + SND_PCM_TYPE_DSHARE, + /** IEC958 subframe plugin */ + SND_PCM_TYPE_IEC958, + SND_PCM_TYPE_LAST = SND_PCM_TYPE_DSNOOP +}; + +/** PCM type */ +typedef enum _snd_pcm_type snd_pcm_type_t; + +/** PCM area specification */ +typedef struct _snd_pcm_channel_area { + /** base address of channel samples */ + void *addr; + /** offset to first sample in bits */ + unsigned int first; + /** samples distance in bits */ + unsigned int step; +} snd_pcm_channel_area_t; + +/** PCM synchronization ID */ +typedef union _snd_pcm_sync_id { + /** 8-bit ID */ + unsigned char id[16]; + /** 16-bit ID */ + unsigned short id16[8]; + /** 32-bit ID */ + unsigned int id32[4]; +} snd_pcm_sync_id_t; + +/** #SND_PCM_TYPE_METER scope handle */ +typedef struct _snd_pcm_scope snd_pcm_scope_t; + +int snd_pcm_open(snd_pcm_t **pcm, const char *name, + snd_pcm_stream_t stream, int mode); +int snd_pcm_open_lconf(snd_pcm_t **pcm, const char *name, + snd_pcm_stream_t stream, int mode, + snd_config_t *lconf); + +int snd_pcm_close(snd_pcm_t *pcm); +const char *snd_pcm_name(snd_pcm_t *pcm); +snd_pcm_type_t snd_pcm_type(snd_pcm_t *pcm); +snd_pcm_stream_t snd_pcm_stream(snd_pcm_t *pcm); +int snd_pcm_poll_descriptors_count(snd_pcm_t *pcm); +int snd_pcm_poll_descriptors(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int space); +int snd_pcm_poll_descriptors_revents(snd_pcm_t *pcm, struct pollfd *pfds, unsigned int nfds, unsigned short *revents); +int snd_pcm_nonblock(snd_pcm_t *pcm, int nonblock); +int snd_async_add_pcm_handler(snd_async_handler_t **handler, snd_pcm_t *pcm, + snd_async_callback_t callback, void *private_data); +snd_pcm_t *snd_async_handler_get_pcm(snd_async_handler_t *handler); +int snd_pcm_info(snd_pcm_t *pcm, snd_pcm_info_t *info); +int snd_pcm_hw_params_current(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); +int snd_pcm_hw_params(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); +int snd_pcm_hw_free(snd_pcm_t *pcm); +int snd_pcm_sw_params_current(snd_pcm_t *pcm, snd_pcm_sw_params_t *params); +int snd_pcm_sw_params(snd_pcm_t *pcm, snd_pcm_sw_params_t *params); +int snd_pcm_prepare(snd_pcm_t *pcm); +int snd_pcm_reset(snd_pcm_t *pcm); +int snd_pcm_status(snd_pcm_t *pcm, snd_pcm_status_t *status); +int snd_pcm_start(snd_pcm_t *pcm); +int snd_pcm_drop(snd_pcm_t *pcm); +int snd_pcm_drain(snd_pcm_t *pcm); +int snd_pcm_pause(snd_pcm_t *pcm, int enable); +snd_pcm_state_t snd_pcm_state(snd_pcm_t *pcm); +int snd_pcm_hwsync(snd_pcm_t *pcm); +int snd_pcm_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp); +int snd_pcm_resume(snd_pcm_t *pcm); +snd_pcm_sframes_t snd_pcm_avail_update(snd_pcm_t *pcm); +snd_pcm_sframes_t snd_pcm_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames); +snd_pcm_sframes_t snd_pcm_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames); +snd_pcm_sframes_t snd_pcm_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size); +snd_pcm_sframes_t snd_pcm_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size); +snd_pcm_sframes_t snd_pcm_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size); +snd_pcm_sframes_t snd_pcm_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size); +int snd_pcm_wait(snd_pcm_t *pcm, int timeout); + +int snd_pcm_link(snd_pcm_t *pcm1, snd_pcm_t *pcm2); +int snd_pcm_unlink(snd_pcm_t *pcm); + +/** \} */ + +/** + * \defgroup PCM_Info Stream Information + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +size_t snd_pcm_info_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_pcm_info_t using standard alloca + * \param ptr returned pointer + */ +#define snd_pcm_info_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_info_t *) alloca(snd_pcm_info_sizeof()); memset(*ptr, 0, snd_pcm_info_sizeof()); } while (0) +int snd_pcm_info_malloc(snd_pcm_info_t **ptr); +void snd_pcm_info_free(snd_pcm_info_t *obj); +void snd_pcm_info_copy(snd_pcm_info_t *dst, const snd_pcm_info_t *src); +unsigned int snd_pcm_info_get_device(const snd_pcm_info_t *obj); +unsigned int snd_pcm_info_get_subdevice(const snd_pcm_info_t *obj); +snd_pcm_stream_t snd_pcm_info_get_stream(const snd_pcm_info_t *obj); +int snd_pcm_info_get_card(const snd_pcm_info_t *obj); +const char *snd_pcm_info_get_id(const snd_pcm_info_t *obj); +const char *snd_pcm_info_get_name(const snd_pcm_info_t *obj); +const char *snd_pcm_info_get_subdevice_name(const snd_pcm_info_t *obj); +snd_pcm_class_t snd_pcm_info_get_class(const snd_pcm_info_t *obj); +snd_pcm_subclass_t snd_pcm_info_get_subclass(const snd_pcm_info_t *obj); +unsigned int snd_pcm_info_get_subdevices_count(const snd_pcm_info_t *obj); +unsigned int snd_pcm_info_get_subdevices_avail(const snd_pcm_info_t *obj); +snd_pcm_sync_id_t snd_pcm_info_get_sync(const snd_pcm_info_t *obj); +void snd_pcm_info_set_device(snd_pcm_info_t *obj, unsigned int val); +void snd_pcm_info_set_subdevice(snd_pcm_info_t *obj, unsigned int val); +void snd_pcm_info_set_stream(snd_pcm_info_t *obj, snd_pcm_stream_t val); + +/** \} */ + +/** + * \defgroup PCM_HW_Params Hardware Parameters + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +int snd_pcm_hw_params_any(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + +int snd_pcm_hw_params_can_mmap_sample_resolution(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_is_double(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_is_batch(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_is_block_transfer(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_can_overrange(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_can_pause(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_can_resume(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_is_half_duplex(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_is_joint_duplex(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_can_sync_start(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_get_rate_numden(const snd_pcm_hw_params_t *params, + unsigned int *rate_num, + unsigned int *rate_den); +int snd_pcm_hw_params_get_sbits(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_get_fifo_size(const snd_pcm_hw_params_t *params); + +#if 0 +typedef struct _snd_pcm_hw_strategy snd_pcm_hw_strategy_t; + +/* choices need to be sorted on ascending badness */ +typedef struct _snd_pcm_hw_strategy_simple_choices_list { + unsigned int value; + unsigned int badness; +} snd_pcm_hw_strategy_simple_choices_list_t; + +int snd_pcm_hw_params_strategy(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, + const snd_pcm_hw_strategy_t *strategy, + unsigned int badness_min, + unsigned int badness_max); + +void snd_pcm_hw_strategy_free(snd_pcm_hw_strategy_t *strategy); +int snd_pcm_hw_strategy_simple(snd_pcm_hw_strategy_t **strategyp, + unsigned int badness_min, + unsigned int badness_max); +int snd_pcm_hw_params_try_explain_failure(snd_pcm_t *pcm, + snd_pcm_hw_params_t *fail, + snd_pcm_hw_params_t *success, + unsigned int depth, + snd_output_t *out); + +#endif + +size_t snd_pcm_hw_params_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_pcm_hw_params_t using standard alloca + * \param ptr returned pointer + */ +#define snd_pcm_hw_params_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_hw_params_t *) alloca(snd_pcm_hw_params_sizeof()); memset(*ptr, 0, snd_pcm_hw_params_sizeof()); } while (0) +int snd_pcm_hw_params_malloc(snd_pcm_hw_params_t **ptr); +void snd_pcm_hw_params_free(snd_pcm_hw_params_t *obj); +void snd_pcm_hw_params_copy(snd_pcm_hw_params_t *dst, const snd_pcm_hw_params_t *src); + +#ifndef ALSA_LIBRARY_BUILD + +#ifndef ALSA_PCM_OLD_HW_PARAMS_API + +int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params, snd_pcm_access_t *access); +int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t access); +int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t access); +int snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *access); +int snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t *access); +int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask); +int snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask); + +int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params, snd_pcm_format_t *val); +int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val); +int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val); +int snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format); +int snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t *format); +int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask); +void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask); + +int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat); +int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat); +int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t subformat); +int snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat); +int snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t *subformat); +int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask); +void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask); + +int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params, unsigned int *val); +int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params, unsigned int *val); +int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params, unsigned int *val); +int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); +int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); +int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); +int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); +int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max); +int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); +int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); +int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); + +int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_rate_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir); +int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); + +int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_period_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir); +int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); + +int snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir); +int snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir); +int snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *frames, int *dir); +int snd_pcm_hw_params_test_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir); +int snd_pcm_hw_params_set_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir); +int snd_pcm_hw_params_set_period_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir); +int snd_pcm_hw_params_set_period_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir); +int snd_pcm_hw_params_set_period_size_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *min, int *mindir, snd_pcm_uframes_t *max, int *maxdir); +int snd_pcm_hw_params_set_period_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir); +int snd_pcm_hw_params_set_period_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir); +int snd_pcm_hw_params_set_period_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir); +int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + +int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_periods_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir); +int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + +int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_buffer_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir); +int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); + +int snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val); +int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val); +int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_hw_params_set_buffer_size_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *min, snd_pcm_uframes_t *max); +int snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); + +int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_test_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_tick_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_tick_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_tick_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir); +int snd_pcm_hw_params_set_tick_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_tick_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_tick_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); + +#else + +asm(".symver snd_pcm_hw_params_get_access,snd_pcm_hw_params_get_access@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_access_first,snd_pcm_hw_params_set_access_first@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_access_last,snd_pcm_hw_params_set_access_last@ALSA_0.9"); + +int snd_pcm_hw_params_get_access(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_test_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t val); +int snd_pcm_hw_params_set_access(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_t val); +snd_pcm_access_t snd_pcm_hw_params_set_access_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); +snd_pcm_access_t snd_pcm_hw_params_set_access_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_set_access_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask); +void snd_pcm_hw_params_get_access_mask(snd_pcm_hw_params_t *params, snd_pcm_access_mask_t *mask); + +asm(".symver snd_pcm_hw_params_get_format,snd_pcm_hw_params_get_format@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_format_first,snd_pcm_hw_params_set_format_first@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_format_last,snd_pcm_hw_params_set_format_last@ALSA_0.9"); + +int snd_pcm_hw_params_get_format(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_test_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val); +int snd_pcm_hw_params_set_format(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_t val); +snd_pcm_format_t snd_pcm_hw_params_set_format_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); +snd_pcm_format_t snd_pcm_hw_params_set_format_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_set_format_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask); +void snd_pcm_hw_params_get_format_mask(snd_pcm_hw_params_t *params, snd_pcm_format_mask_t *mask); + +asm(".symver snd_pcm_hw_params_get_subformat,snd_pcm_hw_params_get_subformat@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_subformat_first,snd_pcm_hw_params_set_subformat_first@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_subformat_last,snd_pcm_hw_params_set_subformat_last@ALSA_0.9"); + +int snd_pcm_hw_params_test_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t val); +int snd_pcm_hw_params_get_subformat(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_set_subformat(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_t val); +snd_pcm_subformat_t snd_pcm_hw_params_set_subformat_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); +snd_pcm_subformat_t snd_pcm_hw_params_set_subformat_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_set_subformat_mask(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask); +void snd_pcm_hw_params_get_subformat_mask(snd_pcm_hw_params_t *params, snd_pcm_subformat_mask_t *mask); + +asm(".symver snd_pcm_hw_params_get_channels,snd_pcm_hw_params_get_channels@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_channels_min,snd_pcm_hw_params_get_channels_min@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_channels_max,snd_pcm_hw_params_get_channels_max@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_channels_near,snd_pcm_hw_params_set_channels_near@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_channels_first,snd_pcm_hw_params_set_channels_first@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_channels_last,snd_pcm_hw_params_set_channels_last@ALSA_0.9"); + +int snd_pcm_hw_params_get_channels(const snd_pcm_hw_params_t *params); +unsigned int snd_pcm_hw_params_get_channels_min(const snd_pcm_hw_params_t *params); +unsigned int snd_pcm_hw_params_get_channels_max(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_test_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); +int snd_pcm_hw_params_set_channels(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); +int snd_pcm_hw_params_set_channels_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); +int snd_pcm_hw_params_set_channels_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val); +int snd_pcm_hw_params_set_channels_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, unsigned int *max); +unsigned int snd_pcm_hw_params_set_channels_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val); +unsigned int snd_pcm_hw_params_set_channels_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); +unsigned int snd_pcm_hw_params_set_channels_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + +asm(".symver snd_pcm_hw_params_get_rate,snd_pcm_hw_params_get_rate@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_rate_min,snd_pcm_hw_params_get_rate_min@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_rate_max,snd_pcm_hw_params_get_rate_max@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_rate_near,snd_pcm_hw_params_set_rate_near@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_rate_first,snd_pcm_hw_params_set_rate_first@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_rate_last,snd_pcm_hw_params_set_rate_last@ALSA_0.9"); + +int snd_pcm_hw_params_get_rate(const snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_get_rate_min(const snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_get_rate_max(const snd_pcm_hw_params_t *params, int *dir); +int snd_pcm_hw_params_test_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_rate(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_rate_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_rate_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_rate_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir); +unsigned int snd_pcm_hw_params_set_rate_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir); +unsigned int snd_pcm_hw_params_set_rate_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_set_rate_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); + +asm(".symver snd_pcm_hw_params_get_period_time,snd_pcm_hw_params_get_period_time@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_period_time_min,snd_pcm_hw_params_get_period_time_min@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_period_time_max,snd_pcm_hw_params_get_period_time_max@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_period_time_near,snd_pcm_hw_params_set_period_time_near@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_period_time_first,snd_pcm_hw_params_set_period_time_first@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_period_time_last,snd_pcm_hw_params_set_period_time_last@ALSA_0.9"); + +int snd_pcm_hw_params_get_period_time(const snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_get_period_time_min(const snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_get_period_time_max(const snd_pcm_hw_params_t *params, int *dir); +int snd_pcm_hw_params_test_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_period_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_period_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_period_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_period_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir); +unsigned int snd_pcm_hw_params_set_period_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir); +unsigned int snd_pcm_hw_params_set_period_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_set_period_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); + +asm(".symver snd_pcm_hw_params_get_period_size,snd_pcm_hw_params_get_period_size@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_period_size_min,snd_pcm_hw_params_get_period_size_min@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_period_size_max,snd_pcm_hw_params_get_period_size_max@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_period_size_near,snd_pcm_hw_params_set_period_size_near@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_period_size_first,snd_pcm_hw_params_set_period_size_first@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_period_size_last,snd_pcm_hw_params_set_period_size_last@ALSA_0.9"); + +snd_pcm_sframes_t snd_pcm_hw_params_get_period_size(const snd_pcm_hw_params_t *params, int *dir); +snd_pcm_uframes_t snd_pcm_hw_params_get_period_size_min(const snd_pcm_hw_params_t *params, int *dir); +snd_pcm_uframes_t snd_pcm_hw_params_get_period_size_max(const snd_pcm_hw_params_t *params, int *dir); +int snd_pcm_hw_params_test_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir); +int snd_pcm_hw_params_set_period_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int dir); +int snd_pcm_hw_params_set_period_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir); +int snd_pcm_hw_params_set_period_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val, int *dir); +int snd_pcm_hw_params_set_period_size_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *min, int *mindir, snd_pcm_uframes_t *max, int *maxdir); +snd_pcm_uframes_t snd_pcm_hw_params_set_period_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val, int *dir); +snd_pcm_uframes_t snd_pcm_hw_params_set_period_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); +snd_pcm_uframes_t snd_pcm_hw_params_set_period_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); +int snd_pcm_hw_params_set_period_size_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + +asm(".symver snd_pcm_hw_params_get_periods,snd_pcm_hw_params_get_periods@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_periods_min,snd_pcm_hw_params_get_periods_min@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_periods_max,snd_pcm_hw_params_get_periods_max@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_periods_near,snd_pcm_hw_params_set_periods_near@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_periods_first,snd_pcm_hw_params_set_periods_first@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_periods_last,snd_pcm_hw_params_set_periods_last@ALSA_0.9"); + +int snd_pcm_hw_params_get_periods(const snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_get_periods_min(const snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_get_periods_max(const snd_pcm_hw_params_t *params, int *dir); +int snd_pcm_hw_params_test_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_periods(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_periods_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_periods_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_periods_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir); +unsigned int snd_pcm_hw_params_set_periods_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir); +unsigned int snd_pcm_hw_params_set_periods_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_set_periods_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); +int snd_pcm_hw_params_set_periods_integer(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + +asm(".symver snd_pcm_hw_params_get_buffer_time,snd_pcm_hw_params_get_buffer_time@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_buffer_time_min,snd_pcm_hw_params_get_buffer_time_min@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_buffer_time_max,snd_pcm_hw_params_get_buffer_time_max@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_buffer_time_near,snd_pcm_hw_params_set_buffer_time_near@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_buffer_time_first,snd_pcm_hw_params_set_buffer_time_first@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_buffer_time_last,snd_pcm_hw_params_set_buffer_time_last@ALSA_0.9"); + +int snd_pcm_hw_params_get_buffer_time(const snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_get_buffer_time_min(const snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_get_buffer_time_max(const snd_pcm_hw_params_t *params, int *dir); +int snd_pcm_hw_params_test_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_buffer_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_buffer_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_buffer_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_buffer_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir); +unsigned int snd_pcm_hw_params_set_buffer_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir); +unsigned int snd_pcm_hw_params_set_buffer_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_set_buffer_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); + +asm(".symver snd_pcm_hw_params_get_buffer_size,snd_pcm_hw_params_get_buffer_size@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_buffer_size_min,snd_pcm_hw_params_get_buffer_size_min@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_buffer_size_max,snd_pcm_hw_params_get_buffer_size_max@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_buffer_size_near,snd_pcm_hw_params_set_buffer_size_near@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_buffer_size_first,snd_pcm_hw_params_set_buffer_size_first@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_buffer_size_last,snd_pcm_hw_params_set_buffer_size_last@ALSA_0.9"); + +snd_pcm_sframes_t snd_pcm_hw_params_get_buffer_size(const snd_pcm_hw_params_t *params); +snd_pcm_uframes_t snd_pcm_hw_params_get_buffer_size_min(const snd_pcm_hw_params_t *params); +snd_pcm_uframes_t snd_pcm_hw_params_get_buffer_size_max(const snd_pcm_hw_params_t *params); +int snd_pcm_hw_params_test_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val); +int snd_pcm_hw_params_set_buffer_size(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val); +int snd_pcm_hw_params_set_buffer_size_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_hw_params_set_buffer_size_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_hw_params_set_buffer_size_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t *min, snd_pcm_uframes_t *max); +snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, snd_pcm_uframes_t val); +snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); +snd_pcm_uframes_t snd_pcm_hw_params_set_buffer_size_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params); + +asm(".symver snd_pcm_hw_params_get_tick_time,snd_pcm_hw_params_get_tick_time@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_tick_time_min,snd_pcm_hw_params_get_tick_time_min@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_get_tick_time_max,snd_pcm_hw_params_get_tick_time_max@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_tick_time_near,snd_pcm_hw_params_set_tick_time_near@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_tick_time_first,snd_pcm_hw_params_set_tick_time_first@ALSA_0.9"); +asm(".symver snd_pcm_hw_params_set_tick_time_last,snd_pcm_hw_params_set_tick_time_last@ALSA_0.9"); + +int snd_pcm_hw_params_get_tick_time(const snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_get_tick_time_min(const snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_get_tick_time_max(const snd_pcm_hw_params_t *params, int *dir); +int snd_pcm_hw_params_test_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_tick_time(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int dir); +int snd_pcm_hw_params_set_tick_time_min(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_tick_time_max(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *val, int *dir); +int snd_pcm_hw_params_set_tick_time_minmax(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int *min, int *mindir, unsigned int *max, int *maxdir); +unsigned int snd_pcm_hw_params_set_tick_time_near(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, unsigned int val, int *dir); +unsigned int snd_pcm_hw_params_set_tick_time_first(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); +unsigned int snd_pcm_hw_params_set_tick_time_last(snd_pcm_t *pcm, snd_pcm_hw_params_t *params, int *dir); + +#endif /* ALSA_PCM_OLD_HW_PARAMS_API */ +#endif /* ALSA_LIBRARY_BUILD */ + +int snd_pcm_hw_params_get_min_align(const snd_pcm_hw_params_t *params, snd_pcm_uframes_t *val); + +/** \} */ + +/** + * \defgroup PCM_SW_Params Software Parameters + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +size_t snd_pcm_sw_params_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_pcm_sw_params_t using standard alloca + * \param ptr returned pointer + */ +#define snd_pcm_sw_params_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_sw_params_t *) alloca(snd_pcm_sw_params_sizeof()); memset(*ptr, 0, snd_pcm_sw_params_sizeof()); } while (0) +int snd_pcm_sw_params_malloc(snd_pcm_sw_params_t **ptr); +void snd_pcm_sw_params_free(snd_pcm_sw_params_t *obj); +void snd_pcm_sw_params_copy(snd_pcm_sw_params_t *dst, const snd_pcm_sw_params_t *src); +int snd_pcm_sw_params_get_boundary(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val); + +#ifndef ALSA_LIBRARY_BUILD +#ifndef ALSA_PCM_OLD_SW_PARAMS_API + +int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val); +int snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_t *val); +int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val); +int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params, unsigned int *val); +int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); +int snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); +int snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); +int snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *paramsm, snd_pcm_uframes_t *val); +int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); +int snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); +int snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val); +int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); +int snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params, snd_pcm_uframes_t *val); + +#else + +asm(".symver snd_pcm_sw_params_get_tstamp_mode,snd_pcm_sw_params_get_tstamp_mode@ALSA_0.9"); +asm(".symver snd_pcm_sw_params_get_sleep_min,snd_pcm_sw_params_get_sleep_min@ALSA_0.9"); +asm(".symver snd_pcm_sw_params_get_avail_min,snd_pcm_sw_params_get_avail_min@ALSA_0.9"); +asm(".symver snd_pcm_sw_params_get_xfer_align,snd_pcm_sw_params_get_xfer_align@ALSA_0.9"); +asm(".symver snd_pcm_sw_params_get_start_threshold,snd_pcm_sw_params_get_start_threshold@ALSA_0.9"); +asm(".symver snd_pcm_sw_params_get_stop_threshold,snd_pcm_sw_params_set_stop_threshold@ALSA_0.9"); +asm(".symver snd_pcm_sw_params_get_silence_threshold,snd_pcm_sw_params_get_silence_threshold@ALSA_0.9"); +asm(".symver snd_pcm_sw_params_get_silence_size,snd_pcm_sw_params_get_silence_size@ALSA_0.9"); + +int snd_pcm_sw_params_set_tstamp_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_t val); +snd_pcm_tstamp_t snd_pcm_sw_params_get_tstamp_mode(const snd_pcm_sw_params_t *params); +int snd_pcm_sw_params_set_sleep_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, unsigned int val); +unsigned int snd_pcm_sw_params_get_sleep_min(const snd_pcm_sw_params_t *params); +int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); +snd_pcm_uframes_t snd_pcm_sw_params_get_avail_min(const snd_pcm_sw_params_t *params); +int snd_pcm_sw_params_set_xfer_align(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); +snd_pcm_uframes_t snd_pcm_sw_params_get_xfer_align(const snd_pcm_sw_params_t *params); +int snd_pcm_sw_params_set_start_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); +snd_pcm_uframes_t snd_pcm_sw_params_get_start_threshold(const snd_pcm_sw_params_t *params); +int snd_pcm_sw_params_set_stop_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); +snd_pcm_uframes_t snd_pcm_sw_params_get_stop_threshold(const snd_pcm_sw_params_t *params); +int snd_pcm_sw_params_set_silence_threshold(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); +snd_pcm_uframes_t snd_pcm_sw_params_get_silence_threshold(const snd_pcm_sw_params_t *params); +int snd_pcm_sw_params_set_silence_size(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_uframes_t val); +snd_pcm_uframes_t snd_pcm_sw_params_get_silence_size(const snd_pcm_sw_params_t *params); + +#endif /* ALSA_PCM_OLD_SW_PARAMS_API */ +#endif /* ALSA_LIBRARY_BUILD */ + +/** \} */ + +/** + * \defgroup PCM_Access Access Mask Functions + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +size_t snd_pcm_access_mask_sizeof(void); +/** \hideinitializer + * \brief allocate an empty #snd_pcm_access_mask_t using standard alloca + * \param ptr returned pointer + */ +#define snd_pcm_access_mask_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_access_mask_t *) alloca(snd_pcm_access_mask_sizeof()); memset(*ptr, 0, snd_pcm_access_mask_sizeof()); } while (0) +int snd_pcm_access_mask_malloc(snd_pcm_access_mask_t **ptr); +void snd_pcm_access_mask_free(snd_pcm_access_mask_t *obj); +void snd_pcm_access_mask_copy(snd_pcm_access_mask_t *dst, const snd_pcm_access_mask_t *src); +void snd_pcm_access_mask_none(snd_pcm_access_mask_t *mask); +void snd_pcm_access_mask_any(snd_pcm_access_mask_t *mask); +int snd_pcm_access_mask_test(const snd_pcm_access_mask_t *mask, snd_pcm_access_t val); +int snd_pcm_access_mask_empty(const snd_pcm_access_mask_t *mask); +void snd_pcm_access_mask_set(snd_pcm_access_mask_t *mask, snd_pcm_access_t val); +void snd_pcm_access_mask_reset(snd_pcm_access_mask_t *mask, snd_pcm_access_t val); + +/** \} */ + +/** + * \defgroup PCM_Format Format Mask Functions + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +size_t snd_pcm_format_mask_sizeof(void); +/** \hideinitializer + * \brief allocate an empty #snd_pcm_format_mask_t using standard alloca + * \param ptr returned pointer + */ +#define snd_pcm_format_mask_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_format_mask_t *) alloca(snd_pcm_format_mask_sizeof()); memset(*ptr, 0, snd_pcm_format_mask_sizeof()); } while (0) +int snd_pcm_format_mask_malloc(snd_pcm_format_mask_t **ptr); +void snd_pcm_format_mask_free(snd_pcm_format_mask_t *obj); +void snd_pcm_format_mask_copy(snd_pcm_format_mask_t *dst, const snd_pcm_format_mask_t *src); +void snd_pcm_format_mask_none(snd_pcm_format_mask_t *mask); +void snd_pcm_format_mask_any(snd_pcm_format_mask_t *mask); +int snd_pcm_format_mask_test(const snd_pcm_format_mask_t *mask, snd_pcm_format_t val); +int snd_pcm_format_mask_empty(const snd_pcm_format_mask_t *mask); +void snd_pcm_format_mask_set(snd_pcm_format_mask_t *mask, snd_pcm_format_t val); +void snd_pcm_format_mask_reset(snd_pcm_format_mask_t *mask, snd_pcm_format_t val); + +/** \} */ + +/** + * \defgroup PCM_SubFormat Subformat Mask Functions + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +size_t snd_pcm_subformat_mask_sizeof(void); +/** \hideinitializer + * \brief allocate an empty #snd_pcm_subformat_mask_t using standard alloca + * \param ptr returned pointer + */ +#define snd_pcm_subformat_mask_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_subformat_mask_t *) alloca(snd_pcm_subformat_mask_sizeof()); memset(*ptr, 0, snd_pcm_subformat_mask_sizeof()); } while (0) +int snd_pcm_subformat_mask_malloc(snd_pcm_subformat_mask_t **ptr); +void snd_pcm_subformat_mask_free(snd_pcm_subformat_mask_t *obj); +void snd_pcm_subformat_mask_copy(snd_pcm_subformat_mask_t *dst, const snd_pcm_subformat_mask_t *src); +void snd_pcm_subformat_mask_none(snd_pcm_subformat_mask_t *mask); +void snd_pcm_subformat_mask_any(snd_pcm_subformat_mask_t *mask); +int snd_pcm_subformat_mask_test(const snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val); +int snd_pcm_subformat_mask_empty(const snd_pcm_subformat_mask_t *mask); +void snd_pcm_subformat_mask_set(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val); +void snd_pcm_subformat_mask_reset(snd_pcm_subformat_mask_t *mask, snd_pcm_subformat_t val); + +/** \} */ + +/** + * \defgroup PCM_Status Status Functions + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +size_t snd_pcm_status_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_pcm_status_t using standard alloca + * \param ptr returned pointer + */ +#define snd_pcm_status_alloca(ptr) do { assert(ptr); *ptr = (snd_pcm_status_t *) alloca(snd_pcm_status_sizeof()); memset(*ptr, 0, snd_pcm_status_sizeof()); } while (0) +int snd_pcm_status_malloc(snd_pcm_status_t **ptr); +void snd_pcm_status_free(snd_pcm_status_t *obj); +void snd_pcm_status_copy(snd_pcm_status_t *dst, const snd_pcm_status_t *src); +snd_pcm_state_t snd_pcm_status_get_state(const snd_pcm_status_t *obj); +void snd_pcm_status_get_trigger_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr); +void snd_pcm_status_get_trigger_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr); +void snd_pcm_status_get_tstamp(const snd_pcm_status_t *obj, snd_timestamp_t *ptr); +void snd_pcm_status_get_htstamp(const snd_pcm_status_t *obj, snd_htimestamp_t *ptr); +snd_pcm_sframes_t snd_pcm_status_get_delay(const snd_pcm_status_t *obj); +snd_pcm_uframes_t snd_pcm_status_get_avail(const snd_pcm_status_t *obj); +snd_pcm_uframes_t snd_pcm_status_get_avail_max(const snd_pcm_status_t *obj); +snd_pcm_uframes_t snd_pcm_status_get_overrange(const snd_pcm_status_t *obj); + +/** \} */ + +/** + * \defgroup PCM_Description Description Functions + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +const char *snd_pcm_type_name(snd_pcm_type_t type); +const char *snd_pcm_stream_name(const snd_pcm_stream_t stream); +const char *snd_pcm_access_name(const snd_pcm_access_t _access); +const char *snd_pcm_format_name(const snd_pcm_format_t format); +const char *snd_pcm_format_description(const snd_pcm_format_t format); +const char *snd_pcm_subformat_name(const snd_pcm_subformat_t subformat); +const char *snd_pcm_subformat_description(const snd_pcm_subformat_t subformat); +snd_pcm_format_t snd_pcm_format_value(const char* name); +const char *snd_pcm_tstamp_mode_name(const snd_pcm_tstamp_t mode); +const char *snd_pcm_state_name(const snd_pcm_state_t state); + +/** \} */ + +/** + * \defgroup PCM_Dump Debug Functions + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +int snd_pcm_dump(snd_pcm_t *pcm, snd_output_t *out); +int snd_pcm_dump_hw_setup(snd_pcm_t *pcm, snd_output_t *out); +int snd_pcm_dump_sw_setup(snd_pcm_t *pcm, snd_output_t *out); +int snd_pcm_dump_setup(snd_pcm_t *pcm, snd_output_t *out); +int snd_pcm_hw_params_dump(snd_pcm_hw_params_t *params, snd_output_t *out); +int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out); +int snd_pcm_status_dump(snd_pcm_status_t *status, snd_output_t *out); + +/** \} */ + +/** + * \defgroup PCM_Direct Direct Access (MMAP) Functions + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +int snd_pcm_mmap_begin(snd_pcm_t *pcm, + const snd_pcm_channel_area_t **areas, + snd_pcm_uframes_t *offset, + snd_pcm_uframes_t *frames); +snd_pcm_sframes_t snd_pcm_mmap_commit(snd_pcm_t *pcm, + snd_pcm_uframes_t offset, + snd_pcm_uframes_t frames); +snd_pcm_sframes_t snd_pcm_mmap_writei(snd_pcm_t *pcm, const void *buffer, snd_pcm_uframes_t size); +snd_pcm_sframes_t snd_pcm_mmap_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size); +snd_pcm_sframes_t snd_pcm_mmap_writen(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size); +snd_pcm_sframes_t snd_pcm_mmap_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size); + +/** \} */ + +/** + * \defgroup PCM_Helpers Helper Functions + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +int snd_pcm_format_signed(snd_pcm_format_t format); +int snd_pcm_format_unsigned(snd_pcm_format_t format); +int snd_pcm_format_linear(snd_pcm_format_t format); +int snd_pcm_format_float(snd_pcm_format_t format); +int snd_pcm_format_little_endian(snd_pcm_format_t format); +int snd_pcm_format_big_endian(snd_pcm_format_t format); +int snd_pcm_format_cpu_endian(snd_pcm_format_t format); +int snd_pcm_format_width(snd_pcm_format_t format); /* in bits */ +int snd_pcm_format_physical_width(snd_pcm_format_t format); /* in bits */ +snd_pcm_format_t snd_pcm_build_linear_format(int width, int pwidth, int unsignd, int big_endian); +ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples); +u_int8_t snd_pcm_format_silence(snd_pcm_format_t format); +u_int16_t snd_pcm_format_silence_16(snd_pcm_format_t format); +u_int32_t snd_pcm_format_silence_32(snd_pcm_format_t format); +u_int64_t snd_pcm_format_silence_64(snd_pcm_format_t format); +int snd_pcm_format_set_silence(snd_pcm_format_t format, void *buf, unsigned int samples); + +snd_pcm_sframes_t snd_pcm_bytes_to_frames(snd_pcm_t *pcm, ssize_t bytes); +ssize_t snd_pcm_frames_to_bytes(snd_pcm_t *pcm, snd_pcm_sframes_t frames); +long snd_pcm_bytes_to_samples(snd_pcm_t *pcm, ssize_t bytes); +ssize_t snd_pcm_samples_to_bytes(snd_pcm_t *pcm, long samples); + +int snd_pcm_area_silence(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset, + unsigned int samples, snd_pcm_format_t format); +int snd_pcm_areas_silence(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset, + unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format); +int snd_pcm_area_copy(const snd_pcm_channel_area_t *dst_channel, snd_pcm_uframes_t dst_offset, + const snd_pcm_channel_area_t *src_channel, snd_pcm_uframes_t src_offset, + unsigned int samples, snd_pcm_format_t format); +int snd_pcm_areas_copy(const snd_pcm_channel_area_t *dst_channels, snd_pcm_uframes_t dst_offset, + const snd_pcm_channel_area_t *src_channels, snd_pcm_uframes_t src_offset, + unsigned int channels, snd_pcm_uframes_t frames, snd_pcm_format_t format); + +/** \} */ + +/** + * \defgroup PCM_Hook Hook Extension + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +/** type of pcm hook */ +typedef enum _snd_pcm_hook_type { + SND_PCM_HOOK_TYPE_HW_PARAMS = 0, + SND_PCM_HOOK_TYPE_HW_FREE, + SND_PCM_HOOK_TYPE_CLOSE, + SND_PCM_HOOK_TYPE_LAST = SND_PCM_HOOK_TYPE_CLOSE +} snd_pcm_hook_type_t; + +/** PCM hook container */ +typedef struct _snd_pcm_hook snd_pcm_hook_t; +/** PCM hook callback function */ +typedef int (*snd_pcm_hook_func_t)(snd_pcm_hook_t *hook); +snd_pcm_t *snd_pcm_hook_get_pcm(snd_pcm_hook_t *hook); +void *snd_pcm_hook_get_private(snd_pcm_hook_t *hook); +void snd_pcm_hook_set_private(snd_pcm_hook_t *hook, void *private_data); +int snd_pcm_hook_add(snd_pcm_hook_t **hookp, snd_pcm_t *pcm, + snd_pcm_hook_type_t type, + snd_pcm_hook_func_t func, void *private_data); +int snd_pcm_hook_remove(snd_pcm_hook_t *hook); + +/** \} */ + +/** + * \defgroup PCM_Scope Scope Plugin Extension + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +/** #SND_PCM_TYPE_METER scope functions */ +typedef struct _snd_pcm_scope_ops { + /** \brief Enable and prepare it using current params + * \param scope scope handle + */ + int (*enable)(snd_pcm_scope_t *scope); + /** \brief Disable + * \param scope scope handle + */ + void (*disable)(snd_pcm_scope_t *scope); + /** \brief PCM has been started + * \param scope scope handle + */ + void (*start)(snd_pcm_scope_t *scope); + /** \brief PCM has been stopped + * \param scope scope handle + */ + void (*stop)(snd_pcm_scope_t *scope); + /** \brief New frames are present + * \param scope scope handle + */ + void (*update)(snd_pcm_scope_t *scope); + /** \brief Reset status + * \param scope scope handle + */ + void (*reset)(snd_pcm_scope_t *scope); + /** \brief PCM is closing + * \param scope scope handle + */ + void (*close)(snd_pcm_scope_t *scope); +} snd_pcm_scope_ops_t; + +snd_pcm_uframes_t snd_pcm_meter_get_bufsize(snd_pcm_t *pcm); +unsigned int snd_pcm_meter_get_channels(snd_pcm_t *pcm); +unsigned int snd_pcm_meter_get_rate(snd_pcm_t *pcm); +snd_pcm_uframes_t snd_pcm_meter_get_now(snd_pcm_t *pcm); +snd_pcm_uframes_t snd_pcm_meter_get_boundary(snd_pcm_t *pcm); +int snd_pcm_meter_add_scope(snd_pcm_t *pcm, snd_pcm_scope_t *scope); +snd_pcm_scope_t *snd_pcm_meter_search_scope(snd_pcm_t *pcm, const char *name); +int snd_pcm_scope_malloc(snd_pcm_scope_t **ptr); +void snd_pcm_scope_set_ops(snd_pcm_scope_t *scope, snd_pcm_scope_ops_t *val); +void snd_pcm_scope_set_name(snd_pcm_scope_t *scope, const char *val); +const char *snd_pcm_scope_get_name(snd_pcm_scope_t *scope); +void *snd_pcm_scope_get_callback_private(snd_pcm_scope_t *scope); +void snd_pcm_scope_set_callback_private(snd_pcm_scope_t *scope, void *val); +int snd_pcm_scope_s16_open(snd_pcm_t *pcm, const char *name, + snd_pcm_scope_t **scopep); +int16_t *snd_pcm_scope_s16_get_channel_buffer(snd_pcm_scope_t *scope, + unsigned int channel); + +/** \} */ + +/** + * \defgroup PCM_Simple Simple setup functions + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +/** Simple PCM latency type */ +typedef enum _snd_spcm_latency { + /** standard latency - for standard playback or capture + (estimated latency in one direction 350ms) */ + SND_SPCM_LATENCY_STANDARD = 0, + /** medium latency - software phones etc. + (estimated latency in one direction maximally 25ms */ + SND_SPCM_LATENCY_MEDIUM, + /** realtime latency - realtime applications (effect processors etc.) + (estimated latency in one direction 5ms and better) */ + SND_SPCM_LATENCY_REALTIME +} snd_spcm_latency_t; + +/** Simple PCM xrun type */ +typedef enum _snd_spcm_xrun_type { + /** driver / library will ignore all xruns, the stream runs forever */ + SND_SPCM_XRUN_IGNORE = 0, + /** driver / library stops the stream when an xrun occurs */ + SND_SPCM_XRUN_STOP +} snd_spcm_xrun_type_t; + +/** Simple PCM duplex type */ +typedef enum _snd_spcm_duplex_type { + /** liberal duplex - the buffer and period sizes might not match */ + SND_SPCM_DUPLEX_LIBERAL = 0, + /** pedantic duplex - the buffer and period sizes MUST match */ + SND_SPCM_DUPLEX_PEDANTIC +} snd_spcm_duplex_type_t; + +int snd_spcm_init(snd_pcm_t *pcm, + unsigned int rate, + unsigned int channels, + snd_pcm_format_t format, + snd_pcm_subformat_t subformat, + snd_spcm_latency_t latency, + snd_pcm_access_t access, + snd_spcm_xrun_type_t xrun_type); + +int snd_spcm_init_duplex(snd_pcm_t *playback_pcm, + snd_pcm_t *capture_pcm, + unsigned int rate, + unsigned int channels, + snd_pcm_format_t format, + snd_pcm_subformat_t subformat, + snd_spcm_latency_t latency, + snd_pcm_access_t access, + snd_spcm_xrun_type_t xrun_type, + snd_spcm_duplex_type_t duplex_type); + +int snd_spcm_init_get_params(snd_pcm_t *pcm, + unsigned int *rate, + snd_pcm_uframes_t *buffer_size, + snd_pcm_uframes_t *period_size); + +/** \} */ + +/** + * \defgroup PCM_Deprecated Deprecated Functions + * \ingroup PCM + * See the \ref pcm page for more details. + * \{ + */ + +/* Deprecated functions, for compatibility */ +const char *snd_pcm_start_mode_name(snd_pcm_start_t mode); +const char *snd_pcm_xrun_mode_name(snd_pcm_xrun_t mode); +int snd_pcm_sw_params_set_start_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_start_t val); +snd_pcm_start_t snd_pcm_sw_params_get_start_mode(const snd_pcm_sw_params_t *params); +int snd_pcm_sw_params_set_xrun_mode(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_xrun_t val); +snd_pcm_xrun_t snd_pcm_sw_params_get_xrun_mode(const snd_pcm_sw_params_t *params); + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_PCM_H */ diff --git a/debian/include-alsa/alsa/pcm_ordinary.h b/debian/include-alsa/alsa/pcm_ordinary.h new file mode 100644 index 0000000..cc60040 --- /dev/null +++ b/debian/include-alsa/alsa/pcm_ordinary.h @@ -0,0 +1,145 @@ +/** + * \file <alsa/pcm_ordinary.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \date 2003 + * + * Application interface library for the ALSA driver. + * See the \ref pcm_ordinary page for more details. + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_PCM_ORDINARY_H +#define __ALSA_PCM_ORDINARY_H + +#include <alsa/asoundlib.h> + +/** Ordinary PCM latency type */ +enum sndo_pcm_latency_type { + /** normal latency - for standard playback or capture + (estimated latency in one direction 350ms) (default) */ + SNDO_PCM_LATENCY_NORMAL = 0, + /** medium latency - software phones etc. + (estimated latency in one direction maximally 50ms) */ + SNDO_PCM_LATENCY_MEDIUM, + /** realtime latency - realtime applications (effect processors etc.) + (estimated latency in one direction 5ms) */ + SNDO_PCM_LATENCY_REALTIME +}; + +/** Ordinary PCM access type */ +enum sndo_pcm_access_type { + /** interleaved access - channels are interleaved without any gaps among samples (default) */ + SNDO_PCM_ACCESS_INTERLEAVED = 0, + /** noninterleaved access - channels are separate without any gaps among samples */ + SNDO_PCM_ACCESS_NONINTERLEAVED +}; + +/** Ordinary PCM xrun type */ +enum sndo_pcm_xrun_type { + /** driver / library will ignore all xruns, the stream runs forever (default) */ + SNDO_PCM_XRUN_IGNORE = 0, + /** driver / library stops the stream when an xrun occurs */ + SNDO_PCM_XRUN_STOP +}; + +typedef struct sndo_pcm sndo_pcm_t; + +typedef int (sndo_pcm_engine_callback_t)(sndo_pcm_t *pcm); + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup PCM_ordinary PCM Ordinary Interface + * See the \ref pcm_ordinary page for more details. + * \{ + */ + +int sndo_pcm_open(sndo_pcm_t **pcm, const char *playback_name, const char *capture_name, struct alisp_cfg *lconf); +int sndo_pcm_close(sndo_pcm_t *pcm); +int sndo_pcm_poll_descriptors_count(sndo_pcm_t *pcm); +int sndo_pcm_poll_descriptors(sndo_pcm_t *pcm, struct pollfd *pfds, unsigned int space); +int sndo_pcm_start(sndo_pcm_t *pcm); +int sndo_pcm_drop(sndo_pcm_t *pcm); +int sndo_pcm_drain(sndo_pcm_t *pcm); +int sndo_pcm_delay(sndo_pcm_t *pcm, snd_pcm_sframes_t *delayp); +int sndo_pcm_transfer_block(sndo_pcm_t *pcm, snd_pcm_uframes_t *tblock); +int sndo_pcm_resume(sndo_pcm_t *pcm); +int sndo_pcm_wait(sndo_pcm_t *pcm, int timeout); +snd_pcm_t *sndo_pcm_raw_playback(sndo_pcm_t *pcm); +snd_pcm_t *sndo_pcm_raw_capture(sndo_pcm_t *pcm); + +/** + * \defgroup PCM_ordinary_params Parameters Functions + * \ingroup PCM_ordinary + * See the \ref pcm_ordinary page for more details. + * \{ + */ + +int sndo_pcm_param_reset(sndo_pcm_t *pcm); +int sndo_pcm_param_access(sndo_pcm_t *pcm, enum sndo_pcm_access_type access); +int sndo_pcm_param_rate(sndo_pcm_t *pcm, unsigned int rate, unsigned int *used_rate); +int sndo_pcm_param_channels(sndo_pcm_t *pcm, unsigned int channels); +int sndo_pcm_param_format(sndo_pcm_t *pcm, snd_pcm_format_t format, snd_pcm_subformat_t subformat); +int sndo_pcm_param_latency(sndo_pcm_t *pcm, enum sndo_pcm_latency_type latency, snd_pcm_uframes_t *used_latency); +int sndo_pcm_param_xrun(sndo_pcm_t *pcm, enum sndo_pcm_xrun_type xrun); + +/** \} */ + +/** + * \defgroup PCM_ordinary_access Ring Buffer I/O Functions + * \ingroup PCM_ordinary + * See the \ref pcm_ordinary page for more details. + * \{ + */ + +/* playback */ +int sndo_pcm_pio_ibegin(sndo_pcm_t *pcm, void **ring_buffer, snd_pcm_uframes_t *frames); +snd_pcm_sframes_t sndo_pcm_pio_iend(sndo_pcm_t *pcm, snd_pcm_uframes_t frames); +int sndo_pcm_pio_nbegin(sndo_pcm_t *pcm, void ***ring_buffer, snd_pcm_uframes_t *frames); +snd_pcm_sframes_t sndo_pcm_pio_nend(sndo_pcm_t *pcm, snd_pcm_uframes_t frames); +/* capture */ +int sndo_pcm_cio_ibegin(sndo_pcm_t *pcm, void **ring_buffer, snd_pcm_uframes_t *frames); +snd_pcm_sframes_t sndo_pcm_cio_iend(sndo_pcm_t *pcm, snd_pcm_uframes_t frames); +int sndo_pcm_cio_nbegin(sndo_pcm_t *pcm, void ***ring_buffer, snd_pcm_uframes_t *frames); +snd_pcm_sframes_t sndo_pcm_cio_nend(sndo_pcm_t *pcm, snd_pcm_uframes_t frames); + +/** \} */ + +/** + * \defgroup PCM_ordinary_engine Callback like engine + * \ingroup PCM_ordinary + * See the \ref pcm_ordinary page for more details. + * \{ + */ + +int sndo_pcm_set_private_data(sndo_pcm_t *pcm, void *private_data); +int sndo_pcm_get_private_data(sndo_pcm_t *pcm, void **private_data); +int sndo_pcm_engine(sndo_pcm_t *pcm, + sndo_pcm_engine_callback_t *playback, + sndo_pcm_engine_callback_t *capture); + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_PCM_ORDINARY_H */ diff --git a/debian/include-alsa/alsa/pcm_plugin.h b/debian/include-alsa/alsa/pcm_plugin.h new file mode 100644 index 0000000..a2ab60e --- /dev/null +++ b/debian/include-alsa/alsa/pcm_plugin.h @@ -0,0 +1,200 @@ +/** + * \file <alsa/pcm_plugin.h> + * \brief Common PCM plugin code + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Jaroslav Kysela <perex@suse.cz> + * \date 2000-2001 + * + * Application interface library for the ALSA driver. + * See the \ref pcm_plugins page for more details. + * + * \warning Using of contents of this header file might be dangerous + * in the sense of compatibility reasons. The contents might be + * freely changed in future. + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_PCM_PLUGIN_H + +/** + * \defgroup PCM_Plugins PCM Plugins + * \ingroup PCM + * See the \ref pcm_plugins page for more details. + * \{ + */ + +#define SND_PCM_PLUGIN_RATE_MIN 4000 /**< minimal rate for the rate plugin */ +#define SND_PCM_PLUGIN_RATE_MAX 192000 /**< maximal rate for the rate plugin */ + +/* ROUTE_FLOAT should be set to 0 for machines without FP unit - like iPAQ */ +#ifdef HAVE_SOFT_FLOAT +#define SND_PCM_PLUGIN_ROUTE_FLOAT 0 /**< use integers for route plugin */ +#else +#define SND_PCM_PLUGIN_ROUTE_FLOAT 1 /**< use floats for route plugin */ +#endif + +#define SND_PCM_PLUGIN_ROUTE_RESOLUTION 16 /**< integer resolution for route plugin */ + +#if SND_PCM_PLUGIN_ROUTE_FLOAT +/** route ttable entry type */ +typedef float snd_pcm_route_ttable_entry_t; +#define SND_PCM_PLUGIN_ROUTE_HALF 0.5 /**< half value */ +#define SND_PCM_PLUGIN_ROUTE_FULL 1.0 /**< full value */ +#else +/** route ttable entry type */ +typedef int snd_pcm_route_ttable_entry_t; +#define SND_PCM_PLUGIN_ROUTE_HALF (SND_PCM_PLUGIN_ROUTE_RESOLUTION / 2) /**< half value */ +#define SND_PCM_PLUGIN_ROUTE_FULL SND_PCM_PLUGIN_ROUTE_RESOLUTION /**< full value */ +#endif + +/* + * Hardware plugin + */ +int snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name, + int card, int device, int subdevice, + snd_pcm_stream_t stream, int mode, + int mmap_emulation, int sync_ptr_ioctl); +int _snd_pcm_hw_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root ATTRIBUTE_UNUSED, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + +/* + * Copy plugin + */ +int snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name, + snd_pcm_t *slave, int close_slave); +int _snd_pcm_copy_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + +/* + * Linear conversion plugin + */ +int snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name, + snd_pcm_format_t sformat, snd_pcm_t *slave, + int close_slave); +int _snd_pcm_linear_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + +/* + * Linear<->Float conversion plugin + */ +int snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name, + snd_pcm_format_t sformat, snd_pcm_t *slave, + int close_slave); +int _snd_pcm_lfloat_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + +/* + * Linear<->mu-Law conversion plugin + */ +int snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name, + snd_pcm_format_t sformat, snd_pcm_t *slave, + int close_slave); +int _snd_pcm_mulaw_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + +/* + * Linear<->a-Law conversion plugin + */ +int snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name, + snd_pcm_format_t sformat, snd_pcm_t *slave, + int close_slave); +int _snd_pcm_alaw_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + +/* + * Linear<->Ima-ADPCM conversion plugin + */ +int snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name, + snd_pcm_format_t sformat, snd_pcm_t *slave, + int close_slave); +int _snd_pcm_adpcm_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + +/* + * Route plugin for linear formats + */ +int snd_pcm_route_load_ttable(snd_config_t *tt, snd_pcm_route_ttable_entry_t *ttable, + unsigned int tt_csize, unsigned int tt_ssize, + unsigned int *tt_cused, unsigned int *tt_sused, + int schannels); +int snd_pcm_route_determine_ttable(snd_config_t *tt, + unsigned int *tt_csize, + unsigned int *tt_ssize); +int snd_pcm_route_open(snd_pcm_t **pcmp, const char *name, + snd_pcm_format_t sformat, int schannels, + snd_pcm_route_ttable_entry_t *ttable, + unsigned int tt_ssize, + unsigned int tt_cused, unsigned int tt_sused, + snd_pcm_t *slave, int close_slave); +int _snd_pcm_route_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + +/* + * Rate plugin for linear formats + */ +int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, + snd_pcm_format_t sformat, unsigned int srate, + snd_pcm_t *slave, int close_slave); +int _snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + +/* + * Hooks plugin + */ +int snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name, + snd_pcm_t *slave, int close_slave); +int _snd_pcm_hooks_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + +/* + * LADSPA plugin + */ +int snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name, + const char *ladspa_path, + snd_config_t *ladspa_pplugins, + snd_config_t *ladspa_cplugins, + snd_pcm_t *slave, int close_slave); +int _snd_pcm_ladspa_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + +/* + * Jack plugin + */ +int snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *playback_conf, + snd_config_t *capture_conf, + snd_pcm_stream_t stream, int mode); +int _snd_pcm_jack_open(snd_pcm_t **pcmp, const char *name, + snd_config_t *root, snd_config_t *conf, + snd_pcm_stream_t stream, int mode); + + +/** \} */ + +#endif /* __ALSA_PCM_PLUGIN_H */ diff --git a/debian/include-alsa/alsa/rawmidi.h b/debian/include-alsa/alsa/rawmidi.h new file mode 100644 index 0000000..e53fb1b --- /dev/null +++ b/debian/include-alsa/alsa/rawmidi.h @@ -0,0 +1,159 @@ +/** + * \file <alsa/rawmidi.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_RAWMIDI_H +#define __ALSA_RAWMIDI_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup RawMidi RawMidi Interface + * The RawMidi Interface. See \ref rawmidi page for more details. + * \{ + */ + +/** dlsym version for interface entry callback */ +#define SND_RAWMIDI_DLSYM_VERSION _dlsym_rawmidi_001 + +/** RawMidi information container */ +typedef struct _snd_rawmidi_info snd_rawmidi_info_t; +/** RawMidi settings container */ +typedef struct _snd_rawmidi_params snd_rawmidi_params_t; +/** RawMidi status container */ +typedef struct _snd_rawmidi_status snd_rawmidi_status_t; + +/** RawMidi stream (direction) */ +typedef enum _snd_rawmidi_stream { + /** Output stream */ + SND_RAWMIDI_STREAM_OUTPUT = 0, + /** Input stream */ + SND_RAWMIDI_STREAM_INPUT, + SND_RAWMIDI_STREAM_LAST = SND_RAWMIDI_STREAM_INPUT +} snd_rawmidi_stream_t; + +/** Append (flag to open mode) \hideinitializer */ +#define SND_RAWMIDI_APPEND 0x0001 +/** Non blocking mode (flag to open mode) \hideinitializer */ +#define SND_RAWMIDI_NONBLOCK 0x0002 +/** Write sync mode (Flag to open mode) \hideinitializer */ +#define SND_RAWMIDI_SYNC 0x0004 + +/** RawMidi handle */ +typedef struct _snd_rawmidi snd_rawmidi_t; + +/** RawMidi type */ +typedef enum _snd_rawmidi_type { + /** Kernel level RawMidi */ + SND_RAWMIDI_TYPE_HW, + /** Shared memory client RawMidi (not yet implemented) */ + SND_RAWMIDI_TYPE_SHM, + /** INET client RawMidi (not yet implemented) */ + SND_RAWMIDI_TYPE_INET, + /** Virtual (sequencer) RawMidi */ + SND_RAWMIDI_TYPE_VIRTUAL +} snd_rawmidi_type_t; + +int snd_rawmidi_open(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi, + const char *name, int mode); +int snd_rawmidi_open_lconf(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi, + const char *name, int mode, snd_config_t *lconf); +int snd_rawmidi_close(snd_rawmidi_t *rmidi); +int snd_rawmidi_poll_descriptors_count(snd_rawmidi_t *rmidi); +int snd_rawmidi_poll_descriptors(snd_rawmidi_t *rmidi, struct pollfd *pfds, unsigned int space); +int snd_rawmidi_poll_descriptors_revents(snd_rawmidi_t *rawmidi, struct pollfd *pfds, unsigned int nfds, unsigned short *revent); +int snd_rawmidi_nonblock(snd_rawmidi_t *rmidi, int nonblock); +size_t snd_rawmidi_info_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_rawmidi_info_t using standard alloca + * \param ptr returned pointer + */ +#define snd_rawmidi_info_alloca(ptr) do { assert(ptr); *ptr = (snd_rawmidi_info_t *) alloca(snd_rawmidi_info_sizeof()); memset(*ptr, 0, snd_rawmidi_info_sizeof()); } while (0) +int snd_rawmidi_info_malloc(snd_rawmidi_info_t **ptr); +void snd_rawmidi_info_free(snd_rawmidi_info_t *obj); +void snd_rawmidi_info_copy(snd_rawmidi_info_t *dst, const snd_rawmidi_info_t *src); +unsigned int snd_rawmidi_info_get_device(const snd_rawmidi_info_t *obj); +unsigned int snd_rawmidi_info_get_subdevice(const snd_rawmidi_info_t *obj); +snd_rawmidi_stream_t snd_rawmidi_info_get_stream(const snd_rawmidi_info_t *obj); +int snd_rawmidi_info_get_card(const snd_rawmidi_info_t *obj); +unsigned int snd_rawmidi_info_get_flags(const snd_rawmidi_info_t *obj); +const char *snd_rawmidi_info_get_id(const snd_rawmidi_info_t *obj); +const char *snd_rawmidi_info_get_name(const snd_rawmidi_info_t *obj); +const char *snd_rawmidi_info_get_subdevice_name(const snd_rawmidi_info_t *obj); +unsigned int snd_rawmidi_info_get_subdevices_count(const snd_rawmidi_info_t *obj); +unsigned int snd_rawmidi_info_get_subdevices_avail(const snd_rawmidi_info_t *obj); +void snd_rawmidi_info_set_device(snd_rawmidi_info_t *obj, unsigned int val); +void snd_rawmidi_info_set_subdevice(snd_rawmidi_info_t *obj, unsigned int val); +void snd_rawmidi_info_set_stream(snd_rawmidi_info_t *obj, snd_rawmidi_stream_t val); +int snd_rawmidi_info(snd_rawmidi_t *rmidi, snd_rawmidi_info_t * info); +size_t snd_rawmidi_params_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_rawmidi_params_t using standard alloca + * \param ptr returned pointer + */ +#define snd_rawmidi_params_alloca(ptr) do { assert(ptr); *ptr = (snd_rawmidi_params_t *) alloca(snd_rawmidi_params_sizeof()); memset(*ptr, 0, snd_rawmidi_params_sizeof()); } while (0) +int snd_rawmidi_params_malloc(snd_rawmidi_params_t **ptr); +void snd_rawmidi_params_free(snd_rawmidi_params_t *obj); +void snd_rawmidi_params_copy(snd_rawmidi_params_t *dst, const snd_rawmidi_params_t *src); +int snd_rawmidi_params_set_buffer_size(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, size_t val); +size_t snd_rawmidi_params_get_buffer_size(const snd_rawmidi_params_t *params); +int snd_rawmidi_params_set_avail_min(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, size_t val); +size_t snd_rawmidi_params_get_avail_min(const snd_rawmidi_params_t *params); +int snd_rawmidi_params_set_no_active_sensing(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params, int val); +int snd_rawmidi_params_get_no_active_sensing(const snd_rawmidi_params_t *params); +int snd_rawmidi_params(snd_rawmidi_t *rmidi, snd_rawmidi_params_t * params); +int snd_rawmidi_params_current(snd_rawmidi_t *rmidi, snd_rawmidi_params_t *params); +size_t snd_rawmidi_status_sizeof(void); +/** \hideinitializer + * \brief allocate an invalid #snd_rawmidi_status_t using standard alloca + * \param ptr returned pointer + */ +#define snd_rawmidi_status_alloca(ptr) do { assert(ptr); *ptr = (snd_rawmidi_status_t *) alloca(snd_rawmidi_status_sizeof()); memset(*ptr, 0, snd_rawmidi_status_sizeof()); } while (0) +int snd_rawmidi_status_malloc(snd_rawmidi_status_t **ptr); +void snd_rawmidi_status_free(snd_rawmidi_status_t *obj); +void snd_rawmidi_status_copy(snd_rawmidi_status_t *dst, const snd_rawmidi_status_t *src); +void snd_rawmidi_status_get_tstamp(const snd_rawmidi_status_t *obj, snd_htimestamp_t *ptr); +size_t snd_rawmidi_status_get_avail(const snd_rawmidi_status_t *obj); +size_t snd_rawmidi_status_get_xruns(const snd_rawmidi_status_t *obj); +int snd_rawmidi_status(snd_rawmidi_t *rmidi, snd_rawmidi_status_t * status); +int snd_rawmidi_drain(snd_rawmidi_t *rmidi); +int snd_rawmidi_drop(snd_rawmidi_t *rmidi); +ssize_t snd_rawmidi_write(snd_rawmidi_t *rmidi, const void *buffer, size_t size); +ssize_t snd_rawmidi_read(snd_rawmidi_t *rmidi, void *buffer, size_t size); +const char *snd_rawmidi_name(snd_rawmidi_t *rmidi); +snd_rawmidi_type_t snd_rawmidi_type(snd_rawmidi_t *rmidi); +snd_rawmidi_stream_t snd_rawmidi_stream(snd_rawmidi_t *rawmidi); + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __RAWMIDI_H */ + diff --git a/debian/include-alsa/alsa/seq.h b/debian/include-alsa/alsa/seq.h new file mode 100644 index 0000000..f46aa86 --- /dev/null +++ b/debian/include-alsa/alsa/seq.h @@ -0,0 +1,718 @@ +/** + * \file <alsa/seq.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + */ +/* + * Application interface library for the ALSA driver + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_SEQ_H +#define __ALSA_SEQ_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup Sequencer MIDI Sequencer + * MIDI Sequencer Interface. + * See \ref seq page for more details. + * \{ + */ + +/** dlsym version for interface entry callback */ +#define SND_SEQ_DLSYM_VERSION _dlsym_seq_001 + +/** Sequencer handle */ +typedef struct _snd_seq snd_seq_t; + +#ifndef DOC_HIDDEN +#define SND_ALLOCA(type,ptr) \ +do {\ + assert(ptr);\ + *ptr = (type##_t *)alloca(type##_sizeof());\ + memset(*ptr, 0, type##_sizeof());\ +} while (0) +#endif + +/** + * sequencer opening stream types + */ +#define SND_SEQ_OPEN_OUTPUT 1 /**< open for output (write) */ +#define SND_SEQ_OPEN_INPUT 2 /**< open for input (read) */ +#define SND_SEQ_OPEN_DUPLEX (SND_SEQ_OPEN_OUTPUT|SND_SEQ_OPEN_INPUT) /**< open for both input and output (read/write) */ + +/** + * sequencer opening mode + */ +#define SND_SEQ_NONBLOCK 0x0001 /**< non-blocking mode (flag to open mode) */ + +/** sequencer handle type */ +typedef enum _snd_seq_type { + SND_SEQ_TYPE_HW, /**< hardware */ + SND_SEQ_TYPE_SHM, /**< shared memory (NYI) */ + SND_SEQ_TYPE_INET /**< network (NYI) */ +} snd_seq_type_t; + +/** special client (port) ids */ +#define SND_SEQ_ADDRESS_UNKNOWN 253 /**< unknown source */ +#define SND_SEQ_ADDRESS_SUBSCRIBERS 254 /**< send event to all subscribed ports */ +#define SND_SEQ_ADDRESS_BROADCAST 255 /**< send event to all queues/clients/ports/channels */ + +/** known client numbers */ +#define SND_SEQ_CLIENT_SYSTEM 0 /**< system client */ +#define SND_SEQ_CLIENT_DUMMY 62 /**< dummy ports */ +#define SND_SEQ_CLIENT_OSS 63 /**< OSS sequencer emulator */ + +/* + */ +int snd_seq_open(snd_seq_t **handle, const char *name, int streams, int mode); +int snd_seq_open_lconf(snd_seq_t **handle, const char *name, int streams, int mode, snd_config_t *lconf); +const char *snd_seq_name(snd_seq_t *seq); +snd_seq_type_t snd_seq_type(snd_seq_t *seq); +int snd_seq_close(snd_seq_t *handle); +int snd_seq_poll_descriptors_count(snd_seq_t *handle, short events); +int snd_seq_poll_descriptors(snd_seq_t *handle, struct pollfd *pfds, unsigned int space, short events); +int snd_seq_poll_descriptors_revents(snd_seq_t *seq, struct pollfd *pfds, unsigned int nfds, unsigned short *revents); +int snd_seq_nonblock(snd_seq_t *handle, int nonblock); +int snd_seq_client_id(snd_seq_t *handle); + +size_t snd_seq_get_output_buffer_size(snd_seq_t *handle); +size_t snd_seq_get_input_buffer_size(snd_seq_t *handle); +int snd_seq_set_output_buffer_size(snd_seq_t *handle, size_t size); +int snd_seq_set_input_buffer_size(snd_seq_t *handle, size_t size); + +/** system information container */ +typedef struct _snd_seq_system_info snd_seq_system_info_t; + +size_t snd_seq_system_info_sizeof(void); +/** allocate a #snd_seq_system_info_t container on stack */ +#define snd_seq_system_info_alloca(ptr) \ + SND_ALLOCA(snd_seq_system_info, ptr) +int snd_seq_system_info_malloc(snd_seq_system_info_t **ptr); +void snd_seq_system_info_free(snd_seq_system_info_t *ptr); +void snd_seq_system_info_copy(snd_seq_system_info_t *dst, const snd_seq_system_info_t *src); + +int snd_seq_system_info_get_queues(const snd_seq_system_info_t *info); +int snd_seq_system_info_get_clients(const snd_seq_system_info_t *info); +int snd_seq_system_info_get_ports(const snd_seq_system_info_t *info); +int snd_seq_system_info_get_channels(const snd_seq_system_info_t *info); +int snd_seq_system_info_get_cur_clients(const snd_seq_system_info_t *info); +int snd_seq_system_info_get_cur_queues(const snd_seq_system_info_t *info); + +int snd_seq_system_info(snd_seq_t *handle, snd_seq_system_info_t *info); + +/** \} */ + + +/** + * \defgroup SeqClient Sequencer Client Interface + * Sequencer Client Interface + * \ingroup Sequencer + * \{ + */ + +/** client information container */ +typedef struct _snd_seq_client_info snd_seq_client_info_t; + +/** client types */ +typedef enum snd_seq_client_type { + SND_SEQ_USER_CLIENT = 1, /**< user client */ + SND_SEQ_KERNEL_CLIENT = 2 /**< kernel client */ +} snd_seq_client_type_t; + +size_t snd_seq_client_info_sizeof(void); +/** allocate a #snd_seq_client_info_t container on stack */ +#define snd_seq_client_info_alloca(ptr) \ + SND_ALLOCA(snd_seq_client_info, ptr) +int snd_seq_client_info_malloc(snd_seq_client_info_t **ptr); +void snd_seq_client_info_free(snd_seq_client_info_t *ptr); +void snd_seq_client_info_copy(snd_seq_client_info_t *dst, const snd_seq_client_info_t *src); + +int snd_seq_client_info_get_client(const snd_seq_client_info_t *info); +snd_seq_client_type_t snd_seq_client_info_get_type(const snd_seq_client_info_t *info); +const char *snd_seq_client_info_get_name(snd_seq_client_info_t *info); +int snd_seq_client_info_get_broadcast_filter(const snd_seq_client_info_t *info); +int snd_seq_client_info_get_error_bounce(const snd_seq_client_info_t *info); +const unsigned char *snd_seq_client_info_get_event_filter(const snd_seq_client_info_t *info); +int snd_seq_client_info_get_num_ports(const snd_seq_client_info_t *info); +int snd_seq_client_info_get_event_lost(const snd_seq_client_info_t *info); + +void snd_seq_client_info_set_client(snd_seq_client_info_t *info, int client); +void snd_seq_client_info_set_name(snd_seq_client_info_t *info, const char *name); +void snd_seq_client_info_set_broadcast_filter(snd_seq_client_info_t *info, int val); +void snd_seq_client_info_set_error_bounce(snd_seq_client_info_t *info, int val); +void snd_seq_client_info_set_event_filter(snd_seq_client_info_t *info, unsigned char *filter); + +int snd_seq_get_client_info(snd_seq_t *handle, snd_seq_client_info_t *info); +int snd_seq_get_any_client_info(snd_seq_t *handle, int client, snd_seq_client_info_t *info); +int snd_seq_set_client_info(snd_seq_t *handle, snd_seq_client_info_t *info); +int snd_seq_query_next_client(snd_seq_t *handle, snd_seq_client_info_t *info); + +/* + */ + +/** client pool information container */ +typedef struct _snd_seq_client_pool snd_seq_client_pool_t; + +size_t snd_seq_client_pool_sizeof(void); +/** allocate a #snd_seq_client_pool_t container on stack */ +#define snd_seq_client_pool_alloca(ptr) \ + SND_ALLOCA(snd_seq_client_pool, ptr) +int snd_seq_client_pool_malloc(snd_seq_client_pool_t **ptr); +void snd_seq_client_pool_free(snd_seq_client_pool_t *ptr); +void snd_seq_client_pool_copy(snd_seq_client_pool_t *dst, const snd_seq_client_pool_t *src); + +int snd_seq_client_pool_get_client(const snd_seq_client_pool_t *info); +size_t snd_seq_client_pool_get_output_pool(const snd_seq_client_pool_t *info); +size_t snd_seq_client_pool_get_input_pool(const snd_seq_client_pool_t *info); +size_t snd_seq_client_pool_get_output_room(const snd_seq_client_pool_t *info); +size_t snd_seq_client_pool_get_output_free(const snd_seq_client_pool_t *info); +size_t snd_seq_client_pool_get_input_free(const snd_seq_client_pool_t *info); +void snd_seq_client_pool_set_output_pool(snd_seq_client_pool_t *info, size_t size); +void snd_seq_client_pool_set_input_pool(snd_seq_client_pool_t *info, size_t size); +void snd_seq_client_pool_set_output_room(snd_seq_client_pool_t *info, size_t size); + +int snd_seq_get_client_pool(snd_seq_t *handle, snd_seq_client_pool_t *info); +int snd_seq_set_client_pool(snd_seq_t *handle, snd_seq_client_pool_t *info); + + +/** \} */ + + +/** + * \defgroup SeqPort Sequencer Port Interface + * Sequencer Port Interface + * \ingroup Sequencer + * \{ + */ + +/** port information container */ +typedef struct _snd_seq_port_info snd_seq_port_info_t; + +/** known port numbers */ +#define SND_SEQ_PORT_SYSTEM_TIMER 0 /**< system timer port */ +#define SND_SEQ_PORT_SYSTEM_ANNOUNCE 1 /**< system announce port */ + +/** port capabilities (32 bits) */ +#define SND_SEQ_PORT_CAP_READ (1<<0) /**< readable from this port */ +#define SND_SEQ_PORT_CAP_WRITE (1<<1) /**< writable to this port */ + +#define SND_SEQ_PORT_CAP_SYNC_READ (1<<2) /**< allow read subscriptions */ +#define SND_SEQ_PORT_CAP_SYNC_WRITE (1<<3) /**< allow write subscriptions */ + +#define SND_SEQ_PORT_CAP_DUPLEX (1<<4) /**< allow read/write duplex */ + +#define SND_SEQ_PORT_CAP_SUBS_READ (1<<5) /**< allow read subscription */ +#define SND_SEQ_PORT_CAP_SUBS_WRITE (1<<6) /**< allow write subscription */ +#define SND_SEQ_PORT_CAP_NO_EXPORT (1<<7) /**< routing not allowed */ + +/** port type */ +#define SND_SEQ_PORT_TYPE_SPECIFIC (1<<0) /**< hardware specific */ +#define SND_SEQ_PORT_TYPE_MIDI_GENERIC (1<<1) /**< generic MIDI device */ +#define SND_SEQ_PORT_TYPE_MIDI_GM (1<<2) /**< General MIDI compatible device */ +#define SND_SEQ_PORT_TYPE_MIDI_GS (1<<3) /**< GS compatible device */ +#define SND_SEQ_PORT_TYPE_MIDI_XG (1<<4) /**< XG compatible device */ +#define SND_SEQ_PORT_TYPE_MIDI_MT32 (1<<5) /**< MT-32 compatible device */ +#define SND_SEQ_PORT_TYPE_SYNTH (1<<10) /**< Synth device */ +#define SND_SEQ_PORT_TYPE_DIRECT_SAMPLE (1<<11) /**< Sampling device (support sample download) */ +#define SND_SEQ_PORT_TYPE_SAMPLE (1<<12) /**< Sampling device (sample can be downloaded at any time) */ +#define SND_SEQ_PORT_TYPE_APPLICATION (1<<20) /**< application (sequencer/editor) */ + + +size_t snd_seq_port_info_sizeof(void); +/** allocate a #snd_seq_port_info_t container on stack */ +#define snd_seq_port_info_alloca(ptr) \ + SND_ALLOCA(snd_seq_port_info, ptr) +int snd_seq_port_info_malloc(snd_seq_port_info_t **ptr); +void snd_seq_port_info_free(snd_seq_port_info_t *ptr); +void snd_seq_port_info_copy(snd_seq_port_info_t *dst, const snd_seq_port_info_t *src); + +int snd_seq_port_info_get_client(const snd_seq_port_info_t *info); +int snd_seq_port_info_get_port(const snd_seq_port_info_t *info); +const snd_seq_addr_t *snd_seq_port_info_get_addr(const snd_seq_port_info_t *info); +const char *snd_seq_port_info_get_name(const snd_seq_port_info_t *info); +unsigned int snd_seq_port_info_get_capability(const snd_seq_port_info_t *info); +unsigned int snd_seq_port_info_get_type(const snd_seq_port_info_t *info); +int snd_seq_port_info_get_midi_channels(const snd_seq_port_info_t *info); +int snd_seq_port_info_get_midi_voices(const snd_seq_port_info_t *info); +int snd_seq_port_info_get_synth_voices(const snd_seq_port_info_t *info); +int snd_seq_port_info_get_read_use(const snd_seq_port_info_t *info); +int snd_seq_port_info_get_write_use(const snd_seq_port_info_t *info); +int snd_seq_port_info_get_port_specified(const snd_seq_port_info_t *info); +int snd_seq_port_info_get_timestamping(const snd_seq_port_info_t *info); +int snd_seq_port_info_get_timestamp_real(const snd_seq_port_info_t *info); +int snd_seq_port_info_get_timestamp_queue(const snd_seq_port_info_t *info); + +void snd_seq_port_info_set_client(snd_seq_port_info_t *info, int client); +void snd_seq_port_info_set_port(snd_seq_port_info_t *info, int port); +void snd_seq_port_info_set_addr(snd_seq_port_info_t *info, const snd_seq_addr_t *addr); +void snd_seq_port_info_set_name(snd_seq_port_info_t *info, const char *name); +void snd_seq_port_info_set_capability(snd_seq_port_info_t *info, unsigned int capability); +void snd_seq_port_info_set_type(snd_seq_port_info_t *info, unsigned int type); +void snd_seq_port_info_set_midi_channels(snd_seq_port_info_t *info, int channels); +void snd_seq_port_info_set_midi_voices(snd_seq_port_info_t *info, int voices); +void snd_seq_port_info_set_synth_voices(snd_seq_port_info_t *info, int voices); +void snd_seq_port_info_set_port_specified(snd_seq_port_info_t *info, int val); +void snd_seq_port_info_set_timestamping(snd_seq_port_info_t *info, int enable); +void snd_seq_port_info_set_timestamp_real(snd_seq_port_info_t *info, int realtime); +void snd_seq_port_info_set_timestamp_queue(snd_seq_port_info_t *info, int queue); + +int snd_seq_create_port(snd_seq_t *handle, snd_seq_port_info_t *info); +int snd_seq_delete_port(snd_seq_t *handle, int port); +int snd_seq_get_port_info(snd_seq_t *handle, int port, snd_seq_port_info_t *info); +int snd_seq_get_any_port_info(snd_seq_t *handle, int client, int port, snd_seq_port_info_t *info); +int snd_seq_set_port_info(snd_seq_t *handle, int port, snd_seq_port_info_t *info); +int snd_seq_query_next_port(snd_seq_t *handle, snd_seq_port_info_t *info); + +/** \} */ + + +/** + * \defgroup SeqSubscribe Sequencer Port Subscription + * Sequencer Port Subscription + * \ingroup Sequencer + * \{ + */ + +/** port subscription container */ +typedef struct _snd_seq_port_subscribe snd_seq_port_subscribe_t; + +size_t snd_seq_port_subscribe_sizeof(void); +/** allocate a #snd_seq_port_subscribe_t container on stack */ +#define snd_seq_port_subscribe_alloca(ptr) \ + SND_ALLOCA(snd_seq_port_subscribe, ptr) +int snd_seq_port_subscribe_malloc(snd_seq_port_subscribe_t **ptr); +void snd_seq_port_subscribe_free(snd_seq_port_subscribe_t *ptr); +void snd_seq_port_subscribe_copy(snd_seq_port_subscribe_t *dst, const snd_seq_port_subscribe_t *src); + +const snd_seq_addr_t *snd_seq_port_subscribe_get_sender(const snd_seq_port_subscribe_t *info); +const snd_seq_addr_t *snd_seq_port_subscribe_get_dest(const snd_seq_port_subscribe_t *info); +int snd_seq_port_subscribe_get_queue(const snd_seq_port_subscribe_t *info); +int snd_seq_port_subscribe_get_exclusive(const snd_seq_port_subscribe_t *info); +int snd_seq_port_subscribe_get_time_update(const snd_seq_port_subscribe_t *info); +int snd_seq_port_subscribe_get_time_real(const snd_seq_port_subscribe_t *info); + +void snd_seq_port_subscribe_set_sender(snd_seq_port_subscribe_t *info, const snd_seq_addr_t *addr); +void snd_seq_port_subscribe_set_dest(snd_seq_port_subscribe_t *info, const snd_seq_addr_t *addr); +void snd_seq_port_subscribe_set_queue(snd_seq_port_subscribe_t *info, int q); +void snd_seq_port_subscribe_set_exclusive(snd_seq_port_subscribe_t *info, int val); +void snd_seq_port_subscribe_set_time_update(snd_seq_port_subscribe_t *info, int val); +void snd_seq_port_subscribe_set_time_real(snd_seq_port_subscribe_t *info, int val); + +int snd_seq_get_port_subscription(snd_seq_t *handle, snd_seq_port_subscribe_t *sub); +int snd_seq_subscribe_port(snd_seq_t *handle, snd_seq_port_subscribe_t *sub); +int snd_seq_unsubscribe_port(snd_seq_t *handle, snd_seq_port_subscribe_t *sub); + +/* + */ + +/** subscription query container */ +typedef struct _snd_seq_query_subscribe snd_seq_query_subscribe_t; + +/** type of query subscription */ +typedef enum { + SND_SEQ_QUERY_SUBS_READ, /**< query read subscriptions */ + SND_SEQ_QUERY_SUBS_WRITE /**< query write subscriptions */ +} snd_seq_query_subs_type_t; + +size_t snd_seq_query_subscribe_sizeof(void); +/** allocate a #snd_seq_query_subscribe_t container on stack */ +#define snd_seq_query_subscribe_alloca(ptr) \ + SND_ALLOCA(snd_seq_query_subscribe, ptr) +int snd_seq_query_subscribe_malloc(snd_seq_query_subscribe_t **ptr); +void snd_seq_query_subscribe_free(snd_seq_query_subscribe_t *ptr); +void snd_seq_query_subscribe_copy(snd_seq_query_subscribe_t *dst, const snd_seq_query_subscribe_t *src); + +int snd_seq_query_subscribe_get_client(const snd_seq_query_subscribe_t *info); +int snd_seq_query_subscribe_get_port(const snd_seq_query_subscribe_t *info); +const snd_seq_addr_t *snd_seq_query_subscribe_get_root(const snd_seq_query_subscribe_t *info); +snd_seq_query_subs_type_t snd_seq_query_subscribe_get_type(const snd_seq_query_subscribe_t *info); +int snd_seq_query_subscribe_get_index(const snd_seq_query_subscribe_t *info); +int snd_seq_query_subscribe_get_num_subs(const snd_seq_query_subscribe_t *info); +const snd_seq_addr_t *snd_seq_query_subscribe_get_addr(const snd_seq_query_subscribe_t *info); +int snd_seq_query_subscribe_get_queue(const snd_seq_query_subscribe_t *info); +int snd_seq_query_subscribe_get_exclusive(const snd_seq_query_subscribe_t *info); +int snd_seq_query_subscribe_get_time_update(const snd_seq_query_subscribe_t *info); +int snd_seq_query_subscribe_get_time_real(const snd_seq_query_subscribe_t *info); + +void snd_seq_query_subscribe_set_client(snd_seq_query_subscribe_t *info, int client); +void snd_seq_query_subscribe_set_port(snd_seq_query_subscribe_t *info, int port); +void snd_seq_query_subscribe_set_root(snd_seq_query_subscribe_t *info, const snd_seq_addr_t *addr); +void snd_seq_query_subscribe_set_type(snd_seq_query_subscribe_t *info, snd_seq_query_subs_type_t type); +void snd_seq_query_subscribe_set_index(snd_seq_query_subscribe_t *info, int index); + +int snd_seq_query_port_subscribers(snd_seq_t *seq, snd_seq_query_subscribe_t * subs); + +/** \} */ + + +/** + * \defgroup SeqQueue Sequencer Queue Interface + * Sequencer Queue Interface + * \ingroup Sequencer + * \{ + */ + +/** queue information container */ +typedef struct _snd_seq_queue_info snd_seq_queue_info_t; +/** queue status container */ +typedef struct _snd_seq_queue_status snd_seq_queue_status_t; +/** queue tempo container */ +typedef struct _snd_seq_queue_tempo snd_seq_queue_tempo_t; +/** queue timer information container */ +typedef struct _snd_seq_queue_timer snd_seq_queue_timer_t; + +/** special queue ids */ +#define SND_SEQ_QUEUE_DIRECT 253 /**< direct dispatch */ + +size_t snd_seq_queue_info_sizeof(void); +/** allocate a #snd_seq_queue_info_t container on stack */ +#define snd_seq_queue_info_alloca(ptr) \ + SND_ALLOCA(snd_seq_queue_info, ptr) +int snd_seq_queue_info_malloc(snd_seq_queue_info_t **ptr); +void snd_seq_queue_info_free(snd_seq_queue_info_t *ptr); +void snd_seq_queue_info_copy(snd_seq_queue_info_t *dst, const snd_seq_queue_info_t *src); + +int snd_seq_queue_info_get_queue(const snd_seq_queue_info_t *info); +const char *snd_seq_queue_info_get_name(const snd_seq_queue_info_t *info); +int snd_seq_queue_info_get_owner(const snd_seq_queue_info_t *info); +int snd_seq_queue_info_get_locked(const snd_seq_queue_info_t *info); +unsigned int snd_seq_queue_info_get_flags(const snd_seq_queue_info_t *info); + +void snd_seq_queue_info_set_name(snd_seq_queue_info_t *info, const char *name); +void snd_seq_queue_info_set_owner(snd_seq_queue_info_t *info, int owner); +void snd_seq_queue_info_set_locked(snd_seq_queue_info_t *info, int locked); +void snd_seq_queue_info_set_flags(snd_seq_queue_info_t *info, unsigned int flags); + +int snd_seq_create_queue(snd_seq_t *seq, snd_seq_queue_info_t *info); +int snd_seq_alloc_named_queue(snd_seq_t *seq, const char *name); +int snd_seq_alloc_queue(snd_seq_t *handle); +int snd_seq_free_queue(snd_seq_t *handle, int q); +int snd_seq_get_queue_info(snd_seq_t *seq, int q, snd_seq_queue_info_t *info); +int snd_seq_set_queue_info(snd_seq_t *seq, int q, snd_seq_queue_info_t *info); +int snd_seq_query_named_queue(snd_seq_t *seq, const char *name); + +int snd_seq_get_queue_usage(snd_seq_t *handle, int q); +int snd_seq_set_queue_usage(snd_seq_t *handle, int q, int used); + +/* + */ +size_t snd_seq_queue_status_sizeof(void); +/** allocate a #snd_seq_queue_status_t container on stack */ +#define snd_seq_queue_status_alloca(ptr) \ + SND_ALLOCA(snd_seq_queue_status, ptr) +int snd_seq_queue_status_malloc(snd_seq_queue_status_t **ptr); +void snd_seq_queue_status_free(snd_seq_queue_status_t *ptr); +void snd_seq_queue_status_copy(snd_seq_queue_status_t *dst, const snd_seq_queue_status_t *src); + +int snd_seq_queue_status_get_queue(const snd_seq_queue_status_t *info); +int snd_seq_queue_status_get_events(const snd_seq_queue_status_t *info); +snd_seq_tick_time_t snd_seq_queue_status_get_tick_time(const snd_seq_queue_status_t *info); +const snd_seq_real_time_t *snd_seq_queue_status_get_real_time(const snd_seq_queue_status_t *info); +unsigned int snd_seq_queue_status_get_status(const snd_seq_queue_status_t *info); + +int snd_seq_get_queue_status(snd_seq_t *handle, int q, snd_seq_queue_status_t *status); + +/* + */ +size_t snd_seq_queue_tempo_sizeof(void); +/** allocate a #snd_seq_queue_tempo_t container on stack */ +#define snd_seq_queue_tempo_alloca(ptr) \ + SND_ALLOCA(snd_seq_queue_tempo, ptr) +int snd_seq_queue_tempo_malloc(snd_seq_queue_tempo_t **ptr); +void snd_seq_queue_tempo_free(snd_seq_queue_tempo_t *ptr); +void snd_seq_queue_tempo_copy(snd_seq_queue_tempo_t *dst, const snd_seq_queue_tempo_t *src); + +int snd_seq_queue_tempo_get_queue(const snd_seq_queue_tempo_t *info); +unsigned int snd_seq_queue_tempo_get_tempo(const snd_seq_queue_tempo_t *info); +int snd_seq_queue_tempo_get_ppq(const snd_seq_queue_tempo_t *info); +unsigned int snd_seq_queue_tempo_get_skew(const snd_seq_queue_tempo_t *info); +unsigned int snd_seq_queue_tempo_get_skew_base(const snd_seq_queue_tempo_t *info); +void snd_seq_queue_tempo_set_tempo(snd_seq_queue_tempo_t *info, unsigned int tempo); +void snd_seq_queue_tempo_set_ppq(snd_seq_queue_tempo_t *info, int ppq); +void snd_seq_queue_tempo_set_skew(snd_seq_queue_tempo_t *info, unsigned int skew); +void snd_seq_queue_tempo_set_skew_base(snd_seq_queue_tempo_t *info, unsigned int base); + +int snd_seq_get_queue_tempo(snd_seq_t *handle, int q, snd_seq_queue_tempo_t *tempo); +int snd_seq_set_queue_tempo(snd_seq_t *handle, int q, snd_seq_queue_tempo_t *tempo); + +/* + */ + +/** sequencer timer sources */ +typedef enum { + SND_SEQ_TIMER_ALSA = 0, /* ALSA timer */ + SND_SEQ_TIMER_MIDI_CLOCK = 1, /* Midi Clock (CLOCK event) */ + SND_SEQ_TIMER_MIDI_TICK = 2 /* Midi Timer Tick (TICK event */ +} snd_seq_queue_timer_type_t; + +size_t snd_seq_queue_timer_sizeof(void); +/** allocate a #snd_seq_queue_timer_t container on stack */ +#define snd_seq_queue_timer_alloca(ptr) \ + SND_ALLOCA(snd_seq_queue_timer, ptr) +int snd_seq_queue_timer_malloc(snd_seq_queue_timer_t **ptr); +void snd_seq_queue_timer_free(snd_seq_queue_timer_t *ptr); +void snd_seq_queue_timer_copy(snd_seq_queue_timer_t *dst, const snd_seq_queue_timer_t *src); + +int snd_seq_queue_timer_get_queue(const snd_seq_queue_timer_t *info); +snd_seq_queue_timer_type_t snd_seq_queue_timer_get_type(const snd_seq_queue_timer_t *info); +const snd_timer_id_t *snd_seq_queue_timer_get_id(const snd_seq_queue_timer_t *info); +unsigned int snd_seq_queue_timer_get_resolution(const snd_seq_queue_timer_t *info); + +void snd_seq_queue_timer_set_type(snd_seq_queue_timer_t *info, snd_seq_queue_timer_type_t type); +void snd_seq_queue_timer_set_id(snd_seq_queue_timer_t *info, const snd_timer_id_t *id); +void snd_seq_queue_timer_set_resolution(snd_seq_queue_timer_t *info, unsigned int resolution); + +int snd_seq_get_queue_timer(snd_seq_t *handle, int q, snd_seq_queue_timer_t *timer); +int snd_seq_set_queue_timer(snd_seq_t *handle, int q, snd_seq_queue_timer_t *timer); + +/** \} */ + +/** + * \defgroup SeqEvent Sequencer Event API + * Sequencer Event API + * \ingroup Sequencer + * \{ + */ + +int snd_seq_free_event(snd_seq_event_t *ev); +ssize_t snd_seq_event_length(snd_seq_event_t *ev); +int snd_seq_event_output(snd_seq_t *handle, snd_seq_event_t *ev); +int snd_seq_event_output_buffer(snd_seq_t *handle, snd_seq_event_t *ev); +int snd_seq_event_output_direct(snd_seq_t *handle, snd_seq_event_t *ev); +int snd_seq_event_input(snd_seq_t *handle, snd_seq_event_t **ev); +int snd_seq_event_input_pending(snd_seq_t *seq, int fetch_sequencer); +int snd_seq_drain_output(snd_seq_t *handle); +int snd_seq_event_output_pending(snd_seq_t *seq); +int snd_seq_extract_output(snd_seq_t *handle, snd_seq_event_t **ev); +int snd_seq_drop_output(snd_seq_t *handle); +int snd_seq_drop_output_buffer(snd_seq_t *handle); +int snd_seq_drop_input(snd_seq_t *handle); +int snd_seq_drop_input_buffer(snd_seq_t *handle); + +/** event removal conditionals */ +typedef struct _snd_seq_remove_events snd_seq_remove_events_t; + +/** Remove conditional flags */ +#define SND_SEQ_REMOVE_INPUT (1<<0) /**< Flush input queues */ +#define SND_SEQ_REMOVE_OUTPUT (1<<1) /**< Flush output queues */ +#define SND_SEQ_REMOVE_DEST (1<<2) /**< Restrict by destination q:client:port */ +#define SND_SEQ_REMOVE_DEST_CHANNEL (1<<3) /**< Restrict by channel */ +#define SND_SEQ_REMOVE_TIME_BEFORE (1<<4) /**< Restrict to before time */ +#define SND_SEQ_REMOVE_TIME_AFTER (1<<5) /**< Restrict to time or after */ +#define SND_SEQ_REMOVE_TIME_TICK (1<<6) /**< Time is in ticks */ +#define SND_SEQ_REMOVE_EVENT_TYPE (1<<7) /**< Restrict to event type */ +#define SND_SEQ_REMOVE_IGNORE_OFF (1<<8) /**< Do not flush off events */ +#define SND_SEQ_REMOVE_TAG_MATCH (1<<9) /**< Restrict to events with given tag */ + +size_t snd_seq_remove_events_sizeof(void); +/** allocate a #snd_seq_remove_events_t container on stack */ +#define snd_seq_remove_events_alloca(ptr) \ + SND_ALLOCA(snd_seq_remove_events, ptr) +int snd_seq_remove_events_malloc(snd_seq_remove_events_t **ptr); +void snd_seq_remove_events_free(snd_seq_remove_events_t *ptr); +void snd_seq_remove_events_copy(snd_seq_remove_events_t *dst, const snd_seq_remove_events_t *src); + +unsigned int snd_seq_remove_events_get_condition(const snd_seq_remove_events_t *info); +int snd_seq_remove_events_get_queue(const snd_seq_remove_events_t *info); +const snd_seq_timestamp_t *snd_seq_remove_events_get_time(const snd_seq_remove_events_t *info); +const snd_seq_addr_t *snd_seq_remove_events_get_dest(const snd_seq_remove_events_t *info); +int snd_seq_remove_events_get_channel(const snd_seq_remove_events_t *info); +int snd_seq_remove_events_get_event_type(const snd_seq_remove_events_t *info); +int snd_seq_remove_events_get_tag(const snd_seq_remove_events_t *info); + +void snd_seq_remove_events_set_condition(snd_seq_remove_events_t *info, unsigned int flags); +void snd_seq_remove_events_set_queue(snd_seq_remove_events_t *info, int queue); +void snd_seq_remove_events_set_time(snd_seq_remove_events_t *info, const snd_seq_timestamp_t *time); +void snd_seq_remove_events_set_dest(snd_seq_remove_events_t *info, const snd_seq_addr_t *addr); +void snd_seq_remove_events_set_channel(snd_seq_remove_events_t *info, int channel); +void snd_seq_remove_events_set_event_type(snd_seq_remove_events_t *info, int type); +void snd_seq_remove_events_set_tag(snd_seq_remove_events_t *info, int tag); + +int snd_seq_remove_events(snd_seq_t *handle, snd_seq_remove_events_t *info); + +/** \} */ + +/** + * \defgroup SeqMisc Sequencer Miscellaneous + * Sequencer Miscellaneous + * \ingroup Sequencer + * \{ + */ + +void snd_seq_set_bit(int nr, void *array); +int snd_seq_change_bit(int nr, void *array); +int snd_seq_get_bit(int nr, void *array); + +/** \} */ + + +/** + * \defgroup SeqEvType Sequencer Event Type Checks + * Sequencer Event Type Checks + * \ingroup Sequencer + * \{ + */ + +/* event type macros */ +enum { + SND_SEQ_EVFLG_RESULT, + SND_SEQ_EVFLG_NOTE, + SND_SEQ_EVFLG_CONTROL, + SND_SEQ_EVFLG_QUEUE, + SND_SEQ_EVFLG_SYSTEM, + SND_SEQ_EVFLG_MESSAGE, + SND_SEQ_EVFLG_CONNECTION, + SND_SEQ_EVFLG_SAMPLE, + SND_SEQ_EVFLG_USERS, + SND_SEQ_EVFLG_INSTR, + SND_SEQ_EVFLG_QUOTE, + SND_SEQ_EVFLG_NONE, + SND_SEQ_EVFLG_RAW, + SND_SEQ_EVFLG_FIXED, + SND_SEQ_EVFLG_VARIABLE, + SND_SEQ_EVFLG_VARUSR +}; + +enum { + SND_SEQ_EVFLG_NOTE_ONEARG, + SND_SEQ_EVFLG_NOTE_TWOARG +}; + +enum { + SND_SEQ_EVFLG_QUEUE_NOARG, + SND_SEQ_EVFLG_QUEUE_TICK, + SND_SEQ_EVFLG_QUEUE_TIME, + SND_SEQ_EVFLG_QUEUE_VALUE +}; + +/** + * Exported event type table + * + * This table is referred by snd_seq_ev_is_xxx. + */ +extern const unsigned int snd_seq_event_types[]; + +#define _SND_SEQ_TYPE(x) (1<<(x)) /**< master type - 24bit */ +#define _SND_SEQ_TYPE_OPT(x) ((x)<<24) /**< optional type - 8bit */ + +/** check the event type */ +#define snd_seq_type_check(ev,x) (snd_seq_event_types[(ev)->type] & _SND_SEQ_TYPE(x)) + +/** event type check: result events */ +#define snd_seq_ev_is_result_type(ev) \ + snd_seq_type_check(ev, SND_SEQ_EVFLG_RESULT) +/** event type check: note events */ +#define snd_seq_ev_is_note_type(ev) \ + snd_seq_type_check(ev, SND_SEQ_EVFLG_NOTE) +/** event type check: control events */ +#define snd_seq_ev_is_control_type(ev) \ + snd_seq_type_check(ev, SND_SEQ_EVFLG_CONTROL) +/** event type check: channel specific events */ +#define snd_seq_ev_is_channel_type(ev) \ + (snd_seq_event_types[(ev)->type] & (_SND_SEQ_TYPE(SND_SEQ_EVFLG_NOTE) | _SND_SEQ_TYPE(SND_SEQ_EVFLG_CONTROL))) + +/** event type check: queue control events */ +#define snd_seq_ev_is_queue_type(ev) \ + snd_seq_type_check(ev, SND_SEQ_EVFLG_QUEUE) +/** event type check: system status messages */ +#define snd_seq_ev_is_message_type(ev) \ + snd_seq_type_check(ev, SND_SEQ_EVFLG_MESSAGE) +/** event type check: system status messages */ +#define snd_seq_ev_is_subscribe_type(ev) \ + snd_seq_type_check(ev, SND_SEQ_EVFLG_CONNECTION) +/** event type check: sample messages */ +#define snd_seq_ev_is_sample_type(ev) \ + snd_seq_type_check(ev, SND_SEQ_EVFLG_SAMPLE) +/** event type check: user-defined messages */ +#define snd_seq_ev_is_user_type(ev) \ + snd_seq_type_check(ev, SND_SEQ_EVFLG_USERS) +/** event type check: instrument layer events */ +#define snd_seq_ev_is_instr_type(ev) \ + snd_seq_type_check(ev, SND_SEQ_EVFLG_INSTR) +/** event type check: fixed length events */ +#define snd_seq_ev_is_fixed_type(ev) \ + snd_seq_type_check(ev, SND_SEQ_EVFLG_FIXED) +/** event type check: variable length events */ +#define snd_seq_ev_is_variable_type(ev) \ + snd_seq_type_check(ev, SND_SEQ_EVFLG_VARIABLE) +/** event type check: user pointer events */ +#define snd_seq_ev_is_varusr_type(ev) \ + snd_seq_type_check(ev, SND_SEQ_EVFLG_VARUSR) +/** event type check: reserved for kernel */ +#define snd_seq_ev_is_reserved(ev) \ + (! snd_seq_event_types[(ev)->type]) + +/** + * macros to check event flags + */ +/** prior events */ +#define snd_seq_ev_is_prior(ev) \ + (((ev)->flags & SND_SEQ_PRIORITY_MASK) == SND_SEQ_PRIORITY_HIGH) + +/** get the data length type */ +#define snd_seq_ev_length_type(ev) \ + ((ev)->flags & SND_SEQ_EVENT_LENGTH_MASK) +/** fixed length events */ +#define snd_seq_ev_is_fixed(ev) \ + (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_FIXED) +/** variable length events */ +#define snd_seq_ev_is_variable(ev) \ + (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_VARIABLE) +/** variable length on user-space */ +#define snd_seq_ev_is_varusr(ev) \ + (snd_seq_ev_length_type(ev) == SND_SEQ_EVENT_LENGTH_VARUSR) + +/** time-stamp type */ +#define snd_seq_ev_timestamp_type(ev) \ + ((ev)->flags & SND_SEQ_TIME_STAMP_MASK) +/** event is in tick time */ +#define snd_seq_ev_is_tick(ev) \ + (snd_seq_ev_timestamp_type(ev) == SND_SEQ_TIME_STAMP_TICK) +/** event is in real-time */ +#define snd_seq_ev_is_real(ev) \ + (snd_seq_ev_timestamp_type(ev) == SND_SEQ_TIME_STAMP_REAL) + +/** time-mode type */ +#define snd_seq_ev_timemode_type(ev) \ + ((ev)->flags & SND_SEQ_TIME_MODE_MASK) +/** scheduled in absolute time */ +#define snd_seq_ev_is_abstime(ev) \ + (snd_seq_ev_timemode_type(ev) == SND_SEQ_TIME_MODE_ABS) +/** scheduled in relative time */ +#define snd_seq_ev_is_reltime(ev) \ + (snd_seq_ev_timemode_type(ev) == SND_SEQ_TIME_MODE_REL) + +/** direct dispatched events */ +#define snd_seq_ev_is_direct(ev) \ + ((ev)->queue == SND_SEQ_QUEUE_DIRECT) + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_SEQ_H */ + diff --git a/debian/include-alsa/alsa/seq_event.h b/debian/include-alsa/alsa/seq_event.h new file mode 100644 index 0000000..6fb0f4c --- /dev/null +++ b/debian/include-alsa/alsa/seq_event.h @@ -0,0 +1,452 @@ +/** + * \file <alsa/seq_event.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_SEQ_EVENT_H +#define __ALSA_SEQ_EVENT_H + +/** + * \defgroup SeqEvents Sequencer Event Definitions + * Sequencer Event Definitions + * \ingroup Sequencer + * \{ + */ + +/** + * Sequencer event data type + */ +typedef unsigned char snd_seq_event_type_t; + +/** Sequencer event type */ +enum snd_seq_event_type { + /** system status; event data type = #snd_seq_result_t */ + SND_SEQ_EVENT_SYSTEM = 0, + /** returned result status; event data type = #snd_seq_result_t */ + SND_SEQ_EVENT_RESULT, + + /** note on and off with duration; event data type = #snd_seq_ev_note_t */ + SND_SEQ_EVENT_NOTE = 5, + /** note on; event data type = #snd_seq_ev_note_t */ + SND_SEQ_EVENT_NOTEON, + /** note off; event data type = #snd_seq_ev_note_t */ + SND_SEQ_EVENT_NOTEOFF, + /** key pressure change (aftertouch); event data type = #snd_seq_ev_note_t */ + SND_SEQ_EVENT_KEYPRESS, + + /** controller; event data type = #snd_seq_ev_ctrl_t */ + SND_SEQ_EVENT_CONTROLLER = 10, + /** program change; event data type = #snd_seq_ev_ctrl_t */ + SND_SEQ_EVENT_PGMCHANGE, + /** channel pressure; event data type = #snd_seq_ev_ctrl_t */ + SND_SEQ_EVENT_CHANPRESS, + /** pitchwheel; event data type = #snd_seq_ev_ctrl_t; data is from -8192 to 8191) */ + SND_SEQ_EVENT_PITCHBEND, + /** 14 bit controller value; event data type = #snd_seq_ev_ctrl_t */ + SND_SEQ_EVENT_CONTROL14, + /** 14 bit NRPN; event data type = #snd_seq_ev_ctrl_t */ + SND_SEQ_EVENT_NONREGPARAM, + /** 14 bit RPN; event data type = #snd_seq_ev_ctrl_t */ + SND_SEQ_EVENT_REGPARAM, + + /** SPP with LSB and MSB values; event data type = #snd_seq_ev_ctrl_t */ + SND_SEQ_EVENT_SONGPOS = 20, + /** Song Select with song ID number; event data type = #snd_seq_ev_ctrl_t */ + SND_SEQ_EVENT_SONGSEL, + /** midi time code quarter frame; event data type = #snd_seq_ev_ctrl_t */ + SND_SEQ_EVENT_QFRAME, + /** SMF Time Signature event; event data type = #snd_seq_ev_ctrl_t */ + SND_SEQ_EVENT_TIMESIGN, + /** SMF Key Signature event; event data type = #snd_seq_ev_ctrl_t */ + SND_SEQ_EVENT_KEYSIGN, + + /** MIDI Real Time Start message; event data type = #snd_seq_ev_queue_control_t */ + SND_SEQ_EVENT_START = 30, + /** MIDI Real Time Continue message; event data type = #snd_seq_ev_queue_control_t */ + SND_SEQ_EVENT_CONTINUE, + /** MIDI Real Time Stop message; event data type = #snd_seq_ev_queue_control_t */ + SND_SEQ_EVENT_STOP, + /** Set tick queue position; event data type = #snd_seq_ev_queue_control_t */ + SND_SEQ_EVENT_SETPOS_TICK, + /** Set real-time queue position; event data type = #snd_seq_ev_queue_control_t */ + SND_SEQ_EVENT_SETPOS_TIME, + /** (SMF) Tempo event; event data type = #snd_seq_ev_queue_control_t */ + SND_SEQ_EVENT_TEMPO, + /** MIDI Real Time Clock message; event data type = #snd_seq_ev_queue_control_t */ + SND_SEQ_EVENT_CLOCK, + /** MIDI Real Time Tick message; event data type = #snd_seq_ev_queue_control_t */ + SND_SEQ_EVENT_TICK, + /** Queue timer skew; event data type = #snd_seq_ev_queue_control_t */ + SND_SEQ_EVENT_QUEUE_SKEW, + /** Sync position changed; event data type = #snd_seq_ev_queue_control_t */ + SND_SEQ_EVENT_SYNC_POS, + + /** Tune request; event data type = none */ + SND_SEQ_EVENT_TUNE_REQUEST = 40, + /** Reset to power-on state; event data type = none */ + SND_SEQ_EVENT_RESET, + /** Active sensing event; event data type = none */ + SND_SEQ_EVENT_SENSING, + + /** Echo-back event; event data type = any type */ + SND_SEQ_EVENT_ECHO = 50, + /** OSS emulation raw event; event data type = any type */ + SND_SEQ_EVENT_OSS, + + /** New client has connected; event data type = #snd_seq_addr_t */ + SND_SEQ_EVENT_CLIENT_START = 60, + /** Client has left the system; event data type = #snd_seq_addr_t */ + SND_SEQ_EVENT_CLIENT_EXIT, + /** Client status/info has changed; event data type = #snd_seq_addr_t */ + SND_SEQ_EVENT_CLIENT_CHANGE, + /** New port was created; event data type = #snd_seq_addr_t */ + SND_SEQ_EVENT_PORT_START, + /** Port was deleted from system; event data type = #snd_seq_addr_t */ + SND_SEQ_EVENT_PORT_EXIT, + /** Port status/info has changed; event data type = #snd_seq_addr_t */ + SND_SEQ_EVENT_PORT_CHANGE, + + /** Ports connected; event data type = #snd_seq_connect_t */ + SND_SEQ_EVENT_PORT_SUBSCRIBED, + /** Ports disconnected; event data type = #snd_seq_connect_t */ + SND_SEQ_EVENT_PORT_UNSUBSCRIBED, + + /** Sample select; event data type = #snd_seq_ev_sample_control_t */ + SND_SEQ_EVENT_SAMPLE = 70, + /** Sample cluster select; event data type = #snd_seq_ev_sample_control_t */ + SND_SEQ_EVENT_SAMPLE_CLUSTER, + /** voice start */ + SND_SEQ_EVENT_SAMPLE_START, + /** voice stop */ + SND_SEQ_EVENT_SAMPLE_STOP, + /** playback frequency */ + SND_SEQ_EVENT_SAMPLE_FREQ, + /** volume and balance */ + SND_SEQ_EVENT_SAMPLE_VOLUME, + /** sample loop */ + SND_SEQ_EVENT_SAMPLE_LOOP, + /** sample position */ + SND_SEQ_EVENT_SAMPLE_POSITION, + /** private (hardware dependent) event */ + SND_SEQ_EVENT_SAMPLE_PRIVATE1, + + /** user-defined event; event data type = any (fixed size) */ + SND_SEQ_EVENT_USR0 = 90, + /** user-defined event; event data type = any (fixed size) */ + SND_SEQ_EVENT_USR1, + /** user-defined event; event data type = any (fixed size) */ + SND_SEQ_EVENT_USR2, + /** user-defined event; event data type = any (fixed size) */ + SND_SEQ_EVENT_USR3, + /** user-defined event; event data type = any (fixed size) */ + SND_SEQ_EVENT_USR4, + /** user-defined event; event data type = any (fixed size) */ + SND_SEQ_EVENT_USR5, + /** user-defined event; event data type = any (fixed size) */ + SND_SEQ_EVENT_USR6, + /** user-defined event; event data type = any (fixed size) */ + SND_SEQ_EVENT_USR7, + /** user-defined event; event data type = any (fixed size) */ + SND_SEQ_EVENT_USR8, + /** user-defined event; event data type = any (fixed size) */ + SND_SEQ_EVENT_USR9, + + /** begin of instrument management */ + SND_SEQ_EVENT_INSTR_BEGIN = 100, + /** end of instrument management */ + SND_SEQ_EVENT_INSTR_END, + /** query instrument interface info */ + SND_SEQ_EVENT_INSTR_INFO, + /** result of instrument interface info */ + SND_SEQ_EVENT_INSTR_INFO_RESULT, + /** query instrument format info */ + SND_SEQ_EVENT_INSTR_FINFO, + /** result of instrument format info */ + SND_SEQ_EVENT_INSTR_FINFO_RESULT, + /** reset instrument instrument memory */ + SND_SEQ_EVENT_INSTR_RESET, + /** get instrument interface status */ + SND_SEQ_EVENT_INSTR_STATUS, + /** result of instrument interface status */ + SND_SEQ_EVENT_INSTR_STATUS_RESULT, + /** put an instrument to port */ + SND_SEQ_EVENT_INSTR_PUT, + /** get an instrument from port */ + SND_SEQ_EVENT_INSTR_GET, + /** result of instrument query */ + SND_SEQ_EVENT_INSTR_GET_RESULT, + /** free instrument(s) */ + SND_SEQ_EVENT_INSTR_FREE, + /** get instrument list */ + SND_SEQ_EVENT_INSTR_LIST, + /** result of instrument list */ + SND_SEQ_EVENT_INSTR_LIST_RESULT, + /** set cluster parameters */ + SND_SEQ_EVENT_INSTR_CLUSTER, + /** get cluster parameters */ + SND_SEQ_EVENT_INSTR_CLUSTER_GET, + /** result of cluster parameters */ + SND_SEQ_EVENT_INSTR_CLUSTER_RESULT, + /** instrument change */ + SND_SEQ_EVENT_INSTR_CHANGE, + + /** system exclusive data (variable length); event data type = #snd_seq_ev_ext_t */ + SND_SEQ_EVENT_SYSEX = 130, + /** error event; event data type = #snd_seq_ev_ext_t */ + SND_SEQ_EVENT_BOUNCE, + /** reserved for user apps; event data type = #snd_seq_ev_ext_t */ + SND_SEQ_EVENT_USR_VAR0 = 135, + /** reserved for user apps; event data type = #snd_seq_ev_ext_t */ + SND_SEQ_EVENT_USR_VAR1, + /** reserved for user apps; event data type = #snd_seq_ev_ext_t */ + SND_SEQ_EVENT_USR_VAR2, + /** reserved for user apps; event data type = #snd_seq_ev_ext_t */ + SND_SEQ_EVENT_USR_VAR3, + /** reserved for user apps; event data type = #snd_seq_ev_ext_t */ + SND_SEQ_EVENT_USR_VAR4, + + /** NOP; ignored in any case */ + SND_SEQ_EVENT_NONE = 255 +}; + + +/** Sequencer event address */ +typedef struct snd_seq_addr { + unsigned char client; /**< Client id */ + unsigned char port; /**< Port id */ +} snd_seq_addr_t; + +/** Connection (subscription) between ports */ +typedef struct snd_seq_connect { + snd_seq_addr_t sender; /**< sender address */ + snd_seq_addr_t dest; /**< destination address */ +} snd_seq_connect_t; + + +/** Real-time data record */ +typedef struct snd_seq_real_time { + unsigned int tv_sec; /**< seconds */ + unsigned int tv_nsec; /**< nanoseconds */ +} snd_seq_real_time_t; + +/** (MIDI) Tick-time data record */ +typedef unsigned int snd_seq_tick_time_t; + +/** unioned time stamp */ +typedef union snd_seq_timestamp { + snd_seq_tick_time_t tick; /**< tick-time */ + struct snd_seq_real_time time; /**< real-time */ +} snd_seq_timestamp_t; + + +/** + * Event mode flags + * + * NOTE: only 8 bits available! + */ +#define SND_SEQ_TIME_STAMP_TICK (0<<0) /**< timestamp in clock ticks */ +#define SND_SEQ_TIME_STAMP_REAL (1<<0) /**< timestamp in real time */ +#define SND_SEQ_TIME_STAMP_MASK (1<<0) /**< mask for timestamp bits */ + +#define SND_SEQ_TIME_MODE_ABS (0<<1) /**< absolute timestamp */ +#define SND_SEQ_TIME_MODE_REL (1<<1) /**< relative to current time */ +#define SND_SEQ_TIME_MODE_MASK (1<<1) /**< mask for time mode bits */ + +#define SND_SEQ_EVENT_LENGTH_FIXED (0<<2) /**< fixed event size */ +#define SND_SEQ_EVENT_LENGTH_VARIABLE (1<<2) /**< variable event size */ +#define SND_SEQ_EVENT_LENGTH_VARUSR (2<<2) /**< variable event size - user memory space */ +#define SND_SEQ_EVENT_LENGTH_MASK (3<<2) /**< mask for event length bits */ + +#define SND_SEQ_PRIORITY_NORMAL (0<<4) /**< normal priority */ +#define SND_SEQ_PRIORITY_HIGH (1<<4) /**< event should be processed before others */ +#define SND_SEQ_PRIORITY_MASK (1<<4) /**< mask for priority bits */ + + +/** Note event */ +typedef struct snd_seq_ev_note { + unsigned char channel; /**< channel number */ + unsigned char note; /**< note */ + unsigned char velocity; /**< velocity */ + unsigned char off_velocity; /**< note-off velocity; only for #SND_SEQ_EVENT_NOTE */ + unsigned int duration; /**< duration until note-off; only for #SND_SEQ_EVENT_NOTE */ +} snd_seq_ev_note_t; + +/** Controller event */ +typedef struct snd_seq_ev_ctrl { + unsigned char channel; /**< channel number */ + unsigned char unused[3]; /**< reserved */ + unsigned int param; /**< control parameter */ + signed int value; /**< control value */ +} snd_seq_ev_ctrl_t; + +/** generic set of bytes (12x8 bit) */ +typedef struct snd_seq_ev_raw8 { + unsigned char d[12]; /**< 8 bit value */ +} snd_seq_ev_raw8_t; + +/** generic set of integers (3x32 bit) */ +typedef struct snd_seq_ev_raw32 { + unsigned int d[3]; /**< 32 bit value */ +} snd_seq_ev_raw32_t; + +/** external stored data */ +typedef struct snd_seq_ev_ext { + unsigned int len; /**< length of data */ + void *ptr; /**< pointer to data (note: can be 64-bit) */ +} __attribute__((packed)) snd_seq_ev_ext_t; + +/** Instrument cluster type */ +typedef unsigned int snd_seq_instr_cluster_t; + +/** Instrument type */ +typedef struct snd_seq_instr { + snd_seq_instr_cluster_t cluster; /**< cluster id */ + unsigned int std; /**< instrument standard id; the upper byte means a private instrument (owner - client id) */ + unsigned short bank; /**< instrument bank id */ + unsigned short prg; /**< instrument program id */ +} snd_seq_instr_t; + +/** sample number */ +typedef struct snd_seq_ev_sample { + unsigned int std; /**< sample standard id */ + unsigned short bank; /**< sample bank id */ + unsigned short prg; /**< sample program id */ +} snd_seq_ev_sample_t; + +/** sample cluster */ +typedef struct snd_seq_ev_cluster { + snd_seq_instr_cluster_t cluster; /**< cluster id */ +} snd_seq_ev_cluster_t; + +/** sample position */ +typedef unsigned int snd_seq_position_t; /**< playback position (in samples) * 16 */ + +/** sample stop mode */ +typedef enum snd_seq_stop_mode { + SND_SEQ_SAMPLE_STOP_IMMEDIATELY = 0, /**< terminate playing immediately */ + SND_SEQ_SAMPLE_STOP_VENVELOPE = 1, /**< finish volume envelope */ + SND_SEQ_SAMPLE_STOP_LOOP = 2 /**< terminate loop and finish wave */ +} snd_seq_stop_mode_t; + +/** sample frequency */ +typedef int snd_seq_frequency_t; /**< playback frequency in HZ * 16 */ + +/** sample volume control; if any value is set to -1 == do not change */ +typedef struct snd_seq_ev_volume { + signed short volume; /**< range: 0-16383 */ + signed short lr; /**< left-right balance; range: 0-16383 */ + signed short fr; /**< front-rear balance; range: 0-16383 */ + signed short du; /**< down-up balance; range: 0-16383 */ +} snd_seq_ev_volume_t; + +/** simple loop redefinition */ +typedef struct snd_seq_ev_loop { + unsigned int start; /**< loop start (in samples) * 16 */ + unsigned int end; /**< loop end (in samples) * 16 */ +} snd_seq_ev_loop_t; + +/** Sample control events */ +typedef struct snd_seq_ev_sample_control { + unsigned char channel; /**< channel */ + unsigned char unused[3]; /**< reserved */ + union { + snd_seq_ev_sample_t sample; /**< sample number */ + snd_seq_ev_cluster_t cluster; /**< cluster number */ + snd_seq_position_t position; /**< position */ + snd_seq_stop_mode_t stop_mode; /**< stop mode */ + snd_seq_frequency_t frequency; /**< frequency */ + snd_seq_ev_volume_t volume; /**< volume */ + snd_seq_ev_loop_t loop; /**< loop control */ + unsigned char raw8[8]; /**< raw 8-bit */ + } param; /**< control parameters */ +} snd_seq_ev_sample_control_t; + + + +/** INSTR_BEGIN event */ +typedef struct snd_seq_ev_instr_begin { + int timeout; /**< zero = forever, otherwise timeout in ms */ +} snd_seq_ev_instr_begin_t; + +/** Result events */ +typedef struct snd_seq_result { + int event; /**< processed event type */ + int result; /**< status */ +} snd_seq_result_t; + +/** Queue skew values */ +typedef struct snd_seq_queue_skew { + unsigned int value; /**< skew value */ + unsigned int base; /**< skew base */ +} snd_seq_queue_skew_t; + +/** queue timer control */ +typedef struct snd_seq_ev_queue_control { + unsigned char queue; /**< affected queue */ + unsigned char unused[3]; /**< reserved */ + union { + signed int value; /**< affected value (e.g. tempo) */ + snd_seq_timestamp_t time; /**< time */ + unsigned int position; /**< sync position */ + snd_seq_queue_skew_t skew; /**< queue skew */ + unsigned int d32[2]; /**< any data */ + unsigned char d8[8]; /**< any data */ + } param; /**< data value union */ +} snd_seq_ev_queue_control_t; + + +/** Sequencer event */ +typedef struct snd_seq_event { + snd_seq_event_type_t type; /**< event type */ + unsigned char flags; /**< event flags */ + unsigned char tag; /**< tag */ + + unsigned char queue; /**< schedule queue */ + snd_seq_timestamp_t time; /**< schedule time */ + + snd_seq_addr_t source; /**< source address */ + snd_seq_addr_t dest; /**< destination address */ + + union { + snd_seq_ev_note_t note; /**< note information */ + snd_seq_ev_ctrl_t control; /**< MIDI control information */ + snd_seq_ev_raw8_t raw8; /**< raw8 data */ + snd_seq_ev_raw32_t raw32; /**< raw32 data */ + snd_seq_ev_ext_t ext; /**< external data */ + snd_seq_ev_queue_control_t queue; /**< queue control */ + snd_seq_timestamp_t time; /**< timestamp */ + snd_seq_addr_t addr; /**< address */ + snd_seq_connect_t connect; /**< connect information */ + snd_seq_result_t result; /**< operation result code */ + snd_seq_ev_instr_begin_t instr_begin; /**< instrument */ + snd_seq_ev_sample_control_t sample; /**< sample control */ + } data; /**< event data... */ +} snd_seq_event_t; + + +/** \} */ + +#endif /* __ALSA_SEQ_EVENT_H */ + diff --git a/debian/include-alsa/alsa/seq_midi_event.h b/debian/include-alsa/alsa/seq_midi_event.h new file mode 100644 index 0000000..dad9dc7 --- /dev/null +++ b/debian/include-alsa/alsa/seq_midi_event.h @@ -0,0 +1,65 @@ +/** + * \file <alsa/seq_midi_event.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_SEQ_MIDI_EVENT_H +#define __ALSA_SEQ_MIDI_EVENT_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup MIDI_Event Sequencer event <-> MIDI byte stream coder + * \ingroup Sequencer + * Sequencer event <-> MIDI byte stream coder + * \{ + */ + +/** container for sequencer midi event parsers */ +typedef struct snd_midi_event snd_midi_event_t; + +int snd_midi_event_new(size_t bufsize, snd_midi_event_t **rdev); +int snd_midi_event_resize_buffer(snd_midi_event_t *dev, size_t bufsize); +void snd_midi_event_free(snd_midi_event_t *dev); +void snd_midi_event_init(snd_midi_event_t *dev); +void snd_midi_event_reset_encode(snd_midi_event_t *dev); +void snd_midi_event_reset_decode(snd_midi_event_t *dev); +void snd_midi_event_no_status(snd_midi_event_t *dev, int on); +/* encode from byte stream - return number of written bytes if success */ +long snd_midi_event_encode(snd_midi_event_t *dev, const unsigned char *buf, long count, snd_seq_event_t *ev); +int snd_midi_event_encode_byte(snd_midi_event_t *dev, int c, snd_seq_event_t *ev); +/* decode from event to bytes - return number of written bytes if success */ +long snd_midi_event_decode(snd_midi_event_t *dev, unsigned char *buf, long count, const snd_seq_event_t *ev); + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_SEQ_MIDI_EVENT_H */ + diff --git a/debian/include-alsa/alsa/seqmid.h b/debian/include-alsa/alsa/seqmid.h new file mode 100644 index 0000000..e4759ba --- /dev/null +++ b/debian/include-alsa/alsa/seqmid.h @@ -0,0 +1,480 @@ +/** + * \file <alsa/seqmid.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_SEQMID_H +#define __ALSA_SEQMID_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup SeqMiddle Sequencer Middle Level Interface + * Sequencer Middle Level Interface + * \ingroup Sequencer + * \{ + */ + +/** + * \brief initialize event record + * \param ev event record pointer + * + * This macro clears the given event record pointer to the default status. + */ +#define snd_seq_ev_clear(ev) \ + memset(ev, 0, sizeof(snd_seq_event_t)) + +/** + * \brief set the explicit destination + * \param ev event record + * \param c destination client id + * \param p destination port id + * + * This macro sets the client and port id numbers to the given event record. + * + * \sa snd_seq_ev_set_subs() + */ +#define snd_seq_ev_set_dest(ev,c,p) \ + ((ev)->dest.client = (c), (ev)->dest.port = (p)) + +/** + * \brief set broadcasting to subscribers + * \param ev event record + * + * This macro sets the destination as the subscribers. + * + * \sa snd_seq_ev_set_dest() + */ +#define snd_seq_ev_set_subs(ev) \ + ((ev)->dest.client = SND_SEQ_ADDRESS_SUBSCRIBERS,\ + (ev)->dest.port = SND_SEQ_ADDRESS_UNKNOWN) + +/** + * \brief set broadcasting to all clients/ports + * \param ev event record + * + * This macro sets the destination as the broadcasting. + * + * \sa snd_seq_ev_set_dest() + */ +#define snd_seq_ev_set_broadcast(ev) \ + ((ev)->dest.client = SND_SEQ_ADDRESS_BROADCAST,\ + (ev)->dest.port = SND_SEQ_ADDRESS_BROADCAST) + +/** + * \brief set the source port + * \param ev event record + * \param p source port id + * + * This macro sets the source port id number. + */ +#define snd_seq_ev_set_source(ev,p) \ + ((ev)->source.port = (p)) + +/** + * \brief set direct passing mode (without queued) + * \param ev event instance + * + * This macro sets the event to the direct passing mode + * to be delivered immediately without queueing. + * + * \sa snd_seq_ev_schedule_tick(), snd_seq_ev_schedule_real() + */ +#define snd_seq_ev_set_direct(ev) \ + ((ev)->queue = SND_SEQ_QUEUE_DIRECT) + +/** + * \brief set tick-scheduling mode on queue + * \param ev event instance + * \param q queue id to schedule + * \param relative relative time-stamp if non-zero + * \param ttick tick time-stamp to be delivered + * + * This macro sets the scheduling of the event in the + * MIDI tick mode. + * + * \sa snd_seq_ev_schedule_real(), snd_seq_ev_set_direct() + */ +#define snd_seq_ev_schedule_tick(ev, q, relative, ttick) \ + ((ev)->flags &= ~(SND_SEQ_TIME_STAMP_MASK | SND_SEQ_TIME_MODE_MASK),\ + (ev)->flags |= SND_SEQ_TIME_STAMP_TICK,\ + (ev)->flags |= (relative) ? SND_SEQ_TIME_MODE_REL : SND_SEQ_TIME_MODE_ABS,\ + (ev)->time.tick = (ttick),\ + (ev)->queue = (q)) + +/** + * \brief set real-time-scheduling mode on queue + * \param ev event instance + * \param q queue id to schedule + * \param relative relative time-stamp if non-zero + * \param rtime time-stamp to be delivered + * + * This macro sets the scheduling of the event in the + * realtime mode. + * + * \sa snd_seq_ev_schedule_tick(), snd_seq_ev_set_direct() + */ +#define snd_seq_ev_schedule_real(ev, q, relative, rtime) \ + ((ev)->flags &= ~(SND_SEQ_TIME_STAMP_MASK | SND_SEQ_TIME_MODE_MASK),\ + (ev)->flags |= SND_SEQ_TIME_STAMP_REAL,\ + (ev)->flags |= (relative) ? SND_SEQ_TIME_MODE_REL : SND_SEQ_TIME_MODE_ABS,\ + (ev)->time.time = *(rtime),\ + (ev)->queue = (q)) + +/** + * \brief set event priority + * \param ev event instance + * \param high_prior 1 for high priority mode + */ +#define snd_seq_ev_set_priority(ev, high_prior) \ + ((ev)->flags &= ~SND_SEQ_PRIORITY_MASK,\ + (ev)->flags |= (high_prior) ? SND_SEQ_PRIORITY_HIGH : SND_SEQ_PRIORITY_NORMAL) + +/** + * \brief set fixed data + * \param ev event instance + * + * Sets the event length mode as fixed size. + * + * \sa snd_seq_ev_set_variable(), snd_seq_ev_set_varusr() + */ +#define snd_seq_ev_set_fixed(ev) \ + ((ev)->flags &= ~SND_SEQ_EVENT_LENGTH_MASK,\ + (ev)->flags |= SND_SEQ_EVENT_LENGTH_FIXED) + +/** + * \brief set variable data + * \param ev event instance + * \param datalen length of the external data + * \param dataptr pointer of the external data + * + * Sets the event length mode as variable length and stores the data. + * + * \sa snd_seq_ev_set_fixed(), snd_seq_ev_set_varusr() + */ +#define snd_seq_ev_set_variable(ev, datalen, dataptr) \ + ((ev)->flags &= ~SND_SEQ_EVENT_LENGTH_MASK,\ + (ev)->flags |= SND_SEQ_EVENT_LENGTH_VARIABLE,\ + (ev)->data.ext.len = (datalen),\ + (ev)->data.ext.ptr = (dataptr)) + +/** + * \brief set varusr data + * \param ev event instance + * \param len length of the external data + * \param ptr pointer of the external data + * + * Sets the event length mode as variable user-space data and stores the data. + * + * \sa snd_seq_ev_set_fixed(), snd_seq_ev_set_variable() + */ +#define snd_seq_ev_set_varusr(ev, datalen, dataptr) \ + ((ev)->flags &= ~SND_SEQ_EVENT_LENGTH_MASK,\ + (ev)->flags |= SND_SEQ_EVENT_LENGTH_VARUSR,\ + (ev)->data.ext.len = (datalen),\ + (ev)->data.ext.ptr = (dataptr)) + +/** + * \brief set queue controls + * \param ev event record + * \param typ event type + * \param q queue id + * \param val control value + */ +#define snd_seq_ev_set_queue_control(ev, typ, q, val) \ + ((ev)->type = (typ),\ + snd_seq_ev_set_dest(ev, SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_TIMER),\ + (ev)->data.queue.queue = (q),\ + (ev)->data.queue.param.value = (val)) + +/** + * \brief set the start queue event + * \param ev event record + * \param q queue id to start + * + * \sa snd_seq_ev_set_queue_stop(), snd_seq_ev_set_queue_continue() + */ +#define snd_seq_ev_set_queue_start(ev, q) \ + snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_START, q, 0) + +/** + * \brief set the stop queue event + * \param ev event record + * \param q queue id to stop + * + * \sa snd_seq_ev_set_queue_start(), snd_seq_ev_set_queue_continue() + */ +#define snd_seq_ev_set_queue_stop(ev, q) \ + snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_STOP, q, 0) + +/** + * \brief set the stop queue event + * \param ev event record + * \param q queue id to continue + * + * \sa snd_seq_ev_set_queue_start(), snd_seq_ev_set_queue_stop() + */ +#define snd_seq_ev_set_queue_continue(ev, q) \ + snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_CONTINUE, q, 0) + +/** + * \brief set the stop queue event + * \param ev event record + * \param q queue id to change tempo + * \param val the new tempo value + */ +#define snd_seq_ev_set_queue_tempo(ev, q, val) \ + snd_seq_ev_set_queue_control(ev, SND_SEQ_EVENT_TEMPO, q, val) + +/** + * \brief set the real-time position of a queue + * \param ev event record + * \param q queue id to change tempo + * \param rtime the new real-time pointer + */ +#define snd_seq_ev_set_queue_pos_real(ev, q, rtime) \ + ((ev)->type = SND_SEQ_EVENT_SETPOS_TIME,\ + snd_seq_ev_set_dest(ev, SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_TIMER),\ + (ev)->data.queue.queue = (q),\ + (ev)->data.queue.param.time.time = *(rtime)) + +/** + * \brief set the tick-time position of a queue + * \param ev event record + * \param q queue id to change tempo + * \param ttime the new tick-time + */ +#define snd_seq_ev_set_queue_pos_tick(ev, q, ttime) \ + ((ev)->type = SND_SEQ_EVENT_SETPOS_TICK,\ + snd_seq_ev_set_dest(ev, SND_SEQ_CLIENT_SYSTEM, SND_SEQ_PORT_SYSTEM_TIMER),\ + (ev)->data.queue.queue = (q),\ + (ev)->data.queue.param.time.tick = (ttime)) + +/* set and send a queue control event */ +int snd_seq_control_queue(snd_seq_t *seq, int q, int type, int value, snd_seq_event_t *ev); + +/** + * \brief start the specified queue + * \param seq sequencer handle + * \param q queue id to start + * \param ev optional event record (see #snd_seq_control_queue) + */ +#define snd_seq_start_queue(seq, q, ev) \ + snd_seq_control_queue(seq, q, SND_SEQ_EVENT_START, 0, ev) + +/** + * \brief stop the specified queue + * \param seq sequencer handle + * \param q queue id to stop + * \param ev optional event record (see #snd_seq_control_queue) + */ +#define snd_seq_stop_queue(seq, q, ev) \ + snd_seq_control_queue(seq, q, SND_SEQ_EVENT_STOP, 0, ev) + +/** + * \brief continue the specified queue + * \param seq sequencer handle + * \param q queue id to continue + * \param ev optional event record (see #snd_seq_control_queue) + */ +#define snd_seq_continue_queue(seq, q, ev) \ + snd_seq_control_queue(seq, q, SND_SEQ_EVENT_CONTINUE, 0, ev) + +/** + * \brief change the tempo of the specified queue + * \param seq sequencer handle + * \param q queue id + * \param tempo the new tempo value + * \param ev optional event record (see #snd_seq_control_queue) + */ +#define snd_seq_change_queue_tempo(seq, q, tempo, ev) \ + snd_seq_control_queue(seq, q, SND_SEQ_EVENT_TEMPO, tempo, ev) + +/* create a port - simple version - return the port number */ +int snd_seq_create_simple_port(snd_seq_t *seq, const char *name, + unsigned int caps, unsigned int type); +/* delete the port */ +int snd_seq_delete_simple_port(snd_seq_t *seq, int port); + +/* simple subscription between this port and another port + (w/o exclusive & time conversion) + */ +int snd_seq_connect_from(snd_seq_t *seq, int my_port, int src_client, int src_port); +int snd_seq_connect_to(snd_seq_t *seq, int my_port, int dest_client, int dest_port); +int snd_seq_disconnect_from(snd_seq_t *seq, int my_port, int src_client, int src_port); +int snd_seq_disconnect_to(snd_seq_t *seq, int my_port, int dest_client, int dest_port); + +/* + * set client information + */ +int snd_seq_set_client_name(snd_seq_t *seq, const char *name); +int snd_seq_set_client_event_filter(snd_seq_t *seq, int event_type); +int snd_seq_set_client_pool_output(snd_seq_t *seq, size_t size); +int snd_seq_set_client_pool_output_room(snd_seq_t *seq, size_t size); +int snd_seq_set_client_pool_input(snd_seq_t *seq, size_t size); +/* sync output queue */ +int snd_seq_sync_output_queue(snd_seq_t *seq); + +/* + * parse the given string and get the sequencer address + */ +int snd_seq_parse_address(snd_seq_t *seq, snd_seq_addr_t *addr, const char *str); + +/* + * reset client input/output pool + */ +int snd_seq_reset_pool_output(snd_seq_t *seq); +int snd_seq_reset_pool_input(snd_seq_t *seq); + +/** + * \brief set note event + * \param ev event record + * \param ch channel number + * \param key note key + * \param vel velocity + * \param dur duration (in tick or msec) + */ +#define snd_seq_ev_set_note(ev, ch, key, vel, dur) \ + ((ev)->type = SND_SEQ_EVENT_NOTE,\ + snd_seq_ev_set_fixed(ev),\ + (ev)->data.note.channel = (ch),\ + (ev)->data.note.note = (key),\ + (ev)->data.note.velocity = (vel),\ + (ev)->data.note.duration = (dur)) + +/** + * \brief set note-on event + * \param ev event record + * \param ch channel number + * \param key note key + * \param vel velocity + */ +#define snd_seq_ev_set_noteon(ev, ch, key, vel) \ + ((ev)->type = SND_SEQ_EVENT_NOTEON,\ + snd_seq_ev_set_fixed(ev),\ + (ev)->data.note.channel = (ch),\ + (ev)->data.note.note = (key),\ + (ev)->data.note.velocity = (vel)) + +/** + * \brief set note-off event + * \param ev event record + * \param ch channel number + * \param key note key + * \param vel velocity + */ +#define snd_seq_ev_set_noteoff(ev, ch, key, vel) \ + ((ev)->type = SND_SEQ_EVENT_NOTEOFF,\ + snd_seq_ev_set_fixed(ev),\ + (ev)->data.note.channel = (ch),\ + (ev)->data.note.note = (key),\ + (ev)->data.note.velocity = (vel)) + +/** + * \brief set key-pressure event + * \param ev event record + * \param ch channel number + * \param key note key + * \param vel velocity + */ +#define snd_seq_ev_set_keypress(ev,ch,key,vel) \ + ((ev)->type = SND_SEQ_EVENT_KEYPRESS,\ + snd_seq_ev_set_fixed(ev),\ + (ev)->data.note.channel = (ch),\ + (ev)->data.note.note = (key),\ + (ev)->data.note.velocity = (vel)) + +/** + * \brief set MIDI controller event + * \param ev event record + * \param ch channel number + * \param cc controller number + * \param val control value + */ +#define snd_seq_ev_set_controller(ev,ch,cc,val) \ + ((ev)->type = SND_SEQ_EVENT_CONTROLLER,\ + snd_seq_ev_set_fixed(ev),\ + (ev)->data.control.channel = (ch),\ + (ev)->data.control.param = (cc),\ + (ev)->data.control.value = (val)) + +/** + * \brief set program change event + * \param ev event record + * \param ch channel number + * \param val program number + */ +#define snd_seq_ev_set_pgmchange(ev,ch,val) \ + ((ev)->type = SND_SEQ_EVENT_PGMCHANGE,\ + snd_seq_ev_set_fixed(ev),\ + (ev)->data.control.channel = (ch),\ + (ev)->data.control.value = (val)) + +/** + * \brief set pitch-bend event + * \param ev event record + * \param ch channel number + * \param val pitch bend; zero centered from -8192 to 8191 + */ +#define snd_seq_ev_set_pitchbend(ev,ch,val) \ + ((ev)->type = SND_SEQ_EVENT_PITCHBEND,\ + snd_seq_ev_set_fixed(ev),\ + (ev)->data.control.channel = (ch),\ + (ev)->data.control.value = (val)) + +/** + * \brief set channel pressure event + * \param ev event record + * \param ch channel number + * \param val channel pressure value + */ +#define snd_seq_ev_set_chanpress(ev,ch,val) \ + ((ev)->type = SND_SEQ_EVENT_CHANPRESS,\ + snd_seq_ev_set_fixed(ev),\ + (ev)->data.control.channel = (ch),\ + (ev)->data.control.value = (val)) + +/** + * \brief set sysex event + * \param ev event record + * \param datalen length of sysex data + * \param dataptr sysex data pointer + * + * the sysex data must contain the start byte 0xf0 and the end byte 0xf7. + */ +#define snd_seq_ev_set_sysex(ev,datalen,dataptr) \ + ((ev)->type = SND_SEQ_EVENT_SYSEX,\ + snd_seq_ev_set_variable(ev, datalen, dataptr)) + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /* __ALSA_SEQMID_H */ + diff --git a/debian/include-alsa/alsa/sound/ainstr_fm.h b/debian/include-alsa/alsa/sound/ainstr_fm.h new file mode 100644 index 0000000..2dfa9a5 --- /dev/null +++ b/debian/include-alsa/alsa/sound/ainstr_fm.h @@ -0,0 +1,134 @@ +/* + * Advanced Linux Sound Architecture + * + * FM (OPL2/3) Instrument Format + * Copyright (c) 2000 Uros Bizjak <uros@kss-loka.si> + * + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __SOUND_AINSTR_FM_H +#define __SOUND_AINSTR_FM_H + +#ifndef __KERNEL__ +#define __KERNEL__ +#include <asm/types.h> +#include <asm/byteorder.h> +#undef __KERNEL__ +#endif + +/* + * share types (share ID 1) + */ + +#define FM_SHARE_FILE 0 + +/* + * FM operator + */ + +typedef struct fm_operator { + unsigned char am_vib; + unsigned char ksl_level; + unsigned char attack_decay; + unsigned char sustain_release; + unsigned char wave_select; +} fm_operator_t; + +/* + * Instrument + */ + +#define FM_PATCH_OPL2 0x01 /* OPL2 2 operators FM instrument */ +#define FM_PATCH_OPL3 0x02 /* OPL3 4 operators FM instrument */ + +typedef struct { + unsigned int share_id[4]; /* share id - zero = no sharing */ + unsigned char type; /* instrument type */ + + fm_operator_t op[4]; + unsigned char feedback_connection[2]; + + unsigned char echo_delay; + unsigned char echo_atten; + unsigned char chorus_spread; + unsigned char trnsps; + unsigned char fix_dur; + unsigned char modes; + unsigned char fix_key; +} fm_instrument_t; + +/* + * + * Kernel <-> user space + * Hardware (CPU) independent section + * + * * = zero or more + * + = one or more + * + * fm_xinstrument FM_STRU_INSTR + * + */ + +#define FM_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T') + +/* + * FM operator + */ + +typedef struct fm_xoperator { + __u8 am_vib; + __u8 ksl_level; + __u8 attack_decay; + __u8 sustain_release; + __u8 wave_select; +} fm_xoperator_t; + +/* + * Instrument + */ + +typedef struct fm_xinstrument { + __u32 stype; /* structure type */ + + __u32 share_id[4]; /* share id - zero = no sharing */ + __u8 type; /* instrument type */ + + fm_xoperator_t op[4]; /* fm operators */ + __u8 feedback_connection[2]; + + __u8 echo_delay; + __u8 echo_atten; + __u8 chorus_spread; + __u8 trnsps; + __u8 fix_dur; + __u8 modes; + __u8 fix_key; +} fm_xinstrument_t; + +#ifdef __KERNEL__ + +#include "seq_instr.h" + +extern char *snd_seq_fm_id; + +int snd_seq_fm_init(snd_seq_kinstr_ops_t * ops, + snd_seq_kinstr_ops_t * next); + +#endif + +#endif /* __SOUND_AINSTR_FM_H */ diff --git a/debian/include-alsa/alsa/sound/ainstr_gf1.h b/debian/include-alsa/alsa/sound/ainstr_gf1.h new file mode 100644 index 0000000..882d17b --- /dev/null +++ b/debian/include-alsa/alsa/sound/ainstr_gf1.h @@ -0,0 +1,227 @@ +/* + * Advanced Linux Sound Architecture + * + * GF1 (GUS) Patch Instrument Format + * Copyright (c) 1994-99 by Jaroslav Kysela <perex@suse.cz> + * + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __SOUND_AINSTR_GF1_H +#define __SOUND_AINSTR_GF1_H + +#ifndef __KERNEL__ +#include <asm/types.h> +#include <asm/byteorder.h> +#endif + +/* + * share types (share ID 1) + */ + +#define GF1_SHARE_FILE 0 + +/* + * wave formats + */ + +#define GF1_WAVE_16BIT 0x0001 /* 16-bit wave */ +#define GF1_WAVE_UNSIGNED 0x0002 /* unsigned wave */ +#define GF1_WAVE_INVERT 0x0002 /* same as unsigned wave */ +#define GF1_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */ +#define GF1_WAVE_LOOP 0x0008 /* loop mode */ +#define GF1_WAVE_BIDIR 0x0010 /* bidirectional mode */ +#define GF1_WAVE_STEREO 0x0100 /* stereo mode */ +#define GF1_WAVE_ULAW 0x0200 /* uLaw compression mode */ + +/* + * Wavetable definitions + */ + +typedef struct gf1_wave { + unsigned int share_id[4]; /* share id - zero = no sharing */ + unsigned int format; /* wave format */ + + struct { + unsigned int number; /* some other ID for this instrument */ + unsigned int memory; /* begin of waveform in onboard memory */ + unsigned char *ptr; /* pointer to waveform in system memory */ + } address; + + unsigned int size; /* size of waveform in samples */ + unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ + unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ + unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ + unsigned short loop_repeat; /* loop repeat - 0 = forever */ + + unsigned char flags; /* GF1 patch flags */ + unsigned char pad; + unsigned int sample_rate; /* sample rate in Hz */ + unsigned int low_frequency; /* low frequency range */ + unsigned int high_frequency; /* high frequency range */ + unsigned int root_frequency; /* root frequency range */ + signed short tune; + unsigned char balance; + unsigned char envelope_rate[6]; + unsigned char envelope_offset[6]; + unsigned char tremolo_sweep; + unsigned char tremolo_rate; + unsigned char tremolo_depth; + unsigned char vibrato_sweep; + unsigned char vibrato_rate; + unsigned char vibrato_depth; + unsigned short scale_frequency; + unsigned short scale_factor; /* 0-2048 or 0-2 */ + + struct gf1_wave *next; +} gf1_wave_t; + +/* + * Instrument + */ + +#define IWFFFF_EXCLUDE_NONE 0x0000 /* exclusion mode - none */ +#define IWFFFF_EXCLUDE_SINGLE 0x0001 /* exclude single - single note from the instrument group */ +#define IWFFFF_EXCLUDE_MULTIPLE 0x0002 /* exclude multiple - stop only same note from this instrument */ + +#define IWFFFF_EFFECT_NONE 0 +#define IWFFFF_EFFECT_REVERB 1 +#define IWFFFF_EFFECT_CHORUS 2 +#define IWFFFF_EFFECT_ECHO 3 + +typedef struct { + unsigned short exclusion; + unsigned short exclusion_group; /* 0 - none, 1-65535 */ + + unsigned char effect1; /* effect 1 */ + unsigned char effect1_depth; /* 0-127 */ + unsigned char effect2; /* effect 2 */ + unsigned char effect2_depth; /* 0-127 */ + + gf1_wave_t *wave; /* first waveform */ +} gf1_instrument_t; + +/* + * + * Kernel <-> user space + * Hardware (CPU) independent section + * + * * = zero or more + * + = one or more + * + * gf1_xinstrument IWFFFF_STRU_INSTR + * +gf1_xwave IWFFFF_STRU_WAVE + * + */ + +#define GF1_STRU_WAVE __cpu_to_be32(('W'<<24)|('A'<<16)|('V'<<8)|'E') +#define GF1_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T') + +/* + * Wavetable definitions + */ + +typedef struct gf1_xwave { + __u32 stype; /* structure type */ + + __u32 share_id[4]; /* share id - zero = no sharing */ + __u32 format; /* wave format */ + + __u32 size; /* size of waveform in samples */ + __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ + __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ + __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ + __u16 loop_repeat; /* loop repeat - 0 = forever */ + + __u8 flags; /* GF1 patch flags */ + __u8 pad; + __u32 sample_rate; /* sample rate in Hz */ + __u32 low_frequency; /* low frequency range */ + __u32 high_frequency; /* high frequency range */ + __u32 root_frequency; /* root frequency range */ + __s16 tune; + __u8 balance; + __u8 envelope_rate[6]; + __u8 envelope_offset[6]; + __u8 tremolo_sweep; + __u8 tremolo_rate; + __u8 tremolo_depth; + __u8 vibrato_sweep; + __u8 vibrato_rate; + __u8 vibrato_depth; + __u16 scale_frequency; + __u16 scale_factor; /* 0-2048 or 0-2 */ +} gf1_xwave_t; + +/* + * Instrument + */ + +typedef struct gf1_xinstrument { + __u32 stype; + + __u16 exclusion; + __u16 exclusion_group; /* 0 - none, 1-65535 */ + + __u8 effect1; /* effect 1 */ + __u8 effect1_depth; /* 0-127 */ + __u8 effect2; /* effect 2 */ + __u8 effect2_depth; /* 0-127 */ +} gf1_xinstrument_t; + +/* + * Instrument info + */ + +#define GF1_INFO_ENVELOPE (1<<0) +#define GF1_INFO_TREMOLO (1<<1) +#define GF1_INFO_VIBRATO (1<<2) + +typedef struct gf1_info { + unsigned char flags; /* supported wave flags */ + unsigned char pad[3]; + unsigned int features; /* supported features */ + unsigned int max8_len; /* maximum 8-bit wave length */ + unsigned int max16_len; /* maximum 16-bit wave length */ +} gf1_info_t; + +#ifdef __KERNEL__ + +#include "seq_instr.h" + +extern char *snd_seq_gf1_id; + +typedef struct { + void *private_data; + int (*info)(void *private_data, gf1_info_t *info); + int (*put_sample)(void *private_data, gf1_wave_t *wave, + char *data, long len, int atomic); + int (*get_sample)(void *private_data, gf1_wave_t *wave, + char *data, long len, int atomic); + int (*remove_sample)(void *private_data, gf1_wave_t *wave, + int atomic); + void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what); + snd_seq_kinstr_ops_t kops; +} snd_gf1_ops_t; + +int snd_seq_gf1_init(snd_gf1_ops_t *ops, + void *private_data, + snd_seq_kinstr_ops_t *next); + +#endif + +#endif /* __SOUND_AINSTR_GF1_H */ diff --git a/debian/include-alsa/alsa/sound/ainstr_iw.h b/debian/include-alsa/alsa/sound/ainstr_iw.h new file mode 100644 index 0000000..1ddb54f --- /dev/null +++ b/debian/include-alsa/alsa/sound/ainstr_iw.h @@ -0,0 +1,377 @@ +/* + * Advanced Linux Sound Architecture + * + * InterWave FFFF Instrument Format + * Copyright (c) 1994-99 by Jaroslav Kysela <perex@suse.cz> + * + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __SOUND_AINSTR_IW_H +#define __SOUND_AINSTR_IW_H + +#ifndef __KERNEL__ +#define __KERNEL__ +#include <asm/types.h> +#include <asm/byteorder.h> +#undef __KERNEL__ +#endif + +/* + * share types (share ID 1) + */ + +#define IWFFFF_SHARE_FILE 0 + +/* + * wave formats + */ + +#define IWFFFF_WAVE_16BIT 0x0001 /* 16-bit wave */ +#define IWFFFF_WAVE_UNSIGNED 0x0002 /* unsigned wave */ +#define IWFFFF_WAVE_INVERT 0x0002 /* same as unsigned wave */ +#define IWFFFF_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */ +#define IWFFFF_WAVE_LOOP 0x0008 /* loop mode */ +#define IWFFFF_WAVE_BIDIR 0x0010 /* bidirectional mode */ +#define IWFFFF_WAVE_ULAW 0x0020 /* uLaw compressed wave */ +#define IWFFFF_WAVE_RAM 0x0040 /* wave is _preloaded_ in RAM (it is used for ROM simulation) */ +#define IWFFFF_WAVE_ROM 0x0080 /* wave is in ROM */ +#define IWFFFF_WAVE_STEREO 0x0100 /* wave is stereo */ + +/* + * Wavetable definitions + */ + +typedef struct iwffff_wave { + unsigned int share_id[4]; /* share id - zero = no sharing */ + unsigned int format; /* wave format */ + + struct { + unsigned int number; /* some other ID for this wave */ + unsigned int memory; /* begin of waveform in onboard memory */ + unsigned char *ptr; /* pointer to waveform in system memory */ + } address; + + unsigned int size; /* size of waveform in samples */ + unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ + unsigned int loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ + unsigned int loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ + unsigned short loop_repeat; /* loop repeat - 0 = forever */ + unsigned int sample_ratio; /* sample ratio (44100 * 1024 / rate) */ + unsigned char attenuation; /* 0 - 127 (no corresponding midi controller) */ + unsigned char low_note; /* lower frequency range for this waveform */ + unsigned char high_note; /* higher frequency range for this waveform */ + unsigned char pad; + + struct iwffff_wave *next; +} iwffff_wave_t; + +/* + * Layer + */ + +#define IWFFFF_LFO_SHAPE_TRIANGLE 0 +#define IWFFFF_LFO_SHAPE_POSTRIANGLE 1 + +typedef struct iwffff_lfo { + unsigned short freq; /* (0-2047) 0.01Hz - 21.5Hz */ + signed short depth; /* volume +- (0-255) 0.48675dB/step */ + signed short sweep; /* 0 - 950 deciseconds */ + unsigned char shape; /* see to IWFFFF_LFO_SHAPE_XXXX */ + unsigned char delay; /* 0 - 255 deciseconds */ +} iwffff_lfo_t; + +#define IWFFFF_ENV_FLAG_RETRIGGER 0x0001 /* flag - retrigger */ + +#define IWFFFF_ENV_MODE_ONE_SHOT 0x0001 /* mode - one shot */ +#define IWFFFF_ENV_MODE_SUSTAIN 0x0002 /* mode - sustain */ +#define IWFFFF_ENV_MODE_NO_SUSTAIN 0x0003 /* mode - no sustain */ + +#define IWFFFF_ENV_INDEX_VELOCITY 0x0001 /* index - velocity */ +#define IWFFFF_ENV_INDEX_FREQUENCY 0x0002 /* index - frequency */ + +typedef struct iwffff_env_point { + unsigned short offset; + unsigned short rate; +} iwffff_env_point_t; + +typedef struct iwffff_env_record { + unsigned short nattack; + unsigned short nrelease; + unsigned short sustain_offset; + unsigned short sustain_rate; + unsigned short release_rate; + unsigned char hirange; + unsigned char pad; + struct iwffff_env_record *next; + /* points are stored here */ + /* count of points = nattack + nrelease */ +} iwffff_env_record_t; + +typedef struct iwffff_env { + unsigned char flags; + unsigned char mode; + unsigned char index; + unsigned char pad; + struct iwffff_env_record *record; +} iwffff_env_t; + +#define IWFFFF_LAYER_FLAG_RETRIGGER 0x0001 /* retrigger */ + +#define IWFFFF_LAYER_VELOCITY_TIME 0x0000 /* velocity mode = time */ +#define IWFFFF_LAYER_VELOCITY_RATE 0x0001 /* velocity mode = rate */ + +#define IWFFFF_LAYER_EVENT_KUP 0x0000 /* layer event - key up */ +#define IWFFFF_LAYER_EVENT_KDOWN 0x0001 /* layer event - key down */ +#define IWFFFF_LAYER_EVENT_RETRIG 0x0002 /* layer event - retrigger */ +#define IWFFFF_LAYER_EVENT_LEGATO 0x0003 /* layer event - legato */ + +typedef struct iwffff_layer { + unsigned char flags; + unsigned char velocity_mode; + unsigned char layer_event; + unsigned char low_range; /* range for layer based */ + unsigned char high_range; /* on either velocity or frequency */ + unsigned char pan; /* pan offset from CC1 (0 left - 127 right) */ + unsigned char pan_freq_scale; /* position based on frequency (0-127) */ + unsigned char attenuation; /* 0-127 (no corresponding midi controller) */ + iwffff_lfo_t tremolo; /* tremolo effect */ + iwffff_lfo_t vibrato; /* vibrato effect */ + unsigned short freq_scale; /* 0-2048, 1024 is equal to semitone scaling */ + unsigned char freq_center; /* center for keyboard frequency scaling */ + unsigned char pad; + iwffff_env_t penv; /* pitch envelope */ + iwffff_env_t venv; /* volume envelope */ + + iwffff_wave_t *wave; + struct iwffff_layer *next; +} iwffff_layer_t; + +/* + * Instrument + */ + +#define IWFFFF_EXCLUDE_NONE 0x0000 /* exclusion mode - none */ +#define IWFFFF_EXCLUDE_SINGLE 0x0001 /* exclude single - single note from the instrument group */ +#define IWFFFF_EXCLUDE_MULTIPLE 0x0002 /* exclude multiple - stop only same note from this instrument */ + +#define IWFFFF_LAYER_NONE 0x0000 /* not layered */ +#define IWFFFF_LAYER_ON 0x0001 /* layered */ +#define IWFFFF_LAYER_VELOCITY 0x0002 /* layered by velocity */ +#define IWFFFF_LAYER_FREQUENCY 0x0003 /* layered by frequency */ + +#define IWFFFF_EFFECT_NONE 0 +#define IWFFFF_EFFECT_REVERB 1 +#define IWFFFF_EFFECT_CHORUS 2 +#define IWFFFF_EFFECT_ECHO 3 + +typedef struct { + unsigned short exclusion; + unsigned short layer_type; + unsigned short exclusion_group; /* 0 - none, 1-65535 */ + + unsigned char effect1; /* effect 1 */ + unsigned char effect1_depth; /* 0-127 */ + unsigned char effect2; /* effect 2 */ + unsigned char effect2_depth; /* 0-127 */ + + iwffff_layer_t *layer; /* first layer */ +} iwffff_instrument_t; + +/* + * + * Kernel <-> user space + * Hardware (CPU) independent section + * + * * = zero or more + * + = one or more + * + * iwffff_xinstrument IWFFFF_STRU_INSTR + * +iwffff_xlayer IWFFFF_STRU_LAYER + * *iwffff_xenv_record IWFFFF_STRU_ENV_RECT (tremolo) + * *iwffff_xenv_record IWFFFF_STRU_EVN_RECT (vibrato) + * +iwffff_xwave IWFFFF_STRU_WAVE + * + */ + +#define IWFFFF_STRU_WAVE __cpu_to_be32(('W'<<24)|('A'<<16)|('V'<<8)|'E') +#define IWFFFF_STRU_ENV_RECP __cpu_to_be32(('E'<<24)|('N'<<16)|('R'<<8)|'P') +#define IWFFFF_STRU_ENV_RECV __cpu_to_be32(('E'<<24)|('N'<<16)|('R'<<8)|'V') +#define IWFFFF_STRU_LAYER __cpu_to_be32(('L'<<24)|('A'<<16)|('Y'<<8)|'R') +#define IWFFFF_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T') + +/* + * Wavetable definitions + */ + +typedef struct iwffff_xwave { + __u32 stype; /* structure type */ + + __u32 share_id[4]; /* share id - zero = no sharing */ + + __u32 format; /* wave format */ + __u32 offset; /* offset to ROM (address) */ + + __u32 size; /* size of waveform in samples */ + __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ + __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ + __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ + __u16 loop_repeat; /* loop repeat - 0 = forever */ + __u32 sample_ratio; /* sample ratio (44100 * 1024 / rate) */ + __u8 attenuation; /* 0 - 127 (no corresponding midi controller) */ + __u8 low_note; /* lower frequency range for this waveform */ + __u8 high_note; /* higher frequency range for this waveform */ + __u8 pad; +} iwffff_xwave_t; + +/* + * Layer + */ + +typedef struct iwffff_xlfo { + __u16 freq; /* (0-2047) 0.01Hz - 21.5Hz */ + __s16 depth; /* volume +- (0-255) 0.48675dB/step */ + __s16 sweep; /* 0 - 950 deciseconds */ + __u8 shape; /* see to ULTRA_IW_LFO_SHAPE_XXXX */ + __u8 delay; /* 0 - 255 deciseconds */ +} iwffff_xlfo_t; + +typedef struct iwffff_xenv_point { + __u16 offset; + __u16 rate; +} iwffff_xenv_point_t; + +typedef struct iwffff_xenv_record { + __u32 stype; + __u16 nattack; + __u16 nrelease; + __u16 sustain_offset; + __u16 sustain_rate; + __u16 release_rate; + __u8 hirange; + __u8 pad; + /* points are stored here.. */ + /* count of points = nattack + nrelease */ +} iwffff_xenv_record_t; + +typedef struct iwffff_xenv { + __u8 flags; + __u8 mode; + __u8 index; + __u8 pad; +} iwffff_xenv_t; + +typedef struct iwffff_xlayer { + __u32 stype; + __u8 flags; + __u8 velocity_mode; + __u8 layer_event; + __u8 low_range; /* range for layer based */ + __u8 high_range; /* on either velocity or frequency */ + __u8 pan; /* pan offset from CC1 (0 left - 127 right) */ + __u8 pan_freq_scale; /* position based on frequency (0-127) */ + __u8 attenuation; /* 0-127 (no corresponding midi controller) */ + iwffff_xlfo_t tremolo; /* tremolo effect */ + iwffff_xlfo_t vibrato; /* vibrato effect */ + __u16 freq_scale; /* 0-2048, 1024 is equal to semitone scaling */ + __u8 freq_center; /* center for keyboard frequency scaling */ + __u8 pad; + iwffff_xenv_t penv; /* pitch envelope */ + iwffff_xenv_t venv; /* volume envelope */ +} iwffff_xlayer_t; + +/* + * Instrument + */ + +typedef struct iwffff_xinstrument { + __u32 stype; + + __u16 exclusion; + __u16 layer_type; + __u16 exclusion_group; /* 0 - none, 1-65535 */ + + __u8 effect1; /* effect 1 */ + __u8 effect1_depth; /* 0-127 */ + __u8 effect2; /* effect 2 */ + __u8 effect2_depth; /* 0-127 */ +} iwffff_xinstrument_t; + +/* + * ROM support + * InterWave ROMs are Little-Endian (x86) + */ + +#define IWFFFF_ROM_HDR_SIZE 512 + +typedef struct { + __u8 iwave[8]; + __u8 revision; + __u8 series_number; + __u8 series_name[16]; + __u8 date[10]; + __u16 vendor_revision_major; + __u16 vendor_revision_minor; + __u32 rom_size; + __u8 copyright[128]; + __u8 vendor_name[64]; + __u8 description[128]; +} iwffff_rom_header_t; + +/* + * Instrument info + */ + +#define IWFFFF_INFO_LFO_VIBRATO (1<<0) +#define IWFFFF_INFO_LFO_VIBRATO_SHAPE (1<<1) +#define IWFFFF_INFO_LFO_TREMOLO (1<<2) +#define IWFFFF_INFO_LFO_TREMOLO_SHAPE (1<<3) + +typedef struct iwffff_info { + unsigned int format; /* supported format bits */ + unsigned int effects; /* supported effects (1 << IWFFFF_EFFECT*) */ + unsigned int lfos; /* LFO effects */ + unsigned int max8_len; /* maximum 8-bit wave length */ + unsigned int max16_len; /* maximum 16-bit wave length */ +} iwffff_info_t; + +#ifdef __KERNEL__ + +#include "seq_instr.h" + +extern char *snd_seq_iwffff_id; + +typedef struct { + void *private_data; + int (*info)(void *private_data, iwffff_info_t *info); + int (*put_sample)(void *private_data, iwffff_wave_t *wave, + char *data, long len, int atomic); + int (*get_sample)(void *private_data, iwffff_wave_t *wave, + char *data, long len, int atomic); + int (*remove_sample)(void *private_data, iwffff_wave_t *wave, + int atomic); + void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what); + snd_seq_kinstr_ops_t kops; +} snd_iwffff_ops_t; + +int snd_seq_iwffff_init(snd_iwffff_ops_t *ops, + void *private_data, + snd_seq_kinstr_ops_t *next); + +#endif + +#endif /* __SOUND_AINSTR_IW_H */ diff --git a/debian/include-alsa/alsa/sound/ainstr_simple.h b/debian/include-alsa/alsa/sound/ainstr_simple.h new file mode 100644 index 0000000..52974e2 --- /dev/null +++ b/debian/include-alsa/alsa/sound/ainstr_simple.h @@ -0,0 +1,160 @@ +/* + * Advanced Linux Sound Architecture + * + * Simple (MOD player) Instrument Format + * Copyright (c) 1994-99 by Jaroslav Kysela <perex@suse.cz> + * + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __SOUND_AINSTR_SIMPLE_H +#define __SOUND_AINSTR_SIMPLE_H + +#ifndef __KERNEL__ +#define __KERNEL__ +#include <asm/types.h> +#include <asm/byteorder.h> +#undef __KERNEL__ +#endif + +/* + * share types (share ID 1) + */ + +#define SIMPLE_SHARE_FILE 0 + +/* + * wave formats + */ + +#define SIMPLE_WAVE_16BIT 0x0001 /* 16-bit wave */ +#define SIMPLE_WAVE_UNSIGNED 0x0002 /* unsigned wave */ +#define SIMPLE_WAVE_INVERT 0x0002 /* same as unsigned wave */ +#define SIMPLE_WAVE_BACKWARD 0x0004 /* backward mode (maybe used for reverb or ping-ping loop) */ +#define SIMPLE_WAVE_LOOP 0x0008 /* loop mode */ +#define SIMPLE_WAVE_BIDIR 0x0010 /* bidirectional mode */ +#define SIMPLE_WAVE_STEREO 0x0100 /* stereo wave */ +#define SIMPLE_WAVE_ULAW 0x0200 /* uLaw compression mode */ + +/* + * instrument effects + */ + +#define SIMPLE_EFFECT_NONE 0 +#define SIMPLE_EFFECT_REVERB 1 +#define SIMPLE_EFFECT_CHORUS 2 +#define SIMPLE_EFFECT_ECHO 3 + +/* + * instrument info + */ + +typedef struct simple_instrument_info { + unsigned int format; /* supported format bits */ + unsigned int effects; /* supported effects (1 << SIMPLE_EFFECT_*) */ + unsigned int max8_len; /* maximum 8-bit wave length */ + unsigned int max16_len; /* maximum 16-bit wave length */ +} simple_instrument_info_t; + +/* + * Instrument + */ + +typedef struct { + unsigned int share_id[4]; /* share id - zero = no sharing */ + unsigned int format; /* wave format */ + + struct { + unsigned int number; /* some other ID for this instrument */ + unsigned int memory; /* begin of waveform in onboard memory */ + unsigned char *ptr; /* pointer to waveform in system memory */ + } address; + + unsigned int size; /* size of waveform in samples */ + unsigned int start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ + unsigned int loop_start; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ + unsigned int loop_end; /* loop end offset in samples * 16 (lowest 4 bits - fraction) */ + unsigned short loop_repeat; /* loop repeat - 0 = forever */ + + unsigned char effect1; /* effect 1 */ + unsigned char effect1_depth; /* 0-127 */ + unsigned char effect2; /* effect 2 */ + unsigned char effect2_depth; /* 0-127 */ +} simple_instrument_t; + +/* + * + * Kernel <-> user space + * Hardware (CPU) independent section + * + * * = zero or more + * + = one or more + * + * simple_xinstrument SIMPLE_STRU_INSTR + * + */ + +#define SIMPLE_STRU_INSTR __cpu_to_be32(('I'<<24)|('N'<<16)|('S'<<8)|'T') + +/* + * Instrument + */ + +typedef struct simple_xinstrument { + __u32 stype; + + __u32 share_id[4]; /* share id - zero = no sharing */ + __u32 format; /* wave format */ + + __u32 size; /* size of waveform in samples */ + __u32 start; /* start offset in samples * 16 (lowest 4 bits - fraction) */ + __u32 loop_start; /* bits loop start offset in samples * 16 (lowest 4 bits - fraction) */ + __u32 loop_end; /* loop start offset in samples * 16 (lowest 4 bits - fraction) */ + __u16 loop_repeat; /* loop repeat - 0 = forever */ + + __u8 effect1; /* effect 1 */ + __u8 effect1_depth; /* 0-127 */ + __u8 effect2; /* effect 2 */ + __u8 effect2_depth; /* 0-127 */ +} simple_xinstrument_t; + +#ifdef __KERNEL__ + +#include "seq_instr.h" + +extern char *snd_seq_simple_id; + +typedef struct { + void *private_data; + int (*info)(void *private_data, simple_instrument_info_t *info); + int (*put_sample)(void *private_data, simple_instrument_t *instr, + char *data, long len, int atomic); + int (*get_sample)(void *private_data, simple_instrument_t *instr, + char *data, long len, int atomic); + int (*remove_sample)(void *private_data, simple_instrument_t *instr, + int atomic); + void (*notify)(void *private_data, snd_seq_kinstr_t *instr, int what); + snd_seq_kinstr_ops_t kops; +} snd_simple_ops_t; + +int snd_seq_simple_init(snd_simple_ops_t *ops, + void *private_data, + snd_seq_kinstr_ops_t *next); + +#endif + +#endif /* __SOUND_AINSTR_SIMPLE_H */ diff --git a/debian/include-alsa/alsa/sound/hdsp.h b/debian/include-alsa/alsa/sound/hdsp.h new file mode 100644 index 0000000..21a9f1c --- /dev/null +++ b/debian/include-alsa/alsa/sound/hdsp.h @@ -0,0 +1,110 @@ +#ifndef __SOUND_HDSP_H +#define __SOUND_HDSP_H + +/* + * Copyright (C) 2003 Thomas Charbonnel (thomas@undata.org) + * + * 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. + */ + +#define HDSP_MATRIX_MIXER_SIZE 2048 + +typedef enum { + Digiface, + Multiface, + H9652, + H9632, + Undefined, +} HDSP_IO_Type; + +typedef struct _snd_hdsp_peak_rms hdsp_peak_rms_t; + +struct _snd_hdsp_peak_rms { + unsigned int input_peaks[26]; + unsigned int playback_peaks[26]; + unsigned int output_peaks[28]; + unsigned long long input_rms[26]; + unsigned long long playback_rms[26]; + /* These are only used for H96xx cards */ + unsigned long long output_rms[26]; +}; + +#define SNDRV_HDSP_IOCTL_GET_PEAK_RMS _IOR('H', 0x40, hdsp_peak_rms_t) + +typedef struct _snd_hdsp_config_info hdsp_config_info_t; + +struct _snd_hdsp_config_info { + unsigned char pref_sync_ref; + unsigned char wordclock_sync_check; + unsigned char spdif_sync_check; + unsigned char adatsync_sync_check; + unsigned char adat_sync_check[3]; + unsigned char spdif_in; + unsigned char spdif_out; + unsigned char spdif_professional; + unsigned char spdif_emphasis; + unsigned char spdif_nonaudio; + unsigned int spdif_sample_rate; + unsigned int system_sample_rate; + unsigned int autosync_sample_rate; + unsigned char system_clock_mode; + unsigned char clock_source; + unsigned char autosync_ref; + unsigned char line_out; + unsigned char passthru; + unsigned char da_gain; + unsigned char ad_gain; + unsigned char phone_gain; + unsigned char xlr_breakout_cable; + unsigned char analog_extension_board; +}; + +#define SNDRV_HDSP_IOCTL_GET_CONFIG_INFO _IOR('H', 0x41, hdsp_config_info_t) + +typedef struct _snd_hdsp_firmware hdsp_firmware_t; + +struct _snd_hdsp_firmware { + unsigned long *firmware_data; /* 24413 long words */ +}; + +#define SNDRV_HDSP_IOCTL_UPLOAD_FIRMWARE _IOW('H', 0x42, hdsp_firmware_t) + +typedef struct _snd_hdsp_version hdsp_version_t; + +struct _snd_hdsp_version { + HDSP_IO_Type io_type; + unsigned short firmware_rev; +}; + +#define SNDRV_HDSP_IOCTL_GET_VERSION _IOR('H', 0x43, hdsp_version_t) + +typedef struct _snd_hdsp_mixer hdsp_mixer_t; + +struct _snd_hdsp_mixer { + unsigned short matrix[HDSP_MATRIX_MIXER_SIZE]; +}; + +#define SNDRV_HDSP_IOCTL_GET_MIXER _IOR('H', 0x44, hdsp_mixer_t) + +typedef struct _snd_hdsp_9632_aeb hdsp_9632_aeb_t; + +struct _snd_hdsp_9632_aeb { + int aebi; + int aebo; +}; + +#define SNDRV_HDSP_IOCTL_GET_9632_AEB _IOR('H', 0x45, hdsp_9632_aeb_t) + +#endif /* __SOUND_HDSP_H */ diff --git a/debian/include-alsa/alsa/sound/sb16_csp.h b/debian/include-alsa/alsa/sound/sb16_csp.h new file mode 100644 index 0000000..78817b4 --- /dev/null +++ b/debian/include-alsa/alsa/sound/sb16_csp.h @@ -0,0 +1,115 @@ +#ifndef __SOUND_SB16_CSP_H +#define __SOUND_SB16_CSP_H + +/* + * Copyright (c) 1999 by Uros Bizjak <uros@kss-loka.si> + * Takashi Iwai <tiwai@suse.de> + * + * SB16ASP/AWE32 CSP control + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +/* CSP modes */ +#define SNDRV_SB_CSP_MODE_NONE 0x00 +#define SNDRV_SB_CSP_MODE_DSP_READ 0x01 /* Record from DSP */ +#define SNDRV_SB_CSP_MODE_DSP_WRITE 0x02 /* Play to DSP */ +#define SNDRV_SB_CSP_MODE_QSOUND 0x04 /* QSound */ + +/* CSP load flags */ +#define SNDRV_SB_CSP_LOAD_FROMUSER 0x01 +#define SNDRV_SB_CSP_LOAD_INITBLOCK 0x02 + +/* CSP sample width */ +#define SNDRV_SB_CSP_SAMPLE_8BIT 0x01 +#define SNDRV_SB_CSP_SAMPLE_16BIT 0x02 + +/* CSP channels */ +#define SNDRV_SB_CSP_MONO 0x01 +#define SNDRV_SB_CSP_STEREO 0x02 + +/* CSP rates */ +#define SNDRV_SB_CSP_RATE_8000 0x01 +#define SNDRV_SB_CSP_RATE_11025 0x02 +#define SNDRV_SB_CSP_RATE_22050 0x04 +#define SNDRV_SB_CSP_RATE_44100 0x08 +#define SNDRV_SB_CSP_RATE_ALL 0x0f + +/* CSP running state */ +#define SNDRV_SB_CSP_ST_IDLE 0x00 +#define SNDRV_SB_CSP_ST_LOADED 0x01 +#define SNDRV_SB_CSP_ST_RUNNING 0x02 +#define SNDRV_SB_CSP_ST_PAUSED 0x04 +#define SNDRV_SB_CSP_ST_AUTO 0x08 +#define SNDRV_SB_CSP_ST_QSOUND 0x10 + +/* maximum QSound value (180 degrees right) */ +#define SNDRV_SB_CSP_QSOUND_MAX_RIGHT 0x20 + +/* maximum microcode RIFF file size */ +#define SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE 0x3000 + +/* microcode header */ +typedef struct snd_sb_csp_mc_header { + char codec_name[16]; /* id name of codec */ + unsigned short func_req; /* requested function */ +} snd_sb_csp_mc_header_t; + +/* microcode to be loaded */ +typedef struct snd_sb_csp_microcode { + snd_sb_csp_mc_header_t info; + unsigned char data[SNDRV_SB_CSP_MAX_MICROCODE_FILE_SIZE]; +} snd_sb_csp_microcode_t; + +/* start CSP with sample_width in mono/stereo */ +typedef struct snd_sb_csp_start { + int sample_width; /* sample width, look above */ + int channels; /* channels, look above */ +} snd_sb_csp_start_t; + +/* CSP information */ +typedef struct snd_sb_csp_info { + char codec_name[16]; /* id name of codec */ + unsigned short func_nr; /* function number */ + unsigned int acc_format; /* accepted PCM formats */ + unsigned short acc_channels; /* accepted channels */ + unsigned short acc_width; /* accepted sample width */ + unsigned short acc_rates; /* accepted sample rates */ + unsigned short csp_mode; /* CSP mode, see above */ + unsigned short run_channels; /* current channels */ + unsigned short run_width; /* current sample width */ + unsigned short version; /* version id: 0x10 - 0x1f */ + unsigned short state; /* state bits */ +} snd_sb_csp_info_t; + +/* HWDEP controls */ +/* get CSP information */ +#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, snd_sb_csp_info_t) +/* load microcode to CSP */ +#define SNDRV_SB_CSP_IOCTL_LOAD_CODE _IOW('H', 0x11, snd_sb_csp_microcode_t) +/* unload microcode from CSP */ +#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12) +/* start CSP */ +#define SNDRV_SB_CSP_IOCTL_START _IOW('H', 0x13, snd_sb_csp_start_t) +/* stop CSP */ +#define SNDRV_SB_CSP_IOCTL_STOP _IO('H', 0x14) +/* pause CSP and DMA transfer */ +#define SNDRV_SB_CSP_IOCTL_PAUSE _IO('H', 0x15) +/* restart CSP and DMA transfer */ +#define SNDRV_SB_CSP_IOCTL_RESTART _IO('H', 0x16) + + +#endif /* __SOUND_SB16_CSP */ diff --git a/debian/include-alsa/alsa/sound/sscape_ioctl.h b/debian/include-alsa/alsa/sound/sscape_ioctl.h new file mode 100644 index 0000000..c6653eb --- /dev/null +++ b/debian/include-alsa/alsa/sound/sscape_ioctl.h @@ -0,0 +1,21 @@ +#ifndef SSCAPE_IOCTL_H +#define SSCAPE_IOCTL_H + + +struct sscape_bootblock +{ + unsigned char code[256]; + unsigned version; +}; + +#define SSCAPE_MICROCODE_SIZE 65536 + +struct sscape_microcode +{ + unsigned char *code; +}; + +#define SND_SSCAPE_LOAD_BOOTB _IOWR('P', 100, struct sscape_bootblock) +#define SND_SSCAPE_LOAD_MCODE _IOW ('P', 101, struct sscape_microcode) + +#endif diff --git a/debian/include-alsa/alsa/timer.h b/debian/include-alsa/alsa/timer.h new file mode 100644 index 0000000..d500fc2 --- /dev/null +++ b/debian/include-alsa/alsa/timer.h @@ -0,0 +1,230 @@ +/** + * \file <alsa/timer.h> + * \brief Application interface library for the ALSA driver + * \author Jaroslav Kysela <perex@suse.cz> + * \author Abramo Bagnara <abramo@alsa-project.org> + * \author Takashi Iwai <tiwai@suse.de> + * \date 1998-2001 + * + * Application interface library for the ALSA driver + * + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#ifndef __ALSA_TIMER_H +#define __ALSA_TIMER_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup Timer Timer Interface + * Timer Interface. See \ref timer page for more details. + * \{ + */ + +/** dlsym version for interface entry callback */ +#define SND_TIMER_DLSYM_VERSION _dlsym_timer_001 +/** dlsym version for interface entry callback */ +#define SND_TIMER_QUERY_DLSYM_VERSION _dlsym_timer_query_001 + +/** timer identification structure */ +typedef struct _snd_timer_id snd_timer_id_t; +/** timer global info structure */ +typedef struct _snd_timer_ginfo snd_timer_ginfo_t; +/** timer global params structure */ +typedef struct _snd_timer_gparams snd_timer_gparams_t; +/** timer global status structure */ +typedef struct _snd_timer_gstatus snd_timer_gstatus_t; +/** timer info structure */ +typedef struct _snd_timer_info snd_timer_info_t; +/** timer params structure */ +typedef struct _snd_timer_params snd_timer_params_t; +/** timer status structure */ +typedef struct _snd_timer_status snd_timer_status_t; +/** timer master class */ +typedef enum _snd_timer_class { + SND_TIMER_CLASS_NONE = -1, /**< invalid */ + SND_TIMER_CLASS_SLAVE = 0, /**< slave timer */ + SND_TIMER_CLASS_GLOBAL, /**< global timer */ + SND_TIMER_CLASS_CARD, /**< card timer */ + SND_TIMER_CLASS_PCM, /**< PCM timer */ + SND_TIMER_CLASS_LAST = SND_TIMER_CLASS_PCM /**< last timer */ +} snd_timer_class_t; + +/** timer slave class */ +typedef enum _snd_timer_slave_class { + SND_TIMER_SCLASS_NONE = 0, /**< none */ + SND_TIMER_SCLASS_APPLICATION, /**< for internal use */ + SND_TIMER_SCLASS_SEQUENCER, /**< sequencer timer */ + SND_TIMER_SCLASS_OSS_SEQUENCER, /**< OSS sequencer timer */ + SND_TIMER_SCLASS_LAST = SND_TIMER_SCLASS_OSS_SEQUENCER /**< last slave timer */ +} snd_timer_slave_class_t; + +/** timer read event identification */ +typedef enum _snd_timer_event { + SND_TIMER_EVENT_RESOLUTION = 0, /* val = resolution in ns */ + SND_TIMER_EVENT_TICK, /* val = ticks */ + SND_TIMER_EVENT_START, /* val = resolution in ns */ + SND_TIMER_EVENT_STOP, /* val = 0 */ + SND_TIMER_EVENT_CONTINUE, /* val = resolution in ns */ + SND_TIMER_EVENT_PAUSE, /* val = 0 */ + SND_TIMER_EVENT_EARLY, /* val = 0 */ + /* master timer events for slave timer instances */ + SND_TIMER_EVENT_MSTART = SND_TIMER_EVENT_START + 10, + SND_TIMER_EVENT_MSTOP = SND_TIMER_EVENT_STOP + 10, + SND_TIMER_EVENT_MCONTINUE = SND_TIMER_EVENT_CONTINUE + 10, + SND_TIMER_EVENT_MPAUSE = SND_TIMER_EVENT_PAUSE + 10, +} snd_timer_event_t; + +/** timer read structure */ +typedef struct _snd_timer_read { + unsigned int resolution; /**< tick resolution in nanoseconds */ + unsigned int ticks; /**< count of happened ticks */ +} snd_timer_read_t; + +/** timer tstamp + event read structure */ +typedef struct _snd_timer_tread { + snd_timer_event_t event; + snd_htimestamp_t tstamp; + unsigned int val; +} snd_timer_tread_t; + +/** global timer - system */ +#define SND_TIMER_GLOBAL_SYSTEM 0 +/** global timer - RTC */ +#define SND_TIMER_GLOBAL_RTC 1 + +/** timer open mode flag - non-blocking behaviour */ +#define SND_TIMER_OPEN_NONBLOCK (1<<0) +/** use timestamps and event notification - enhanced read */ +#define SND_TIMER_OPEN_TREAD (1<<1) + +/** timer handle type */ +typedef enum _snd_timer_type { + /** Kernel level HwDep */ + SND_TIMER_TYPE_HW = 0, + /** Shared memory client timer (not yet implemented) */ + SND_TIMER_TYPE_SHM, + /** INET client timer (not yet implemented) */ + SND_TIMER_TYPE_INET +} snd_timer_type_t; + +/** timer query handle */ +typedef struct _snd_timer_query snd_timer_query_t; +/** timer handle */ +typedef struct _snd_timer snd_timer_t; + + +int snd_timer_query_open(snd_timer_query_t **handle, const char *name, int mode); +int snd_timer_query_open_lconf(snd_timer_query_t **handle, const char *name, int mode, snd_config_t *lconf); +int snd_timer_query_close(snd_timer_query_t *handle); +int snd_timer_query_next_device(snd_timer_query_t *handle, snd_timer_id_t *tid); +int snd_timer_query_info(snd_timer_query_t *handle, snd_timer_ginfo_t *info); +int snd_timer_query_params(snd_timer_query_t *handle, snd_timer_gparams_t *params); +int snd_timer_query_status(snd_timer_query_t *handle, snd_timer_gstatus_t *status); + +int snd_timer_open(snd_timer_t **handle, const char *name, int mode); +int snd_timer_open_lconf(snd_timer_t **handle, const char *name, int mode, snd_config_t *lconf); +int snd_timer_close(snd_timer_t *handle); +int snd_timer_poll_descriptors_count(snd_timer_t *handle); +int snd_timer_poll_descriptors(snd_timer_t *handle, struct pollfd *pfds, unsigned int space); +int snd_timer_poll_descriptors_revents(snd_timer_t *timer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents); +int snd_timer_info(snd_timer_t *handle, snd_timer_info_t *timer); +int snd_timer_params(snd_timer_t *handle, snd_timer_params_t *params); +int snd_timer_status(snd_timer_t *handle, snd_timer_status_t *status); +int snd_timer_start(snd_timer_t *handle); +int snd_timer_stop(snd_timer_t *handle); +int snd_timer_continue(snd_timer_t *handle); +ssize_t snd_timer_read(snd_timer_t *handle, void *buffer, size_t size); + +size_t snd_timer_id_sizeof(void); +/** allocate #snd_timer_id_t container on stack */ +#define snd_timer_id_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_id_t *) alloca(snd_timer_id_sizeof()); memset(*ptr, 0, snd_timer_id_sizeof()); } while (0) +int snd_timer_id_malloc(snd_timer_id_t **ptr); +void snd_timer_id_free(snd_timer_id_t *obj); +void snd_timer_id_copy(snd_timer_id_t *dst, const snd_timer_id_t *src); + +void snd_timer_id_set_class(snd_timer_id_t *id, int dev_class); +int snd_timer_id_get_class(snd_timer_id_t *id); +void snd_timer_id_set_sclass(snd_timer_id_t *id, int dev_sclass); +int snd_timer_id_get_sclass(snd_timer_id_t *id); +void snd_timer_id_set_card(snd_timer_id_t *id, int card); +int snd_timer_id_get_card(snd_timer_id_t *id); +void snd_timer_id_set_device(snd_timer_id_t *id, int device); +int snd_timer_id_get_device(snd_timer_id_t *id); +void snd_timer_id_set_subdevice(snd_timer_id_t *id, int subdevice); +int snd_timer_id_get_subdevice(snd_timer_id_t *id); + +size_t snd_timer_info_sizeof(void); +/** allocate #snd_timer_info_t container on stack */ +#define snd_timer_info_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_info_t *) alloca(snd_timer_info_sizeof()); memset(*ptr, 0, snd_timer_info_sizeof()); } while (0) +int snd_timer_info_malloc(snd_timer_info_t **ptr); +void snd_timer_info_free(snd_timer_info_t *obj); +void snd_timer_info_copy(snd_timer_info_t *dst, const snd_timer_info_t *src); + +int snd_timer_info_is_slave(snd_timer_info_t * info); +int snd_timer_info_get_card(snd_timer_info_t * info); +const char *snd_timer_info_get_id(snd_timer_info_t * info); +const char *snd_timer_info_get_name(snd_timer_info_t * info); +long snd_timer_info_get_resolution(snd_timer_info_t * info); + +size_t snd_timer_params_sizeof(void); +/** allocate #snd_timer_params_t container on stack */ +#define snd_timer_params_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_params_t *) alloca(snd_timer_params_sizeof()); memset(*ptr, 0, snd_timer_params_sizeof()); } while (0) +int snd_timer_params_malloc(snd_timer_params_t **ptr); +void snd_timer_params_free(snd_timer_params_t *obj); +void snd_timer_params_copy(snd_timer_params_t *dst, const snd_timer_params_t *src); + +int snd_timer_params_set_auto_start(snd_timer_params_t * params, int auto_start); +int snd_timer_params_get_auto_start(snd_timer_params_t * params); +int snd_timer_params_set_exclusive(snd_timer_params_t * params, int exclusive); +int snd_timer_params_get_exclusive(snd_timer_params_t * params); +int snd_timer_params_set_early_event(snd_timer_params_t * params, int early_event); +int snd_timer_params_get_early_event(snd_timer_params_t * params); +void snd_timer_params_set_ticks(snd_timer_params_t * params, long ticks); +long snd_timer_params_get_ticks(snd_timer_params_t * params); +void snd_timer_params_set_queue_size(snd_timer_params_t * params, long queue_size); +long snd_timer_params_get_queue_size(snd_timer_params_t * params); +void snd_timer_params_set_filter(snd_timer_params_t * params, unsigned int filter); +unsigned int snd_timer_params_get_filter(snd_timer_params_t * params); + +size_t snd_timer_status_sizeof(void); +/** allocate #snd_timer_status_t container on stack */ +#define snd_timer_status_alloca(ptr) do { assert(ptr); *ptr = (snd_timer_status_t *) alloca(snd_timer_status_sizeof()); memset(*ptr, 0, snd_timer_status_sizeof()); } while (0) +int snd_timer_status_malloc(snd_timer_status_t **ptr); +void snd_timer_status_free(snd_timer_status_t *obj); +void snd_timer_status_copy(snd_timer_status_t *dst, const snd_timer_status_t *src); + +snd_htimestamp_t snd_timer_status_get_timestamp(snd_timer_status_t * status); +long snd_timer_status_get_resolution(snd_timer_status_t * status); +long snd_timer_status_get_lost(snd_timer_status_t * status); +long snd_timer_status_get_overrun(snd_timer_status_t * status); +long snd_timer_status_get_queue(snd_timer_status_t * status); + +/* deprecated functions, for compatibility */ +long snd_timer_info_get_ticks(snd_timer_info_t * info); + +/** \} */ + +#ifdef __cplusplus +} +#endif + +#endif /** __ALSA_TIMER_H */ + diff --git a/debian/include-alsa/alsa/version.h b/debian/include-alsa/alsa/version.h new file mode 100644 index 0000000..c74c09d --- /dev/null +++ b/debian/include-alsa/alsa/version.h @@ -0,0 +1,15 @@ +/* + * version.h + */ + +#define SND_LIB_MAJOR 1 /**< major number of library version */ +#define SND_LIB_MINOR 0 /**< minor number of library version */ +#define SND_LIB_SUBMINOR 5 /**< subminor number of library version */ +#define SND_LIB_EXTRAVER 1000000 /**< extra version number, used mainly for betas */ +/** library version */ +#define SND_LIB_VERSION ((SND_LIB_MAJOR<<16)|\ + (SND_LIB_MINOR<<8)|\ + SND_LIB_SUBMINOR) +/** library version (string) */ +#define SND_LIB_VERSION_STR "1.0.5" + diff --git a/debian/liboss4-salsa-dev.install b/debian/liboss4-salsa-dev.install new file mode 100644 index 0000000..52d6041 --- /dev/null +++ b/debian/liboss4-salsa-dev.install @@ -0,0 +1,2 @@ +debian/include-alsa/alsa /usr/include +debian/alsa.pc /usr/lib/pkgconfig diff --git a/debian/m-a/compat b/debian/m-a/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/m-a/compat @@ -0,0 +1 @@ +5 diff --git a/debian/m-a/control.modules.in b/debian/m-a/control.modules.in new file mode 100644 index 0000000..161e59e --- /dev/null +++ b/debian/m-a/control.modules.in @@ -0,0 +1,21 @@ +Source: oss4 +Section: sound +Priority: optional +Maintainer: Debian OSS4 Maintainers <pkg-oss4-maintainers@lists.alioth.debian.org> +Build-Depends: debhelper (>> 5.0.0) +Standards-Version: 3.9.2 + +Package: oss4-modules-_KVERS_ +Architecture: linux-any +Provides: oss4-modules +Description: OSS4 modules for Linux (kernel _KVERS_). + This package contains the set of loadable kernel modules for the + Open Sound System v4. + . + This package contains the compiled kernel modules for _KVERS_ + . + If you have compiled your own kernel, you will most likely need to build + your own oss4-modules. The oss4-source package has been provided for use + with the Debian's module-assistant or kernel-package utilities + to produce a version of oss4-module for your kernel. + diff --git a/debian/m-a/rules b/debian/m-a/rules new file mode 100644 index 0000000..2449edc --- /dev/null +++ b/debian/m-a/rules @@ -0,0 +1,69 @@ +#!/usr/bin/make -f + +### KERNEL SETUP +### Setup the stuff needed for making kernel module packages +### taken from /usr/share/kernel-package/sample.module.rules + +# prefix of the target package name +PACKAGE=oss4-modules +# modifieable for experiments or debugging m-a +MA_DIR ?= /usr/share/modass +# load generic variable handling +-include $(MA_DIR)/include/generic.make +# load default rules, including kdist, kdist_image, ... +-include $(MA_DIR)/include/common-rules.make + +# module assistant calculates all needed things for us and sets +# following variables: +# KSRC (kernel source directory), KVERS (kernel version string), KDREV +# (revision of the Debian kernel-image package), CC (the correct +# compiler), VERSION (the final package version string), PKGNAME (full +# package name with KVERS included), DEB_DESTDIR (path to store DEBs) + +# The kdist_configure target is called by make-kpkg modules_config and +# by kdist* rules by dependency. It should configure the module so it is +# ready for compilation (mostly useful for calling configure). +# prep-deb-files from module-assistant creates the neccessary debian/ files +kdist_config kdist_configure: prep-deb-files + +# the kdist_clean target is called by make-kpkg modules_clean and from +# kdist* rules. It is responsible for cleaning up any changes that have +# been made by the other kdist_commands (except for the .deb files created) +kdist_clean: + cd core && rm -f *.o *.ko *.mod.c *.mod.o .*.cmd modules.order Module.symvers limits.h && rm -rf .tmp_versions && cd .. + cd drivers && rm -f *.o *.ko *.mod.c *.mod.o .*.cmd modules.order osscore_symbols.inc && rm -rf .tmp_versions && cd .. +# rm -f driver/*.o driver/*.ko +# +### end KERNEL SETUP + + +.PHONY: binary_modules +binary-modules: + dh_testroot + dh_clean -k + dh_installdirs lib/modules/$(KVERS)/kernel/oss4 + + # This is Bad(tm) but necessary since linux-headers >= 2.6.29 + cp /lib/modules/$(KVERS)/source/include/linux/limits.h $(PWD)/core + + # Build the modules + $(MAKE) -C $(KSRC) M=$(PWD)/core modules + $(MAKE) -C $(PWD)/drivers osscore_symbols.inc + $(MAKE) -C $(KSRC) M=$(PWD)/drivers modules + + # Install the modules + cp core/osscore.ko drivers/*.ko debian/$(PKGNAME)/lib/modules/$(KVERS)/kernel/oss4 + + dh_installdocs + dh_installchangelogs + dh_installmodules + #sed -e "s/@KERNEL@/$(KVERS)/g" debian/preinst.modules.in > debian/preinst + #sed -e "s/@KERNEL@/$(KVERS)/g" debian/postrm.modules.in > debian/postrm + dh_compress + dh_fixperms + dh_installdeb + dh_gencontrol -- -v$(VERSION) + dh_md5sums + dh_builddeb --destdir=$(DEB_DESTDIR) + dh_clean -k + diff --git a/debian/modprobe.d/ALSA-module-list b/debian/modprobe.d/ALSA-module-list new file mode 100644 index 0000000..02dd295 --- /dev/null +++ b/debian/modprobe.d/ALSA-module-list @@ -0,0 +1,171 @@ +snd-seq +snd-seq-device +snd-seq-dummy +snd-seq-instr +snd-seq-midi +snd-seq-midi-emul +snd-seq-midi-event +snd-seq-oss +snd-seq-virmidi +snd-dummy +snd-virmidi +snd-loopback +snd-ac97-codec +snd-ad1816a +snd-ad1816a-lib +snd-ad1848 +snd-ad1848-lib +snd-ainstr-fm +snd-ainstr-gf1 +snd-ainstr-iw +snd-ainstr-simple +snd-ak4117 +snd-ak4531-codec +snd-ak4xxx-adda +snd-ali5451 +snd-als100 +snd-als300 +snd-als4000 +snd_aoa +snd_aoa_codec_tas +snd_aoa_fabric_layout +snd_aoa_i2sbus +snd_aoa_soundbus +snd-armaaci # Added because there is a card by this name +snd-asihpi # Added because there is a card by this name +snd-atiixp +snd-atiixp-modem +snd-au1x00 # Added because there is a card by this name +snd-au8810 +snd-au8820 +snd-au8830 +snd-azt2320 +snd-azt3328 +snd-bt87x +snd-ca0106 +snd-cmi8330 +snd-cmipci +snd-cs4231 +snd-cs4231-lib +snd-cs4232 +snd-cs4236 +snd-cs4236-lib +snd-cs4281 +snd-cs46xx +snd-cs8427 +snd-darla20 # Added because there is a card by this name +snd-darla24 # Added because there is a card by this name +snd-dt019x +snd-echo3g # Added because there is a card by this name +snd-emu10k1 +snd-emu10k1-synth +snd-emu10k1x +snd-emu8000-synth +snd-emux-synth +snd-ens1370 +snd-ens1371 +snd-es1688 +snd-es1688-lib +snd-es18xx +snd-es1938 +snd-es1968 +snd-es968 +snd-fm801 +snd-fm801-tea575x # Added because there is a card by this name +snd-gina20 # Added because there is a card by this name +snd-gina24 # Added because there is a card by this name +snd-gusclassic +snd-gusextreme +snd-gus-lib +snd-gusmax +snd-gus-synth +snd-harmony # Added because there is a card by this name +snd-hda-intel # Added because there is a card by this name +snd-hdsp +snd-hdspm # Added because there is a card by this name +snd-hwdep +snd-i2c +snd-ice1712 +snd-ice1724 +snd-ice17xx-ak4xxx +snd-indigo # Added because there is a card by this name +snd-indigodj # Added because there is a card by this name +snd-indigoio # Added because there is a card by this name +snd-intel8x0 +snd-intel8x0m +snd-interwave +snd-interwave-stb +snd-korg1212 +snd-layla20 # Added because there is a card by this name +snd-layla24 # Added because there is a card by this name +snd-maestro3 +snd-mia # Added because there is a card by this name +snd-miro # Added because there is a card by this name +snd-mixart +snd-mixer-oss +snd-mona # Added because there is a card by this name +snd-mpu401 +snd-mpu401-uart +snd-msnd-pinnacle # Added because there is a card by this name +snd-mtpav +snd-mts64 +snd-nm256 +snd-opl3-lib +snd-opl3sa2 +snd-opl3-synth +snd-opl4-lib +snd-opl4-synth +snd-opti92x-ad1848 +snd-opti92x-cs4231 +snd-opti93x +snd-page-alloc +snd-pc98-cs4232 # Added because there is a card by this name +snd-pcm +snd-pcm-oss +snd-pcsp # Added because there is a card by this name +snd-pcxhr # Added because there is a card by this name +snd-pdaudiocf +snd-pdplus # Added because there is a card by this name +snd-portman2x4 # Added because there is a card by this name +snd-powermac # Added because there is a card by this name +snd-pxa2xx-ac97 # Added because there is a card by this name +snd-rawmidi +snd-rme32 +snd-rme96 +snd-rme9652 +snd-rtctimer +snd-s3c2410 # Added because there is a card by this name +snd-sa11xx-uda1341 # Added because there is a card by this name +snd-sb16 +snd-sb16-csp +snd-sb16-dsp +snd-sb8 +snd-sb8-dsp +snd-sbawe +snd-sb-common +snd-serialmidi # Added because there is a card by this name +snd-serial-u16550 +snd-sgalaxy +snd-sonicvibes +snd-sscape +snd-sun-amd7930 # Added because there is a card by this name +snd-sun-cs4231 # Added because there is a card by this name +snd-sun-dbri # Added because there is a card by this name +snd-tea575x-tuner +snd-tea6330t +snd-timer +snd-trident +snd-trident-synth +snd-usb-audio +snd-usb-lib +snd-usb-usx2y +snd-util-mem +snd-via82xx +snd-via82xx-modem +snd-vx222 +snd-vx-cs +snd-vx-lib +snd-vxp440 +snd-vxpocket +snd-wavefront +snd-ymfpci diff --git a/debian/modprobe.d/OSS-module-list b/debian/modprobe.d/OSS-module-list new file mode 100644 index 0000000..47089aa --- /dev/null +++ b/debian/modprobe.d/OSS-module-list @@ -0,0 +1,72 @@ +ac97 +ac97_codec +ac97_plugin_ad1980 +#aci # No ALSA substitute +ad1848 +ad1889 +adlib_card +aedsp16 +ali5455 +btaudio +cmpci +cs4232 +cs4281 +cs461x +cs46xx +emu10k1 +es1370 +es1371 +esssolo1 +forte +gus +i810_audio +kahlua +mad16 +maestro +maestro3 +maui +mpu401 +nm256_audio +opl3 +opl3sa +opl3sa2 +pas2 +pss +rme96xx +sb +sb_lib +sgalaxy +sonicvibes +sound +sscape +trident +trix +uart401 +uart6850 +via82cxxx_audio +v_midi +wavefront +ymfpci +# +# The following are not present in kernel-image 2.6.11 +# but we still list them for compatibility with earlier kernels +# +ac97_plugin_wm97xx +ad1816 +audio +awe_wave +dmasound_core +dmasound_pmac +#hal2 # No ALSA substitute +harmony +#ics2101 # No ALSA substitute +#ite8172 # No ALSA substitute +#miropcm20 # No ALSA substitute +#msnd # No ALSA substitute +#nec_vrc5477 # No ALSA substitute +sequencer +soundcard +usb-midi +#vidc # No ALSA substitute +#vwsnd # No ALSA substitute +#waveartist # No ALSA substitute diff --git a/debian/modprobe.d/oss4-base.conf b/debian/modprobe.d/oss4-base.conf new file mode 100644 index 0000000..2bde4e1 --- /dev/null +++ b/debian/modprobe.d/oss4-base.conf @@ -0,0 +1,3 @@ +# Prevent udev or modprobe from loading OSS3 +install sound /bin/true + diff --git a/debian/oss.conf.in b/debian/oss.conf.in new file mode 100644 index 0000000..c4b9ba3 --- /dev/null +++ b/debian/oss.conf.in @@ -0,0 +1,3 @@ +OSSETCDIR=/etc/oss4 +OSSVARDIR=/var/lib/oss4 +OSSDKMSDIR=/var/lib/dkms/oss4/_VERSION_ diff --git a/debian/oss4-base.dirs b/debian/oss4-base.dirs new file mode 100644 index 0000000..9e99474 --- /dev/null +++ b/debian/oss4-base.dirs @@ -0,0 +1,2 @@ +var/lib/oss4 +etc/pm/sleep.d diff --git a/debian/oss4-base.init b/debian/oss4-base.init new file mode 100644 index 0000000..639083e --- /dev/null +++ b/debian/oss4-base.init @@ -0,0 +1,220 @@ +#!/bin/bash +# +# Starts the OSS sound driver +# +### BEGIN INIT INFO +# Provides: oss4-base +# Required-Start: $remote_fs $local_fs +# Required-Stop: $remote_fs $local_fs +# Default-Start: S +# Default-Stop: 0 1 6 +# Short-Description: Start and Stop the OSS4 subsystem +### END INIT INFO + +OSSETCDIR=/etc/oss4 +OSSVARDIR=/var/lib/oss4 + +. /etc/oss.conf +. /lib/lsb/init-functions + +# Exit if oss4 is not installed +test -x /usr/sbin/ossdetect || exit 0 + +echo_procs_using_sound() +{ + echo $( fuser /dev/mixer* /dev/dsp* /dev/midi* /dev/oss/*/* 2>/dev/null ) +} + +kill_procs_using_sound() +{ + procs_using_sound="$(echo_procs_using_sound)" + + if [ "$procs_using_sound" ] ; then + echo -n "Terminating processes:" + for attempt in 1 2 3 4 ; do + echo -n " ${procs_using_sound}" + kill $procs_using_sound || : + sleep 1 + procs_using_sound="$(echo_procs_using_sound)" + [ "$procs_using_sound" ] || break + done + # Either no more procs using sound or attempts ran out + if [ "$procs_using_sound" ] ; then + echo -n " (with SIGKILL:) ${procs_using_sound}" + kill -9 $procs_using_sound || : + sleep 1 + fi + procs_using_sound="$(echo_procs_using_sound)" + if [ "$procs_using_sound" ] ; then + echo " (failed: processes still using sound devices: $(echo_with_command_names $procs_using_sound))." + return 1 + fi + echo "." + fi + return 0 +} + +unload_modules() +{ + procs_using_sound="$(echo_procs_using_sound)" + + if test "$procs_using_sound " != " " + then + log_action_end_msg 2 'Some applications are still using OSS' + exit 2 + fi + + # Unload oss drivers + for n in `cat $OSSETCDIR/installed_drivers | sed 's/#.*//'` + do + if ! /sbin/rmmod $n + then + log_warning_msg "Unloading module $n failed - ignored" + fi + done + + if ! /sbin/rmmod osscore + then + log_action_end_msg 3 'Cannot unload the OSS driver modules' + exit 3 + fi +} + +case "$1" in + start) + log_begin_msg 'Starting Open Sound System: ' + + # Check if OSS is already running + if test -f /proc/opensound/devfiles + then + log_action_end_msg 0 'OSS is already loaded' + exit 0 + fi + + # Check if oss kernel modules are installed + if ! test -f /lib/modules/`uname -r`/kernel/oss4/osscore.ko && ! test -f /lib/modules/`uname -r`/updates/dkms/osscore.ko + then + log_action_end_msg 1 'No kernel modules detected' + exit 0 + fi + + # Detect hardware + if ! test -f $OSSETCDIR/installed_drivers + then + /usr/sbin/ossdetect -v + fi + if ! test -f $OSSETCDIR/installed_drivers + then + log_action_end_msg 10 "No $OSSETCDIR/installed_drivers - cannot continue (problem with ossdetect?)" + exit 10 + fi + + # Load osscore + OPTIONS= + if test -f $OSSETCDIR/conf/osscore.conf + then + OPTIONS="`grep -v -h '^#' $OSSETCDIR/conf/osscore.conf|sed 's/ //g'`" + fi + if ! /sbin/modprobe osscore $OPTIONS + then + log_action_end_msg 60 "Cannot load the osscore module" + exit 60 + fi + + # Load oss drivers + for n in `cat $OSSETCDIR/installed_drivers | sed 's/#.*//'` + do + OPTIONS= + + if test -f $OSSETCDIR/conf/$n.conf + then + OPTIONS="`grep -v -h '^#' $OSSETCDIR/conf/$n.conf|sed 's/ //g'`" + fi + + if ! /sbin/modprobe $n $OPTIONS + then + log_warning_msg "Loading module $n failed - ignored" + fi + done + + # Check if everything is OK + if ! test -f /proc/opensound/devfiles + then + log_action_end_msg 70 'OSS Core module refused to start' + exit 70 + fi + + # Create device file + /usr/sbin/ossdetect -d -m 660 -g audio + + # Create basic links + /usr/sbin/ossdevlinks + if test -f $OSSVARDIR/legacy_devices + then + sh $OSSVARDIR/legacy_devices + fi + + /usr/sbin/savemixer -L + + log_action_end_msg 0 + ;; + + stop) + log_begin_msg 'Stopping Open Sound System: ' + if ! test -f /proc/opensound/devfiles + then + log_action_end_msg 0 'OSS not loaded' + exit 0 + fi + + /usr/sbin/savemixer + + log_action_end_msg 0 + ;; + + unload) + log_begin_msg 'Unloading Open Sound System kernel modules: ' + + if ! test -f /proc/opensound/devfiles + then + log_action_end_msg 0 'OSS not loaded' + exit 0 + fi + + /usr/sbin/savemixer + unload_modules + log_action_end_msg 0 + ;; + + force-unload) + log_begin_msg 'Unloading Open Sound System kernel modules: ' + + if ! test -f /proc/opensound/devfiles + then + log_action_end_msg 0 'OSS not loaded' + exit 0 + fi + + /usr/sbin/savemixer + kill_procs_using_sound + unload_modules + log_action_end_msg 0 + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + force-reload) + $0 force-unload + sleep 1 + $0 start + ;; + + *) + echo "Usage: $0 {start|stop|unload|force-unload|restart|force-reload}" + exit 3 +esac + diff --git a/debian/oss4-base.install b/debian/oss4-base.install new file mode 100644 index 0000000..9a76c39 --- /dev/null +++ b/debian/oss4-base.install @@ -0,0 +1,24 @@ +debian/oss.conf etc/ +debian/modprobe.d/oss4-base.conf etc/modprobe.d/ +debian/tmp/usr/bin/ossinfo +debian/tmp/usr/bin/ossmix +debian/tmp/usr/bin/ossplay +debian/tmp/usr/bin/osstest +debian/tmp/usr/share/man/man1/ossinfo.1.gz +debian/tmp/usr/share/man/man1/ossmix.1.gz +debian/tmp/usr/share/man/man1/ossplay.1.gz +debian/tmp/usr/share/man/man1/ossrecord.1.gz +debian/tmp/usr/share/man/man1/osstest.1.gz +debian/tmp/usr/sbin/ossdetect +debian/tmp/usr/sbin/ossdevlinks +debian/tmp/usr/sbin/savemixer +debian/tmp/usr/sbin/vmixctl +debian/tmp/usr/share/man/man8/ossdetect.8.gz +debian/tmp/usr/share/man/man8/ossdevlinks.8.gz +debian/tmp/usr/share/man/man8/savemixer.8.gz +debian/tmp/usr/share/man/man8/vmixctl.8.gz +debian/tmp/usr/share/man/man7 +debian/tmp/usr/lib/oss/etc/devices.list etc/oss4/ +debian/tmp/usr/lib/oss/version.dat etc/oss4/ +debian/tmp/usr/lib/oss/conf.tmpl/* etc/oss4/conf/ +debian/30oss4-pm etc/pm/sleep.d diff --git a/debian/oss4-base.links b/debian/oss4-base.links new file mode 100644 index 0000000..a40c876 --- /dev/null +++ b/debian/oss4-base.links @@ -0,0 +1 @@ +usr/bin/ossplay usr/bin/ossrecord diff --git a/debian/oss4-dev.README.Debian b/debian/oss4-dev.README.Debian new file mode 100644 index 0000000..6e8e26b --- /dev/null +++ b/debian/oss4-dev.README.Debian @@ -0,0 +1,17 @@ +OSS 4 for Debian +---------------- + +The OSS 4.0 API is backward compatible with applications developed +for previous API versions. Since OSS is based on the Posix/Unix +system call interface, there is no library code that could cause +dependency problems with different library versions. + +This makes it possible to get 10 years old programs to work with +the latest OSS version without recompiling (provided that the program +doesn't depend on undocumented features). + +Equally it's possible to use an application compiled against +the very latest OSS header in a system that runs some 10 years old driver. +This is of course only possible if that application doesn't use +the new ioctl calls. + diff --git a/debian/oss4-dev.install b/debian/oss4-dev.install new file mode 100644 index 0000000..fe4dd53 --- /dev/null +++ b/debian/oss4-dev.install @@ -0,0 +1,2 @@ +debian/tmp/usr/lib/oss/include/sys/soundcard.h usr/include/linux + diff --git a/debian/oss4-dev.postrm b/debian/oss4-dev.postrm new file mode 100644 index 0000000..57cdd0d --- /dev/null +++ b/debian/oss4-dev.postrm @@ -0,0 +1,21 @@ +#!/bin/sh + +set -e + + +case "$1" in + + remove|purge|disappear) + dpkg-divert --package oss4-dev --rename --remove "/usr/include/linux/soundcard.h" + ;; + + *) + exit 0 + ;; +esac + + + + + +#DEBHELPER# diff --git a/debian/oss4-dev.preinst b/debian/oss4-dev.preinst new file mode 100644 index 0000000..3847f54 --- /dev/null +++ b/debian/oss4-dev.preinst @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + + +case "$1" in + install) + # Diverting old soundcard.h + dpkg-divert --package oss4-dev --divert \ + /usr/include/linux/soundcard.h.oss3 \ + --rename /usr/include/linux/soundcard.h + ;; +esac + + +#DEBHELPER# diff --git a/debian/oss4-dkms.dkms.in b/debian/oss4-dkms.dkms.in new file mode 100644 index 0000000..9470af1 --- /dev/null +++ b/debian/oss4-dkms.dkms.in @@ -0,0 +1,106 @@ +PACKAGE_NAME="oss4" +PACKAGE_VERSION="_VERSION_" +BUILT_MODULE_NAME[0]="osscore" +BUILT_MODULE_NAME[1]="oss_usb" +BUILT_MODULE_NAME[2]="oss_sbxfi" +BUILT_MODULE_NAME[3]="oss_via823x" +BUILT_MODULE_NAME[4]="oss_geode" +BUILT_MODULE_NAME[5]="oss_envy24" +BUILT_MODULE_NAME[6]="oss_userdev" +BUILT_MODULE_NAME[7]="oss_digi96" +BUILT_MODULE_NAME[8]="oss_midiloop" +BUILT_MODULE_NAME[9]="oss_imux" +BUILT_MODULE_NAME[10]="oss_hdaudio" +BUILT_MODULE_NAME[11]="oss_envy24ht" +BUILT_MODULE_NAME[12]="oss_cmi878x" +BUILT_MODULE_NAME[13]="oss_atiaudio" +BUILT_MODULE_NAME[14]="oss_fmedia" +BUILT_MODULE_NAME[15]="oss_sblive" +BUILT_MODULE_NAME[16]="oss_emu10k1x" +BUILT_MODULE_NAME[17]="oss_audioloop" +BUILT_MODULE_NAME[18]="oss_via97" +BUILT_MODULE_NAME[19]="oss_cs4281" +BUILT_MODULE_NAME[20]="oss_midimix" +BUILT_MODULE_NAME[21]="oss_cs461x" +BUILT_MODULE_NAME[22]="oss_madi" +BUILT_MODULE_NAME[23]="oss_trident" +BUILT_MODULE_NAME[24]="oss_solo" +BUILT_MODULE_NAME[25]="oss_ich" +BUILT_MODULE_NAME[26]="oss_audigyls" +BUILT_MODULE_NAME[27]="oss_ali5455" +BUILT_MODULE_NAME[28]="oss_audiopci" +BUILT_MODULE_NAME[29]="oss_ymf7xx" +BUILT_MODULE_NAME[30]="oss_cmpci" +BUILT_MODULE_NAME[31]="oss_sbpci" +BUILT_MODULE_LOCATION[0]="core/" +BUILT_MODULE_LOCATION[1]="drivers/" +BUILT_MODULE_LOCATION[2]="drivers/" +BUILT_MODULE_LOCATION[3]="drivers/" +BUILT_MODULE_LOCATION[4]="drivers/" +BUILT_MODULE_LOCATION[5]="drivers/" +BUILT_MODULE_LOCATION[6]="drivers/" +BUILT_MODULE_LOCATION[7]="drivers/" +BUILT_MODULE_LOCATION[8]="drivers/" +BUILT_MODULE_LOCATION[9]="drivers/" +BUILT_MODULE_LOCATION[10]="drivers/" +BUILT_MODULE_LOCATION[11]="drivers/" +BUILT_MODULE_LOCATION[12]="drivers/" +BUILT_MODULE_LOCATION[13]="drivers/" +BUILT_MODULE_LOCATION[14]="drivers/" +BUILT_MODULE_LOCATION[15]="drivers/" +BUILT_MODULE_LOCATION[16]="drivers/" +BUILT_MODULE_LOCATION[17]="drivers/" +BUILT_MODULE_LOCATION[18]="drivers/" +BUILT_MODULE_LOCATION[19]="drivers/" +BUILT_MODULE_LOCATION[20]="drivers/" +BUILT_MODULE_LOCATION[21]="drivers/" +BUILT_MODULE_LOCATION[22]="drivers/" +BUILT_MODULE_LOCATION[23]="drivers/" +BUILT_MODULE_LOCATION[24]="drivers/" +BUILT_MODULE_LOCATION[25]="drivers/" +BUILT_MODULE_LOCATION[26]="drivers/" +BUILT_MODULE_LOCATION[27]="drivers/" +BUILT_MODULE_LOCATION[28]="drivers/" +BUILT_MODULE_LOCATION[29]="drivers/" +BUILT_MODULE_LOCATION[30]="drivers/" +BUILT_MODULE_LOCATION[31]="drivers/" +DEST_MODULE_LOCATION[0]="/updates/dkms/" +DEST_MODULE_LOCATION[1]="/updates/dkms/" +DEST_MODULE_LOCATION[2]="/updates/dkms/" +DEST_MODULE_LOCATION[3]="/updates/dkms/" +DEST_MODULE_LOCATION[4]="/updates/dkms/" +DEST_MODULE_LOCATION[5]="/updates/dkms/" +DEST_MODULE_LOCATION[6]="/updates/dkms/" +DEST_MODULE_LOCATION[7]="/updates/dkms/" +DEST_MODULE_LOCATION[8]="/updates/dkms/" +DEST_MODULE_LOCATION[9]="/updates/dkms/" +DEST_MODULE_LOCATION[10]="/updates/dkms/" +DEST_MODULE_LOCATION[11]="/updates/dkms/" +DEST_MODULE_LOCATION[12]="/updates/dkms/" +DEST_MODULE_LOCATION[13]="/updates/dkms/" +DEST_MODULE_LOCATION[14]="/updates/dkms/" +DEST_MODULE_LOCATION[15]="/updates/dkms/" +DEST_MODULE_LOCATION[16]="/updates/dkms/" +DEST_MODULE_LOCATION[17]="/updates/dkms/" +DEST_MODULE_LOCATION[18]="/updates/dkms/" +DEST_MODULE_LOCATION[19]="/updates/dkms/" +DEST_MODULE_LOCATION[20]="/updates/dkms/" +DEST_MODULE_LOCATION[21]="/updates/dkms/" +DEST_MODULE_LOCATION[22]="/updates/dkms/" +DEST_MODULE_LOCATION[23]="/updates/dkms/" +DEST_MODULE_LOCATION[24]="/updates/dkms/" +DEST_MODULE_LOCATION[25]="/updates/dkms/" +DEST_MODULE_LOCATION[26]="/updates/dkms/" +DEST_MODULE_LOCATION[27]="/updates/dkms/" +DEST_MODULE_LOCATION[28]="/updates/dkms/" +DEST_MODULE_LOCATION[29]="/updates/dkms/" +DEST_MODULE_LOCATION[30]="/updates/dkms/" +DEST_MODULE_LOCATION[31]="/updates/dkms/" +AUTOINSTALL=yes +MAKE[0]="cp /lib/modules/${kernelver}/source/include/linux/limits.h ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/core && \ + make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/core modules && \ + make -C ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/drivers osscore_symbols.inc && \ + make -C ${kernel_source_dir} SUBDIRS=${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/drivers modules" +CLEAN="cd core && rm -f *.o *.ko *.mod.c *.mod.o .*.cmd modules.order Module.symvers limits.h && rm -rf .tmp_versions && cd .. \ + cd drivers && rm -f *.o *.ko *.mod.c *.mod.o .*.cmd modules.order osscore_symbols.inc && rm -rf .tmp_versions && cd .. " + diff --git a/debian/oss4-dkms.install.in b/debian/oss4-dkms.install.in new file mode 100644 index 0000000..d721705 --- /dev/null +++ b/debian/oss4-dkms.install.in @@ -0,0 +1 @@ +build-tree/modules/oss4/core build-tree/modules/oss4/include build-tree/modules/oss4/drivers usr/src/oss4-_VERSION_ diff --git a/debian/oss4-dkms.postinst b/debian/oss4-dkms.postinst new file mode 100644 index 0000000..64dc6d8 --- /dev/null +++ b/debian/oss4-dkms.postinst @@ -0,0 +1,28 @@ +#! /bin/sh +# postinst script for liquidsoap +set -e + +#DEBHELPER# + +case "$1" in + configure) + # Restart oss4-base + if which invoke-rc.d >/dev/null 2>&1; then + invoke-rc.d oss4-base force-reload + else + /etc/init.d/oss4-base force-reload + fi + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + exit 0 + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +exit 0 + diff --git a/debian/oss4-gtk.install b/debian/oss4-gtk.install new file mode 100644 index 0000000..daf29de --- /dev/null +++ b/debian/oss4-gtk.install @@ -0,0 +1,2 @@ +debian/tmp/usr/bin/ossxmix +debian/tmp/usr/share/man/man1/ossxmix.1.gz diff --git a/debian/oss4-source.install b/debian/oss4-source.install new file mode 100644 index 0000000..5ad62ea --- /dev/null +++ b/debian/oss4-source.install @@ -0,0 +1 @@ +build-tree/oss4.tar.bz2 usr/src/ diff --git a/debian/patches/CFLAGS.patch b/debian/patches/CFLAGS.patch new file mode 100644 index 0000000..0b0e102 --- /dev/null +++ b/debian/patches/CFLAGS.patch @@ -0,0 +1,26 @@ +Index: oss4-4.2-build2004/lib/libsalsa/Makefile +=================================================================== +--- oss4-4.2-build2004.orig/lib/libsalsa/Makefile 2011-06-14 11:33:22.000000000 -0500 ++++ oss4-4.2-build2004/lib/libsalsa/Makefile 2011-06-14 11:35:03.000000000 -0500 +@@ -2,7 +2,7 @@ + + OSSLIBDIR=/usr/lib/oss + +-CFLAGS=-O -I../../include -I../libOSSlib ++CFLAGS+=-I../../include -I../libOSSlib + LIBTOOL=libtool --tag=CC + + all: libsalsa.la +Index: oss4-4.2-build2004/lib/libOSSlib/Makefile +=================================================================== +--- oss4-4.2-build2004.orig/lib/libOSSlib/Makefile 2011-06-14 11:33:22.000000000 -0500 ++++ oss4-4.2-build2004/lib/libOSSlib/Makefile 2011-06-14 11:33:24.000000000 -0500 +@@ -1,7 +1,7 @@ + OBJS=libmain.o midiparser.o play_event.o + INSTALLLIB=/lib + LDFLAGS=-shared -fPIC +-CFLAGS=-O -fPIC ++CFLAGS+=-fPIC + #LDFLAGS=-Bdynamic + AROPTS=rc + AR=ar diff --git a/debian/patches/arch_without_mregparm.patch b/debian/patches/arch_without_mregparm.patch new file mode 100644 index 0000000..2efe8e0 --- /dev/null +++ b/debian/patches/arch_without_mregparm.patch @@ -0,0 +1,24 @@ +Index: oss4-4.2-build2004/setup/srcconf_linux.inc +=================================================================== +--- oss4-4.2-build2004.orig/setup/srcconf_linux.inc 2011-06-14 11:33:23.000000000 -0500 ++++ oss4-4.2-build2004/setup/srcconf_linux.inc 2011-06-14 11:33:24.000000000 -0500 +@@ -53,7 +53,9 @@ + fprintf (f, + "CFLAGS += -O3 -fno-common -mcmodel=kernel -mno-red-zone -fno-asynchronous-unwind-tables -ffreestanding%s\n", fnsp); + # else +-# ifndef __arm__ ++# if defined(__arm__) || defined(__sh__) || defined(__mips__) || defined(__sparc__) || defined(__ia64__) || defined(__alpha__) || defined(__s390__) || defined(__powerpc__) || defined(__hppa__) ++ fprintf (f, "CFLAGS += -O3 -fno-common -ffreestanding%s\n", fnsp); ++# else + if (getenv ("NO_REGPARM") == NULL) + { + fprintf (f, +@@ -63,8 +65,6 @@ + { + fprintf (f, "CFLAGS += -O3 -fno-common -ffreestanding -DNO_REGPARM%s\n", fnsp); + } +-# else +- fprintf (f, "CFLAGS += -O3 -fno-common -ffreestanding%s\n", fnsp); + # endif + # endif + } diff --git a/debian/patches/cmd.patch b/debian/patches/cmd.patch new file mode 100644 index 0000000..9f685de --- /dev/null +++ b/debian/patches/cmd.patch @@ -0,0 +1,124 @@ +Index: oss4-4.2-build2004/cmd/ossdevlinks/ossdevlinks.c +=================================================================== +--- oss4-4.2-build2004.orig/cmd/ossdevlinks/ossdevlinks.c 2011-06-14 11:33:24.000000000 -0500 ++++ oss4-4.2-build2004/cmd/ossdevlinks/ossdevlinks.c 2011-06-14 11:33:24.000000000 -0500 +@@ -75,7 +75,7 @@ + #if defined(sun) + #define DEFAULT_OSSLIBDIR "/etc/oss" + #else +-#define DEFAULT_OSSLIBDIR "/usr/lib/oss" ++#define DEFAULT_OSSLIBDIR "/var/lib/oss4" + #endif + + static char * +@@ -99,7 +99,7 @@ + if (l > 0 && tmp[l - 1] == '\n') + tmp[l - 1] = '\0'; + +- if (strncmp (tmp, "OSSLIBDIR=", 10) == 0) ++ if (strncmp (tmp, "OSSVARDIR=", 10) == 0) + { + l = snprintf (name, sizeof (name), "%s", &tmp[10]); + if ((l >= OSSLIBDIRLEN) || (l < 0)) +@@ -991,7 +991,7 @@ + char lfile[PATH_MAX+20], * osslibdir; + + osslibdir = get_mapname (); +- snprintf (lfile, sizeof (lfile), "%s/%s", osslibdir, "etc/legacy_devices"); ++ snprintf (lfile, sizeof (lfile), "%s/%s", osslibdir, "legacy_devices"); + if ((f = fopen (lfile, "w")) == NULL) + { + perror (lfile); +Index: oss4-4.2-build2004/cmd/ossdevlinks/ossdevlinks.man +=================================================================== +--- oss4-4.2-build2004.orig/cmd/ossdevlinks/ossdevlinks.man 2011-06-14 11:33:24.000000000 -0500 ++++ oss4-4.2-build2004/cmd/ossdevlinks/ossdevlinks.man 2011-06-14 11:33:24.000000000 -0500 +@@ -34,7 +34,7 @@ + + FILES + /usr/sbin/ossdevlinks +-/usr/lib/oss/etc/legacy_devices ++/var/lib/oss4/legacy_devices + /dev/dspN + /dev/midiNN + /dev/mixerN +Index: oss4-4.2-build2004/cmd/savemixer/savemixer.c +=================================================================== +--- oss4-4.2-build2004.orig/cmd/savemixer/savemixer.c 2011-06-14 11:33:24.000000000 -0500 ++++ oss4-4.2-build2004/cmd/savemixer/savemixer.c 2011-06-14 11:33:24.000000000 -0500 +@@ -268,14 +268,14 @@ + get_mapname (void) + { + FILE *f; +- char tmp[ETCDIRLEN+11]; /* Adding 'OSSLIBDIR=' */ +- static char name[ETCDIRLEN+15]; /* Adding '/etc/mixer.save' */ ++ char tmp[ETCDIRLEN+11]; /* Adding 'OSSVARDIR=' */ ++ static char name[ETCDIRLEN+10]; /* Adding 'mixer.save' */ + struct stat st; + +- if (stat ("/etc/oss", &st) != -1) /* Use /etc/oss/mixer.save */ ++ if (stat ("/var/lib/oss4", &st) != -1) /* Use /var/lib/oss4/mixer.save */ + { +- strcpy (name, "/etc/oss/mixer.save"); +- strcpy (ossetcdir, "/etc/oss"); ++ strcpy (name, "/var/lib/oss4/mixer.save"); ++ strcpy (ossetcdir, "/var/lib/oss4"); + return name; + } + +@@ -291,15 +291,15 @@ + if (l > 0 && tmp[l - 1] == '\n') + tmp[l - 1] = '\0'; + +- if (strncmp (tmp, "OSSLIBDIR=", 10) == 0) ++ if (strncmp (tmp, "OSSVARDIR=", 10) == 0) + { +- l = snprintf (name, sizeof (name), "%s/etc/mixer.save", &tmp[10]); ++ l = snprintf (name, sizeof (name), "%s/mixer.save", &tmp[10]); + if ((l >= sizeof (name)) || (l < 0)) + { + fprintf (stderr, "String in /etc/oss.conf is too long!\n"); + goto oexit; + } +- snprintf (ossetcdir, sizeof (ossetcdir), "%s/etc", &tmp[10]); ++ snprintf (ossetcdir, sizeof (ossetcdir), "%s", &tmp[10]); + if ((l >= sizeof (ossetcdir)) || (l < 0)) + { + fprintf (stderr, "String in /etc/oss.conf is too long!\n"); +@@ -311,7 +311,7 @@ + } + + fclose (f); +- fprintf (stderr, "Error: OSSLIBDIR not set in /etc/oss.conf\n"); ++ fprintf (stderr, "Error: OSSVARDIR not set in /etc/oss.conf\n"); + + dexit: + snprintf (name, sizeof (name), "%s/mixer.save", ossetcdir); +Index: oss4-4.2-build2004/cmd/savemixer/savemixer.man +=================================================================== +--- oss4-4.2-build2004.orig/cmd/savemixer/savemixer.man 2011-06-14 11:33:23.000000000 -0500 ++++ oss4-4.2-build2004/cmd/savemixer/savemixer.man 2011-06-14 11:33:24.000000000 -0500 +@@ -9,8 +9,8 @@ + settings back into the mixer. + + Running this program without any parameters will save the current mixer +-settings into /etc/oss/mixer.save or $OSSLIBDIR/etc/mixer.save file. +-OSSLIBDIR is decided by reading /etc/oss.conf, and defaults to /usr/lib/oss. ++settings into /var/lib/oss4/mixer.save or $OSSVARDIR/mixer.save file. ++OSSVARDIR is decided by reading /etc/oss.conf, and defaults to /var/lib/oss4. + + AUTOMATIC SAVE + By default the soundoff command will automatically run savemixer to save +@@ -29,9 +29,9 @@ + FILES + /etc/oss.conf + /usr/sbin/savemixer +-/usr/lib/oss/etc/mixer.save +-/usr/lib/oss/etc/dspdevs.map +-/usr/lib/oss/etc/applist.conf ++/var/lib/oss4/mixer.save ++/var/lib/oss4/dspdevs.map ++/var/lib/oss4/applist.conf + + AUTHOR + 4Front Technologies diff --git a/debian/patches/dont_build_kernel_module.patch b/debian/patches/dont_build_kernel_module.patch new file mode 100644 index 0000000..d417af1 --- /dev/null +++ b/debian/patches/dont_build_kernel_module.patch @@ -0,0 +1,11 @@ +--- oss-v4.2-build2006-src-gpl/setup/Linux/build.sh.orig 2012-02-18 18:56:31.543278967 +0100 ++++ oss-v4.2-build2006-src-gpl/setup/Linux/build.sh 2012-02-18 18:56:47.167278816 +0100 +@@ -110,7 +110,6 @@ + if ! $LD -r -o prototype/$OSSLIBDIR/$OBJECTS/osscore.o target/objects/*.o + then + echo Linking osscore failed! +- exit 1 + fi + + rm -f devlist.txt devices.list + diff --git a/debian/patches/fix_invalid_printf.patch b/debian/patches/fix_invalid_printf.patch new file mode 100644 index 0000000..1f6bb96 --- /dev/null +++ b/debian/patches/fix_invalid_printf.patch @@ -0,0 +1,17 @@ +Index: oss4-4.2-build2004/setup/elflib.inc +=================================================================== +--- oss4-4.2-build2004.orig/setup/elflib.inc 2011-06-14 11:33:23.000000000 -0500 ++++ oss4-4.2-build2004/setup/elflib.inc 2011-06-14 11:33:24.000000000 -0500 +@@ -81,7 +81,11 @@ + } + if (hdr->e_ehsize != sizeof (*hdr)) + { +- fprintf (stderr, "e_ehsize=%x (%x)\n", hdr->e_ehsize, sizeof (*hdr)); ++ #if defined(__alpha__) || defined(__s390__) || defined(__ia64__) ++ fprintf (stderr, "e_ehsize=%x (%lx)\n", hdr->e_ehsize, sizeof (*hdr)); ++ #else ++ fprintf (stderr, "e_ehsize=%x (%x)\n", hdr->e_ehsize, sizeof (*hdr)); ++ #endif + return 0; + } + diff --git a/debian/patches/gcc-4.6.patch b/debian/patches/gcc-4.6.patch new file mode 100644 index 0000000..c07a737 --- /dev/null +++ b/debian/patches/gcc-4.6.patch @@ -0,0 +1,61 @@ +--- oss4-4.2-build2004/cmd/ossmixd/ossmixd.c ++++ oss4-4.2-build2004/cmd/ossmixd/ossmixd.c +@@ -161,7 +161,7 @@ + oss_mixext *ext; + int i; + int nrext; +- int value, prev_value; ++ int value, prev_value __attribute__((unused)); + + nrext = ossmix_get_nrext (mixernum); + +--- oss4-4.2-build2004/cmd/ossphone/ossphone.c ++++ oss4-4.2-build2004/cmd/ossphone/ossphone.c +@@ -151,7 +151,7 @@ + printf("Waiting for dial tone...\n"); + while (dc_level < min_dc_level) + { +- int dummy; ++ int dummy __attribute__((unused)); + modem_read(modem_in_fd, buf, sizeof(buf)); + dummy=write(dev_dsp_fd, buf, sizeof(buf)); + +@@ -187,7 +187,7 @@ + { + if (dtmf_fill_digit (digit, digit_len, *phone_number) >= 0) + { +- int dummy; ++ int dummy __attribute__((unused)); + + printf("%c", *phone_number); + fflush(stdout); +@@ -381,7 +381,7 @@ + + while (1) + { +- int dummy; ++ int dummy __attribute__((unused)); + FD_ZERO(&rfds); + FD_SET(modem_in_fd, &rfds); + FD_SET(dev_dsp_fd, &rfds); +--- oss4-4.2-build2004/cmd/ossplay/ossplay_parser.c ++++ oss4-4.2-build2004/cmd/ossplay/ossplay_parser.c +@@ -764,7 +764,7 @@ + pos = l + 7, tmp, vers; + unsigned char buf[256], block_type; + flag plock = 0; +- int speed = 11025, channels = 1, bits = 8, format = AFMT_U8; ++ int speed = 11025, channels = 1, bits __attribute__((unused)) = 8, format = AFMT_U8; + errors_t ret; + + if (read (fd, hdr + 19, 7) < 7) +@@ -1685,7 +1685,7 @@ + caf_desc_parse (uint32 id, unsigned char * buf, big_t len, file_t * f) + { + int format; +- uint32 bits, bytes_per_packet, flags, frames_per_packet; ++ uint32 bits, bytes_per_packet, flags, frames_per_packet __attribute__((unused)); + + { + /* + diff --git a/debian/patches/generic_srccconf.patch b/debian/patches/generic_srccconf.patch new file mode 100644 index 0000000..26d815a --- /dev/null +++ b/debian/patches/generic_srccconf.patch @@ -0,0 +1,75 @@ +--- oss-v4.2-build2003-src-gpl/setup/srcconf.c.orig 2010-08-23 03:17:48.000000000 +0200 ++++ oss-v4.2-build2003-src-gpl/setup/srcconf.c 2010-08-23 03:31:07.000000000 +0200 +@@ -107,32 +107,38 @@ + + static char arch[32] = ""; + +-static void +-generate_driver (char *name, conf_t * conf, char *cfg_name, char *cfg_header, +- char *dirname, char *topdir); +- +-typedef void +-(*generate_driver_t) (char *name, conf_t * conf, char *cfg_name, char *cfg_header, +- char *dirname, char *topdir); +- +-generate_driver_t driver_gen = generate_driver; +- + #ifdef linux + #include "srcconf_vxworks.inc" + #include "srcconf_linux.inc" ++#define HAVE_SRCCONF + #endif + + #ifdef __FreeBSD__ + #include "srcconf_freebsd.inc" ++#define HAVE_SRCCONF + #endif + + #ifdef sun + #include "srcconf_vxworks.inc" + #include "srcconf_solaris.inc" ++#define HAVE_SRCCONF + #endif + + #if defined(__BEOS__) || defined(__HAIKU__) + #include "srcconf_beos.inc" ++#define HAVE_SRCCONF ++#endif ++ ++#ifdef HAVE_SRCCONF ++static void ++generate_driver (char *name, conf_t * conf, char *cfg_name, char *cfg_header, ++ char *dirname, char *topdir); ++ ++typedef void ++(*generate_driver_t) (char *name, conf_t * conf, char *cfg_name, char *cfg_header, ++ char *dirname, char *topdir); ++ ++generate_driver_t driver_gen = generate_driver; + #endif + + static int +@@ -643,8 +649,10 @@ + conf.mode == MD_KERNEL_ || conf.mode == MD_MODULE_) + return 0; + ++#ifdef HAVE_SRCCONF + if (conf.mode == MD_MODULE) + driver_gen (name, &conf, cfg_name, cfg_header, path, topdir); ++#endif + + if ((dir = opendir (path)) == NULL) + { +@@ -1471,9 +1479,9 @@ + shlib_ldflags = "-G -lsocket -lnsl"; + # endif + +- if (strcmp (un.machine, "i386") == 0 || +- strcmp (un.machine, "i486") == 0 || +- strcmp (un.machine, "i586") == 0 || strcmp (un.machine, "i686") == 0) ++ if (strncmp (un.machine, "i386", 4) == 0 || ++ strncmp (un.machine, "i486", 4) == 0 || ++ strncmp (un.machine, "i586", 4) == 0 || strncmp (un.machine, "i686", 4) == 0) + { + strcpy (conf->platform, "i86pc"); + } diff --git a/debian/patches/hurd_iot.patch b/debian/patches/hurd_iot.patch new file mode 100644 index 0000000..791d9d3 --- /dev/null +++ b/debian/patches/hurd_iot.patch @@ -0,0 +1,21 @@ +This is needed for GNU/Hurd build. These _IOT__IOTBASE_* definitions will not +work of course, that's ok since we do not support sound yet anyway, and we do +not export this to other packages. + +Index: oss4-4.2-build2004/lib/libsalsa/local.h +=================================================================== +--- oss4-4.2-build2004.orig/lib/libsalsa/local.h 2011-06-14 11:33:22.000000000 -0500 ++++ oss4-4.2-build2004/lib/libsalsa/local.h 2011-06-14 11:35:15.000000000 -0500 +@@ -96,3 +96,12 @@ + extern void midiparser_callback (void *context, int category, + unsigned char msg, unsigned char ch, + unsigned char *parms, int len); ++ ++#define _IOT__IOTBASE_oss_longname_t _IOT (0, 0, 0, 0, 0, 0) ++#define _IOT__IOTBASE_audio_buf_info _IOT (0, 0, 0, 0, 0, 0) ++#define _IOT__IOTBASE_oss_sysinfo _IOT (0, 0, 0, 0, 0, 0) ++#define _IOT__IOTBASE_oss_mixext _IOT (0, 0, 0, 0, 0, 0) ++#define _IOT__IOTBASE_oss_mixer_value _IOT (0, 0, 0, 0, 0, 0) ++#define _IOT__IOTBASE_oss_audioinfo _IOT (0, 0, 0, 0, 0, 0) ++#define _IOT__IOTBASE_oss_mixerinfo _IOT (0, 0, 0, 0, 0, 0) ++#define _IOT__IOTBASE_oss_card_info _IOT (0, 0, 0, 0, 0, 0) diff --git a/debian/patches/kfreebsd-gnu.patch b/debian/patches/kfreebsd-gnu.patch new file mode 100644 index 0000000..010c603 --- /dev/null +++ b/debian/patches/kfreebsd-gnu.patch @@ -0,0 +1,116 @@ +--- a/include/soundcard.h ++++ b/include/soundcard.h +@@ -50,7 +50,7 @@ + /* In Linux we need to be prepared for cross compiling */ + #include <linux/ioctl.h> + #else +-# ifdef __FreeBSD__ ++# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + # include <sys/ioccom.h> + # else + # include <sys/ioctl.h> +--- a/kernel/framework/audio/oss_audio_core.c ++++ b/kernel/framework/audio/oss_audio_core.c +@@ -3646,7 +3646,7 @@ + } + return 0; + +-#ifdef __FreeBSD__ ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + case FREEBSD_GETBLKSIZE: + #endif + case SNDCTL_DSP_GETBLKSIZE: +--- a/kernel/framework/sndstat/oss_sndstat.c ++++ b/kernel/framework/sndstat/oss_sndstat.c +@@ -109,9 +109,9 @@ + put_status ("\n"); + } + +-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__NetBSD__) + { +-#if defined(__FreeBSD__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + extern char version[]; + #endif + +--- a/lib/libOSSlib/compile.sh ++++ b/lib/libOSSlib/compile.sh +@@ -7,7 +7,7 @@ + $MAKE libOSSlib.so + ;; + +-"FreeBSD") ++"FreeBSD" | "GNU/kFreeBSD") + $MAKE libOSSlib.so + ;; + +--- a/setup/srcconf.c ++++ b/setup/srcconf.c +@@ -122,7 +122,7 @@ + #include "srcconf_linux.inc" + #endif + +-#ifdef __FreeBSD__ ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + #include "srcconf_freebsd.inc" + #endif + +@@ -480,7 +480,7 @@ + #include "gen_driver_linux.inc" + #endif + +-#if defined(__FreeBSD__) ++#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + #include "gen_driver_freebsd.inc" + #endif + +@@ -1456,6 +1456,8 @@ + strcpy (un.sysname, "SCO_SV"); + if (strcmp (un.sysname, "Haiku") == 0) + strcpy (un.sysname, "BeOS"); ++ if (strcmp (un.sysname, "GNU/kFreeBSD") == 0) ++ strcpy (un.sysname, "FreeBSD"); + printf ("System: %s\n", un.sysname); + strcpy (conf->system, un.sysname); + sprintf (this_os, "kernel/OS/%s", un.sysname); +@@ -1549,7 +1551,7 @@ + if (hostcc == NULL) hostcc = DEFAULT_CC; + if (targetcc == NULL) targetcc = DEFAULT_CC; + +-#if defined(linux) || defined(__FreeBSD__) || defined(__SCO_VERSION__) ++#if defined(linux) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__SCO_VERSION__) + mkdir ("target", 0755); + mkdir ("target/build", 0755); + system ("touch target/build/.nomake"); +--- a/setup/setupdir.sh ++++ b/setup/setupdir.sh +@@ -33,6 +33,12 @@ + OS=BeOS + fi + ++# Use the same source directories for FreeBSD and GNU/kFreeBSD ++if test "$OS " = "GNU/kFreeBSD " ++then ++ OS=FreeBSD ++fi ++ + # Use Linux24 as the OS name for Linux 2.4.x + if test "$OS " = "Linux " + then +--- a/setup/FreeBSD/build.sh ++++ b/setup/FreeBSD/build.sh +@@ -150,10 +150,10 @@ + strip prototype/usr/sbin/osslic + + BITS=3 # Default to 32 bit ELF format +- if test "`uname -m` " = "amd64 " +- then ++ case "`uname -m`" in amd64|x86_64) + BITS=6 # Use 64 bit ELF format +- fi ++ ;; ++ esac + + prototype/usr/sbin/osslic -q -u -$BITS./prototype/$OSSLIBDIR/build/osscore.lib + diff --git a/debian/patches/liboss4-salsa.patch b/debian/patches/liboss4-salsa.patch new file mode 100644 index 0000000..5eeb628 --- /dev/null +++ b/debian/patches/liboss4-salsa.patch @@ -0,0 +1,19 @@ +Rename libsalsa into liboss4-salsa (the former would conflict for no good reason +with another package in Debian). + +Add rpath to /usr/lib/oss4-libsalsa, where the internal lib libOSSlib resides +(as agreed on with ftp-master). + +Index: oss4-4.2-build2004/lib/libsalsa/Makefile +=================================================================== +--- oss4-4.2-build2004.orig/lib/libsalsa/Makefile 2011-06-14 11:33:24.000000000 -0500 ++++ oss4-4.2-build2004/lib/libsalsa/Makefile 2011-06-14 11:33:24.000000000 -0500 +@@ -46,7 +46,7 @@ + $(LIBTOOL) --mode=compile ${CC} $(CFLAGS) -c rawmidi.c + + libsalsa.la: $(LOBJECTS) +- $(LIBTOOL) --mode=link ${CC} -rpath /usr/lib -Wl,--version-script=Versions -version-info 2:0:0 -o libsalsa.la $(LOBJECTS) -L../libOSSlib -lOSSlib ++ $(LIBTOOL) --mode=link ${CC} -rpath /usr/lib -R /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/oss4-libsalsa -Wl,--version-script=Versions -version-info 2:0:0 -o liboss4-salsa.la $(LOBJECTS) -L../libOSSlib -lOSSlib + + install: libsalsa.la + $(LIBTOOL) cp libsalsa.la /usr/lib diff --git a/debian/patches/libsalsa_fixes.patch b/debian/patches/libsalsa_fixes.patch new file mode 100644 index 0000000..8bb2f88 --- /dev/null +++ b/debian/patches/libsalsa_fixes.patch @@ -0,0 +1,51 @@ +Index: oss4-4.2-build2004/lib/libsalsa/seq.c +=================================================================== +--- oss4-4.2-build2004.orig/lib/libsalsa/seq.c 2011-06-14 11:33:22.000000000 -0500 ++++ oss4-4.2-build2004/lib/libsalsa/seq.c 2011-06-14 11:33:24.000000000 -0500 +@@ -111,7 +111,7 @@ + if ((seq = malloc (sizeof (*seq))) == NULL) + return -ENOMEM; + +- dbg_printf ("Created sequencer seq=%x\n", seq); ++ dbg_printf ("Created sequencer seq=%p\n", seq); + + memset (seq, 0, sizeof (*seq)); + +Index: oss4-4.2-build2004/lib/libsalsa/seq_output.c +=================================================================== +--- oss4-4.2-build2004.orig/lib/libsalsa/seq_output.c 2011-06-14 11:33:22.000000000 -0500 ++++ oss4-4.2-build2004/lib/libsalsa/seq_output.c 2011-06-14 11:35:11.000000000 -0500 +@@ -78,7 +78,7 @@ + + dbg_printf3 + ("Event %2d: flags=%08x tag=%08x, q=%2d, time=%d, src=%x, dst=%x\n", +- ev->type, ev->flags, ev->tag, ev->queue, ev->time, ev->source, ev->dest); ++ ev->type, ev->flags, ev->tag, ev->queue, ev->time.tick, ev->source, ev->dest); + + switch (ev->type) + { +Index: oss4-4.2-build2004/lib/libsalsa/timer.c +=================================================================== +--- oss4-4.2-build2004.orig/lib/libsalsa/timer.c 2011-06-14 11:33:22.000000000 -0500 ++++ oss4-4.2-build2004/lib/libsalsa/timer.c 2011-06-14 11:33:24.000000000 -0500 +@@ -57,7 +57,7 @@ + + timer = malloc (sizeof (*timer)); + +- dbg_printf ("snd_timer_open(name='%s', mode=%x)=%x\n", name, mode, timer); ++ dbg_printf ("snd_timer_open(name='%s', mode=%x)=%p\n", name, mode, timer); + + if (timer == NULL) + return -ENOMEM; +Index: oss4-4.2-build2004/lib/libsalsa/local.h +=================================================================== +--- oss4-4.2-build2004.orig/lib/libsalsa/local.h 2011-06-14 11:33:24.000000000 -0500 ++++ oss4-4.2-build2004/lib/libsalsa/local.h 2011-06-14 11:33:24.000000000 -0500 +@@ -9,6 +9,7 @@ + #include "../../include/soundcard.h" + #include "alsakernel.h" + #include <sys/poll.h> ++#include <sys/ioctl.h> + #include "../../kernel/framework/include/midiparser.h" + + extern int alib_verbose; diff --git a/debian/patches/modules-i386.patch b/debian/patches/modules-i386.patch new file mode 100644 index 0000000..4e7e279 --- /dev/null +++ b/debian/patches/modules-i386.patch @@ -0,0 +1,10 @@ +--- oss4-4.2-build2005/kernel/OS/Linux/os_linux.h.orig ++++ oss4-4.2-build2005/kernel/OS/Linux/os_linux.h +@@ -53,7 +53,6 @@ + + #include <sys/types.h> + #include <sys/param.h> +-#include <sys/signal.h> + #include <oss_errno.h> + #include <sys/file.h> + #include "oss_ddi.h" diff --git a/debian/patches/no_EBADE.patch b/debian/patches/no_EBADE.patch new file mode 100644 index 0000000..99d85c8 --- /dev/null +++ b/debian/patches/no_EBADE.patch @@ -0,0 +1,35 @@ +GNU/Hurd doesn't have EBADE. Report EGRATUITOUS there for now (or EIO on any +other system which doesn't have EBADE either). + +Index: oss4-4.2-build2004/lib/libsalsa/seq_output.c +=================================================================== +--- oss4-4.2-build2004.orig/lib/libsalsa/seq_output.c 2011-06-14 11:33:24.000000000 -0500 ++++ oss4-4.2-build2004/lib/libsalsa/seq_output.c 2011-06-14 11:33:24.000000000 -0500 +@@ -40,7 +40,13 @@ + if (l == -1) + return -errno; + ++#ifdef EBADE + return -EBADE; /* Randomly selected error */ ++#elif defined(EGRATUITOUS) ++ return -EGRATUITOUS; /* Randomly selected error */ ++#else ++ return -EIO; /* Randomly selected error */ ++#endif + } + + return 0; +@@ -65,7 +71,13 @@ + if (l == -1) + return -errno; + ++#ifdef EBADE + return -EBADE; /* Randomly selected error */ ++#elif defined(EGRATUITOUS) ++ return -EGRATUITOUS; /* Randomly selected error */ ++#else ++ return -EIO; /* Randomly selected error */ ++#endif + } + + return 0; diff --git a/debian/patches/os_cmd.patch b/debian/patches/os_cmd.patch new file mode 100644 index 0000000..ea06852 --- /dev/null +++ b/debian/patches/os_cmd.patch @@ -0,0 +1,139 @@ +Index: oss4-4.2-build2004/os_cmd/Linux/ossdetect/ossdetect.c +=================================================================== +--- oss4-4.2-build2004.orig/os_cmd/Linux/ossdetect/ossdetect.c ++++ oss4-4.2-build2004/os_cmd/Linux/ossdetect/ossdetect.c +@@ -23,6 +23,7 @@ + #include <sys/types.h> + #include <sys/stat.h> + #include <sys/dir.h> ++#include <grp.h> + + #define PCI_PASS 0 + #define USB_PASS 1 +@@ -31,6 +32,7 @@ + + #define OSSLIBDIRLEN 512 + static char *osslibdir = NULL; ++static char *groupname = "root"; + + static int usb_ok = 0; + +@@ -90,7 +92,7 @@ + if (l > 0 && tmp[l - 1] == '\n') + tmp[l - 1] = '\0'; + +- if (strncmp (tmp, "OSSLIBDIR=", 10) == 0) ++ if (strncmp (tmp, "OSSETCDIR=", 10) == 0) + { + l = snprintf (name, sizeof (name), "%s", &tmp[10]); + if ((l >= OSSLIBDIRLEN) || (l < 0)) +@@ -109,12 +111,12 @@ + } + } + +- fprintf (stderr, "OSSLIBDIR not set in /etc/oss.conf, using default " +- "/usr/lib/oss\n"); ++ fprintf (stderr, "OSSETCDIR not set in /etc/oss.conf, using default " ++ "/etc/oss4\n"); + oexit: + fclose (f); + oexit2: +- snprintf (name, sizeof (name), "/usr/lib/oss"); ++ snprintf (name, sizeof (name), "/etc/oss4"); + return name; + } + +@@ -503,6 +505,13 @@ + mode_t perm; + int minor, major; + ++ struct group *grpstruct; ++ if((grpstruct = getgrnam(groupname)) == NULL) ++ { ++ fprintf (stderr, "getgrnam() error\n"); ++ exit (-1); ++ } ++ + if ((f = fopen ("/proc/opensound/devfiles", "r")) == NULL) + { + perror ("/proc/opensound/devfiles"); +@@ -554,6 +563,8 @@ + printf ("mknod %s c %d %d -m %o\n", dev, major, minor, node_m); + if (mknod (dev, node_m, makedev (major, minor)) == -1) + perror (dev); ++ ++ chown(dev, 0, grpstruct->gr_gid); + } + + umask (perm); +@@ -586,7 +597,7 @@ + struct stat st; + FILE *f; + +- while ((i = getopt(argc, argv, "L:a:dilm:uv")) != EOF) ++ while ((i = getopt(argc, argv, "L:a:dg:ilm:uv")) != EOF) + switch (i) + { + case 'v': +@@ -613,6 +624,10 @@ + do_license = 1; + break; + ++ case 'g': ++ groupname = optarg; ++ break; ++ + case 'L': + osslibdir = optarg; + break; +@@ -648,7 +663,7 @@ + exit (0); + } + +- load_devlist ("etc/devices.list", 0); ++ load_devlist ("devices.list", 0); + + if (stat ("/etc/oss_3rdparty", &st) != -1) + load_devlist ("/etc/oss_3rdparty", 1); +@@ -674,7 +689,7 @@ + } + + snprintf (instfname, sizeof (instfname), "%s/%s", osslibdir, +- "etc/installed_drivers"); ++ "installed_drivers"); + + if ((f = fopen (instfname, "w")) == NULL) + { +Index: oss4-4.2-build2004/os_cmd/Linux/ossdetect/ossdetect.man +=================================================================== +--- oss4-4.2-build2004.orig/os_cmd/Linux/ossdetect/ossdetect.man ++++ oss4-4.2-build2004/os_cmd/Linux/ossdetect/ossdetect.man +@@ -6,9 +6,10 @@ + + DESCRIPTION + The ossdetect application performs automatic detection of soundcards. +-The application looks at the /usr/lib/oss/etc/device.list and performs ++The application looks at the $OSSETCDIR/device.list and performs + automatic detection. It will create a file with the list of the configured +-drivers in /usr/lib/oss/etc/installed_drivers. ++drivers in $OSSETCDIR/installed_drivers. ++OSSETCDIR is decided by reading /etc/oss.conf, and defaults to /etc/oss4. + + The Input Multiplexer driver (IMUX) is not configured by default and + can be added to the OSS configuration using the -i option. +@@ -17,6 +18,7 @@ + -d Create device file links. + -i Adds the oss_imux driver. + -m<mode> Create nodes with permissions set to octal <mode>. ++-g<group> Create nodes with group ownership set to <group>. + -u Adds the oss_userdev driver. + -v Verbose output. + -L<path> Use <path> as root directory for OSS files. +@@ -26,6 +28,7 @@ + ossdevlinks(1), ossinfo(1) + + FILES ++/etc/oss.conf + /usr/sbin/ossdetect + + AUTHOR diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..b101a66 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,17 @@ +cmd.patch +os_cmd.patch +txt2man.patch +arch_without_mregparm.patch +dont_build_kernel_module.patch +fix_invalid_printf.patch +hurd_iot.patch +libsalsa_fixes.patch +no_EBADE.patch +CFLAGS.patch +liboss4-salsa.patch +snd_asoundlib_version.patch +gcc-4.6.patch +#generic_srccconf.patch +kfreebsd-gnu.patch +modules-i386.patch + diff --git a/debian/patches/snd_asoundlib_version.patch b/debian/patches/snd_asoundlib_version.patch new file mode 100644 index 0000000..fc1d47f --- /dev/null +++ b/debian/patches/snd_asoundlib_version.patch @@ -0,0 +1,18 @@ +Index: oss4-4.2-build2004/lib/libsalsa/misc.c +=================================================================== +--- oss4-4.2-build2004.orig/lib/libsalsa/misc.c 2011-06-14 11:33:21.000000000 -0500 ++++ oss4-4.2-build2004/lib/libsalsa/misc.c 2011-06-14 11:33:24.000000000 -0500 +@@ -105,3 +105,13 @@ + dbg_printf ("snd_lib_error_set_handler()\n"); + return 0; + } ++ ++ ++/** ++ * \brief Returns the ALSA sound library version in ASCII format ++ * \return The ASCII description of the used ALSA sound library. ++ */ ++const char *snd_asoundlib_version(void) ++{ ++ return SND_LIB_VERSION_STR; ++} diff --git a/debian/patches/txt2man.patch b/debian/patches/txt2man.patch new file mode 100644 index 0000000..e790a34 --- /dev/null +++ b/debian/patches/txt2man.patch @@ -0,0 +1,12 @@ +--- oss-v4.2-build2006-src-gpl/setup/Linux/build.sh.orig 2012-02-18 18:53:51.707280520 +0100 ++++ oss-v4.2-build2006-src-gpl/setup/Linux/build.sh 2012-02-18 18:54:01.955280417 +0100 +@@ -8,7 +8,7 @@ + else + echo "No gawk found. Using lesser replacement" >&2 + cc -o txt2man origdir/setup/txt2man.c +- TXT2MAN=./txt2man ++ TXT2MAN=/usr/bin/txt2man + fi + + [ -z "$LD" ] && LD=ld + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..65ccfd7 --- /dev/null +++ b/debian/rules @@ -0,0 +1,122 @@ +#!/usr/bin/make -f + +DEB_DH_INSTALLINIT_ARGS := --no-start -- start 50 S . stop 50 0 1 6 . +DEB_DH_INSTALL_ARGS := -X.svn +UPSTREAM_VERSION := $(shell dpkg-parsechangelog|grep "^Version:"|cut -d" " -f2|rev|cut -d- -f2-|rev|cut -d':' -f2) + +DEB_HOST_ARCH_OS ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_OS) +DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk + + +pre-build:: apply-patches stamp-prepare-oss4 + +stamp-prepare-oss4: + mkdir -p $(CURDIR)/build-tree/oss-build + cd $(CURDIR)/build-tree/oss-build && $(CURDIR)/configure --enable-libsalsa=NO --config-vmix=FIXEDPOINT + +ifneq ($(DEB_HOST_ARCH_OS),hurd) + # we do NOT want to build the kernel modules now + sed -i -e 's/SUBDIRS=lib cmd \(.*\)/SUBDIRS=lib cmd os_cmd/' $(CURDIR)/build-tree/oss-build/Makefile + echo > $(CURDIR)/build-tree/oss-build/.makefile +endif + + touch $@ + +stamp-build-oss4: + cd $(CURDIR)/build-tree/oss-build && make build + +ifeq ($(DEB_HOST_ARCH_OS),linux) + # TODO: rewrite upstream's 'build.sh' from scratch + cat `find $(CURDIR)/build-tree/oss-build/kernel/drv -name .devices`| grep -v '^#' \ + | sort | grep -v '^osscore' | grep -v '^oss_audiocs' | grep -v '^oss_sadasupport' \ + > $(CURDIR)/build-tree/oss-build/prototype/usr/lib/oss/etc/devices.list + + for n in `cat $(CURDIR)/build-tree/oss-build/prototype/usr/lib/oss/etc/devices.list | cut -f 1 | uniq` ; do \ + ( sed "s:CONFIGFILEPATH:/etc/oss4/conf:g" < $(CURDIR)/build-tree/oss-build/noregparm/kernel/drv/$$n/$$n.man > /tmp/ossman.txt && \ + /usr/bin/txt2man -t "$$n" -v "OSS Devices" -s 7 /tmp/ossman.txt | gzip -9 > $(CURDIR)/build-tree/oss-build/prototype/usr/share/man/man7/$$n.7.gz ) \ + done +endif + + touch $@ + +stamp-build-libsalsa: + cd $(CURDIR)/build-tree/oss-build/lib/libOSSlib && CFLAGS="$$CFLAGS -isystem $(CURDIR)/debian/include-alsa" make libOSSlib.so + cd $(CURDIR)/build-tree/oss-build/lib/libsalsa && CFLAGS="$$CFLAGS -isystem $(CURDIR)/debian/include-alsa" make + sed -e '/^libdir/s&$$&/$(DEB_HOST_MULTIARCH)&' < debian/alsa.pc.in > debian/alsa.pc + + touch $@ + +build/oss4-base:: stamp-build-oss4 + +build/oss4-source:: stamp-source-oss4 + rm -rf build-tree/modules/oss4/debian + mkdir -p build-tree/modules/oss4/debian + cp -r debian/m-a/* build-tree/modules/oss4/debian/ + cp debian/copyright build-tree/modules/oss4/debian/ + cp debian/changelog build-tree/modules/oss4/debian/ + chmod 755 build-tree/modules/oss4/debian/rules + cd build-tree/ && tar cjf oss4.tar.bz2 modules/ + +build/oss4-dkms:: stamp-source-oss4 + sed -e 's#_VERSION_#$(UPSTREAM_VERSION)#' < debian/oss4-dkms.install.in > debian/oss4-dkms.install + sed -e 's#_VERSION_#$(UPSTREAM_VERSION)#' < debian/oss4-dkms.dkms.in > debian/oss4-dkms.dkms + +build/liboss4-salsa2:: stamp-build-libsalsa +build/liboss4-salsa-dev:: stamp-build-libsalsa +build/liboss4-salsa-asound2:: stamp-build-libsalsa + +install/oss4-dkms:: + dh_dkms + +stamp-source-oss4: + bash ./debian/create-ma-tree.sh build-tree/modules/oss4 build-tree/oss-build + find build-tree/modules/oss4 -type f -exec chmod -x {} \; + touch $@ + +$(CURDIR)/debian/tmp: stamp-build-oss4 + cp -a $(CURDIR)/build-tree/oss-build/prototype $(CURDIR)/debian/tmp + +install/oss4-base:: $(CURDIR)/debian/tmp + sed -e 's#_VERSION_#$(UPSTREAM_VERSION)#' < debian/oss.conf.in > debian/oss.conf + +binary-install/oss4-base:: + chmod +x $(CURDIR)/debian/oss4-base/etc/pm/sleep.d/30oss4-pm + cat debian/modprobe.d/OSS-module-list \ + | sed -e 's/^[[:space:]]*//' -e 's/#.*//' -e '/^$$/d' \ + -e 's/[[:space:]].*//' -e 's/^/blacklist /' \ + > debian/oss4-base/etc/modprobe.d/oss4-base_noOSS3.conf + cat debian/modprobe.d/ALSA-module-list \ + | sed -e 's/^[[:space:]]*//' -e 's/#.*//' -e '/^$$/d' \ + -e 's/[[:space:]].*//' -e 's/^/blacklist /' \ + > debian/oss4-base/etc/modprobe.d/oss4-base_noALSA.conf + +binary-install/liboss4-salsa-dev:: + dh_install -pliboss4-salsa-dev build-tree/oss-build/lib/libsalsa/.libs/liboss4-salsa.a build-tree/oss-build/lib/libsalsa/.libs/liboss4-salsa.so usr/lib/$(DEB_HOST_MULTIARCH) + dh_link -pliboss4-salsa-dev /usr/lib/$(DEB_HOST_MULTIARCH)/liboss4-salsa.so.2 /usr/lib/$(DEB_HOST_MULTIARCH)/libasound.so.2 + dh_link -pliboss4-salsa-dev /usr/lib/$(DEB_HOST_MULTIARCH)/liboss4-salsa.so.2 /usr/lib/$(DEB_HOST_MULTIARCH)/libasound.so + dh_link -pliboss4-salsa-dev /usr/lib/$(DEB_HOST_MULTIARCH)/liboss4-salsa.so.2 /usr/lib/$(DEB_HOST_MULTIARCH)/libasound.a + +binary-install/liboss4-salsa2:: + dh_install -pliboss4-salsa2 build-tree/oss-build/lib/libsalsa/.libs/liboss4-salsa.so.2* usr/lib/$(DEB_HOST_MULTIARCH) + dh_install -pliboss4-salsa2 build-tree/oss-build/lib/libOSSlib/libOSSlib.so usr/lib/$(DEB_HOST_MULTIARCH)/oss4-libsalsa + +binary-install/liboss4-salsa-asound2:: + dh_link -pliboss4-salsa-asound2 /usr/lib/$(DEB_HOST_MULTIARCH)/liboss4-salsa.so.2 /usr/lib/$(DEB_HOST_MULTIARCH)/libasound.so.2 + +install/oss4-dev:: $(CURDIR)/debian/tmp + +install/oss4-source:: $(CURDIR)/debian/tmp + +install/oss4-gtk:: $(CURDIR)/debian/tmp + +clean:: + rm -rf stamp-build-oss4 stamp-prepare-oss4 stamp-source-oss4 debian/alsa.pc \ + stamp-build-libsalsa \ + build-tree \ + debian/oss4-dkms.install debian/oss4-dkms.dkms debian/dkms/dkms.conf \ + oss-v$(UPSTREAM_VERSION)-src-gpl.tar.bz2.cdbs-config_list \ + debian/oss.conf + diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..5bfd547 --- /dev/null +++ b/debian/watch @@ -0,0 +1,3 @@ +# Run the "uscan" command to check for upstream updates and more. +version=3 +http://www.4front-tech.com/developer/sources/stable/gpl/oss-v(.+)-src-gpl\.tar\.bz2 |