i686 host but for arm architecture) you will need to call ./configure
script with additional parameters:
-CC=arm-linux-gcc ./configure --target=arm-linux
+CC=arm-linux-gcc ./configure --host=arm-linux
-In this example host where the library is build is guessed (should be
-given with --host=platform) and target for which is the library build is
-Linux on ARM architecture. You should omit setting 'CC' variable and
-cross-compiler will be guessed too.
+You can omit setting 'CC' variable and cross-compiler will be guessed too.
So simplest version would be:
-./configure --target=arm-linux
+./configure --host=arm-linux
For platform names in the form cpu-vendor-os (or aliases for this)
you should look in 'config.guess' script. Target and all paths
snd_config_t *conf;
snd_config_iterator_t i, next;
const char *sockname = NULL;
- const char *host = NULL;
long port = -1;
int err;
char *srvname;
- struct hostent *h;
+
command = argv[0];
while ((c = getopt_long(argc, argv, "h", long_options, 0)) != -1) {
switch (c) {
continue;
if (strcmp(id, "comment") == 0)
continue;
- if (strcmp(id, "host") == 0) {
- err = snd_config_get_string(n, &host);
- if (err < 0) {
- ERROR("Invalid type for %s", id);
- return 1;
- }
+ if (strcmp(id, "host") == 0)
continue;
- }
if (strcmp(id, "socket") == 0) {
err = snd_config_get_string(n, &sockname);
if (err < 0) {
ERROR("Unknown field %s", id);
return 1;
}
- if (!host) {
- ERROR("host is not defined");
- return 1;
- }
- h = gethostbyname(host);
- if (!h) {
- ERROR("Cannot resolve %s", host);
- return 1;
- }
- if (!snd_is_local(h)) {
- ERROR("%s is not the local host", host);
- return 1;
- }
if (!sockname && port < 0) {
ERROR("either socket or port need to be defined");
return 1;
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for alsa-lib 1.0.28.
+# Generated by GNU Autoconf 2.69 for alsa-lib 1.0.29.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
# Identity of this package.
PACKAGE_NAME='alsa-lib'
PACKAGE_TARNAME='alsa-lib'
-PACKAGE_VERSION='1.0.28'
-PACKAGE_STRING='alsa-lib 1.0.28'
+PACKAGE_VERSION='1.0.29'
+PACKAGE_STRING='alsa-lib 1.0.29'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures alsa-lib 1.0.28 to adapt to many kinds of systems.
+\`configure' configures alsa-lib 1.0.29 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of alsa-lib 1.0.28:";;
+ short | recursive ) echo "Configuration of alsa-lib 1.0.29:";;
esac
cat <<\_ACEOF
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-alsa-lib configure 1.0.28
+alsa-lib configure 1.0.29
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by alsa-lib $as_me 1.0.28, which was
+It was created by alsa-lib $as_me 1.0.29, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
# Define the identity of the package.
PACKAGE='alsa-lib'
- VERSION='1.0.28'
+ VERSION='1.0.29'
cat >>confdefs.h <<_ACEOF
ln -sf . "$srcdir"/include/alsa
fi
-ac_config_files="$ac_config_files Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg include/Makefile include/sound/Makefile src/Versions src/Makefile src/control/Makefile src/mixer/Makefile src/pcm/Makefile src/pcm/scopes/Makefile src/rawmidi/Makefile src/timer/Makefile src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile src/alisp/Makefile src/conf/Makefile src/conf/alsa.conf.d/Makefile src/conf/cards/Makefile src/conf/pcm/Makefile src/conf/ucm/Makefile src/conf/ucm/DAISY-I2S/Makefile src/conf/ucm/PandaBoard/Makefile src/conf/ucm/PandaBoardES/Makefile src/conf/ucm/SDP4430/Makefile src/conf/ucm/tegraalc5632/Makefile modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile alsalisp/Makefile aserver/Makefile test/Makefile test/lsb/Makefile utils/Makefile utils/alsa-lib.spec utils/alsa.pc"
+ac_config_files="$ac_config_files Makefile doc/Makefile doc/pictures/Makefile doc/doxygen.cfg include/Makefile include/sound/Makefile src/Versions src/Makefile src/control/Makefile src/mixer/Makefile src/pcm/Makefile src/pcm/scopes/Makefile src/rawmidi/Makefile src/timer/Makefile src/hwdep/Makefile src/seq/Makefile src/ucm/Makefile src/alisp/Makefile src/conf/Makefile src/conf/alsa.conf.d/Makefile src/conf/cards/Makefile src/conf/pcm/Makefile src/conf/ucm/Makefile src/conf/ucm/DAISY-I2S/Makefile src/conf/ucm/PandaBoard/Makefile src/conf/ucm/PandaBoardES/Makefile src/conf/ucm/SDP4430/Makefile src/conf/ucm/tegraalc5632/Makefile src/conf/ucm/PAZ00/Makefile src/conf/ucm/GoogleNyan/Makefile modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile alsalisp/Makefile aserver/Makefile test/Makefile test/lsb/Makefile utils/Makefile utils/alsa-lib.spec utils/alsa.pc"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by alsa-lib $as_me 1.0.28, which was
+This file was extended by alsa-lib $as_me 1.0.29, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-alsa-lib config.status 1.0.28
+alsa-lib config.status 1.0.29
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
"src/conf/ucm/PandaBoardES/Makefile") CONFIG_FILES="$CONFIG_FILES src/conf/ucm/PandaBoardES/Makefile" ;;
"src/conf/ucm/SDP4430/Makefile") CONFIG_FILES="$CONFIG_FILES src/conf/ucm/SDP4430/Makefile" ;;
"src/conf/ucm/tegraalc5632/Makefile") CONFIG_FILES="$CONFIG_FILES src/conf/ucm/tegraalc5632/Makefile" ;;
+ "src/conf/ucm/PAZ00/Makefile") CONFIG_FILES="$CONFIG_FILES src/conf/ucm/PAZ00/Makefile" ;;
+ "src/conf/ucm/GoogleNyan/Makefile") CONFIG_FILES="$CONFIG_FILES src/conf/ucm/GoogleNyan/Makefile" ;;
"modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;;
"modules/mixer/Makefile") CONFIG_FILES="$CONFIG_FILES modules/mixer/Makefile" ;;
"modules/mixer/simple/Makefile") CONFIG_FILES="$CONFIG_FILES modules/mixer/simple/Makefile" ;;
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT(alsa-lib, 1.0.28)
+AC_INIT(alsa-lib, 1.0.29)
AC_CONFIG_SRCDIR([src/control/control.c])
AC_CONFIG_MACRO_DIR([m4])
src/conf/ucm/PandaBoardES/Makefile \
src/conf/ucm/SDP4430/Makefile \
src/conf/ucm/tegraalc5632/Makefile \
+ src/conf/ucm/PAZ00/Makefile \
+ src/conf/ucm/GoogleNyan/Makefile \
modules/Makefile modules/mixer/Makefile modules/mixer/simple/Makefile \
alsalisp/Makefile aserver/Makefile \
test/Makefile test/lsb/Makefile \
alsainclude_HEADERS = asoundlib.h asoundef.h \
version.h global.h input.h output.h error.h \
- conf.h control.h iatomic.h use-case.h
+ conf.h control.h iatomic.h
if BUILD_CTL_PLUGIN_EXT
alsainclude_HEADERS += control_external.h
alsainclude_HEADERS += pcm_plugin.h
endif
if BUILD_PCM_PLUGIN_RATE
-alsainclude_HEADERS += pcm_rate.h
+alsainclude_HEADERS += pcm_rate.h
endif
if BUILD_PCM_PLUGIN_EXTPLUG
alsainclude_HEADERS += pcm_external.h pcm_extplug.h
alsainclude_HEADERS += seq_event.h seq.h seqmid.h seq_midi_event.h
endif
+if BUILD_UCM
+alsainclude_HEADERS += use-case.h
+endif
+
if BUILD_ALISP
alsainclude_HEADERS += alisp.h
endif
@BUILD_CTL_PLUGIN_EXT_TRUE@am__append_1 = control_external.h
@BUILD_PCM_TRUE@am__append_2 = pcm.h pcm_old.h timer.h
@BUILD_PCM_PLUGIN_TRUE@@BUILD_PCM_TRUE@am__append_3 = pcm_plugin.h
-@BUILD_PCM_PLUGIN_RATE_TRUE@@BUILD_PCM_TRUE@am__append_4 = pcm_rate.h
+@BUILD_PCM_PLUGIN_RATE_TRUE@@BUILD_PCM_TRUE@am__append_4 = pcm_rate.h
@BUILD_PCM_PLUGIN_EXTPLUG_TRUE@@BUILD_PCM_TRUE@am__append_5 = pcm_external.h pcm_extplug.h
@BUILD_PCM_PLUGIN_EXTPLUG_FALSE@@BUILD_PCM_PLUGIN_IOPLUG_TRUE@@BUILD_PCM_TRUE@am__append_6 = pcm_external.h
@BUILD_PCM_PLUGIN_IOPLUG_TRUE@@BUILD_PCM_TRUE@am__append_7 = pcm_ioplug.h
@BUILD_HWDEP_TRUE@am__append_9 = hwdep.h
@BUILD_MIXER_TRUE@am__append_10 = mixer.h mixer_abst.h
@BUILD_SEQ_TRUE@am__append_11 = seq_event.h seq.h seqmid.h seq_midi_event.h
-@BUILD_ALISP_TRUE@am__append_12 = alisp.h
+@BUILD_UCM_TRUE@am__append_12 = use-case.h
+@BUILD_ALISP_TRUE@am__append_13 = alisp.h
subdir = include
DIST_COMMON = $(am__alsainclude_HEADERS_DIST) $(noinst_HEADERS) \
$(srcdir)/Makefile.am $(srcdir)/Makefile.in \
esac
am__alsainclude_HEADERS_DIST = asoundlib.h asoundef.h version.h \
global.h input.h output.h error.h conf.h control.h iatomic.h \
- use-case.h control_external.h pcm.h pcm_old.h timer.h \
- pcm_plugin.h pcm_rate.h pcm_external.h pcm_extplug.h \
- pcm_ioplug.h rawmidi.h hwdep.h mixer.h mixer_abst.h \
- seq_event.h seq.h seqmid.h seq_midi_event.h alisp.h
+ control_external.h pcm.h pcm_old.h timer.h pcm_plugin.h \
+ pcm_rate.h pcm_external.h pcm_extplug.h pcm_ioplug.h rawmidi.h \
+ hwdep.h mixer.h mixer_abst.h seq_event.h seq.h seqmid.h \
+ seq_midi_event.h use-case.h alisp.h
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
sysincludedir = ${includedir}/sys
alsaincludedir = ${includedir}/alsa
alsainclude_HEADERS = asoundlib.h asoundef.h version.h global.h \
- input.h output.h error.h conf.h control.h iatomic.h use-case.h \
+ input.h output.h error.h conf.h control.h iatomic.h \
$(am__append_1) $(am__append_2) $(am__append_3) \
$(am__append_4) $(am__append_5) $(am__append_6) \
$(am__append_7) $(am__append_8) $(am__append_9) \
- $(am__append_10) $(am__append_11) $(am__append_12)
+ $(am__append_10) $(am__append_11) $(am__append_12) \
+ $(am__append_13)
noinst_HEADERS = alsa sys.h search.h list.h aserver.h local.h alsa-symbols.h \
asoundlib-head.h asoundlib-tail.h
#include "../src/control/control_local.h"
int snd_receive_fd(int sock, void *data, size_t len, int *fd);
-int snd_is_local(struct hostent *hent);
typedef enum _snd_dev_type {
SND_DEV_TYPE_PCM,
SND_HWDEP_IFACE_USX2Y_PCM, /**< Tascam US122, US224 & US428 raw USB PCM */
SND_HWDEP_IFACE_PCXHR, /**< Digigram PCXHR */
SND_HWDEP_IFACE_SB_RC, /**< SB Extigy/Audigy2NX remote control */
-
- SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_SB_RC /**< last known hwdep interface */
+ SND_HWDEP_IFACE_HDA, /**< HD-audio */
+ SND_HWDEP_IFACE_USB_STREAM, /**< direct access to usb stream */
+ SND_HWDEP_IFACE_FW_DICE, /**< TC DICE FireWire device */
+ SND_HWDEP_IFACE_FW_FIREWORKS, /**< Echo Audio Fireworks based device */
+ SND_HWDEP_IFACE_FW_BEBOB, /**< BridgeCo BeBoB based device */
+ SND_HWDEP_IFACE_FW_OXFW, /**< Oxford OXFW970/971 based device */
+
+ SND_HWDEP_IFACE_LAST = SND_HWDEP_IFACE_FW_OXFW /**< last known hwdep interface */
} snd_hwdep_iface_t;
/** open for reading */
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_count(snd_hwdep_t *hwdep);
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);
SND_PCM_FORMAT_DSD_U8,
/* Direct Stream Digital (DSD) in 2-byte samples (x16) */
SND_PCM_FORMAT_DSD_U16_LE,
- SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_DSD_U16_LE,
+ /* Direct Stream Digital (DSD) in 4-byte samples (x32) */
+ SND_PCM_FORMAT_DSD_U32_LE,
+ /* Direct Stream Digital (DSD) in 2-byte samples (x16) */
+ SND_PCM_FORMAT_DSD_U16_BE,
+ /* Direct Stream Digital (DSD) in 4-byte samples (x32) */
+ SND_PCM_FORMAT_DSD_U32_BE,
+ SND_PCM_FORMAT_LAST = SND_PCM_FORMAT_DSD_U32_BE,
#if __BYTE_ORDER == __LITTLE_ENDIAN
/** Signed 16 bit CPU endian */
SND_PCM_TSTAMP_LAST = SND_PCM_TSTAMP_ENABLE
} snd_pcm_tstamp_t;
+typedef enum _snd_pcm_tstamp_type {
+ SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /** gettimeofday equivalent */
+ SND_PCM_TSTAMP_TYPE_MONOTONIC, /** posix_clock_monotonic equivalent */
+ SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /** monotonic_raw (no NTP) */
+ SND_PCM_TSTAMP_TYPE_LAST = SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
+} snd_pcm_tstamp_type_t;
+
/** Unsigned frames quantity */
typedef unsigned long snd_pcm_uframes_t;
/** Signed frames quantity */
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_tstamp_type(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t val);
+int snd_pcm_sw_params_get_tstamp_type(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t *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_period_event(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, int val);
SNDRV_HWDEP_IFACE_SB_RC, /* SB Extigy/Audigy2NX remote control */
SNDRV_HWDEP_IFACE_HDA, /* HD-audio */
SNDRV_HWDEP_IFACE_USB_STREAM, /* direct access to usb stream */
+ SNDRV_HWDEP_IFACE_FW_DICE, /* TC DICE FireWire device */
+ SNDRV_HWDEP_IFACE_FW_FIREWORKS, /* Echo Audio Fireworks based device */
+ SNDRV_HWDEP_IFACE_FW_BEBOB, /* BridgeCo BeBoB based device */
+ SNDRV_HWDEP_IFACE_FW_OXFW, /* Oxford OXFW970/971 based device */
/* Don't forget to change the following: */
- SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_USB_STREAM
+ SNDRV_HWDEP_IFACE_LAST = SNDRV_HWDEP_IFACE_FW_OXFW
};
struct snd_hwdep_info {
* *
*****************************************************************************/
-#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 11)
+#define SNDRV_PCM_VERSION SNDRV_PROTOCOL_VERSION(2, 0, 12)
typedef unsigned long snd_pcm_uframes_t;
typedef signed long snd_pcm_sframes_t;
#define SNDRV_PCM_FORMAT_G723_24_1B ((__force snd_pcm_format_t) 45) /* 1 sample in 1 byte */
#define SNDRV_PCM_FORMAT_G723_40 ((__force snd_pcm_format_t) 46) /* 8 Samples in 5 bytes */
#define SNDRV_PCM_FORMAT_G723_40_1B ((__force snd_pcm_format_t) 47) /* 1 sample in 1 byte */
-#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_G723_40_1B
+#define SNDRV_PCM_FORMAT_DSD_U8 ((__force snd_pcm_format_t) 48) /* DSD, 1-byte samples DSD (x8) */
+#define SNDRV_PCM_FORMAT_DSD_U16_LE ((__force snd_pcm_format_t) 49) /* DSD, 2-byte samples DSD (x16), little endian */
+#define SNDRV_PCM_FORMAT_DSD_U32_LE ((__force snd_pcm_format_t) 50) /* DSD, 4-byte samples DSD (x32), little endian */
+#define SNDRV_PCM_FORMAT_DSD_U16_BE ((__force snd_pcm_format_t) 51) /* DSD, 2-byte samples DSD (x16), big endian */
+#define SNDRV_PCM_FORMAT_DSD_U32_BE ((__force snd_pcm_format_t) 52) /* DSD, 4-byte samples DSD (x32), big endian */
+#define SNDRV_PCM_FORMAT_LAST SNDRV_PCM_FORMAT_DSD_U32_BE
#ifdef SNDRV_LITTLE_ENDIAN
#define SNDRV_PCM_FORMAT_S16 SNDRV_PCM_FORMAT_S16_LE
snd_pcm_uframes_t silence_threshold; /* min distance from noise for silence filling */
snd_pcm_uframes_t silence_size; /* silence block size */
snd_pcm_uframes_t boundary; /* pointers wrap point */
- unsigned char reserved[64]; /* reserved for future */
+ unsigned int proto; /* protocol version */
+ unsigned int tstamp_type; /* timestamp type (req. proto >= 2.0.12) */
+ unsigned char reserved[56]; /* reserved for future */
};
struct snd_pcm_channel_info {
enum {
SNDRV_PCM_TSTAMP_TYPE_GETTIMEOFDAY = 0, /* gettimeofday equivalent */
SNDRV_PCM_TSTAMP_TYPE_MONOTONIC, /* posix_clock_monotonic equivalent */
- SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC,
+ SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW, /* monotonic_raw (no NTP) */
+ SNDRV_PCM_TSTAMP_TYPE_LAST = SNDRV_PCM_TSTAMP_TYPE_MONOTONIC_RAW,
};
/* channel positions */
#define SNDRV_CTL_POWER_D3hot (SNDRV_CTL_POWER_D3|0x0000) /* Off, with power */
#define SNDRV_CTL_POWER_D3cold (SNDRV_CTL_POWER_D3|0x0001) /* Off, without power */
+#define SNDRV_CTL_ELEM_ID_NAME_MAXLEN 44
+
struct snd_ctl_elem_id {
unsigned int numid; /* numeric identifier, zero = invalid */
snd_ctl_elem_iface_t iface; /* interface identifier */
* \param value Value pointer
* \return Zero if success, otherwise a negative error code
*
- * Note: String is dynamically allocated, use free() to
- * deallocate this string.
+ * Note: The returned string is dynamically allocated, use free() to
+ * deallocate this string. (Yes, the value parameter shouldn't be marked as
+ * "const", but it's too late to fix it, sorry about that.)
*
* Known identifiers:
* NULL - return current card
* Recommended names for values:
* TQ - Tone Quality
* PlaybackPCM - full PCM playback device name
+ * PlaybackPCMIsDummy - Valid values: "yes" and "no". If set to "yes", the
+ * PCM named by the PlaybackPCM value is a dummy device,
+ * meaning that opening it enables an audio path in the
+ * hardware, but writing to the PCM device has no
+ * effect.
* CapturePCM - full PCM capture device name
+ * CapturePCMIsDummy - Valid values: "yes" and "no". If set to "yes", the
+ * PCM named by the CapturePCM value is a dummy device,
+ * meaning that opening it enables an audio path in the
+ * hardware, but reading from the PCM device has no
+ * effect.
* PlaybackRate - playback device sample rate
* PlaybackChannels - playback device channel count
* PlaybackCTL - playback control device name
#define SND_LIB_MAJOR 1 /**< major number of library version */
#define SND_LIB_MINOR 0 /**< minor number of library version */
-#define SND_LIB_SUBMINOR 28 /**< subminor number of library version */
+#define SND_LIB_SUBMINOR 29 /**< 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.28"
+#define SND_LIB_VERSION_STR "1.0.29"
#! /bin/sh
# libtool - Provide generalized library-building support services.
-# Generated automatically by config.status (alsa-lib) 1.0.28
+# Generated automatically by config.status (alsa-lib) 1.0.29
# Libtool was configured on host alsa.alsa-project.org:
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
if (ctype != SND_CTL_ELEM_TYPE_BOOLEAN) {
__invalid_type:
snd_mixer_selem_id_free(id);
+ free(hsimple);
return -EINVAL;
}
break;
snd_config_iterator_t i, next;
if (snd_config_get_type(func_conf) != SND_CONFIG_TYPE_COMPOUND) {
SNDERR("Invalid type for func %s definition", str);
+ err = -EINVAL;
goto _err;
}
snd_config_for_each(i, next, func_conf) {
<confdir:pcm/surround41.conf>
<confdir:pcm/surround50.conf>
<confdir:pcm/surround51.conf>
+<confdir:pcm/surround71.conf>
ICE1712.pcm.surround51.0 {
@args [ CARD ]
slave.channels 10
}
+ICE1712.pcm.surround71.0 {
+ @args [ CARD ]
+ @args.CARD {
+ type string
+ }
+ type route
+ ttable.0.0 1
+ ttable.1.1 1
+ ttable.2.2 1
+ ttable.3.3 1
+ ttable.4.4 1
+ ttable.5.5 1
+ ttable.6.6 1
+ ttable.7.7 1
+ slave.pcm {
+ type hw
+ card $CARD
+ }
+ slave.channels 10
+}
+
<confdir:pcm/iec958.conf>
ICE1712.pcm.iec958.0 {
"OmniStudio" two_stereo_devices
"Quattro" two_stereo_devices
"SB Audigy 2 NX" six_channels
+ "USB AudioSport Quattro (tm)" two_stereo_devices
}
# If a device does not use the first PCM device for digital data, the device
# "NoiseBlaster 3000" 42
# The below don't have digital in/out, so prevent them from being opened.
+ "Andrea PureAudio USB-SA Headset" 999
"Blue Snowball" 999
"HP Digital Stereo Headset" 999
+ "GN 9330" 999
"Logitech Speaker Lapdesk N700" 999
+ "Logitech G35 Headset" 999
"Logitech USB Headset" 999
+ "Logitech USB Headset H540" 999
"Logitech Wireless Headset" 999
"Plantronics GameCom 780" 999
"Plantronics USB Headset" 999
"Plantronics Wireless Audio" 999
"SB WoW Headset" 999
"Scarlett 2i2 USB" 999
+ "Scarlett 2i4 USB" 999
"Sennheiser USB headset" 999
+ "SWTOR Gaming Headset by Razer" 999
"USB Device 0x46d:0x992" 999
}
+# Second iec958 device number, if any.
+USB-Audio.pcm.iec958_2_device {
+ "PHIREE U2" 1 # 0 = PCM S/PDIF, 1 = non-PCM S/PDIF
+}
+
# If a device requires non-standard definitions for front, surround40,
# surround51, surround71 or iec958, they can be defined here.
}
}
+USB-Audio.pcm.iec958.1 {
+ @args [ CARD AES0 AES1 AES2 AES3 ]
+ @args.CARD { type string }
+ @args.AES0 { type integer }
+ @args.AES1 { type integer }
+ @args.AES2 { type integer }
+ @args.AES3 { type integer }
+ @func refer
+ name {
+ @func concat
+ strings [
+ "cards.USB-Audio."
+ { @func card_name card $CARD }
+ ".pcm.iec958_2:CARD=" $CARD
+ ",AES0=" $AES0 ",AES1=" $AES1 ",AES2=" $AES2 ",AES3=" $AES3
+ ]
+ }
+ default {
+ # FIXME: we cannot set the AES parameters
+ type hw
+ card $CARD
+ device {
+ @func refer
+ name {
+ @func concat
+ strings [
+ "cards.USB-Audio.pcm.iec958_2_device."
+ { @func card_name card $CARD }
+ ]
+ }
+ default 999
+ }
+ }
+}
+
# vim: ft=alsaconf
--- /dev/null
+Comment "Nyan internal card"
+SectionUseCase."HiFi" {
+ File "HiFi.conf"
+ Comment "Default"
+}
--- /dev/null
+SectionVerb {
+ EnableSequence [
+ cdev "hw:GoogleNyan"
+ cset "name='Left Speaker Mixer Left DAC Switch' on"
+ cset "name='Right Speaker Mixer Right DAC Switch' on"
+ cset "name='Headphone Left Switch' on"
+ cset "name='Headphone Right Switch' on"
+ cset "name='Digital EQ 3 Band Switch' off"
+ cset "name='Digital EQ 5 Band Switch' off"
+ cset "name='Digital EQ 7 Band Switch' off"
+ cset "name='Biquad Switch' off"
+ cset "name='Filter Mode' Music"
+ cset "name='ADC Oversampling Rate' 0"
+ cset "name='DMIC Mux' DMIC"
+ cset "name='MIC2 Mux' IN34"
+ cset "name='Right ADC Mixer MIC2 Switch' on"
+ cset "name='Left ADC Mixer MIC2 Switch' on"
+ cset "name='MIC2 Volume' 10"
+ cset "name='MIC2 Boost Volume' 0"
+ cset "name='Mic Jack Switch' off"
+ cset "name='Int Mic Switch' on"
+ cset "name='ADCR Boost Volume' 4"
+ cset "name='ADCL Boost Volume' 4"
+ cset "name='ADCR Volume' 11"
+ cset "name='ADCL Volume' 11"
+ cset "name='Left Speaker Mixer Left DAC Switch' on"
+ cset "name='Right Speaker Mixer Right DAC Switch' on"
+ cset "name='Speaker Left Mixer Volume' 2"
+ cset "name='Speaker Right Mixer Volume' 2"
+ cset "name='Record Path DC Blocking' on"
+ cset "name='Playback Path DC Blocking' on"
+ cset "name='Headphone Left Switch' on"
+ cset "name='Headphone Right Switch' on"
+ cset "name='Headphones Switch' off"
+ cset "name='Speaker Left Switch' on"
+ cset "name='Speaker Right Switch' on"
+ cset "name='Speakers Switch' on"
+ ]
+ DisableSequence [
+ ]
+}
+
+SectionDevice."Headphone".0 {
+ Value {
+ OutputDspName ""
+ }
+ EnableSequence [
+ cdev "hw:GoogleNyan"
+ cset "name='Speakers Switch' off"
+ cset "name='Headphones Switch' on"
+ ]
+ DisableSequence [
+ cdev "hw:GoogleNyan"
+ cset "name='Headphones Switch' off"
+ cset "name='Speakers Switch' on"
+ ]
+}
+
+SectionDevice."Mic".0 {
+ Value {
+ CaptureControl "MIC2"
+ }
+ EnableSequence [
+ cdev "hw:GoogleNyan"
+ cset "name='Int Mic Switch' off"
+ cset "name='DMIC Mux' ADC"
+ cset "name='Mic Jack Switch' on"
+ cset "name='Record Path DC Blocking' on"
+ ]
+ DisableSequence [
+ cdev "hw:GoogleNyan"
+ cset "name='Mic Jack Switch' off"
+ cset "name='DMIC Mux' DMIC"
+ cset "name='Int Mic Switch' on"
+ cset "name='Record Path DC Blocking' off"
+ ]
+}
--- /dev/null
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/GoogleNyan
+ucm_DATA = GoogleNyan.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
--- /dev/null
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/conf/ucm/GoogleNyan
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(ucmdir)"
+DATA = $(ucm_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALSA_CONFIG_DIR = @ALSA_CONFIG_DIR@
+ALSA_DEPLIBS = @ALSA_DEPLIBS@
+ALSA_PKGCONF_DIR = @ALSA_PKGCONF_DIR@
+ALSA_PLUGIN_DIR = @ALSA_PLUGIN_DIR@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_VERSION_INFO = @LIBTOOL_VERSION_INFO@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SND_LIB_EXTRAVER = @SND_LIB_EXTRAVER@
+SND_LIB_MAJOR = @SND_LIB_MAJOR@
+SND_LIB_MINOR = @SND_LIB_MINOR@
+SND_LIB_SUBMINOR = @SND_LIB_SUBMINOR@
+SND_LIB_VERSION = @SND_LIB_VERSION@
+STRIP = @STRIP@
+SYMBOL_PREFIX = @SYMBOL_PREFIX@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/GoogleNyan
+ucm_DATA = GoogleNyan.conf HiFi.conf
+EXTRA_DIST = $(ucm_DATA)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/conf/ucm/GoogleNyan/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/conf/ucm/GoogleNyan/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-ucmDATA: $(ucm_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(ucm_DATA)'; test -n "$(ucmdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(ucmdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(ucmdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ucmdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(ucmdir)" || exit $$?; \
+ done
+
+uninstall-ucmDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(ucm_DATA)'; test -n "$(ucmdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(ucmdir)'; $(am__uninstall_files_from_dir)
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(ucmdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-ucmDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-ucmDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ install-ucmDATA installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ uninstall uninstall-am uninstall-ucmDATA
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
-SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632
+SUBDIRS=DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 PAZ00 GoogleNyan
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
-SUBDIRS = DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632
+SUBDIRS = DAISY-I2S PandaBoard PandaBoardES SDP4430 tegraalc5632 PAZ00 GoogleNyan
all: all-recursive
.SUFFIXES:
--- /dev/null
+SectionVerb {
+ EnableSequence [
+ cdev "hw:PAZ00"
+
+ cset "name='Speaker Playback Switch' on"
+ cset "name='Int Spk Switch' on"
+ cset "name='Speaker Mix DAC2SPK Playback Switch' on"
+ ]
+ DisableSequence [
+ cset "name='Speaker Playback Switch' off"
+ cset "name='Int Spk Switch' off"
+ cset "name='Speaker Mix DAC2SPK Playback Switch' off"
+ ]
+}
+
+SectionDevice."Headset".0 {
+ Comment "3.5mm Headset"
+
+ Value {
+ JackName "Paz00 Headset Jack"
+ }
+
+ EnableSequence [
+ cdev "hw:PAZ00"
+
+ # Internal speaker
+ cset "name='Int Spk Switch' off"
+
+ # Headphones
+ cset "name='Headphone Playback Switch' on"
+ cset "name='HPL Mix DACL2HP Playback Switch' on"
+ cset "name='HPR Mix DACR2HP Playback Switch' on"
+ ]
+ DisableSequence [
+ cdev "hw:PAZ00"
+
+ # Headphones
+ cset "name='Headphone Playback Switch' off"
+ cset "name='HPL Mix DACL2HP Playback Switch' off"
+ cset "name='HPR Mix DACR2HP Playback Switch' off"
+
+ # Internal speaker
+ cset "name='Int Spk Switch' on"
+ ]
+}
--- /dev/null
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/PAZ00
+ucm_DATA = PAZ00.conf HiFi.conf Record.conf
+EXTRA_DIST = $(ucm_DATA)
--- /dev/null
+# Makefile.in generated by automake 1.12.2 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = src/conf/ucm/PAZ00
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+ $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/include/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(ucmdir)"
+DATA = $(ucm_DATA)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALSA_CONFIG_DIR = @ALSA_CONFIG_DIR@
+ALSA_DEPLIBS = @ALSA_DEPLIBS@
+ALSA_PKGCONF_DIR = @ALSA_PKGCONF_DIR@
+ALSA_PLUGIN_DIR = @ALSA_PLUGIN_DIR@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_VERSION_INFO = @LIBTOOL_VERSION_INFO@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PYTHON_INCLUDES = @PYTHON_INCLUDES@
+PYTHON_LIBS = @PYTHON_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SND_LIB_EXTRAVER = @SND_LIB_EXTRAVER@
+SND_LIB_MAJOR = @SND_LIB_MAJOR@
+SND_LIB_MINOR = @SND_LIB_MINOR@
+SND_LIB_SUBMINOR = @SND_LIB_SUBMINOR@
+SND_LIB_VERSION = @SND_LIB_VERSION@
+STRIP = @STRIP@
+SYMBOL_PREFIX = @SYMBOL_PREFIX@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+alsaconfigdir = @ALSA_CONFIG_DIR@
+ucmdir = $(alsaconfigdir)/ucm/PAZ00
+ucm_DATA = PAZ00.conf HiFi.conf Record.conf
+EXTRA_DIST = $(ucm_DATA)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/conf/ucm/PAZ00/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign src/conf/ucm/PAZ00/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+install-ucmDATA: $(ucm_DATA)
+ @$(NORMAL_INSTALL)
+ @list='$(ucm_DATA)'; test -n "$(ucmdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(ucmdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(ucmdir)" || exit 1; \
+ fi; \
+ for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ echo "$$d$$p"; \
+ done | $(am__base_list) | \
+ while read files; do \
+ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(ucmdir)'"; \
+ $(INSTALL_DATA) $$files "$(DESTDIR)$(ucmdir)" || exit $$?; \
+ done
+
+uninstall-ucmDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(ucm_DATA)'; test -n "$(ucmdir)" || list=; \
+ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+ dir='$(DESTDIR)$(ucmdir)'; $(am__uninstall_files_from_dir)
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(ucmdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-ucmDATA
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-ucmDATA
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ distclean distclean-generic distclean-libtool distdir dvi \
+ dvi-am html html-am info info-am install install-am \
+ install-data install-data-am install-dvi install-dvi-am \
+ install-exec install-exec-am install-html install-html-am \
+ install-info install-info-am install-man install-pdf \
+ install-pdf-am install-ps install-ps-am install-strip \
+ install-ucmDATA installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ uninstall uninstall-am uninstall-ucmDATA
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
--- /dev/null
+Comment "PAZ00 alc5632"
+
+ValueDefaults {
+ PlaybackCTL "hw:0"
+ CaptureCTL "hw:0"
+}
+
+SectionDefaults [
+ cdev "hw:PAZ00"
+
+ cset "name='Master Playback Switch' on"
+ cset "name='Master Playback Volume' 44,44"
+ cset "name='Headphone Playback Volume' 21,21"
+ cset "name='Speaker Playback Volume' 21,21"
+ cset "name='SpeakerOut Mux' 2"
+ cset "name='SpeakerOut N Mux' LN/-R"
+ cset "name='AB-D Amp Mux' 0"
+ cset "name='Left Headphone Mux' 1"
+ cset "name='Right Headphone Mux' 1"
+ cset "name='DMIC Boost Capture Volume' 4"
+ cset "name='Rec Capture Volume' 24"
+
+ # Fix external mic record volumes
+ cset "name='Mic 1 Boost Volume' 0"
+ cset "name='Mic 2 Boost Volume' 0"
+ cset "name='Mic1 Playback Volume' 0"
+ cset "name='Mic2 Playback Volume' 0"
+ cset "name='Rec Capture Volume' 0"
+]
+
+SectionUseCase."HiFi" {
+ File "HiFi.conf"
+ Comment "Music playback"
+}
+
+SectionUseCase."Record" {
+ File "Record.conf"
+ Comment "Playback and capture"
+}
--- /dev/null
+SectionVerb {
+ EnableSequence [
+ cdev "hw:PAZ00"
+
+ cset "name='Speaker Playback Switch' on"
+ cset "name='Int Spk Switch' on"
+ cset "name='Speaker Mix DAC2SPK Playback Switch' on"
+
+ cset "name='DMICL Mix DMICL2ADC Capture Switch' on"
+ cset "name='DMIC En Capture Switch' on"
+ cset "name='DMIC PreFilter Capture Switch' on"
+ ]
+ DisableSequence [
+ cset "name='Speaker Playback Switch' off"
+ cset "name='Int Spk Switch' off"
+ cset "name='Speaker Mix DAC2SPK Playback Switch' off"
+
+ cset "name='DMICL Mix DMICL2ADC Capture Switch' off"
+ cset "name='DMIC En Capture Switch' off"
+ cset "name='DMIC PreFilter Capture Switch' off"
+ ]
+}
+
+SectionDevice."Headset".0 {
+ Comment "3.5mm Headset"
+
+ Value {
+ JackName "Paz00 Headset Jack"
+ }
+
+ EnableSequence [
+ cdev "hw:PAZ00"
+
+ # Internal speaker
+ cset "name='Int Spk Switch' off"
+
+ # Internal mic
+ cset "name='DMIC En Capture Switch' off"
+
+ # Headphones
+ cset "name='Headphone Playback Switch' on"
+ cset "name='HPL Mix DACL2HP Playback Switch' on"
+ cset "name='HPR Mix DACR2HP Playback Switch' on"
+
+ # External min
+ cset "name='Left Capture Mix MIC12REC_L Capture Switch' on"
+ ]
+ DisableSequence [
+ cdev "hw:PAZ00"
+
+ # Headphones
+ cset "name='Headphone Playback Switch' off"
+ cset "name='HPL Mix DACL2HP Playback Switch' off"
+ cset "name='HPR Mix DACR2HP Playback Switch' off"
+
+ # External mic
+ cset "name='Left Capture Mix MIC12REC_L Capture Switch' on"
+
+ # Internal speaker
+ cset "name='Int Spk Switch' on"
+
+ # Internal mic
+ cset "name='DMIC En Capture Switch' on"
+ ]
+}
/**
* \brief Ask to be informed about events (poll, #snd_async_add_ctl_handler, #snd_ctl_read)
* \param ctl CTL handle
- * \param subscribe 0 = unsubscribe, 1 = subscribe
+ * \param subscribe 0 = unsubscribe, 1 = subscribe, -1 = check subscribe or not
* \return 0 on success otherwise a negative error code
*/
int snd_ctl_subscribe_events(snd_ctl_t *ctl, int subscribe)
if (err >= 0) {
if (snd_config_get_type(type_conf) != SND_CONFIG_TYPE_COMPOUND) {
SNDERR("Invalid type for CTL type %s definition", str);
+ err = -EINVAL;
goto _err;
}
snd_config_for_each(i, next, type_conf) {
return sock;
}
-#if 0
-static int make_inet_socket(const char *host, int port)
-{
- struct sockaddr_in addr;
- int sock;
- struct hostent *h = gethostbyname(host);
- if (!h)
- return -ENOENT;
-
- sock = socket(PF_INET, SOCK_STREAM, 0);
- if (sock < 0)
- return -errno;
-
- addr.sin_family = AF_INET;
- addr.sin_port = htons(port);
- memcpy(&addr.sin_addr, h->h_addr_list[0], sizeof(struct in_addr));
-
- if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0)
- return -errno;
- return sock;
-}
-#endif
-
int snd_ctl_shm_open(snd_ctl_t **handlep, const char *name, const char *sockname, const char *sname, int mode)
{
snd_ctl_t *ctl;
const char *server = NULL;
const char *ctl_name = NULL;
snd_config_t *sconfig;
- const char *host = NULL;
const char *sockname = NULL;
long port = -1;
int err;
- int local;
- struct hostent *h;
+
snd_config_for_each(i, next, conf) {
snd_config_t *n = snd_config_iterator_entry(i);
const char *id;
continue;
if (strcmp(id, "comment") == 0)
continue;
- if (strcmp(id, "host") == 0) {
- err = snd_config_get_string(n, &host);
- if (err < 0) {
- SNDERR("Invalid type for %s", id);
- goto _err;
- }
+ if (strcmp(id, "host") == 0)
continue;
- }
if (strcmp(id, "socket") == 0) {
err = snd_config_get_string(n, &sockname);
if (err < 0) {
goto _err;
}
- if (!host) {
- SNDERR("host is not defined");
- goto _err;
- }
if (!sockname) {
SNDERR("socket is not defined");
goto _err;
}
- h = gethostbyname(host);
- if (!h) {
- SNDERR("Cannot resolve %s", host);
- goto _err;
- }
- local = snd_is_local(h);
- if (!local) {
- SNDERR("%s is not the local host", host);
- goto _err;
- }
err = snd_ctl_shm_open(handlep, name, sockname, ctl_name, mode);
_err:
snd_config_delete(sconfig);
goto out;
s = p;
- val = strtol(s, &p, 10);
+ val = strtol(s, &p, 0);
if (*p == '.') {
p++;
strtol(p, &p, 10);
goto out;
s = p;
- val = strtol(s, &p, 10);
+ val = strtol(s, &p, 0);
if (*p == '.') {
p++;
strtol(p, &p, 10);
}
#endif
#ifdef HAVE_LIBDL
+#ifdef VERSIONED_SYMBOLS
if (version) {
err = snd_dlsym_verify(handle, name, version);
if (err < 0)
return NULL;
}
+#endif
return dlsym(handle, name);
#else
return NULL;
free(c);
}
- unlock:
snd_dlobj_unlock();
}
#endif
if (err < 0)
return err;
err = snd_mixer_attach_hctl(mixer, hctl);
- if (err < 0) {
- snd_hctl_close(hctl);
+ if (err < 0)
return err;
- }
return 0;
}
* \param mixer Mixer handle
* \param hctl the HCTL to be attached
* \return 0 on success otherwise a negative error code
+ *
+ * Upon error, this function closes the given hctl handle automatically.
*/
int snd_mixer_attach_hctl(snd_mixer_t *mixer, snd_hctl_t *hctl)
{
assert(hctl);
slave = calloc(1, sizeof(*slave));
- if (slave == NULL)
+ if (slave == NULL) {
+ snd_hctl_close(hctl);
return -ENOMEM;
+ }
err = snd_hctl_nonblock(hctl, 1);
if (err < 0) {
snd_hctl_close(hctl);
#ifdef HAVE_LIBDL
int snd_mixer_simple_basic_register(snd_mixer_t *mixer, struct snd_mixer_selem_regopt *options, snd_mixer_class_t **classp);
#else
-static inline int snd_mixer_simple_basic_register(snd_mixer_t *mixer,
- struct snd_mixer_selem_regopt *options,
- snd_mixer_class_t **classp)
+static inline int snd_mixer_simple_basic_register(snd_mixer_t *mixer ATTRIBUTE_UNUSED,
+ struct snd_mixer_selem_regopt *options ATTRIBUTE_UNUSED,
+ snd_mixer_class_t **classp ATTRIBUTE_UNUSED)
{
return -ENXIO;
}
#include <fcntl.h>
#include <sys/ioctl.h>
#include <math.h>
+#include "config.h"
#include "mixer_local.h"
#include "mixer_simple.h"
void *h;
int err = 0;
+ if (!lib)
+ return -ENXIO;
path = getenv("ALSA_MIXER_SIMPLE_MODULES");
if (!path)
path = SO_PATH;
#include <math.h>
#include <limits.h>
#include <alsa/asoundlib.h>
-#include "mixer_simple.h"
#include "config.h"
+#include "mixer_simple.h"
#ifndef DOC_HIDDEN
if (err < 0)
return err;
pcm->tstamp_mode = params->tstamp_mode;
+ pcm->tstamp_type = params->tstamp_type;
pcm->period_step = params->period_step;
pcm->avail_min = params->avail_min;
pcm->period_event = sw_get_period_event(params);
#define XRUN(v) [SND_PCM_XRUN_##v] = #v
#define SILENCE(v) [SND_PCM_SILENCE_##v] = #v
#define TSTAMP(v) [SND_PCM_TSTAMP_##v] = #v
+#define TSTAMP_TYPE(v) [SND_PCM_TSTAMP_TYPE_##v] = #v
#define ACCESS(v) [SND_PCM_ACCESS_##v] = #v
#define START(v) [SND_PCM_START_##v] = #v
#define HW_PARAM(v) [SND_PCM_HW_PARAM_##v] = #v
FORMAT(G723_40_1B),
FORMAT(DSD_U8),
FORMAT(DSD_U16_LE),
+ FORMAT(DSD_U32_LE),
+ FORMAT(DSD_U16_BE),
+ FORMAT(DSD_U32_BE),
};
static const char *const snd_pcm_format_aliases[SND_PCM_FORMAT_LAST+1] = {
FORMATD(G723_40_1B, "G.723 (ADPCM) 40 kbit/s, 1 sample in 1 byte"),
FORMATD(DSD_U8, "Direct Stream Digital, 1-byte (x8), oldest bit in MSB"),
FORMATD(DSD_U16_LE, "Direct Stream Digital, 2-byte (x16), little endian, oldest bits in MSB"),
+ FORMATD(DSD_U32_LE, "Direct Stream Digital, 4-byte (x32), little endian, oldest bits in MSB"),
+ FORMATD(DSD_U16_BE, "Direct Stream Digital, 2-byte (x16), big endian, oldest bits in MSB"),
+ FORMATD(DSD_U32_BE, "Direct Stream Digital, 4-byte (x32), big endian, oldest bits in MSB"),
};
static const char *const snd_pcm_type_names[] = {
TSTAMP(NONE),
TSTAMP(ENABLE),
};
+
+static const char *const snd_pcm_tstamp_type_names[] = {
+ TSTAMP_TYPE(GETTIMEOFDAY),
+ TSTAMP_TYPE(MONOTONIC),
+ TSTAMP_TYPE(MONOTONIC_RAW),
+};
#endif
/**
}
/**
+ * \brief get name of PCM tstamp type setting
+ * \param mode PCM tstamp type
+ * \return ascii name of PCM tstamp type setting
+ */
+const char *snd_pcm_tstamp_type_name(snd_pcm_tstamp_type_t type)
+{
+ if (type > SND_PCM_TSTAMP_TYPE_LAST)
+ return NULL;
+ return snd_pcm_tstamp_type_names[type];
+}
+
+/**
* \brief get name of PCM state
* \param state PCM state
* \return ascii name of PCM state
return -EIO;
}
snd_output_printf(out, " tstamp_mode : %s\n", snd_pcm_tstamp_mode_name(pcm->tstamp_mode));
+ snd_output_printf(out, " tstamp_type : %s\n", snd_pcm_tstamp_type_name(pcm->tstamp_type));
snd_output_printf(out, " period_step : %d\n", pcm->period_step);
snd_output_printf(out, " avail_min : %ld\n", pcm->avail_min);
snd_output_printf(out, " period_event : %i\n", pcm->period_event);
if (err >= 0) {
if (snd_config_get_type(type_conf) != SND_CONFIG_TYPE_COMPOUND) {
SNDERR("Invalid type for PCM type %s definition", str);
+ err = -EINVAL;
goto _err;
}
snd_config_for_each(i, next, type_conf) {
SNDMSG("PCM not set up");
return -EIO;
}
+ params->proto = SNDRV_PCM_VERSION;
params->tstamp_mode = pcm->tstamp_mode;
+ params->tstamp_type = pcm->tstamp_type;
params->period_step = pcm->period_step;
params->sleep_min = 0;
params->avail_min = pcm->avail_min;
int snd_pcm_sw_params_dump(snd_pcm_sw_params_t *params, snd_output_t *out)
{
snd_output_printf(out, "tstamp_mode: %s\n", snd_pcm_tstamp_mode_name(params->tstamp_mode));
+ snd_output_printf(out, "tstamp_type: %s\n", snd_pcm_tstamp_type_name(params->tstamp_type));
snd_output_printf(out, "period_step: %u\n", params->period_step);
snd_output_printf(out, "avail_min: %lu\n", params->avail_min);
snd_output_printf(out, "start_threshold: %ld\n", params->start_threshold);
}
/**
+ * \brief Set timestamp type inside a software configuration container
+ * \param pcm PCM handle
+ * \param params Software configuration container
+ * \param val Timestamp type
+ * \return 0 otherwise a negative error code
+ */
+int snd_pcm_sw_params_set_tstamp_type(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t val)
+{
+ assert(pcm && params);
+ if (CHECK_SANITY(val > SND_PCM_TSTAMP_TYPE_LAST)) {
+ SNDMSG("invalid tstamp_type value %d", val);
+ return -EINVAL;
+ }
+ params->tstamp_type = val;
+ return 0;
+}
+
+/**
+ * \brief Get timestamp type from a software configuration container
+ * \param params Software configuration container
+ * \param val Returned timestamp type
+ * \return 0 otherwise a negative error code
+ */
+int snd_pcm_sw_params_get_tstamp_type(const snd_pcm_sw_params_t *params, snd_pcm_tstamp_type_t *val)
+{
+ assert(params && val);
+ *val = params->tstamp_type;
+ return 0;
+}
+
+/**
* \brief (DEPRECATED) Set minimum number of ticks to sleep inside a software configuration container
* \param pcm PCM handle
* \param params Software configuration container
return -ENOMEM;
}
if (map->pos[i] & SND_CHMAP_DRIVER_SPEC)
- len += snprintf(buf + len, maxlen, "%d", p);
+ len += snprintf(buf + len, maxlen - len, "%d", p);
else {
const char *name = chmap_names[p];
if (name)
pcm->private_data = adpcm;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &adpcm->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &adpcm->plug.appl_ptr, -1, 0);
*pcmp = pcm;
pcm->private_data = alaw;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &alaw->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &alaw->plug.appl_ptr, -1, 0);
*pcmp = pcm;
pcm->private_data = copy;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, ©->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, ©->plug.appl_ptr, -1, 0);
*pcmp = pcm;
COPY_SLAVE(period_time);
COPY_SLAVE(periods);
COPY_SLAVE(tstamp_mode);
+ COPY_SLAVE(tstamp_type);
COPY_SLAVE(period_step);
COPY_SLAVE(avail_min);
COPY_SLAVE(start_threshold);
COPY_SLAVE(buffer_time);
COPY_SLAVE(sample_bits);
COPY_SLAVE(frame_bits);
- COPY_SLAVE(monotonic);
}
#undef COPY_SLAVE
dmix->timer_events = (1<<SND_TIMER_EVENT_MSUSPEND) |
(1<<SND_TIMER_EVENT_MRESUME) |
+ (1<<SND_TIMER_EVENT_MSTOP) |
(1<<SND_TIMER_EVENT_STOP);
/*
COPY_SLAVE(period_time);
COPY_SLAVE(periods);
COPY_SLAVE(tstamp_mode);
+ COPY_SLAVE(tstamp_type);
COPY_SLAVE(period_step);
COPY_SLAVE(avail_min);
COPY_SLAVE(start_threshold);
COPY_SLAVE(buffer_time);
COPY_SLAVE(sample_bits);
COPY_SLAVE(frame_bits);
- COPY_SLAVE(monotonic);
spcm->info &= ~SND_PCM_INFO_PAUSE;
spcm->boundary = recalc_boundary_size(dmix->shmptr->s.boundary, spcm->buffer_size);
unsigned int period_size;
unsigned int period_time;
snd_interval_t periods;
- unsigned int monotonic;
snd_pcm_tstamp_t tstamp_mode;
+ snd_pcm_tstamp_type_t tstamp_type;
unsigned int period_step;
unsigned int sleep_min; /* not used */
unsigned int avail_min;
dmix->avail_max = avail;
if (avail >= pcm->stop_threshold) {
snd_timer_stop(dmix->timer);
- gettimestamp(&dmix->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&dmix->trigger_tstamp, pcm->tstamp_type);
if (dmix->state == SND_PCM_STATE_RUNNING) {
dmix->state = SND_PCM_STATE_XRUN;
return -EPIPE;
memset(status, 0, sizeof(*status));
status->state = snd_pcm_dmix_state(pcm);
status->trigger_tstamp = dmix->trigger_tstamp;
- gettimestamp(&status->tstamp, pcm->monotonic);
+ gettimestamp(&status->tstamp, pcm->tstamp_type);
status->avail = snd_pcm_mmap_playback_avail(pcm);
status->avail_max = status->avail > dmix->avail_max ? status->avail : dmix->avail_max;
dmix->avail_max = 0;
return err;
snd_pcm_dmix_sync_area(pcm);
}
- gettimestamp(&dmix->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&dmix->trigger_tstamp, pcm->tstamp_type);
return 0;
}
static snd_pcm_sframes_t snd_pcm_dmix_rewindable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_hw_avail(pcm);
+ return snd_pcm_mmap_playback_hw_rewindable(pcm);
}
static snd_pcm_sframes_t snd_pcm_dmix_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
snd_pcm_direct_t *dmix = pcm->private_data;
snd_pcm_uframes_t slave_appl_ptr, slave_size;
snd_pcm_uframes_t appl_ptr, size, transfer, result;
+ int err;
const snd_pcm_channel_area_t *src_areas, *dst_areas;
if (dmix->state == SND_PCM_STATE_RUNNING ||
- dmix->state == SND_PCM_STATE_DRAINING)
- return snd_pcm_dmix_hwsync(pcm);
+ dmix->state == SND_PCM_STATE_DRAINING) {
+ err = snd_pcm_dmix_hwsync(pcm);
+ if (err < 0)
+ return err;
+ }
if (dmix->last_appl_ptr < dmix->appl_ptr)
size = dmix->appl_ptr - dmix->last_appl_ptr;
{
snd_pcm_sframes_t avail;
- avail = snd_pcm_mmap_playback_avail(pcm);
- if (avail < 0)
- return 0;
+ avail = snd_pcm_dmix_forwardable(pcm);
if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_forward(pcm, frames);
pcm->poll_fd = dmix->poll_fd;
pcm->poll_events = POLLIN; /* it's different than other plugins */
- pcm->monotonic = spcm->monotonic;
+ pcm->tstamp_type = spcm->tstamp_type;
pcm->mmap_rw = 1;
snd_pcm_set_hw_ptr(pcm, &dmix->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &dmix->appl_ptr, -1, 0);
dshare->avail_max = avail;
if (avail >= pcm->stop_threshold) {
snd_timer_stop(dshare->timer);
- gettimestamp(&dshare->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&dshare->trigger_tstamp, pcm->tstamp_type);
if (dshare->state == SND_PCM_STATE_RUNNING) {
dshare->state = SND_PCM_STATE_XRUN;
return -EPIPE;
memset(status, 0, sizeof(*status));
status->state = snd_pcm_state(dshare->spcm);
status->trigger_tstamp = dshare->trigger_tstamp;
- gettimestamp(&status->tstamp, pcm->monotonic);
+ gettimestamp(&status->tstamp, pcm->tstamp_type);
status->avail = snd_pcm_mmap_playback_avail(pcm);
status->avail_max = status->avail > dshare->avail_max ? status->avail : dshare->avail_max;
dshare->avail_max = 0;
return err;
snd_pcm_dshare_sync_area(pcm);
}
- gettimestamp(&dshare->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&dshare->trigger_tstamp, pcm->tstamp_type);
return 0;
}
static snd_pcm_sframes_t snd_pcm_dshare_rewindable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_playback_hw_avail(pcm);
+ return snd_pcm_mmap_playback_hw_rewindable(pcm);
}
static snd_pcm_sframes_t snd_pcm_dshare_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_sframes_t avail;
- avail = snd_pcm_mmap_playback_hw_avail(pcm);
- if (avail < 0)
- return 0;
+ avail = snd_pcm_dshare_rewindable(pcm);
if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_backward(pcm, frames);
{
snd_pcm_sframes_t avail;
- avail = snd_pcm_mmap_playback_avail(pcm);
- if (avail < 0)
- return 0;
+ avail = snd_pcm_dshare_forwardable(pcm);
if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_forward(pcm, frames);
pcm->poll_fd = dshare->poll_fd;
pcm->poll_events = POLLIN; /* it's different than other plugins */
- pcm->monotonic = spcm->monotonic;
+ pcm->tstamp_type = spcm->tstamp_type;
pcm->mmap_rw = 1;
snd_pcm_set_hw_ptr(pcm, &dshare->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &dshare->appl_ptr, -1, 0);
if (pcm->stop_threshold >= pcm->boundary) /* don't care */
return 0;
if ((avail = snd_pcm_mmap_capture_hw_avail(pcm)) >= pcm->stop_threshold) {
- gettimestamp(&dsnoop->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&dsnoop->trigger_tstamp, pcm->tstamp_type);
dsnoop->state = SND_PCM_STATE_XRUN;
dsnoop->avail_max = avail;
return -EPIPE;
static snd_pcm_sframes_t snd_pcm_dsnoop_rewindable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_capture_avail(pcm);
+ return snd_pcm_mmap_capture_hw_avail(pcm);
}
static snd_pcm_sframes_t snd_pcm_dsnoop_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_sframes_t avail;
- avail = snd_pcm_mmap_capture_avail(pcm);
- if (avail < 0)
- return 0;
+ avail = snd_pcm_dsnoop_rewindable(pcm);
if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_backward(pcm, frames);
static snd_pcm_sframes_t snd_pcm_dsnoop_forwardable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_capture_hw_avail(pcm);
+ return snd_pcm_mmap_capture_avail(pcm);
}
static snd_pcm_sframes_t snd_pcm_dsnoop_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_sframes_t avail;
- avail = snd_pcm_mmap_capture_hw_avail(pcm);
- if (avail < 0)
- return 0;
+ avail = snd_pcm_dsnoop_forwardable(pcm);
if (frames > (snd_pcm_uframes_t)avail)
frames = avail;
snd_pcm_mmap_appl_forward(pcm, frames);
pcm->poll_fd = dsnoop->poll_fd;
pcm->poll_events = POLLIN; /* it's different than other plugins */
- pcm->monotonic = spcm->monotonic;
+ pcm->tstamp_type = spcm->tstamp_type;
pcm->mmap_rw = 1;
snd_pcm_set_hw_ptr(pcm, &dsnoop->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &dsnoop->appl_ptr, -1, 0);
static snd_pcm_sframes_t snd_pcm_file_rewindable(snd_pcm_t *pcm)
{
snd_pcm_file_t *file = pcm->private_data;
- snd_pcm_sframes_t res = snd_pcm_rewindable(pcm);
+ snd_pcm_sframes_t res = snd_pcm_rewindable(file->gen.slave);
snd_pcm_sframes_t n = snd_pcm_bytes_to_frames(pcm, file->wbuf_used_bytes);
if (res > n)
res = n;
static snd_pcm_sframes_t snd_pcm_file_forwardable(snd_pcm_t *pcm)
{
snd_pcm_file_t *file = pcm->private_data;
- snd_pcm_sframes_t res = snd_pcm_forwardable(pcm);
+ snd_pcm_sframes_t res = snd_pcm_forwardable(file->gen.slave);
snd_pcm_sframes_t n = snd_pcm_bytes_to_frames(pcm, file->wbuf_size_bytes - file->wbuf_used_bytes);
if (res > n)
res = n;
ifd = open(ifname, O_RDONLY); /* TODO: mind blocking mode */
if (ifd < 0) {
SYSERR("open %s for reading failed", ifname);
+ free(file->fname);
free(file);
return -errno;
}
err = snd_pcm_new(&pcm, SND_PCM_TYPE_FILE, name, slave->stream, slave->mode);
if (err < 0) {
free(file->fname);
+ free(file->ifname);
free(file);
return err;
}
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
pcm->mmap_shadow = 1;
+ pcm->tstamp_type = SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY;
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
- pcm->monotonic = clock_gettime(CLOCK_MONOTONIC, ×pec) == 0;
-#else
- pcm->monotonic = 0;
+ if (clock_gettime(CLOCK_MONOTONIC, ×pec) == 0)
+ pcm->tstamp_type = SND_PCM_TSTAMP_TYPE_MONOTONIC;
#endif
pcm->stream = stream;
snd_pcm_link_hw_ptr(pcm, slave);
if (ok && (snd_pcm_uframes_t)avail1 == *avail)
break;
*avail = avail1;
- gettimestamp(tstamp, pcm->monotonic);
+ gettimestamp(tstamp, pcm->tstamp_type);
ok = 1;
}
return 0;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
pcm->mmap_shadow = 1;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_link_hw_ptr(pcm, slave);
snd_pcm_link_appl_ptr(pcm, slave);
*pcmp = pcm;
err = hook_add_dlobj(pcm, h);
if (err < 0) {
- snd_dlclose(h);
+ if(h)
+ snd_dlclose(h);
return err;
}
return 0;
if (params->info != ~0U) {
params->info &= ~0xf0000000;
- params->info |= (pcm->monotonic ? SND_PCM_INFO_MONOTONIC : 0);
+ if (pcm->tstamp_type != SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY)
+ params->info |= SND_PCM_INFO_MONOTONIC;
}
return 0;
return err;
}
params->info &= ~0xf0000000;
- params->info |= (pcm->monotonic ? SND_PCM_INFO_MONOTONIC : 0);
+ if (pcm->tstamp_type != SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY)
+ params->info |= SND_PCM_INFO_MONOTONIC;
err = sync_ptr(hw, 0);
if (err < 0)
return err;
int old_period_event = sw_get_period_event(params);
sw_set_period_event(params, 0);
if ((snd_pcm_tstamp_t) params->tstamp_mode == pcm->tstamp_mode &&
+ (snd_pcm_tstamp_type_t) params->tstamp_type == pcm->tstamp_type &&
params->period_step == pcm->period_step &&
params->start_threshold == pcm->start_threshold &&
params->stop_threshold == pcm->stop_threshold &&
hw->mmap_control->avail_min = params->avail_min;
return sync_ptr(hw, 0);
}
+ if (params->tstamp_type == SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW &&
+ hw->version < SNDRV_PROTOCOL_VERSION(2, 0, 12)) {
+ SYSMSG("Kernel doesn't support SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW");
+ return -EINVAL;
+ }
+ if (params->tstamp_type == SND_PCM_TSTAMP_TYPE_MONOTONIC &&
+ hw->version < SNDRV_PROTOCOL_VERSION(2, 0, 5)) {
+ SYSMSG("Kernel doesn't support SND_PCM_TSTAMP_TYPE_MONOTONIC");
+ return -EINVAL;
+ }
if (ioctl(fd, SNDRV_PCM_IOCTL_SW_PARAMS, params) < 0) {
err = -errno;
SYSMSG("SNDRV_PCM_IOCTL_SW_PARAMS failed (%i)", err);
return err;
}
+ if ((snd_pcm_tstamp_type_t) params->tstamp_type != pcm->tstamp_type) {
+ if (hw->version < SNDRV_PROTOCOL_VERSION(2, 0, 12)) {
+ int on = (snd_pcm_tstamp_type_t) params->tstamp_type ==
+ SND_PCM_TSTAMP_TYPE_MONOTONIC;
+ if (ioctl(fd, SNDRV_PCM_IOCTL_TSTAMP, &on) < 0) {
+ err = -errno;
+ SNDMSG("TSTAMP failed\n");
+ return err;
+ }
+ }
+ pcm->tstamp_type = params->tstamp_type;
+ }
sw_set_period_event(params, old_period_event);
hw->mmap_control->avail_min = params->avail_min;
if (hw->period_event != old_period_event) {
static snd_pcm_sframes_t snd_pcm_hw_rewindable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_hw_avail(pcm);
+ return snd_pcm_mmap_hw_rewindable(pcm);
}
static snd_pcm_sframes_t snd_pcm_hw_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
int fd, int mmap_emulation ATTRIBUTE_UNUSED,
int sync_ptr_ioctl)
{
- int ver, mode, monotonic = 0;
+ int ver, mode;
+ snd_pcm_tstamp_type_t tstamp_type = SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY;
long fmode;
snd_pcm_t *pcm = NULL;
snd_pcm_hw_t *hw = NULL;
SNDMSG("TTSTAMP failed\n");
return ret;
}
- monotonic = 1;
+ tstamp_type = SND_PCM_TSTAMP_TYPE_MONOTONIC;
}
} else
#endif
pcm->private_data = hw;
pcm->poll_fd = fd;
pcm->poll_events = info.stream == SND_PCM_STREAM_PLAYBACK ? POLLOUT : POLLIN;
- pcm->monotonic = monotonic;
+ pcm->tstamp_type = tstamp_type;
ret = snd_pcm_hw_mmap_status(pcm);
if (ret < 0) {
pcm->private_data = iec;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &iec->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &iec->plug.appl_ptr, -1, 0);
*pcmp = pcm;
if (err < 0)
return err;
- gettimestamp(&io->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&io->trigger_tstamp, pcm->tstamp_type);
io->data->state = SND_PCM_STATE_RUNNING;
return 0;
io->data->callback->stop(io->data);
- gettimestamp(&io->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&io->trigger_tstamp, pcm->tstamp_type);
io->data->state = SND_PCM_STATE_SETUP;
return 0;
static snd_pcm_sframes_t snd_pcm_ioplug_rewindable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_hw_avail(pcm);
+ return snd_pcm_mmap_hw_rewindable(pcm);
}
static snd_pcm_sframes_t snd_pcm_ioplug_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
ioplug->pcm->poll_fd = ioplug->poll_fd;
ioplug->pcm->poll_events = ioplug->poll_events;
- ioplug->pcm->monotonic = (ioplug->flags & SND_PCM_IOPLUG_FLAG_MONOTONIC) != 0;
+ if (ioplug->flags & SND_PCM_IOPLUG_FLAG_MONOTONIC)
+ ioplug->pcm->tstamp_type = SND_PCM_TSTAMP_TYPE_MONOTONIC;
+ else
+ ioplug->pcm->tstamp_type = SND_PCM_TSTAMP_TYPE_GETTIMEOFDAY;
ioplug->pcm->mmap_rw = ioplug->mmap_rw;
return 0;
}
pcm->private_data = ladspa;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &ladspa->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &ladspa->plug.appl_ptr, -1, 0);
*pcmp = pcm;
err = INTERNAL(snd_pcm_hw_params_get_format)(params, &dst_format);
}
if (snd_pcm_format_linear(src_format)) {
- lfloat->int32_idx = snd_pcm_linear_get32_index(src_format, SND_PCM_FORMAT_S32);
+ lfloat->int32_idx = snd_pcm_linear_get_index(src_format, SND_PCM_FORMAT_S32);
lfloat->float32_idx = snd_pcm_lfloat_put_s32_index(dst_format);
lfloat->func = snd_pcm_lfloat_convert_integer_float;
} else {
- lfloat->int32_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, dst_format);
+ lfloat->int32_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, dst_format);
lfloat->float32_idx = snd_pcm_lfloat_get_s32_index(src_format);
lfloat->func = snd_pcm_lfloat_convert_float_integer;
}
pcm->private_data = lfloat;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &lfloat->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &lfloat->plug.appl_ptr, -1, 0);
*pcmp = pcm;
}
}
-int snd_pcm_linear_get32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format)
-{
- return snd_pcm_linear_get_index(src_format, dst_format);
-}
-
int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format)
{
int sign, width, pwidth, endian;
}
}
-int snd_pcm_linear_put32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format)
-{
- int sign, width, pwidth, endian;
- sign = (snd_pcm_format_signed(src_format) !=
- snd_pcm_format_signed(dst_format));
-#ifdef SND_LITTLE_ENDIAN
- endian = snd_pcm_format_big_endian(dst_format);
-#else
- endian = snd_pcm_format_little_endian(dst_format);
-#endif
- if (endian < 0)
- endian = 0;
- pwidth = snd_pcm_format_physical_width(dst_format);
- width = snd_pcm_format_width(dst_format);
- if (pwidth == 24) {
- switch (width) {
- case 24:
- width = 0; break;
- case 20:
- width = 1; break;
- case 18:
- default:
- width = 2; break;
- }
- return width * 4 + endian * 2 + sign + 16;
- } else {
- width = width / 8 - 1;
- return width * 4 + endian * 2 + sign;
- }
-}
-
void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
const snd_pcm_channel_area_t *src_areas, snd_pcm_uframes_t src_offset,
unsigned int channels, snd_pcm_uframes_t frames,
snd_pcm_format_physical_width(linear->sformat) == 24);
if (linear->use_getput) {
if (pcm->stream == SND_PCM_STREAM_PLAYBACK) {
- linear->get_idx = snd_pcm_linear_get32_index(format, SND_PCM_FORMAT_S32);
- linear->put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, linear->sformat);
+ linear->get_idx = snd_pcm_linear_get_index(format, SND_PCM_FORMAT_S32);
+ linear->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, linear->sformat);
} else {
- linear->get_idx = snd_pcm_linear_get32_index(linear->sformat, SND_PCM_FORMAT_S32);
- linear->put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, format);
+ linear->get_idx = snd_pcm_linear_get_index(linear->sformat, SND_PCM_FORMAT_S32);
+ linear->put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, format);
}
} else {
if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
pcm->private_data = linear;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &linear->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &linear->plug.appl_ptr, -1, 0);
*pcmp = pcm;
#include <stdlib.h>
#include <limits.h>
#include <sys/uio.h>
+#include <time.h>
#include <sys/time.h>
#define _snd_mask sndrv_mask
int poll_fd;
unsigned short poll_events;
int setup: 1,
- monotonic: 1,
compat: 1;
snd_pcm_access_t access; /* access mode */
snd_pcm_format_t format; /* SND_PCM_FORMAT_* */
unsigned int period_time; /* period duration */
snd_interval_t periods;
snd_pcm_tstamp_t tstamp_mode; /* timestamp mode */
+ snd_pcm_tstamp_type_t tstamp_type; /* timestamp type */
unsigned int period_step;
snd_pcm_uframes_t avail_min; /* min avail frames for wakeup */
int period_event;
static inline snd_pcm_sframes_t snd_pcm_mmap_hw_avail(snd_pcm_t *pcm)
{
- snd_pcm_sframes_t avail;
- avail = *pcm->hw.ptr - *pcm->appl.ptr;
- if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
- avail += pcm->buffer_size;
- if (avail < 0)
- avail += pcm->boundary;
- return pcm->buffer_size - avail;
+ return pcm->buffer_size - snd_pcm_mmap_avail(pcm);
+}
+
+static inline snd_pcm_sframes_t snd_pcm_mmap_playback_hw_rewindable(snd_pcm_t *pcm)
+{
+ snd_pcm_sframes_t ret = snd_pcm_mmap_playback_hw_avail(pcm);
+ return (ret >= 0) ? ret : 0;
+}
+
+static inline snd_pcm_sframes_t snd_pcm_mmap_capture_hw_rewindable(snd_pcm_t *pcm)
+{
+ snd_pcm_sframes_t ret = snd_pcm_mmap_capture_hw_avail(pcm);
+ return (ret >= 0) ? ret : 0;
+}
+
+static inline snd_pcm_uframes_t snd_pcm_mmap_hw_rewindable(snd_pcm_t *pcm)
+{
+ snd_pcm_sframes_t ret = snd_pcm_mmap_hw_avail(pcm);
+ return (ret >= 0) ? ret : 0;
}
static inline const snd_pcm_channel_area_t *snd_pcm_mmap_areas(snd_pcm_t *pcm)
} snd_tmp_double_t;
/* get the current timestamp */
-static inline void gettimestamp(snd_htimestamp_t *tstamp, int monotonic)
+#ifdef HAVE_CLOCK_GETTIME
+static inline void gettimestamp(snd_htimestamp_t *tstamp,
+ snd_pcm_tstamp_type_t tstamp_type)
{
-#if defined(HAVE_CLOCK_GETTIME)
-#if defined(CLOCK_MONOTONIC)
- if (monotonic) {
- clock_gettime(CLOCK_MONOTONIC, tstamp);
- } else {
-#endif
- clock_gettime(CLOCK_REALTIME, tstamp);
-#else
- struct timeval tv;
+ clockid_t id;
- gettimeofday(&tv, 0);
- tstamp->tv_sec = tv.tv_sec;
- tstamp->tv_nsec = tv.tv_usec * 1000L;
+ switch (tstamp_type) {
+#ifdef CLOCK_MONOTONIC_RAW
+ case SND_PCM_TSTAMP_TYPE_MONOTONIC_RAW:
+ id = CLOCK_MONOTONIC_RAW;
+ break;
#endif
-#if defined(HAVE_CLOCK_GETTIME)
- }
+#ifdef CLOCK_MONOTONIC
+ case SND_PCM_TSTAMP_TYPE_MONOTONIC:
+ id = CLOCK_MONOTONIC;
+ break;
#endif
+ default:
+ id = CLOCK_REALTIME;
+ break;
+ }
+ clock_gettime(id, tstamp);
+}
+#else /* HAVE_CLOCK_GETTIME */
+static inline void gettimestamp(snd_htimestamp_t *tstamp,
+ snd_pcm_tstamp_type_t tstamp_type)
+{
+ struct timeval tv;
+
+ gettimeofday(&tv, 0);
+ tstamp->tv_sec = tv.tv_sec;
+ tstamp->tv_nsec = tv.tv_usec * 1000L;
}
+#endif /* HAVE_CLOCK_GETTIME */
snd_pcm_chmap_query_t **
_snd_pcm_make_single_query_chmaps(const snd_pcm_chmap_t *src);
pcm->private_data = meter;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_link_hw_ptr(pcm, slave);
snd_pcm_link_appl_ptr(pcm, slave);
*pcmp = pcm;
case SNDRV_PCM_FORMAT_U20_3BE:
case SNDRV_PCM_FORMAT_U18_3LE:
case SNDRV_PCM_FORMAT_U18_3BE:
+ case SNDRV_PCM_FORMAT_DSD_U8:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_BE:
+ case SNDRV_PCM_FORMAT_DSD_U32_BE:
return 0;
default:
return -EINVAL;
case SNDRV_PCM_FORMAT_U24_3LE:
case SNDRV_PCM_FORMAT_U20_3LE:
case SNDRV_PCM_FORMAT_U18_3LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
return 1;
case SNDRV_PCM_FORMAT_S16_BE:
case SNDRV_PCM_FORMAT_U16_BE:
case SNDRV_PCM_FORMAT_U24_3BE:
case SNDRV_PCM_FORMAT_U20_3BE:
case SNDRV_PCM_FORMAT_U18_3BE:
+ case SNDRV_PCM_FORMAT_DSD_U16_BE:
+ case SNDRV_PCM_FORMAT_DSD_U32_BE:
return 0;
default:
return -EINVAL;
switch (format) {
case SNDRV_PCM_FORMAT_S8:
case SNDRV_PCM_FORMAT_U8:
+ case SNDRV_PCM_FORMAT_DSD_U8:
return 8;
case SNDRV_PCM_FORMAT_S16_LE:
case SNDRV_PCM_FORMAT_S16_BE:
case SNDRV_PCM_FORMAT_U16_LE:
case SNDRV_PCM_FORMAT_U16_BE:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_BE:
return 16;
case SNDRV_PCM_FORMAT_S18_3LE:
case SNDRV_PCM_FORMAT_S18_3BE:
case SNDRV_PCM_FORMAT_U32_BE:
case SNDRV_PCM_FORMAT_FLOAT_LE:
case SNDRV_PCM_FORMAT_FLOAT_BE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_BE:
return 32;
case SNDRV_PCM_FORMAT_FLOAT64_LE:
case SNDRV_PCM_FORMAT_FLOAT64_BE:
switch (format) {
case SNDRV_PCM_FORMAT_S8:
case SNDRV_PCM_FORMAT_U8:
+ case SNDRV_PCM_FORMAT_DSD_U8:
return 8;
case SNDRV_PCM_FORMAT_S16_LE:
case SNDRV_PCM_FORMAT_S16_BE:
case SNDRV_PCM_FORMAT_U16_LE:
case SNDRV_PCM_FORMAT_U16_BE:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_BE:
return 16;
case SNDRV_PCM_FORMAT_S18_3LE:
case SNDRV_PCM_FORMAT_S18_3BE:
case SNDRV_PCM_FORMAT_FLOAT_BE:
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE:
case SNDRV_PCM_FORMAT_IEC958_SUBFRAME_BE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_BE:
return 32;
case SNDRV_PCM_FORMAT_FLOAT64_LE:
case SNDRV_PCM_FORMAT_FLOAT64_BE:
switch (format) {
case SNDRV_PCM_FORMAT_S8:
case SNDRV_PCM_FORMAT_U8:
+ case SNDRV_PCM_FORMAT_DSD_U8:
return samples;
case SNDRV_PCM_FORMAT_S16_LE:
case SNDRV_PCM_FORMAT_S16_BE:
case SNDRV_PCM_FORMAT_U16_LE:
case SNDRV_PCM_FORMAT_U16_BE:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_BE:
return samples * 2;
case SNDRV_PCM_FORMAT_S18_3LE:
case SNDRV_PCM_FORMAT_S18_3BE:
case SNDRV_PCM_FORMAT_U32_BE:
case SNDRV_PCM_FORMAT_FLOAT_LE:
case SNDRV_PCM_FORMAT_FLOAT_BE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_BE:
return samples * 4;
case SNDRV_PCM_FORMAT_FLOAT64_LE:
case SNDRV_PCM_FORMAT_FLOAT64_BE:
return 0;
case SNDRV_PCM_FORMAT_U8:
return 0x8080808080808080ULL;
+ case SNDRV_PCM_FORMAT_DSD_U8:
+ case SNDRV_PCM_FORMAT_DSD_U16_LE:
+ case SNDRV_PCM_FORMAT_DSD_U32_LE:
+ case SNDRV_PCM_FORMAT_DSD_U16_BE:
+ case SNDRV_PCM_FORMAT_DSD_U32_BE:
+ return 0x6969696969696969ULL;
#ifdef SNDRV_LITTLE_ENDIAN
case SNDRV_PCM_FORMAT_U16_LE:
return 0x8000800080008000ULL;
pcm->private_data = map;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &map->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &map->appl_ptr, -1, 0);
*pcmp = pcm;
pcm->private_data = mulaw;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &mulaw->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &mulaw->plug.appl_ptr, -1, 0);
*pcmp = pcm;
pcm->private_data = multi;
pcm->poll_fd = multi->slaves[master_slave].pcm->poll_fd;
pcm->poll_events = multi->slaves[master_slave].pcm->poll_events;
- pcm->monotonic = multi->slaves[master_slave].pcm->monotonic;
+ pcm->tstamp_type = multi->slaves[master_slave].pcm->tstamp_type;
snd_pcm_link_hw_ptr(pcm, multi->slaves[master_slave].pcm);
snd_pcm_link_appl_ptr(pcm, multi->slaves[master_slave].pcm);
*pcmp = pcm;
if (null->state == SND_PCM_STATE_PREPARED) {
/* it is required to return the correct avail count for */
/* the prepared stream, otherwise the start is not called */
- if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
- return snd_pcm_mmap_playback_avail(pcm);
- else
- return snd_pcm_mmap_capture_avail(pcm);
+ return snd_pcm_mmap_avail(pcm);
}
return pcm->buffer_size;
}
memset(status, 0, sizeof(*status));
status->state = null->state;
status->trigger_tstamp = null->trigger_tstamp;
- gettimestamp(&status->tstamp, pcm->monotonic);
+ gettimestamp(&status->tstamp, pcm->tstamp_type);
status->avail = snd_pcm_null_avail_update(pcm);
status->avail_max = pcm->buffer_size;
return 0;
{
assert(pcm && params);
assert(pcm->setup);
+ params->proto = SNDRV_PCM_VERSION;
params->tstamp_mode = SND_PCM_TSTAMP_NONE;
+ params->tstamp_type = pcm->tstamp_type;
params->period_step = 1;
params->sleep_min = 0;
params->avail_min = pcm->period_size;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
pcm->mmap_shadow = 1;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_link_hw_ptr(pcm, slave);
snd_pcm_link_appl_ptr(pcm, slave);
*pcmp = pcm;
static snd_pcm_sframes_t snd_pcm_plugin_rewindable(snd_pcm_t *pcm)
{
- return snd_pcm_mmap_hw_avail(pcm);
+ return snd_pcm_mmap_hw_rewindable(pcm);
}
snd_pcm_sframes_t snd_pcm_plugin_rewind(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_plugin_t *plugin = pcm->private_data;
- snd_pcm_sframes_t n = snd_pcm_mmap_hw_avail(pcm);
+ snd_pcm_sframes_t n = snd_pcm_plugin_rewindable(pcm);
snd_pcm_sframes_t sframes;
if ((snd_pcm_uframes_t)n < frames)
snd_pcm_sframes_t snd_pcm_plugin_forward(snd_pcm_t *pcm, snd_pcm_uframes_t frames)
{
snd_pcm_plugin_t *plugin = pcm->private_data;
- snd_pcm_sframes_t n = snd_pcm_mmap_avail(pcm);
+ snd_pcm_sframes_t n = snd_pcm_plugin_forwardable(pcm);
snd_pcm_sframes_t sframes;
if ((snd_pcm_uframes_t)n < frames)
/* make local functions really local */
#define snd_pcm_linear_get_index snd1_pcm_linear_get_index
#define snd_pcm_linear_put_index snd1_pcm_linear_put_index
-#define snd_pcm_linear_get32_index snd1_pcm_linear_get32_index
-#define snd_pcm_linear_put32_index snd1_pcm_linear_put32_index
#define snd_pcm_linear_convert_index snd1_pcm_linear_convert_index
#define snd_pcm_linear_convert snd1_pcm_linear_convert
#define snd_pcm_linear_getput snd1_pcm_linear_getput
int snd_pcm_linear_get_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
int snd_pcm_linear_put_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
-int snd_pcm_linear_get32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
-int snd_pcm_linear_put32_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
int snd_pcm_linear_convert_index(snd_pcm_format_t src_format, snd_pcm_format_t dst_format);
void snd_pcm_linear_convert(const snd_pcm_channel_area_t *dst_areas, snd_pcm_uframes_t dst_offset,
rate->hw_ptr =
(slave_hw_ptr / rate->gen.slave->period_size) * pcm->period_size +
rate->ops.input_frames(rate->obj, slave_hw_ptr % rate->gen.slave->period_size);
+
+ rate->hw_ptr %= pcm->boundary;
}
static int snd_pcm_rate_hwsync(snd_pcm_t *pcm)
static int snd_pcm_rate_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delayp)
{
snd_pcm_rate_hwsync(pcm);
- if (pcm->stream == SND_PCM_STREAM_PLAYBACK)
- *delayp = snd_pcm_mmap_playback_hw_avail(pcm);
- else
- *delayp = snd_pcm_mmap_capture_hw_avail(pcm);
+ *delayp = snd_pcm_mmap_hw_avail(pcm);
return 0;
}
static int snd_pcm_rate_start(snd_pcm_t *pcm)
{
snd_pcm_rate_t *rate = pcm->private_data;
- snd_pcm_uframes_t avail;
+ snd_pcm_sframes_t avail;
if (pcm->stream == SND_PCM_STREAM_CAPTURE)
return snd_pcm_start(rate->gen.slave);
if (snd_pcm_state(rate->gen.slave) != SND_PCM_STATE_PREPARED)
return -EBADFD;
- gettimestamp(&rate->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&rate->trigger_tstamp, pcm->tstamp_type);
avail = snd_pcm_mmap_playback_hw_avail(rate->gen.slave);
+ if (avail < 0) /* can't happen on healthy drivers */
+ return -EBADFD;
+
if (avail == 0) {
/* postpone the trigger since we have no data committed yet */
rate->start_pending = 1;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
pcm->mmap_rw = 1;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &rate->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &rate->appl_ptr, -1, 0);
*pcmp = pcm;
typedef struct snd_pcm_route_ttable_dst snd_pcm_route_ttable_dst_t;
typedef struct {
- enum {UINT32=0, UINT64=1, FLOAT=2} sum_idx;
+ enum {UINT64, FLOAT} sum_idx;
unsigned int get_idx;
unsigned int put_idx;
unsigned int conv_idx;
const snd_pcm_route_ttable_dst_t* ttable,
const snd_pcm_route_params_t *params)
{
-#define GETS_LABELS
+#define GET32_LABELS
#define PUT32_LABELS
#include "plugin_ops.h"
-#undef GETS_LABELS
+#undef GET32_LABELS
#undef PUT32_LABELS
- static void *const zero_labels[3] = {
- &&zero_int32, &&zero_int64,
+ static void *const zero_labels[2] = {
+ &&zero_int64,
#if SND_PCM_PLUGIN_ROUTE_FLOAT
&&zero_float
#endif
};
/* sum_type att */
- static void *const add_labels[3 * 2] = {
- &&add_int32_noatt, &&add_int32_att,
+ static void *const add_labels[2 * 2] = {
&&add_int64_noatt, &&add_int64_att,
#if SND_PCM_PLUGIN_ROUTE_FLOAT
&&add_float_noatt, &&add_float_att
#endif
};
- /* sum_type att shift */
- static void *const norm_labels[3 * 2 * 4] = {
- 0,
- &&norm_int32_8_noatt,
- &&norm_int32_16_noatt,
- &&norm_int32_24_noatt,
- 0,
- &&norm_int32_8_att,
- &&norm_int32_16_att,
- &&norm_int32_24_att,
- &&norm_int64_0_noatt,
- &&norm_int64_8_noatt,
- &&norm_int64_16_noatt,
- &&norm_int64_24_noatt,
- &&norm_int64_0_att,
- &&norm_int64_8_att,
- &&norm_int64_16_att,
- &&norm_int64_24_att,
+ /* sum_type att */
+ static void *const norm_labels[2 * 2] = {
+ &&norm_int64_noatt,
+ &&norm_int64_att,
#if SND_PCM_PLUGIN_ROUTE_FLOAT
- &&norm_float_0,
- &&norm_float_8,
- &&norm_float_16,
- &&norm_float_24,
- &&norm_float_0,
- &&norm_float_8,
- &&norm_float_16,
- &&norm_float_24,
+ &&norm_float,
+ &&norm_float,
#endif
};
- void *zero, *get, *add, *norm, *put32;
+ void *zero, *get32, *add, *norm, *put32;
int nsrcs = ttable->nsrcs;
char *dst;
int dst_step;
}
zero = zero_labels[params->sum_idx];
- get = gets_labels[params->get_idx];
+ get32 = get32_labels[params->get_idx];
add = add_labels[params->sum_idx * 2 + ttable->att];
- norm = norm_labels[params->sum_idx * 8 + ttable->att * 4 + 4 - params->src_size];
+ norm = norm_labels[params->sum_idx * 2 + ttable->att];
put32 = put32_labels[params->put_idx];
dst = snd_pcm_channel_area_addr(dst_area, dst_offset);
dst_step = snd_pcm_channel_area_step(dst_area);
/* Zero sum */
goto *zero;
- zero_int32:
- sum.as_sint32 = 0;
- goto zero_end;
zero_int64:
sum.as_sint64 = 0;
goto zero_end;
const char *src = srcs[srcidx];
/* Get sample */
- goto *get;
-#define GETS_END after_get
+ goto *get32;
+#define GET32_END after_get
#include "plugin_ops.h"
-#undef GETS_END
+#undef GET32_END
after_get:
/* Sum */
goto *add;
- add_int32_att:
- sum.as_sint32 += sample * ttp->as_int;
- goto after_sum;
- add_int32_noatt:
- if (ttp->as_int)
- sum.as_sint32 += sample;
- goto after_sum;
add_int64_att:
sum.as_sint64 += (int64_t) sample * ttp->as_int;
goto after_sum;
/* Normalization */
goto *norm;
- norm_int32_8_att:
- sum.as_sint64 = sum.as_sint32;
- norm_int64_8_att:
- sum.as_sint64 <<= 8;
- norm_int64_0_att:
+ norm_int64_att:
div(sum.as_sint64);
- goto norm_int;
-
- norm_int32_16_att:
- sum.as_sint64 = sum.as_sint32;
- norm_int64_16_att:
- sum.as_sint64 <<= 16;
- div(sum.as_sint64);
- goto norm_int;
-
- norm_int32_24_att:
- sum.as_sint64 = sum.as_sint32;
- norm_int64_24_att:
- sum.as_sint64 <<= 24;
- div(sum.as_sint64);
- goto norm_int;
-
- norm_int32_8_noatt:
- sum.as_sint64 = sum.as_sint32;
- norm_int64_8_noatt:
- sum.as_sint64 <<= 8;
- goto norm_int;
-
- norm_int32_16_noatt:
- sum.as_sint64 = sum.as_sint32;
- norm_int64_16_noatt:
- sum.as_sint64 <<= 16;
- goto norm_int;
-
- norm_int32_24_noatt:
- sum.as_sint64 = sum.as_sint32;
- norm_int64_24_noatt:
- sum.as_sint64 <<= 24;
- goto norm_int;
-
- norm_int64_0_noatt:
- norm_int:
+ /* fallthru */
+ norm_int64_noatt:
if (sum.as_sint64 > (int64_t)0x7fffffff)
sample = 0x7fffffff; /* maximum positive value */
else if (sum.as_sint64 < -(int64_t)0x80000000)
goto after_norm;
#if SND_PCM_PLUGIN_ROUTE_FLOAT
- norm_float_8:
- sum.as_float *= 1 << 8;
- goto norm_float;
- norm_float_16:
- sum.as_float *= 1 << 16;
- goto norm_float;
- norm_float_24:
- sum.as_float *= 1 << 24;
- goto norm_float;
- norm_float_0:
norm_float:
sum.as_float = rint(sum.as_float);
if (sum.as_float > (int64_t)0x7fffffff)
}
if (err < 0)
return err;
- route->params.use_getput = snd_pcm_format_physical_width(src_format) == 24 ||
- snd_pcm_format_physical_width(dst_format) == 24;
- route->params.get_idx = snd_pcm_linear_get_index(src_format, SND_PCM_FORMAT_S16);
- route->params.put_idx = snd_pcm_linear_put32_index(SND_PCM_FORMAT_S32, dst_format);
+ /* 3 bytes formats? */
+ route->params.use_getput =
+ (snd_pcm_format_physical_width(src_format) + 7) / 3 == 3 ||
+ (snd_pcm_format_physical_width(dst_format) + 7) / 3 == 3;
+ route->params.get_idx = snd_pcm_linear_get_index(src_format, SND_PCM_FORMAT_S32);
+ route->params.put_idx = snd_pcm_linear_put_index(SND_PCM_FORMAT_S32, dst_format);
route->params.conv_idx = snd_pcm_linear_convert_index(src_format, dst_format);
route->params.src_size = snd_pcm_format_width(src_format) / 8;
route->params.dst_sfmt = dst_format;
#if SND_PCM_PLUGIN_ROUTE_FLOAT
route->params.sum_idx = FLOAT;
#else
- if (snd_pcm_format_width(src_format) == 32)
- route->params.sum_idx = UINT64;
- else
- route->params.sum_idx = UINT32;
+ route->params.sum_idx = UINT64;
#endif
return 0;
}
pcm->private_data = route;
pcm->poll_fd = slave->poll_fd;
pcm->poll_events = slave->poll_events;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &route->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &route->plug.appl_ptr, -1, 0);
err = route_load_ttable(&route->params, pcm->stream, tt_ssize, ttable, tt_cused, tt_sused);
snd_config_iterator_t j, jnext;
long cchannel;
const char *id;
- if (!snd_config_get_id(in, &id) < 0)
+ if (snd_config_get_id(in, &id) < 0)
continue;
err = safe_strtol(id, &cchannel);
if (err < 0 ||
avail += pcm->buffer_size;
if (avail < 0)
avail += pcm->boundary;
+ else if ((snd_pcm_uframes_t) avail >= pcm->boundary)
+ avail -= pcm->boundary;
return avail;
}
err = pipe(slave->poll);
if (err < 0) {
SYSERR("can't create a pipe");
+ Pthread_mutex_unlock(&slave->mutex);
return NULL;
}
while (slave->open_count > 0) {
err = snd_pcm_sw_params(spcm, &slave->sw_params);
if (err < 0) {
SYSERR("snd_pcm_sw_params error");
+ Pthread_mutex_unlock(&slave->mutex);
return NULL;
}
}
}
slave->running_count++;
_snd_pcm_share_update(pcm);
- gettimestamp(&share->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&share->trigger_tstamp, pcm->tstamp_type);
_end:
Pthread_mutex_unlock(&slave->mutex);
return err;
return;
}
#endif
- gettimestamp(&share->trigger_tstamp, pcm->monotonic);
+ gettimestamp(&share->trigger_tstamp, pcm->tstamp_type);
if (pcm->stream == SND_PCM_STREAM_CAPTURE) {
snd_pcm_areas_copy(pcm->stopped_areas, 0,
pcm->running_areas, 0,
pcm->private_data = share;
pcm->poll_fd = share->client_socket;
pcm->poll_events = stream == SND_PCM_STREAM_PLAYBACK ? POLLOUT : POLLIN;
- pcm->monotonic = slave->pcm->monotonic;
+ pcm->tstamp_type = slave->pcm->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &share->hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &share->appl_ptr, -1, 0);
return sock;
}
-#if 0
-static int make_inet_socket(const char *host, int port)
-{
- struct sockaddr_in addr;
- int sock;
- struct hostent *h = gethostbyname(host);
- if (!h)
- return -ENOENT;
-
- sock = socket(PF_INET, SOCK_STREAM, 0);
- if (sock < 0) {
- SYSERR("socket failed");
- return -errno;
- }
-
- addr.sin_family = AF_INET;
- addr.sin_port = htons(port);
- memcpy(&addr.sin_addr, h->h_addr_list[0], sizeof(struct in_addr));
-
- if (connect(sock, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
- SYSERR("connect failed");
- return -errno;
- }
- return sock;
-}
-#endif
-
/**
* \brief Creates a new shared memory PCM
* \param pcmp Returns created PCM handle
const char *server = NULL;
const char *pcm_name = NULL;
snd_config_t *sconfig;
- const char *host = NULL;
const char *sockname = NULL;
long port = -1;
int err;
- int local;
- struct hostent *h;
+
snd_config_for_each(i, next, conf) {
snd_config_t *n = snd_config_iterator_entry(i);
const char *id;
continue;
if (strcmp(id, "comment") == 0)
continue;
- if (strcmp(id, "host") == 0) {
- err = snd_config_get_string(n, &host);
- if (err < 0) {
- SNDERR("Invalid type for %s", id);
- goto _err;
- }
+ if (strcmp(id, "host") == 0)
continue;
- }
if (strcmp(id, "socket") == 0) {
err = snd_config_get_string(n, &sockname);
if (err < 0) {
goto __error;
}
- if (!host) {
- SNDERR("host is not defined");
- goto _err;
- }
if (!sockname) {
SNDERR("socket is not defined");
goto _err;
}
- h = gethostbyname(host);
- if (!h) {
- SNDERR("Cannot resolve %s", host);
- goto _err;
- }
- local = snd_is_local(h);
- if (!local) {
- SNDERR("%s is not the local host", host);
- goto _err;
- }
err = snd_pcm_shm_open(pcmp, name, sockname, pcm_name, stream, mode);
__error:
snd_config_delete(sconfig);
* an extra buffer.
*/
pcm->mmap_shadow = 1;
- pcm->monotonic = slave->monotonic;
+ pcm->tstamp_type = slave->tstamp_type;
snd_pcm_set_hw_ptr(pcm, &svol->plug.hw_ptr, -1, 0);
snd_pcm_set_appl_ptr(pcm, &svol->plug.appl_ptr, -1, 0);
*pcmp = pcm;
}
#endif
-#ifdef GETS_LABELS
-/* width endswap sign_toggle */
-static void *const gets_labels[4 * 2 * 2] = {
- &&gets_1_1, /* 8h -> 8h */
- &&gets_1_9, /* 8h ^> 8h */
- &&gets_1_1, /* 8s -> 8h */
- &&gets_1_9, /* 8s ^> 8h */
- &&gets_12_12, /* 16h -> 16h */
- &&gets_12_92, /* 16h ^> 16h */
- &&gets_12_21, /* 16s -> 16h */
- &&gets_12_A1, /* 16s ^> 16h */
- &&gets_0123_0123, /* 24h -> 24h */
- &&gets_0123_0923, /* 24h ^> 24h */
- &&gets_1230_0321, /* 24s -> 24h */
- &&gets_1230_0B21, /* 24s ^> 24h */
- &&gets_1234_1234, /* 32h -> 32h */
- &&gets_1234_9234, /* 32h ^> 32h */
- &&gets_1234_4321, /* 32s -> 32h */
- &&gets_1234_C321, /* 32s ^> 32h */
-};
-#endif
-
-#ifdef GETS_END
-while (0) {
-gets_1_1: sample = as_s8c(src); goto GETS_END;
-gets_1_9: sample = (int8_t)(as_s8c(src) ^ 0x80); goto GETS_END;
-gets_12_12: sample = as_s16c(src); goto GETS_END;
-gets_12_92: sample = (int16_t)(as_s16c(src) ^ 0x8000); goto GETS_END;
-gets_12_21: sample = (int16_t)bswap_16(as_s16c(src)); goto GETS_END;
-gets_12_A1: sample = (int16_t)bswap_16(as_s16c(src) ^ 0x80); goto GETS_END;
-gets_0123_0123: sample = sx24((int32_t)(as_s32c(src) << 8) >> 8); goto GETS_END;
-gets_0123_0923: sample = sx24((int32_t)((as_s32c(src) ^ 0x800000) << 8) >> 8); goto GETS_END;
-gets_1230_0321: sample = sx24((int32_t)(bswap_32(as_s32c(src)) << 8) >> 8); goto GETS_END;
-gets_1230_0B21: sample = sx24((int32_t)(bswap_32(as_s32c(src) ^ 0x8000) << 8) >> 8); goto GETS_END;
-gets_1234_1234: sample = as_s32c(src); goto GETS_END;
-gets_1234_9234: sample = (int32_t)(as_s32c(src) ^ 0x80000000); goto GETS_END;
-gets_1234_4321: sample = (int32_t)bswap_32(as_s32c(src)); goto GETS_END;
-gets_1234_C321: sample = (int32_t)bswap_32(as_s32c(src) ^ 0x80); goto GETS_END;
-}
-#endif
-
-#ifdef PUT_LABELS
-/* width endswap sign_toggle */
-static void *const put_labels[4 * 2 * 2] = {
- &&put_1_1, /* 8h -> 8h */
- &&put_1_9, /* 8h ^> 8h */
- &&put_1_1, /* 8h -> 8s */
- &&put_1_9, /* 8h ^> 8s */
- &&put_12_12, /* 16h -> 16h */
- &&put_12_92, /* 16h ^> 16h */
- &&put_12_21, /* 16h -> 16s */
- &&put_12_29, /* 16h ^> 16s */
- &&put_0123_0123, /* 24h -> 24h */
- &&put_0123_0923, /* 24h ^> 24h */
- &&put_0123_3210, /* 24h -> 24s */
- &&put_0123_3290, /* 24h ^> 24s */
- &&put_1234_1234, /* 32h -> 32h */
- &&put_1234_9234, /* 32h ^> 32h */
- &&put_1234_4321, /* 32h -> 32s */
- &&put_1234_4329, /* 32h ^> 32s */
-};
-#endif
-
-#ifdef PUT_END
-put_1_1: as_s8(dst) = sample; goto PUT_END;
-put_1_9: as_u8(dst) = sample ^ 0x80; goto PUT_END;
-put_12_12: as_s16(dst) = sample; goto PUT_END;
-put_12_92: as_u16(dst) = sample ^ 0x8000; goto PUT_END;
-put_12_21: as_s16(dst) = bswap_16(sample); goto PUT_END;
-put_12_29: as_u16(dst) = bswap_16(sample) ^ 0x80; goto PUT_END;
-/* this always writes the unused byte in 24-bit formats as 0x00 */
-put_0123_0123: as_s32(dst) = sx24(sample & 0x00ffffff); goto PUT_END;
-put_0123_0923: as_u32(dst) = sx24((sample & 0x00ffffff) ^ 0x800000); goto PUT_END;
-put_0123_3210: as_s32(dst) = sx24s(bswap_32(sample) & 0xffffff00); goto PUT_END;
-put_0123_3290: as_u32(dst) = sx24s((bswap_32(sample) & 0xffffff00) ^ 0x8000); goto PUT_END;
-put_1234_1234: as_s32(dst) = sample; goto PUT_END;
-put_1234_9234: as_u32(dst) = sample ^ 0x80000000; goto PUT_END;
-put_1234_4321: as_s32(dst) = bswap_32(sample); goto PUT_END;
-put_1234_4329: as_u32(dst) = bswap_32(sample) ^ 0x80; goto PUT_END;
-#endif
-
#ifdef PUT32F_LABELS
/* type (0 = float, 1 = float64), endswap */
static void *const put32float_labels[2 * 2] = {
snd_config_delete(type_conf);
if (err >= 0)
err = open_func(inputp, outputp, name, rawmidi_root, rawmidi_conf, mode);
- if (err < 0)
+ if (err < 0) {
+ if (h)
+ snd_dlclose(h);
return err;
+ }
if (inputp) {
(*inputp)->dl_handle = h; h = NULL;
snd_rawmidi_params_default(*inputp, ¶ms);
*fd = *fds;
return ret;
}
-
-int snd_is_local(struct hostent *hent)
-{
- int s;
- int err;
- struct ifconf conf;
- size_t numreqs = 10;
- size_t i;
- struct in_addr *haddr = (struct in_addr*) hent->h_addr_list[0];
-
- s = socket(PF_INET, SOCK_STREAM, 0);
- if (s < 0) {
- SYSERR("socket failed");
- return -errno;
- }
-
- conf.ifc_len = numreqs * sizeof(struct ifreq);
- conf.ifc_buf = malloc((unsigned int) conf.ifc_len);
- if (! conf.ifc_buf)
- return -ENOMEM;
- while (1) {
- err = ioctl(s, SIOCGIFCONF, &conf);
- if (err < 0) {
- SYSERR("SIOCGIFCONF failed");
- return -errno;
- }
- if ((size_t)conf.ifc_len < numreqs * sizeof(struct ifreq))
- break;
- numreqs *= 2;
- conf.ifc_len = numreqs * sizeof(struct ifreq);
- conf.ifc_buf = realloc(conf.ifc_buf, (unsigned int) conf.ifc_len);
- if (! conf.ifc_buf)
- return -ENOMEM;
- }
- numreqs = conf.ifc_len / sizeof(struct ifreq);
- for (i = 0; i < numreqs; ++i) {
- struct ifreq *req = &conf.ifc_req[i];
- struct sockaddr_in *s_in = (struct sockaddr_in *)&req->ifr_addr;
- s_in->sin_family = AF_INET;
- err = ioctl(s, SIOCGIFADDR, req);
- if (err < 0)
- continue;
- if (haddr->s_addr == s_in->sin_addr.s_addr)
- break;
- }
- close(s);
- free(conf.ifc_buf);
- return i < numreqs;
-}
#endif
#include <ctype.h>
#include <stdarg.h>
#include <pthread.h>
+#include <sys/stat.h>
/*
* misc
*/
-static int get_value1(const char **value, struct list_head *value_list,
+static int get_value1(char **value, struct list_head *value_list,
const char *identifier);
-static int get_value3(const char **value,
+static int get_value3(char **value,
const char *identifier,
struct list_head *value_list1,
struct list_head *value_list2,
return 0;
}
+static int binary_file_parse(snd_ctl_elem_value_t *dst,
+ snd_ctl_elem_info_t *info,
+ const char *filepath)
+{
+ int err = 0;
+ int fd;
+ struct stat st;
+ size_t sz;
+ ssize_t sz_read;
+ char *res;
+ snd_ctl_elem_type_t type;
+ unsigned int idx, count;
+
+ type = snd_ctl_elem_info_get_type(info);
+ if (type != SND_CTL_ELEM_TYPE_BYTES) {
+ uc_error("only support byte type!");
+ err = -EINVAL;
+ return err;
+ }
+ fd = open(filepath, O_RDONLY);
+ if (fd < 0) {
+ err = -errno;
+ return err;
+ }
+ if (stat(filepath, &st) == -1) {
+ err = -errno;
+ goto __fail;
+ }
+ sz = st.st_size;
+ count = snd_ctl_elem_info_get_count(info);
+ if (sz != count || sz > sizeof(dst->value.bytes)) {
+ uc_error("invalid parameter size %d!", sz);
+ err = -EINVAL;
+ goto __fail;
+ }
+ res = malloc(sz);
+ if (res == NULL) {
+ err = -ENOMEM;
+ goto __fail;
+ }
+ sz_read = read(fd, res, sz);
+ if (sz_read < 0 || (size_t)sz_read != sz) {
+ err = -errno;
+ goto __fail_read;
+ }
+ for (idx = 0; idx < sz; idx++)
+ snd_ctl_elem_value_set_byte(dst, idx, *(res + idx));
+ __fail_read:
+ free(res);
+ __fail:
+ close(fd);
+ return err;
+}
+
extern int __snd_ctl_ascii_elem_id_parse(snd_ctl_elem_id_t *dst,
const char *str,
const char **ret_ptr);
-static int execute_cset(snd_ctl_t *ctl, const char *cset)
+static int execute_cset(snd_ctl_t *ctl, const char *cset, unsigned int type)
{
const char *pos;
int err;
err = snd_ctl_elem_info(ctl, info);
if (err < 0)
goto __fail;
- err = snd_ctl_ascii_value_parse(ctl, value, info, pos);
+ if (type == SEQUENCE_ELEMENT_TYPE_CSET_BIN_FILE)
+ err = binary_file_parse(value, info, pos);
+ else
+ err = snd_ctl_ascii_value_parse(ctl, value, info, pos);
if (err < 0)
goto __fail;
err = snd_ctl_elem_write(ctl, value);
goto __fail_nomem;
break;
case SEQUENCE_ELEMENT_TYPE_CSET:
+ case SEQUENCE_ELEMENT_TYPE_CSET_BIN_FILE:
if (cdev == NULL) {
- const char *cdev1 = NULL, *cdev2 = NULL;
- err = get_value3(&cdev1, "PlaybackCTL",
+ char *playback_ctl = NULL;
+ char *capture_ctl = NULL;
+
+ err = get_value3(&playback_ctl, "PlaybackCTL",
value_list1,
value_list2,
value_list3);
- if (err < 0 && err != ENOENT) {
+ if (err < 0 && err != -ENOENT) {
uc_error("cdev is not defined!");
return err;
}
- err = get_value3(&cdev1, "CaptureCTL",
+ err = get_value3(&capture_ctl, "CaptureCTL",
value_list1,
value_list2,
value_list3);
- if (err < 0 && err != ENOENT) {
- free((char *)cdev1);
+ if (err < 0 && err != -ENOENT) {
+ free(playback_ctl);
uc_error("cdev is not defined!");
return err;
}
- if (cdev1 == NULL || cdev2 == NULL ||
- strcmp(cdev1, cdev2) == 0) {
- cdev = (char *)cdev1;
- free((char *)cdev2);
- } else {
- free((char *)cdev1);
- free((char *)cdev2);
+ if (playback_ctl == NULL &&
+ capture_ctl == NULL) {
+ uc_error("cdev is not defined!");
+ return -EINVAL;
+ }
+ if (playback_ctl != NULL &&
+ capture_ctl != NULL &&
+ strcmp(playback_ctl, capture_ctl) != 0) {
+ free(playback_ctl);
+ free(capture_ctl);
+ uc_error("cdev is not defined!");
+ return -EINVAL;
}
+ if (playback_ctl != NULL) {
+ cdev = playback_ctl;
+ free(capture_ctl);
+ } else
+ cdev = capture_ctl;
}
if (ctl == NULL) {
err = open_ctl(uc_mgr, &ctl, cdev);
goto __fail;
}
}
- err = execute_cset(ctl, s->data.cset);
+ err = execute_cset(ctl, s->data.cset, s->type);
if (err < 0) {
uc_error("unable to execute cset '%s'\n", s->data.cset);
goto __fail;
return err;
}
-static int get_value1(const char **value, struct list_head *value_list,
+static int get_value1(char **value, struct list_head *value_list,
const char *identifier)
{
struct ucm_value *val;
return -ENOENT;
}
-static int get_value3(const char **value,
+static int get_value3(char **value,
const char *identifier,
struct list_head *value_list1,
struct list_head *value_list2,
*/
static int get_value(snd_use_case_mgr_t *uc_mgr,
const char *identifier,
- const char **value,
+ char **value,
const char *mod_dev_name,
const char *verb_name,
int exact)
verb = NULL;
}
- err = get_value(uc_mgr, ident, value, mod_dev, verb, exact);
+ err = get_value(uc_mgr, ident, (char **)value, mod_dev, verb,
+ exact);
if (ident != identifier)
free((void *)ident);
if (mod_dev)
const char *verb_name)
{
struct use_case_verb *verb;
- int err;
+ int err = 0;
if (uc_mgr->active_verb &&
strcmp(uc_mgr->active_verb->name, verb_name) == 0)
const char *value)
{
char *str, *str1;
- int err;
+ int err = 0;
pthread_mutex_lock(&uc_mgr->mutex);
if (strcmp(identifier, "_verb") == 0)
continue;
}
+ if (strcmp(cmd, "cset-bin-file") == 0) {
+ curr->type = SEQUENCE_ELEMENT_TYPE_CSET_BIN_FILE;
+ err = parse_string(n, &curr->data.cset);
+ if (err < 0) {
+ uc_error("error: cset-bin-file requires a string!");
+ return err;
+ }
+ continue;
+ }
+
if (strcmp(cmd, "usleep") == 0) {
curr->type = SEQUENCE_ELEMENT_TYPE_SLEEP;
err = snd_config_get_integer(n, &curr->data.sleep);
#define SEQUENCE_ELEMENT_TYPE_CSET 2
#define SEQUENCE_ELEMENT_TYPE_SLEEP 3
#define SEQUENCE_ELEMENT_TYPE_EXEC 4
+#define SEQUENCE_ELEMENT_TYPE_CSET_BIN_FILE 5
struct ucm_value {
struct list_head list;
err = wordexp(file, &we, WRDE_NOCMD);
switch (err) {
case WRDE_NOSPACE:
+ wordfree(&we);
return -ENOMEM;
case 0:
if (we.we_wordc == 1)
break;
+ wordfree(&we);
/* fall thru */
default:
- wordfree(&we);
return -EINVAL;
}
*result = strdup(we.we_wordv[0]);
+ wordfree(&we);
if (*result == NULL)
return -ENOMEM;
- wordfree(&we);
return 0;
}
#define TRACK_PLAYBACK /* dump playback timing info */
#define TRACK_SAMPLE_COUNTS /* show difference between sample counters and audiotimestamps returned by driver */
#define PLAYBACK_BUFFERS 4
+#define TSTAMP_TYPE SND_PCM_TSTAMP_TYPE_MONOTONIC
int main(void)
goto _exit;
}
+ err = snd_pcm_sw_params_set_tstamp_type(handle_p, swparams_p, TSTAMP_TYPE);
+ if (err < 0) {
+ printf("Unable to set tstamp type : %s\n", snd_strerror(err));
+ goto _exit;
+ }
+
/* write the sw parameters */
err = snd_pcm_sw_params(handle_p, swparams_p);
if (err < 0) {
goto _exit;
}
+ err = snd_pcm_sw_params_set_tstamp_type(handle_c, swparams_c, TSTAMP_TYPE);
+ if (err < 0) {
+ printf("Unable to set tstamp type : %s\n", snd_strerror(err));
+ goto _exit;
+ }
+
/* write the sw parameters */
err = snd_pcm_sw_params(handle_c, swparams_c);
if (err < 0) {