summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd@debian.org>2012-11-25 22:57:41 +0100
committerSjoerd Simons <sjoerd@debian.org>2012-11-25 22:57:41 +0100
commit014593a3ae35f2f731ebaf9cb4994a0d3d3852dc (patch)
tree47dd528d8d480163a1b7417f07f84ea35b349a1d
parentc90c82795b84e477dc3d46b6b544c6383a06220b (diff)
Imported Upstream version 2.99.2
-rw-r--r--.gitignore33
-rw-r--r--.tarball-version2
-rw-r--r--.version2
-rw-r--r--Makefile.am16
-rw-r--r--Makefile.in16
-rw-r--r--PROTOCOL340
-rw-r--r--config.h.in5
-rwxr-xr-xconfigure54
-rw-r--r--configure.ac11
-rw-r--r--doxygen/.gitignore4
-rw-r--r--m4/.gitignore16
-rw-r--r--man/.gitignore6
-rw-r--r--man/pulse-daemon.conf.54
-rw-r--r--man/pulse-daemon.conf.5.xml.in7
-rw-r--r--po/.gitignore16
-rw-r--r--src/.gitignore73
-rw-r--r--src/Makefile.am4
-rw-r--r--src/Makefile.in4
-rw-r--r--src/daemon/.gitignore3
-rw-r--r--src/modules/alsa/alsa-sink.c26
-rw-r--r--src/modules/alsa/alsa-source.c12
-rw-r--r--src/modules/alsa/alsa-ucm.c2
-rw-r--r--src/modules/alsa/alsa-util.c17
-rw-r--r--src/modules/alsa/alsa-util.h2
-rw-r--r--src/modules/alsa/mixer/paths/analog-input.conf.common6
-rw-r--r--src/modules/alsa/mixer/paths/analog-output-speaker-always.conf13
-rw-r--r--src/modules/alsa/mixer/paths/analog-output-speaker.conf13
-rw-r--r--src/modules/alsa/mixer/paths/analog-output.conf6
-rw-r--r--src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules6
-rw-r--r--src/modules/bluetooth/module-bluetooth-device.c2
-rw-r--r--src/modules/jack/module-jack-sink.c5
-rw-r--r--src/modules/macosx/module-coreaudio-device.c9
-rw-r--r--src/modules/module-combine-sink.c5
-rw-r--r--src/modules/module-device-restore.c16
-rw-r--r--src/modules/module-esound-sink.c5
-rw-r--r--src/modules/module-null-sink.c22
-rw-r--r--src/modules/module-pipe-sink.c7
-rw-r--r--src/modules/module-solaris.c13
-rw-r--r--src/modules/module-tunnel.c5
-rw-r--r--src/modules/module-waveout.c11
-rw-r--r--src/modules/oss/module-oss.c5
-rw-r--r--src/modules/raop/module-raop-sink.c5
-rw-r--r--src/modules/xen/module-xenpv-sink.c7
-rw-r--r--src/pulse/.gitignore1
-rw-r--r--src/pulse/introspect.h8
-rw-r--r--src/pulse/mainloop.c9
-rw-r--r--src/pulse/stream.c20
-rw-r--r--src/pulse/stream.h20
-rw-r--r--src/pulsecore/resampler.c5
-rw-r--r--src/pulsecore/sink-input.c11
-rw-r--r--src/pulsecore/sink.c9
-rw-r--r--src/pulsecore/source-output.c11
-rw-r--r--src/pulsecore/source.c3
-rw-r--r--src/tests/alsa-time-test.c118
54 files changed, 803 insertions, 248 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0635e4d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,33 @@
+.tarball-version
+.version
+.*.swp
+ABOUT-NLS
+intltool-extract.in
+intltool-merge.in
+intltool-update.in
+*~
+*.tar.gz
+*.pc
+PulseAudioConfig.cmake
+PulseAudioConfigVersion.cmake
+/Makefile
+/Makefile.in
+aclocal.m4
+autom4te.cache
+compile
+config.guess
+config.h
+config.h.in
+config.log
+config.rpath
+config.status
+config.sub
+configure
+depcomp
+install-sh
+libltdl
+libtool
+ltmain.sh
+missing
+mkinstalldirs
+stamp-*
diff --git a/.tarball-version b/.tarball-version
index 61bfd43..620718e 100644
--- a/.tarball-version
+++ b/.tarball-version
@@ -1 +1 @@
-2.99.1
+2.99.2
diff --git a/.version b/.version
index 61bfd43..620718e 100644
--- a/.version
+++ b/.version
@@ -1 +1 @@
-2.99.1
+2.99.2
diff --git a/Makefile.am b/Makefile.am
index 8a94a7c..09fe5ef 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -26,12 +26,21 @@ EXTRA_DIST = \
doxygen/Makefile.am \
doxygen/Makefile.in \
doxygen/doxygen.conf.in \
+ PROTOCOL \
README \
todo \
vala/libpulse.deps \
vala/libpulse.vapi \
vala/libpulse-mainloop-glib.deps \
- vala/libpulse-mainloop-glib.vapi
+ vala/libpulse-mainloop-glib.vapi \
+ .gitignore \
+ doxygen/.gitignore \
+ m4/.gitignore \
+ man/.gitignore \
+ po/.gitignore \
+ src/.gitignore \
+ src/daemon/.gitignore \
+ src/pulse/.gitignore
SUBDIRS = src doxygen man po
@@ -74,11 +83,6 @@ fedora-snapshot: dist
cp $(distdir).tar.gz $$HOME/git.fedora/pulseaudio/$(distdir).tar.gz
dist-hook:
- if test -d .git ; then \
- test -z $$USE_GIT || git pull ; \
- test -f ${distdir}/ChangeLog && chmod u+w ${distdir}/ChangeLog ; \
- ( git-changelog.perl || echo "git-changelog.perl failed." ) > ${distdir}/ChangeLog 2>&1 ; \
- fi
echo $(VERSION) > $(distdir)/.tarball-version
echo $(VERSION) > $(distdir)/.version
diff --git a/Makefile.in b/Makefile.in
index 3884ba0..70eb394 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -476,12 +476,21 @@ EXTRA_DIST = \
doxygen/Makefile.am \
doxygen/Makefile.in \
doxygen/doxygen.conf.in \
+ PROTOCOL \
README \
todo \
vala/libpulse.deps \
vala/libpulse.vapi \
vala/libpulse-mainloop-glib.deps \
- vala/libpulse-mainloop-glib.vapi
+ vala/libpulse-mainloop-glib.vapi \
+ .gitignore \
+ doxygen/.gitignore \
+ m4/.gitignore \
+ man/.gitignore \
+ po/.gitignore \
+ src/.gitignore \
+ src/daemon/.gitignore \
+ src/pulse/.gitignore
SUBDIRS = src doxygen man po
MAINTAINERCLEANFILES =
@@ -1123,11 +1132,6 @@ fedora-snapshot: dist
cp $(distdir).tar.gz $$HOME/git.fedora/pulseaudio/$(distdir).tar.gz
dist-hook:
- if test -d .git ; then \
- test -z $$USE_GIT || git pull ; \
- test -f ${distdir}/ChangeLog && chmod u+w ${distdir}/ChangeLog ; \
- ( git-changelog.perl || echo "git-changelog.perl failed." ) > ${distdir}/ChangeLog 2>&1 ; \
- fi
echo $(VERSION) > $(distdir)/.tarball-version
echo $(VERSION) > $(distdir)/.version
diff --git a/PROTOCOL b/PROTOCOL
new file mode 100644
index 0000000..01abeed
--- /dev/null
+++ b/PROTOCOL
@@ -0,0 +1,340 @@
+### v8, implemented by >= 0.8
+
+First version supported.
+
+### v9, implemented by >= 0.9.0
+
+Reply for PA_COMMAND_CREATE_PLAYBACK_STREAM,
+PA_COMMAND_CREATE_RECORD_STREAM now returns buffer_attrs that are used:
+
+Four new fields in reply of PA_COMMAND_CREATE_PLAYBACK_STREAM:
+
+ maxlength
+ tlength
+ prebuf
+ minreq
+
+Two new fields in reply of PA_COMMAND_CREATE_RECORD_STREAM:
+
+ maxlength
+ fragsize
+
+### v10, implemented by >= 0.9.5
+
+New opcodes:
+
+ PA_COMMAND_MOVE_SINK_INPUT
+ PA_COMMAND_MOVE_SOURCE_OUTPUT
+
+SHM data transfer support
+
+### v11, implemented by >= 0.9.7
+
+Reply to to PA_COMMAND_GET_SINK_INPUT_INFO, PA_COMMAND_GET_SINK_INPUT_INFO_LIST gets new field at the end:
+
+ mute
+
+New opcodes:
+
+ PA_COMMAND_SET_SINK_INPUT_MUTE
+ PA_COMMAND_SUSPEND_SINK
+ PA_COMMAND_SUSPEND_SOURCE
+
+### v12, implemented by >= 0.9.8
+
+S32LE, S32BE is now known as sample spec.
+
+Gained six new bool fields for PA_COMMAND_CREATE_PLAYBACK_STREAM, PA_COMMAND_CREATE_RECORD_STREAM request at the end:
+
+ no_remap_channels
+ no_remix_channels
+ fix_format
+ fix_rate
+ fix_channels
+ no_move
+ variable_rate
+
+Reply to these opcodes now includes:
+
+ sample_spec
+ channel_map
+ device_index
+ device_name
+ suspended
+
+New opcodes for changing buffer attrs:
+
+ PA_COMMAND_SET_PLAYBACK_STREAM_BUFFER_ATTR
+ PA_COMMAND_SET_RECORD_STREAM_BUFFER_ATTR
+
+New opcodes for changing sampling rate:
+
+ PA_COMMAND_UPDATE_PLAYBACK_STREAM_SAMPLE_RATE
+ PA_COMMAND_UPDATE_RECORD_STREAM_SAMPLE_RATE
+
+New opcodes for notifications:
+
+ PA_COMMAND_PLAYBACK_STREAM_SUSPENDED
+ PA_COMMAND_CAPTURE_STREAM_SUSPENDED
+ PA_COMMAND_PLAYBACK_STREAM_MOVED
+ PA_COMMAND_CAPTURE_STREAM_MOVED
+
+### v13, implemented by >= 0.9.11
+
+New fields for PA_COMMAND_CREATE_PLAYBACK_STREAM, PA_COMMAND_CREATE_RECORD_STREAM request at the end:
+
+ peak_detect (bool)
+ adjust_latency (bool)
+
+Replace field "name" for PA_COMMAND_CREATE_PLAYBACK_STREAM, PA_COMMAND_CREATE_RECORD_STREAM at the end:
+
+ proplist
+
+Replace field "name" for PA_COMMAND_SET_CLIENT_NAME request at the end:
+
+ proplist
+
+On response of PA_COMMAND_SET_CLIENT_NAME:
+
+ client_index
+
+New proplist field for sink, source, sink input, source output introspection opcodes and at the end:
+
+ proplist
+
+New opcodes for proplist modifications
+
+ PA_COMMAND_UPDATE_RECORD_STREAM_PROPLIST
+ PA_COMMAND_UPDATE_PLAYBACK_STREAM_PROPLIST
+ PA_COMMAND_UPDATE_CLIENT_PROPLIST
+ PA_COMMAND_REMOVE_RECORD_STREAM_PROPLIST
+ PA_COMMAND_REMOVE_PLAYBACK_STREAM_PROPLIST
+ PA_COMMAND_REMOVE_CLIENT_PROPLIST
+
+New field for PA_COMMAND_PLAY_SAMPLE:
+
+ proplist
+
+New field for PA_COMMAND_PLAY_SAMPLE response:
+
+ idx
+
+New field for PA_COMMAND_CREATE_PLAYBACK_STREAM at the end:
+
+ start_muted
+
+Buffer attributes for PA_COMMAND_CREATE_PLAYBACK_STREAM and
+PA_COMMAND_CREATE_RECORD_STREAM may now be 0 for default values.
+
+New field for PA_COMMAND_SET_PLAYBACK_STREAM_BUFFER_ATTR,
+PA_COMMAND_SET_RECORD_STREAM_BUFFER_ATTR at the end:
+
+ adjust_latency (bool)
+
+new message:
+
+ PA_COMMAND_STARTED
+
+### v14, implemented by >= 0.9.12
+
+new message:
+
+ PA_COMMAND_EXTENSION
+
+PA_COMMAND_CREATE_PLAYBACK_STREAM:
+
+ bool volume_set at the end
+
+PA_COMMAND_CREATE_RECORD_STREAM, PA_COMMAND_CREATE_PLAYBACK_STREAM:
+
+ bool early_requests at the end
+
+New field for PA_COMMAND_SET_PLAYBACK_STREAM_BUFFER_ATTR,
+PA_COMMAND_SET_RECORD_STREAM_BUFFER_ATTR at the end:
+
+ early_requests (bool)
+
+### v15, implemented by >= 0.9.15
+
+PA_COMMAND_CREATE_PLAYBACK_STREAM
+
+ bool muted at the end
+
+PA_COMMAND_CREATE_PLAYBACK_STREAM, PA_COMMAND_CREATE_RECORD_STREAM:
+
+ bool dont_inhibit_auto_suspend at the end
+
+PA_COMMAND_GET_MODULE_INFO_LIST
+
+ remove bool auto_unload
+ add proplist at the end
+
+new messages:
+
+ PA_COMMAND_GET_CARD_INFO
+ PA_COMMAND_GET_CARD_INFO_LIST
+ PA_COMMAND_SET_CARD_PROFILE
+
+ PA_COMMAND_CLIENT_EVENT
+ PA_COMMAND_PLAYBACK_STREAM_EVENT
+ PA_COMMAND_RECORD_STREAM_EVENT
+
+ PA_COMMAND_PLAYBACK_BUFFER_ATTR_CHANGED
+ PA_COMMAND_RECORD_BUFFER_ATTR_CHANGED
+
+### v16, implemented by >= 0.9.15
+
+new messages:
+
+ PA_COMMAND_SET_SINK_PORT
+ PA_COMMAND_SET_SOURCE_PORT
+
+## v17, implemented by >= 0.9.20
+
+new flag at end of CREATE_PLAYBACK_STREAM:
+
+ bool relative_volume
+
+## v18, implemented by >= 0.9.22
+
+new flag at end of CREATE_PLAYBACK_STREAM:
+
+ bool passthrough
+
+## v19, implemented by >= 0.9.22
+
+New flag at the end of sink input and source output introspection data:
+
+ bool corked
+
+## v20, implemented by >= 1.0
+
+Two new flags at the end of sink input introspection data:
+
+ bool has_volume
+ bool volume_writable
+
+## v21, implemented by >= 1.0
+
+Changes for format negotiation in the extended API.
+
+New fields PA_COMMAND_CREATE_PLAYBACK_STREAM:
+
+ uint8_t n_formats
+ format_info format1
+ ...
+ format_info formatn
+
+One new field in reply from PA_COMMAND_CREATE_PLAYBACK_STREAM:
+
+ format_info format
+
+New fields in reply from PA_COMMAND_GET_SINK_INFO (and thus
+PA_COMMAND_GET_SINK_INFO_LIST)
+
+ uint8_t n_formats
+ format_info format1
+ ...
+ format_info formatn
+
+One new field in reply from PA_COMMAND_GET_SINK_INPUT_INFO (and thus
+PA_COMMAND_GET_SINK_INPUT_INFO_LIST)
+
+ format_info format
+
+## v22, implemented by >= 1.0
+
+New fields PA_COMMAND_CREATE_RECORD_STREAM:
+
+ uint8_t n_formats
+ format_info format1
+ ...
+ format_info formatn
+ volume
+ bool muted
+ bool volume_set
+ bool muted_set
+ bool relative_volume
+ bool passthrough
+
+One new field in reply from PA_COMMAND_CREATE_RECORD_STREAM:
+
+ format_info format
+
+New fields in reply from PA_COMMAND_GET_SOURCE_INFO (and thus
+PA_COMMAND_GET_SOURCE_INFO_LIST)
+
+ uint8_t n_formats
+ format_info format1
+ ...
+ format_info formatn
+
+Five new fields in reply from PA_COMMAND_GET_SOURCE_OUTPUT_INFO (and thus
+PA_COMMAND_GET_SOURCE_OUTPUT_INFO_LIST)
+
+ volume
+ bool mute
+ bool has_volume
+ bool volume_writable
+ format_info format
+
+## v23, implemented by >= 1.0
+
+New field in PA_COMMAND_UNDERFLOW:
+
+ int64_t index
+
+## v24, implemented by >= 2.0
+
+New field in all commands that send/receive port introspection data
+(PA_COMMAND_GET_(SOURCE|SINK)_INFO,
+PA_COMMAND_GET_(SOURCE|SINK)_INFO_LIST):
+
+ uint32_t available
+
+The field is added once for every port.
+
+## v25, implemented by >= 2.0
+
+When port availability changes, send a subscription event for the
+owning card.
+
+## v26, implemented by >= 2.0
+
+In reply from PA_COMMAND_GET_CARD_INFO (and thus
+PA_COMMAND_GET_CARD_INFO_LIST), the following is added:
+
+ uint32_t n_ports
+
+...followed by n_ports extended port entries, which look like this:
+
+ string name
+ string description
+ uint32_t priority
+ uint32_t available
+ uint8_t direction
+ proplist
+ uint32_t n_profiles
+ string profile_name_1
+ ...
+ string profile_name_n
+
+Profile names must match earlier sent profile names for the same card.
+
+## v27, implemented by >= 3.0
+
+New opcodes:
+ PA_COMMAND_SET_PORT_LATENCY_OFFSET
+
+New field in the card commands that send/receive port introspection data
+PA_COMMAND_GET_CARD_INFO(_LIST)):
+
+ int64_t latency_offset
+
+The field is added once for every port.
+
+#### If you just changed the protocol, read this
+## module-tunnel depends on the sink/source/sink-input/source-input protocol
+## internals, so if you changed these, you might have broken module-tunnel.
+## Don't forget to test module-tunnel-{source,sink} when pushing protocol
+## changes.
diff --git a/config.h.in b/config.h.in
index 91b6e2b..e6fe11c 100644
--- a/config.h.in
+++ b/config.h.in
@@ -506,6 +506,11 @@
/* Have X11? */
#undef HAVE_X11
+/* Define to 1 if you have the
+ </System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h>
+ header file. */
+#undef HAVE__SYSTEM_LIBRARY_FRAMEWORKS_CORESERVICES_FRAMEWORK_HEADERS_CORESERVICES_H
+
/* Define as const if the declaration of iconv() needs const. */
#undef ICONV_CONST
diff --git a/configure b/configure
index acb5d3d..d6fb805 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for pulseaudio 2.99.1.
+# Generated by GNU Autoconf 2.69 for pulseaudio 2.99.2.
#
# Report bugs to <pulseaudio-discuss (at) lists (dot) freedesktop (dot) org>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='pulseaudio'
PACKAGE_TARNAME='pulseaudio'
-PACKAGE_VERSION='2.99.1'
-PACKAGE_STRING='pulseaudio 2.99.1'
+PACKAGE_VERSION='2.99.2'
+PACKAGE_STRING='pulseaudio 2.99.2'
PACKAGE_BUGREPORT='pulseaudio-discuss (at) lists (dot) freedesktop (dot) org'
PACKAGE_URL='http://pulseaudio.org/'
@@ -1692,7 +1692,7 @@ if test "$ac_init_help" = "long"; then
# 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 pulseaudio 2.99.1 to adapt to many kinds of systems.
+\`configure' configures pulseaudio 2.99.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1762,7 +1762,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of pulseaudio 2.99.1:";;
+ short | recursive ) echo "Configuration of pulseaudio 2.99.2:";;
esac
cat <<\_ACEOF
@@ -2024,7 +2024,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-pulseaudio configure 2.99.1
+pulseaudio configure 2.99.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2614,7 +2614,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by pulseaudio $as_me 2.99.1, which was
+It was created by pulseaudio $as_me 2.99.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3556,7 +3556,7 @@ fi
# Define the identity of the package.
PACKAGE='pulseaudio'
- VERSION='2.99.1'
+ VERSION='2.99.2'
cat >>confdefs.h <<_ACEOF
@@ -3701,7 +3701,7 @@ PA_PROTOCOL_VERSION=27
# The stable ABI for client applications, for the version info x:y:z
# always will hold y=z
-LIBPULSE_VERSION_INFO=15:0:15
+LIBPULSE_VERSION_INFO=15:1:15
# A simplified, synchronous, ABI-stable interface for client
@@ -20867,10 +20867,24 @@ $as_echo_n "checking looking for Apple CoreService Framework... " >&6; }
if test "x$ac_cv_header__Developer_Headers_FlatCarbon_CoreServices_h" = xyes; then :
LIBS="$LIBS -framework CoreServices"
else
+ for ac_header in /System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h
+do :
+ ac_fn_c_check_header_mongrel "$LINENO" "/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h" "ac_cv_header__System_Library_Frameworks_CoreServices_framework_Headers_CoreServices_h" "$ac_includes_default"
+if test "x$ac_cv_header__System_Library_Frameworks_CoreServices_framework_Headers_CoreServices_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE__SYSTEM_LIBRARY_FRAMEWORKS_CORESERVICES_FRAMEWORK_HEADERS_CORESERVICES_H 1
+_ACEOF
+ LIBS="$LIBS -framework CoreServices"
+else
as_fn_error $? "CoreServices.h header file not found" "$LINENO" 5
fi
+done
+
+
+fi
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
@@ -25075,12 +25089,12 @@ if test -n "$BLUEZ_CFLAGS"; then
pkg_cv_BLUEZ_CFLAGS="$BLUEZ_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" bluez >= 3.0 \""; } >&5
- ($PKG_CONFIG --exists --print-errors " bluez >= 3.0 ") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" bluez >= 4.99 \""; } >&5
+ ($PKG_CONFIG --exists --print-errors " bluez >= 4.99 ") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_BLUEZ_CFLAGS=`$PKG_CONFIG --cflags " bluez >= 3.0 " 2>/dev/null`
+ pkg_cv_BLUEZ_CFLAGS=`$PKG_CONFIG --cflags " bluez >= 4.99 " 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -25092,12 +25106,12 @@ if test -n "$BLUEZ_LIBS"; then
pkg_cv_BLUEZ_LIBS="$BLUEZ_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" bluez >= 3.0 \""; } >&5
- ($PKG_CONFIG --exists --print-errors " bluez >= 3.0 ") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \" bluez >= 4.99 \""; } >&5
+ ($PKG_CONFIG --exists --print-errors " bluez >= 4.99 ") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_BLUEZ_LIBS=`$PKG_CONFIG --libs " bluez >= 3.0 " 2>/dev/null`
+ pkg_cv_BLUEZ_LIBS=`$PKG_CONFIG --libs " bluez >= 4.99 " 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
@@ -25118,9 +25132,9 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- BLUEZ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs " bluez >= 3.0 " 2>&1`
+ BLUEZ_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs " bluez >= 4.99 " 2>&1`
else
- BLUEZ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " bluez >= 3.0 " 2>&1`
+ BLUEZ_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs " bluez >= 4.99 " 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$BLUEZ_PKG_ERRORS" >&5
@@ -25220,7 +25234,7 @@ if test "x$HAVE_DBUS" != "x1"; then :
fi
if test "x$enable_bluez" = "xyes" && test "x$HAVE_BLUEZ" = "x0"; then :
- as_fn_error $? "*** BLUEZ support not found (requires D-Bus)" "$LINENO" 5
+ as_fn_error $? "*** BLUEZ support not found (requires BlueZ, sbc, and D-Bus)" "$LINENO" 5
fi
@@ -27417,7 +27431,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by pulseaudio $as_me 2.99.1, which was
+This file was extended by pulseaudio $as_me 2.99.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -27484,7 +27498,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-pulseaudio config.status 2.99.1
+pulseaudio config.status 2.99.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 5c70632..595d296 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,7 +44,7 @@ AC_SUBST(PA_PROTOCOL_VERSION, 27)
# The stable ABI for client applications, for the version info x:y:z
# always will hold y=z
-AC_SUBST(LIBPULSE_VERSION_INFO, [15:0:15])
+AC_SUBST(LIBPULSE_VERSION_INFO, [15:1:15])
# A simplified, synchronous, ABI-stable interface for client
# applications, for the version info x:y:z always will hold y=z
@@ -500,7 +500,10 @@ if test "x$os_is_darwin" = "x1" ; then
# How do I check a framework "library" - AC_CHECK_LIB prob. won't work??, just assign LIBS & hope
AC_CHECK_HEADER([/Developer/Headers/FlatCarbon/CoreServices.h],
[LIBS="$LIBS -framework CoreServices"],
- [AC_MSG_ERROR([CoreServices.h header file not found])]
+ [AC_CHECK_HEADERS([/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h],
+ [LIBS="$LIBS -framework CoreServices"],
+ [AC_MSG_ERROR([CoreServices.h header file not found])]
+ )]
)
AC_MSG_RESULT([ok])
@@ -1001,7 +1004,7 @@ AC_ARG_ENABLE([bluez],
AS_HELP_STRING([--disable-bluez],[Disable optional BlueZ support]))
AS_IF([test "x$enable_bluez" != "xno"],
- [PKG_CHECK_MODULES(BLUEZ, [ bluez >= 3.0 ], HAVE_BLUEZ=1, HAVE_BLUEZ=0)],
+ [PKG_CHECK_MODULES(BLUEZ, [ bluez >= 4.99 ], HAVE_BLUEZ=1, HAVE_BLUEZ=0)],
HAVE_BLUEZ=0)
AS_IF([test "x$enable_bluez" != "xno"],
[PKG_CHECK_MODULES(SBC, [ sbc >= 1.0 ], HAVE_BLUEZ=1, HAVE_BLUEZ=0)],
@@ -1009,7 +1012,7 @@ AS_IF([test "x$enable_bluez" != "xno"],
AS_IF([test "x$HAVE_DBUS" != "x1"], HAVE_BLUEZ=0)
AS_IF([test "x$enable_bluez" = "xyes" && test "x$HAVE_BLUEZ" = "x0"],
- [AC_MSG_ERROR([*** BLUEZ support not found (requires D-Bus)])])
+ [AC_MSG_ERROR([*** BLUEZ support not found (requires BlueZ, sbc, and D-Bus)])])
AC_SUBST(BLUEZ_CFLAGS)
AC_SUBST(BLUEZ_LIBS)
diff --git a/doxygen/.gitignore b/doxygen/.gitignore
new file mode 100644
index 0000000..189d6c7
--- /dev/null
+++ b/doxygen/.gitignore
@@ -0,0 +1,4 @@
+/doxygen.conf
+/html/
+/Makefile
+/Makefile.in
diff --git a/m4/.gitignore b/m4/.gitignore
new file mode 100644
index 0000000..f883d98
--- /dev/null
+++ b/m4/.gitignore
@@ -0,0 +1,16 @@
+gettext.m4
+iconv.m4
+lib-ld.m4
+lib-link.m4
+lib-prefix.m4
+nls.m4
+po.m4
+progtest.m4
+argz.m4
+intltool.m4
+libtool.m4
+ltdl.m4
+ltoptions.m4
+ltsugar.m4
+ltversion.m4
+lt~obsolete.m4
diff --git a/man/.gitignore b/man/.gitignore
new file mode 100644
index 0000000..abf96d9
--- /dev/null
+++ b/man/.gitignore
@@ -0,0 +1,6 @@
+/*.1
+/*.1.xml
+/*.5
+/*.5.xml
+/Makefile
+/Makefile.in
diff --git a/man/pulse-daemon.conf.5 b/man/pulse-daemon.conf.5
index 60c50b6..ed5050c 100644
--- a/man/pulse-daemon.conf.5
+++ b/man/pulse-daemon.conf.5
@@ -26,7 +26,7 @@ For the settings that take a boolean argument the values \fBtrue\f1, \fByes\f1,
.TP
\fBenable-remixing=\f1 If disabled never upmix or downmix channels to different channel maps. Instead, do a simple name-based matching only. Defaults to \fByes.\f1
.TP
-\fBenable-lfe-remixing=\f1 if disabeld when upmixing or downmixing ignore LFE channels. When this option is dsabled the output LFE channel will only get a signal when an input LFE channel is available as well. If no input LFE channel is available the output LFE channel will always be 0. If no output LFE channel is available the signal on the input LFE channel will be ignored. Defaults to \fBno\f1.
+\fBenable-lfe-remixing=\f1 If disabled when upmixing or downmixing ignore LFE channels. When this option is disabled the output LFE channel will only get a signal when an input LFE channel is available as well. If no input LFE channel is available the output LFE channel will always be 0. If no output LFE channel is available the signal on the input LFE channel will be ignored. Defaults to \fBno\f1.
.TP
\fBuse-pid-file=\f1 Create a PID file in the runtime directory (\fI$XDG_RUNTIMEDIR/pulse/pid\f1). If this is enabled you may use commands like \fB--kill\f1 or \fB--check\f1. If you are planning to start more than one PulseAudio process per user, you better disable this option since it effectively disables multiple instances. Takes a boolean argument, defaults to \fByes\f1. The \fB--use-pid-file\f1 command line option takes precedence.
.TP
@@ -118,7 +118,7 @@ Most drivers try to open the audio device with these settings and then fall back
.TP
\fBdefault-channel-map\f1 The default channel map.
.TP
-\fBalternate-sample-rate\f1 The alternate sample frequency. Sinks and sources will use either the default-rate-rate value or this alternate value, typically 44.1 or 48kHz. Switching between default and alternate values is enabled only when the sinks/sources are suspended. This option is ignored in passthrough mode where the stream rate will be used. If set to zero, this feature is disabled.
+\fBalternate-sample-rate\f1 The alternate sample frequency. Sinks and sources will use either the default-rate-rate value or this alternate value, typically 44.1 or 48kHz. Switching between default and alternate values is enabled only when the sinks/sources are suspended. This option is ignored in passthrough mode where the stream rate will be used. If set to the same as the default sample rate, this feature is disabled.
.SH DEFAULT FRAGMENT SETTINGS
Some hardware drivers require the hardware playback buffer to be subdivided into several fragments. It is possible to change these buffer metrics for machines with high scheduling latencies. Not all possible values that may be configured here are available in all hardware. The driver will to find the nearest setting supported. Modern drivers that support timer-based scheduling ignore these options.
.TP
diff --git a/man/pulse-daemon.conf.5.xml.in b/man/pulse-daemon.conf.5.xml.in
index a824178..c270d2b 100644
--- a/man/pulse-daemon.conf.5.xml.in
+++ b/man/pulse-daemon.conf.5.xml.in
@@ -113,8 +113,8 @@ USA.
</option>
<option>
- <p><opt>enable-lfe-remixing=</opt> if disabeld when upmixing or
- downmixing ignore LFE channels. When this option is dsabled the
+ <p><opt>enable-lfe-remixing=</opt> If disabled when upmixing or
+ downmixing ignore LFE channels. When this option is disabled the
output LFE channel will only get a signal when an input LFE
channel is available as well. If no input LFE channel is
available the output LFE channel will always be 0. If no output
@@ -437,7 +437,8 @@ USA.
or 48kHz. Switching between default and alternate values is
enabled only when the sinks/sources are suspended. This option
is ignored in passthrough mode where the stream rate will be used.
- If set to zero, this feature is disabled.</p>
+ If set to the same as the default sample rate, this feature is
+ disabled.</p>
</option>
</section>
diff --git a/po/.gitignore b/po/.gitignore
new file mode 100644
index 0000000..1ebb427
--- /dev/null
+++ b/po/.gitignore
@@ -0,0 +1,16 @@
+/.intltool-merge-cache
+/Makefile.in.in
+/Makevars.template
+/POTFILES
+/Rules-quot
+/boldquot.sed
+/en@boldquot.header
+/en@quot.header
+/insert-header.sin
+/pulseaudio.pot
+/quot.sed
+/remove-potcdate.sin
+/*.mo
+/*.gmo
+/Makefile
+/Makefile.in
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..ad8773b
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,73 @@
+TAGS
+*.lo
+*.o
+*.la
+.deps
+.libs
+/Makefile
+/Makefile.in
+proximity-helper
+client.conf
+daemon.conf
+default.pa
+echo-cancel-test
+esdcompat
+gconf-helper
+pacat
+pacmd
+pactl
+padsp
+paplay
+pasuspender
+pax11publish
+pulseaudio
+start-pulseaudio-x11
+start-pulseaudio-kde
+*-symdef.h
+*-orc-gen.[ch]
+# tests
+alsa-time-test
+asyncmsgq-test
+asyncq-test
+channelmap-test
+close-test
+connect-stress
+cpulimit-test
+cpulimit-test2
+cpu-test
+extended-test
+flist-test
+format-test
+get-binary-name-test
+gtk-test
+hook-list-test
+interpol-test
+ipacl-test
+lock-autospawn-test
+mainloop-test
+mainloop-test-glib
+mcalign-test
+memblockq-test
+memblock-test
+mix-test
+once-test
+pacat-simple
+parec-simple
+proplist-test
+queue-test
+remix-test
+resampler-test
+rtpoll-test
+rtstutter
+sig2str-test
+sigbus-test
+smoother-test
+stripnul
+strlist-test
+sync-playback
+system.pa
+thread-mainloop-test
+thread-test
+usergroup-test
+utf8-test
+volume-test
diff --git a/src/Makefile.am b/src/Makefile.am
index cbd7733..155f908 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -530,8 +530,8 @@ gtk_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
alsa_time_test_SOURCES = tests/alsa-time-test.c
alsa_time_test_LDADD = $(AM_LDADD) $(ASOUNDLIB_LIBS)
-alsa_time_test_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS) $(LIBCHECK_CFLAGS)
-alsa_time_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) $(LIBCHECK_LIBS)
+alsa_time_test_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS)
+alsa_time_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
usergroup_test_SOURCES = tests/usergroup-test.c
usergroup_test_LDADD = $(AM_LDADD) libpulsecore-@PA_MAJORMINOR@.la libpulse.la libpulsecommon-@PA_MAJORMINOR@.la
diff --git a/src/Makefile.in b/src/Makefile.in
index 9b8dfaf..b134ab4 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -3257,8 +3257,8 @@ gtk_test_CFLAGS = $(AM_CFLAGS) $(GTK20_CFLAGS)
gtk_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
alsa_time_test_SOURCES = tests/alsa-time-test.c
alsa_time_test_LDADD = $(AM_LDADD) $(ASOUNDLIB_LIBS)
-alsa_time_test_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS) $(LIBCHECK_CFLAGS)
-alsa_time_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS) $(LIBCHECK_LIBS)
+alsa_time_test_CFLAGS = $(AM_CFLAGS) $(ASOUNDLIB_CFLAGS)
+alsa_time_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
usergroup_test_SOURCES = tests/usergroup-test.c
usergroup_test_LDADD = $(AM_LDADD) libpulsecore-@PA_MAJORMINOR@.la libpulse.la libpulsecommon-@PA_MAJORMINOR@.la
usergroup_test_CFLAGS = $(AM_CFLAGS) $(LIBCHECK_CFLAGS)
diff --git a/src/daemon/.gitignore b/src/daemon/.gitignore
new file mode 100644
index 0000000..54e4299
--- /dev/null
+++ b/src/daemon/.gitignore
@@ -0,0 +1,3 @@
+org.pulseaudio.policy
+pulseaudio.desktop
+pulseaudio-kde.desktop
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index d3bf76d..ee82ec7 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -825,6 +825,7 @@ static void update_smoother(struct userdata *u) {
int err;
pa_usec_t now1 = 0, now2;
snd_pcm_status_t *status;
+ snd_htimestamp_t htstamp = { 0, 0 };
snd_pcm_status_alloca(&status);
@@ -833,18 +834,13 @@ static void update_smoother(struct userdata *u) {
/* Let's update the time smoother */
- if (PA_UNLIKELY((err = pa_alsa_safe_delay(u->pcm_handle, &delay, u->hwbuf_size, &u->sink->sample_spec, FALSE)) < 0)) {
+ if (PA_UNLIKELY((err = pa_alsa_safe_delay(u->pcm_handle, status, &delay, u->hwbuf_size, &u->sink->sample_spec, FALSE)) < 0)) {
pa_log_warn("Failed to query DSP status data: %s", pa_alsa_strerror(err));
return;
}
- if (PA_UNLIKELY((err = snd_pcm_status(u->pcm_handle, status)) < 0))
- pa_log_warn("Failed to get timestamp: %s", pa_alsa_strerror(err));
- else {
- snd_htimestamp_t htstamp = { 0, 0 };
- snd_pcm_status_get_htstamp(status, &htstamp);
- now1 = pa_timespec_load(&htstamp);
- }
+ snd_pcm_status_get_htstamp(status, &htstamp);
+ now1 = pa_timespec_load(&htstamp);
/* Hmm, if the timestamp is 0, then it wasn't set and we take the current time */
if (now1 <= 0)
@@ -1612,6 +1608,11 @@ static int process_rewind(struct userdata *u) {
size_t rewind_nbytes, unused_nbytes, limit_nbytes;
pa_assert(u);
+ if (!PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
+ pa_sink_process_rewind(u->sink, 0);
+ return 0;
+ }
+
/* Figure out how much we shall rewind and reset the counter */
rewind_nbytes = u->sink->thread_info.rewind_nbytes;
@@ -1691,16 +1692,17 @@ static void thread_func(void *userdata) {
pa_log_debug("Loop");
#endif
+ if (PA_UNLIKELY(u->sink->thread_info.rewind_requested)) {
+ if (process_rewind(u) < 0)
+ goto fail;
+ }
+
/* Render some data and write it to the dsp */
if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
int work_done;
pa_usec_t sleep_usec = 0;
pa_bool_t on_timeout = pa_rtpoll_timer_elapsed(u->rtpoll);
- if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
- if (process_rewind(u) < 0)
- goto fail;
-
if (u->use_mmap)
work_done = mmap_write(u, &sleep_usec, revents & POLLOUT, on_timeout);
else
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index d3a356a..802b51b 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -767,6 +767,7 @@ static void update_smoother(struct userdata *u) {
int err;
pa_usec_t now1 = 0, now2;
snd_pcm_status_t *status;
+ snd_htimestamp_t htstamp = { 0, 0 };
snd_pcm_status_alloca(&status);
@@ -775,18 +776,13 @@ static void update_smoother(struct userdata *u) {
/* Let's update the time smoother */
- if (PA_UNLIKELY((err = pa_alsa_safe_delay(u->pcm_handle, &delay, u->hwbuf_size, &u->source->sample_spec, TRUE)) < 0)) {
+ if (PA_UNLIKELY((err = pa_alsa_safe_delay(u->pcm_handle, status, &delay, u->hwbuf_size, &u->source->sample_spec, TRUE)) < 0)) {
pa_log_warn("Failed to get delay: %s", pa_alsa_strerror(err));
return;
}
- if (PA_UNLIKELY((err = snd_pcm_status(u->pcm_handle, status)) < 0))
- pa_log_warn("Failed to get timestamp: %s", pa_alsa_strerror(err));
- else {
- snd_htimestamp_t htstamp = { 0, 0 };
- snd_pcm_status_get_htstamp(status, &htstamp);
- now1 = pa_timespec_load(&htstamp);
- }
+ snd_pcm_status_get_htstamp(status, &htstamp);
+ now1 = pa_timespec_load(&htstamp);
/* Hmm, if the timestamp is 0, then it wasn't set and we take the current time */
if (now1 <= 0)
diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
index 81f1c2b..80e98ea 100644
--- a/src/modules/alsa/alsa-ucm.c
+++ b/src/modules/alsa/alsa-ucm.c
@@ -535,7 +535,7 @@ int pa_alsa_ucm_query_profiles(pa_alsa_ucm_config *ucm, int card_index)
err = snd_use_case_mgr_open(&ucm->ucm_mgr, card_name);
if (err < 0) {
- pa_log("UCM not available for card %s", card_name);
+ pa_log_info("UCM not available for card %s", card_name);
goto ucm_mgr_fail;
}
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index bb4e307..4a29a9a 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -1141,10 +1141,11 @@ snd_pcm_sframes_t pa_alsa_safe_avail(snd_pcm_t *pcm, size_t hwbuf_size, const pa
return n;
}
-int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delay, size_t hwbuf_size, const pa_sample_spec *ss, pa_bool_t capture) {
+int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_status_t *status, snd_pcm_sframes_t *delay, size_t hwbuf_size, const pa_sample_spec *ss,
+ pa_bool_t capture) {
ssize_t k;
size_t abs_k;
- int r;
+ int err;
snd_pcm_sframes_t avail = 0;
pa_assert(pcm);
@@ -1154,10 +1155,16 @@ int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delay, size_t hwbuf_si
/* Some ALSA driver expose weird bugs, let's inform the user about
* what is going on. We're going to get both the avail and delay values so
- * that we can compare and check them for capture */
+ * that we can compare and check them for capture.
+ * This is done with snd_pcm_status() which provides
+ * avail, delay and timestamp values in a single kernel call to improve
+ * timer-based scheduling */
- if ((r = snd_pcm_avail_delay(pcm, &avail, delay)) < 0)
- return r;
+ if ((err = snd_pcm_status(pcm, status)) < 0)
+ return err;
+
+ avail = snd_pcm_status_get_avail(status);
+ *delay = snd_pcm_status_get_delay(status);
k = (ssize_t) *delay * (ssize_t) pa_frame_size(ss);
diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
index a4beed2..236a329 100644
--- a/src/modules/alsa/alsa-util.h
+++ b/src/modules/alsa/alsa-util.h
@@ -125,7 +125,7 @@ int pa_alsa_recover_from_poll(snd_pcm_t *pcm, int revents);
pa_rtpoll_item* pa_alsa_build_pollfd(snd_pcm_t *pcm, pa_rtpoll *rtpoll);
snd_pcm_sframes_t pa_alsa_safe_avail(snd_pcm_t *pcm, size_t hwbuf_size, const pa_sample_spec *ss);
-int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_sframes_t *delay, size_t hwbuf_size, const pa_sample_spec *ss, pa_bool_t capture);
+int pa_alsa_safe_delay(snd_pcm_t *pcm, snd_pcm_status_t *status, snd_pcm_sframes_t *delay, size_t hwbuf_size, const pa_sample_spec *ss, pa_bool_t capture);
int pa_alsa_safe_mmap_begin(snd_pcm_t *pcm, const snd_pcm_channel_area_t **areas, snd_pcm_uframes_t *offset, snd_pcm_uframes_t *frames, size_t hwbuf_size, const pa_sample_spec *ss);
char *pa_alsa_get_driver_name(int card);
diff --git a/src/modules/alsa/mixer/paths/analog-input.conf.common b/src/modules/alsa/mixer/paths/analog-input.conf.common
index 9416577..77d46bf 100644
--- a/src/modules/alsa/mixer/paths/analog-input.conf.common
+++ b/src/modules/alsa/mixer/paths/analog-input.conf.common
@@ -235,12 +235,12 @@ name = input-linein
[Element Digital Input Source]
enumeration = select
-[Option Digital Input Source:Analog Inputs]
-name = input
-
[Option Digital Input Source:Digital Mic 1]
name = input-microphone
+[Option Digital Input Source:Analog Inputs]
+name = input
+
[Option Digital Input Source:Digital Mic 2]
name = input-microphone
diff --git a/src/modules/alsa/mixer/paths/analog-output-speaker-always.conf b/src/modules/alsa/mixer/paths/analog-output-speaker-always.conf
index ba4cd5c..14d67b0 100644
--- a/src/modules/alsa/mixer/paths/analog-output-speaker-always.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-speaker-always.conf
@@ -124,4 +124,17 @@ volume = merge
override-map.1 = lfe
override-map.2 = lfe,lfe
+[Element Bass Speaker]
+switch = mute
+volume = merge
+override-map.1 = lfe
+override-map.2 = lfe,lfe
+required-any = any
+
+[Element CLFE]
+switch = mute
+volume = merge
+override-map.1 = all-center
+override-map.2 = all-center,lfe
+
.include analog-output.conf.common
diff --git a/src/modules/alsa/mixer/paths/analog-output-speaker.conf b/src/modules/alsa/mixer/paths/analog-output-speaker.conf
index 7540315..a7e3c4c 100644
--- a/src/modules/alsa/mixer/paths/analog-output-speaker.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-speaker.conf
@@ -137,4 +137,17 @@ override-map.1 = lfe
override-map.2 = lfe,lfe
required-any = any
+[Element Bass Speaker]
+switch = mute
+volume = merge
+override-map.1 = lfe
+override-map.2 = lfe,lfe
+required-any = any
+
+[Element CLFE]
+switch = mute
+volume = merge
+override-map.1 = all-center
+override-map.2 = all-center,lfe
+
.include analog-output.conf.common
diff --git a/src/modules/alsa/mixer/paths/analog-output.conf b/src/modules/alsa/mixer/paths/analog-output.conf
index 16dadc4..1b7482c 100644
--- a/src/modules/alsa/mixer/paths/analog-output.conf
+++ b/src/modules/alsa/mixer/paths/analog-output.conf
@@ -96,4 +96,10 @@ volume = merge
override-map.1 = lfe
override-map.2 = lfe,lfe
+[Element CLFE]
+switch = mute
+volume = merge
+override-map.1 = all-center
+override-map.2 = all-center,lfe
+
.include analog-output.conf.common
diff --git a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
index 52cc52d..bb3b5b4 100644
--- a/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
+++ b/src/modules/alsa/mixer/profile-sets/90-pulseaudio.rules
@@ -31,6 +31,10 @@ ATTRS{vendor}=="0x8086", ENV{PULSE_PROFILE_SET}="extra-hdmi.conf"
# This should only be necessary for kernels 3.3, 3.4 and 3.5 (as they are lacking the phantom jack kctls).
# Acer AOA150
ATTRS{subsystem_vendor}=="0x1025", ATTRS{subsystem_device}=="0x015b", ENV{PULSE_PROFILE_SET}="force-speaker-and-int-mic.conf"
+# Acer Aspire 4810TZ
+ATTRS{subsystem_vendor}=="0x1025", ATTRS{subsystem_device}=="0x022a", ENV{PULSE_PROFILE_SET}="force-speaker-and-int-mic.conf"
+# Packard bell dot m/a
+ATTRS{subsystem_vendor}=="0x1025", ATTRS{subsystem_device}=="0x028c", ENV{PULSE_PROFILE_SET}="force-speaker-and-int-mic.conf"
# Acer Aspire 1810TZ
ATTRS{subsystem_vendor}=="0x1025", ATTRS{subsystem_device}=="0x029b", ENV{PULSE_PROFILE_SET}="force-speaker-and-int-mic.conf"
# Acer AOD260 and AO532h
@@ -65,6 +69,8 @@ ATTRS{subsystem_vendor}=="0x1043", ATTRS{subsystem_device}=="0x83ce", ENV{PULSE_
ATTRS{subsystem_vendor}=="0x104d", ATTRS{subsystem_device}=="0x9033", ENV{PULSE_PROFILE_SET}="force-speaker-and-int-mic.conf"
# Sony Vaio VPC-W115XG
ATTRS{subsystem_vendor}=="0x104d", ATTRS{subsystem_device}=="0x9064", ENV{PULSE_PROFILE_SET}="force-speaker-and-int-mic.conf"
+# Fujitsu Lifebook S7110
+ATTRS{subsystem_vendor}=="0x10cf", ATTRS{subsystem_device}=="0x1397", ENV{PULSE_PROFILE_SET}="force-speaker-and-int-mic.conf"
# Fujitsu Lifebook A530
ATTRS{subsystem_vendor}=="0x10cf", ATTRS{subsystem_device}=="0x1531", ENV{PULSE_PROFILE_SET}="force-speaker-and-int-mic.conf"
# Toshiba A200
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 8c2efa4..8a9d39f 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1081,7 +1081,7 @@ static void thread_func(void *userdata) {
if (u->sink && PA_SINK_IS_LINKED(u->sink->thread_info.state)) {
- if (u->sink->thread_info.rewind_requested)
+ if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
pa_sink_process_rewind(u->sink, 0);
if (pollfd) {
diff --git a/src/modules/jack/module-jack-sink.c b/src/modules/jack/module-jack-sink.c
index f18ff6e..1e34abd 100644
--- a/src/modules/jack/module-jack-sink.c
+++ b/src/modules/jack/module-jack-sink.c
@@ -229,9 +229,8 @@ static void thread_func(void *userdata) {
for (;;) {
int ret;
- if (PA_SINK_IS_OPENED(u->sink->thread_info.state))
- if (u->sink->thread_info.rewind_requested)
- pa_sink_process_rewind(u->sink, 0);
+ if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
+ pa_sink_process_rewind(u->sink, 0);
if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0)
goto fail;
diff --git a/src/modules/macosx/module-coreaudio-device.c b/src/modules/macosx/module-coreaudio-device.c
index 6d39158..ea88ebd 100644
--- a/src/modules/macosx/module-coreaudio-device.c
+++ b/src/modules/macosx/module-coreaudio-device.c
@@ -280,9 +280,6 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
pa_assert(sink);
if (PA_SINK_IS_OPENED(sink->pa_sink->thread_info.state)) {
- if (sink->pa_sink->thread_info.rewind_requested)
- pa_sink_process_rewind(sink->pa_sink, 0);
-
audio_chunk.memblock = pa_memblock_new_fixed(u->module->core->mempool, buf->mData, buf->mDataByteSize, FALSE);
audio_chunk.length = buf->mDataByteSize;
audio_chunk.index = 0;
@@ -664,8 +661,14 @@ static void thread_func(void *userdata) {
pa_thread_mq_install(&u->thread_mq);
for (;;) {
+ coreaudio_sink *ca_sink;
int ret;
+ PA_LLIST_FOREACH(ca_sink, u->sinks) {
+ if (PA_UNLIKELY(ca_sink->pa_sink->thread_info.rewind_requested))
+ pa_sink_process_rewind(ca_sink->pa_sink, 0);
+ }
+
ret = pa_rtpoll_run(u->rtpoll, TRUE);
if (ret < 0)
diff --git a/src/modules/module-combine-sink.c b/src/modules/module-combine-sink.c
index 1afdc12..488f69f 100644
--- a/src/modules/module-combine-sink.c
+++ b/src/modules/module-combine-sink.c
@@ -305,9 +305,8 @@ static void thread_func(void *userdata) {
for (;;) {
int ret;
- if (PA_SINK_IS_OPENED(u->sink->thread_info.state))
- if (u->sink->thread_info.rewind_requested)
- pa_sink_process_rewind(u->sink, 0);
+ if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
+ pa_sink_process_rewind(u->sink, 0);
/* If no outputs are connected, render some data and drop it immediately. */
if (u->sink->thread_info.state == PA_SINK_RUNNING && !u->thread_info.active_outputs) {
diff --git a/src/modules/module-device-restore.c b/src/modules/module-device-restore.c
index b9bd498..16acfd8 100644
--- a/src/modules/module-device-restore.c
+++ b/src/modules/module-device-restore.c
@@ -779,12 +779,13 @@ static pa_hook_result_t sink_fixate_hook_callback(pa_core *c, pa_sink_new_data *
if (!new_data->volume_is_set) {
pa_cvolume v;
+ char buf[PA_CVOLUME_SNPRINT_MAX];
pa_log_info("Restoring volume for sink %s.", new_data->name);
-
v = e->volume;
pa_cvolume_remap(&v, &e->channel_map, &new_data->channel_map);
pa_sink_new_data_set_volume(new_data, &v);
+ pa_log_info("Restored volume: %s", pa_cvolume_snprint(buf, PA_CVOLUME_SNPRINT_MAX, &new_data->volume));
new_data->save_volume = TRUE;
} else
@@ -823,14 +824,15 @@ static pa_hook_result_t sink_port_hook_callback(pa_core *c, pa_sink *sink, struc
if ((e = perportentry_read(u, name, (sink->active_port ? sink->active_port->name : NULL)))) {
if (u->restore_volume && e->volume_valid) {
-
pa_cvolume v;
+ char buf[PA_CVOLUME_SNPRINT_MAX];
pa_log_info("Restoring volume for sink %s.", sink->name);
-
v = e->volume;
pa_cvolume_remap(&v, &e->channel_map, &sink->channel_map);
pa_sink_set_volume(sink, &v, TRUE, FALSE);
+ pa_log_info("Restored volume: %s", pa_cvolume_snprint(buf, PA_CVOLUME_SNPRINT_MAX, &sink->reference_volume));
+
sink->save_volume = TRUE;
}
@@ -920,12 +922,13 @@ static pa_hook_result_t source_fixate_hook_callback(pa_core *c, pa_source_new_da
if (!new_data->volume_is_set) {
pa_cvolume v;
+ char buf[PA_CVOLUME_SNPRINT_MAX];
pa_log_info("Restoring volume for source %s.", new_data->name);
-
v = e->volume;
pa_cvolume_remap(&v, &e->channel_map, &new_data->channel_map);
pa_source_new_data_set_volume(new_data, &v);
+ pa_log_info("Restored volume: %s", pa_cvolume_snprint(buf, PA_CVOLUME_SNPRINT_MAX, &new_data->volume));
new_data->save_volume = TRUE;
} else
@@ -964,14 +967,15 @@ static pa_hook_result_t source_port_hook_callback(pa_core *c, pa_source *source,
if ((e = perportentry_read(u, name, (source->active_port ? source->active_port->name : NULL)))) {
if (u->restore_volume && e->volume_valid) {
-
pa_cvolume v;
+ char buf[PA_CVOLUME_SNPRINT_MAX];
pa_log_info("Restoring volume for source %s.", source->name);
-
v = e->volume;
pa_cvolume_remap(&v, &e->channel_map, &source->channel_map);
pa_source_set_volume(source, &v, TRUE, FALSE);
+ pa_log_info("Restored volume: %s", pa_cvolume_snprint(buf, PA_CVOLUME_SNPRINT_MAX, &source->reference_volume));
+
source->save_volume = TRUE;
}
diff --git a/src/modules/module-esound-sink.c b/src/modules/module-esound-sink.c
index 0838716..40ef5bc 100644
--- a/src/modules/module-esound-sink.c
+++ b/src/modules/module-esound-sink.c
@@ -213,9 +213,8 @@ static void thread_func(void *userdata) {
for (;;) {
int ret;
- if (PA_SINK_IS_OPENED(u->sink->thread_info.state))
- if (u->sink->thread_info.rewind_requested)
- pa_sink_process_rewind(u->sink, 0);
+ if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
+ pa_sink_process_rewind(u->sink, 0);
if (u->rtpoll_item) {
struct pollfd *pollfd;
diff --git a/src/modules/module-null-sink.c b/src/modules/module-null-sink.c
index f40546a..10bc67f 100644
--- a/src/modules/module-null-sink.c
+++ b/src/modules/module-null-sink.c
@@ -136,11 +136,11 @@ static void process_rewind(struct userdata *u, pa_usec_t now) {
pa_assert(u);
- /* Figure out how much we shall rewind and reset the counter */
rewind_nbytes = u->sink->thread_info.rewind_nbytes;
- u->sink->thread_info.rewind_nbytes = 0;
- pa_assert(rewind_nbytes > 0);
+ if (!PA_SINK_IS_OPENED(u->sink->thread_info.state) || rewind_nbytes <= 0)
+ goto do_nothing;
+
pa_log_debug("Requested to rewind %lu bytes.", (unsigned long) rewind_nbytes);
if (u->timestamp <= now)
@@ -207,21 +207,17 @@ static void thread_func(void *userdata) {
u->timestamp = pa_rtclock_now();
for (;;) {
+ pa_usec_t now = 0;
int ret;
- /* Render some data and drop it immediately */
- if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
- pa_usec_t now;
-
+ if (PA_SINK_IS_OPENED(u->sink->thread_info.state))
now = pa_rtclock_now();
- if (u->sink->thread_info.rewind_requested) {
- if (u->sink->thread_info.rewind_nbytes > 0)
- process_rewind(u, now);
- else
- pa_sink_process_rewind(u->sink, 0);
- }
+ if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
+ process_rewind(u, now);
+ /* Render some data and drop it immediately */
+ if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
if (u->timestamp <= now)
process_render(u, now);
diff --git a/src/modules/module-pipe-sink.c b/src/modules/module-pipe-sink.c
index ef18fad..54dceb4 100644
--- a/src/modules/module-pipe-sink.c
+++ b/src/modules/module-pipe-sink.c
@@ -180,12 +180,11 @@ static void thread_func(void *userdata) {
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
+ if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
+ pa_sink_process_rewind(u->sink, 0);
+
/* Render some data and write it to the fifo */
if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
-
- if (u->sink->thread_info.rewind_requested)
- pa_sink_process_rewind(u->sink, 0);
-
if (pollfd->revents) {
if (process_render(u) < 0)
goto fail;
diff --git a/src/modules/module-solaris.c b/src/modules/module-solaris.c
index 5081ceb..753c1a1 100644
--- a/src/modules/module-solaris.c
+++ b/src/modules/module-solaris.c
@@ -587,9 +587,12 @@ static void process_rewind(struct userdata *u) {
pa_assert(u);
- /* Figure out how much we shall rewind and reset the counter */
+ if (!PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
+ pa_sink_process_rewind(u->sink, 0);
+ return;
+ }
+
rewind_nbytes = u->sink->thread_info.rewind_nbytes;
- u->sink->thread_info.rewind_nbytes = 0;
if (rewind_nbytes > 0) {
pa_log_debug("Requested to rewind %lu bytes.", (unsigned long) rewind_nbytes);
@@ -625,13 +628,13 @@ static void thread_func(void *userdata) {
for (;;) {
/* Render some data and write it to the dsp */
+ if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
+ process_rewind(u);
+
if (u->sink && PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
pa_usec_t xtime0, ysleep_interval, xsleep_interval;
uint64_t buffered_bytes;
- if (u->sink->thread_info.rewind_requested)
- process_rewind(u);
-
err = ioctl(u->fd, AUDIO_GETINFO, &info);
if (err < 0) {
pa_log("AUDIO_GETINFO ioctl failed: %s", pa_cstrerror(errno));
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index 4675a62..66b9617 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -698,9 +698,8 @@ static void thread_func(void *userdata) {
int ret;
#ifdef TUNNEL_SINK
- if (PA_SINK_IS_OPENED(u->sink->thread_info.state))
- if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
- pa_sink_process_rewind(u->sink, 0);
+ if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
+ pa_sink_process_rewind(u->sink, 0);
#endif
if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0)
diff --git a/src/modules/module-waveout.c b/src/modules/module-waveout.c
index 53efce9..39c2ab4 100644
--- a/src/modules/module-waveout.c
+++ b/src/modules/module-waveout.c
@@ -255,13 +255,16 @@ static void thread_func(void *userdata) {
int ret;
pa_bool_t need_timer = FALSE;
- if (u->sink && PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
- if (u->sink->thread_info.rewind_requested)
+ if (u->sink) {
+ if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
pa_sink_process_rewind(u->sink, 0);
- do_write(u);
- need_timer = TRUE;
+ if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
+ do_write(u);
+ need_timer = TRUE;
+ }
}
+
if (u->source && PA_SOURCE_IS_OPENED(u->source->thread_info.state)) {
do_read(u);
need_timer = TRUE;
diff --git a/src/modules/oss/module-oss.c b/src/modules/oss/module-oss.c
index 6f0f271..c4746ca 100644
--- a/src/modules/oss/module-oss.c
+++ b/src/modules/oss/module-oss.c
@@ -891,9 +891,8 @@ static void thread_func(void *userdata) {
/* pa_log("loop"); */
- if (u->sink && PA_SINK_IS_OPENED(u->sink->thread_info.state))
- if (u->sink->thread_info.rewind_requested)
- pa_sink_process_rewind(u->sink, 0);
+ if (PA_UNLIKELY(u->sink && u->sink->thread_info.rewind_requested))
+ pa_sink_process_rewind(u->sink, 0);
/* Render some data and write it to the dsp */
diff --git a/src/modules/raop/module-raop-sink.c b/src/modules/raop/module-raop-sink.c
index 2cb7a95..1816fee 100644
--- a/src/modules/raop/module-raop-sink.c
+++ b/src/modules/raop/module-raop-sink.c
@@ -327,9 +327,8 @@ static void thread_func(void *userdata) {
for (;;) {
int ret;
- if (PA_SINK_IS_OPENED(u->sink->thread_info.state))
- if (u->sink->thread_info.rewind_requested)
- pa_sink_process_rewind(u->sink, 0);
+ if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
+ pa_sink_process_rewind(u->sink, 0);
if (u->rtpoll_item) {
struct pollfd *pollfd;
diff --git a/src/modules/xen/module-xenpv-sink.c b/src/modules/xen/module-xenpv-sink.c
index 34e5fc4..6f82ff4 100644
--- a/src/modules/xen/module-xenpv-sink.c
+++ b/src/modules/xen/module-xenpv-sink.c
@@ -338,12 +338,11 @@ static void thread_func(void *userdata) {
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
+ if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
+ pa_sink_process_rewind(u->sink, 0);
+
/* Render some data and write it to the fifo */
if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
-
- if (u->sink->thread_info.rewind_requested)
- pa_sink_process_rewind(u->sink, 0);
-
if (pollfd->revents) {
if (process_render(u) < 0)
goto fail;
diff --git a/src/pulse/.gitignore b/src/pulse/.gitignore
new file mode 100644
index 0000000..6702033
--- /dev/null
+++ b/src/pulse/.gitignore
@@ -0,0 +1 @@
+version.h
diff --git a/src/pulse/introspect.h b/src/pulse/introspect.h
index 6ea4536..a833471 100644
--- a/src/pulse/introspect.h
+++ b/src/pulse/introspect.h
@@ -522,8 +522,8 @@ typedef struct pa_sink_input_info {
pa_sample_spec sample_spec; /**< The sample specification of the sink input. */
pa_channel_map channel_map; /**< Channel map */
pa_cvolume volume; /**< The volume of this sink input. */
- pa_usec_t buffer_usec; /**< Latency due to buffering in sink input, see pa_latency_info for details. */
- pa_usec_t sink_usec; /**< Latency of the sink device, see pa_latency_info for details. */
+ pa_usec_t buffer_usec; /**< Latency due to buffering in sink input, see pa_timing_info for details. */
+ pa_usec_t sink_usec; /**< Latency of the sink device, see pa_timing_info for details. */
const char *resample_method; /**< The resampling method used by this sink input. */
const char *driver; /**< Driver name */
int mute; /**< Stream muted \since 0.9.7 */
@@ -573,8 +573,8 @@ typedef struct pa_source_output_info {
uint32_t source; /**< Index of the connected source */
pa_sample_spec sample_spec; /**< The sample specification of the source output */
pa_channel_map channel_map; /**< Channel map */
- pa_usec_t buffer_usec; /**< Latency due to buffering in the source output, see pa_latency_info for details. */
- pa_usec_t source_usec; /**< Latency of the source device, see pa_latency_info for details. */
+ pa_usec_t buffer_usec; /**< Latency due to buffering in the source output, see pa_timing_info for details. */
+ pa_usec_t source_usec; /**< Latency of the source device, see pa_timing_info for details. */
const char *resample_method; /**< The resampling method used by this source output. */
const char *driver; /**< Driver name */
pa_proplist *proplist; /**< Property list \since 0.9.11 */
diff --git a/src/pulse/mainloop.c b/src/pulse/mainloop.c
index 725bdb4..aec082c 100644
--- a/src/pulse/mainloop.c
+++ b/src/pulse/mainloop.c
@@ -114,7 +114,7 @@ struct pa_mainloop {
int retval;
pa_bool_t quit:1;
- pa_bool_t wakeup_requested:1;
+ pa_atomic_t wakeup_requested;
int wakeup_pipe[2];
int wakeup_pipe_type;
@@ -772,9 +772,9 @@ void pa_mainloop_wakeup(pa_mainloop *m) {
char c = 'W';
pa_assert(m);
- if (m->wakeup_pipe[1] >= 0 && m->state == STATE_POLLING) {
+ if (m->wakeup_pipe[1] >= 0) {
pa_write(m->wakeup_pipe[1], &c, sizeof(c), &m->wakeup_pipe_type);
- m->wakeup_requested++;
+ pa_atomic_store(&m->wakeup_requested, TRUE);
}
}
@@ -786,10 +786,9 @@ static void clear_wakeup(pa_mainloop *m) {
if (m->wakeup_pipe[0] < 0)
return;
- if (m->wakeup_requested) {
+ if (pa_atomic_cmpxchg(&m->wakeup_requested, TRUE, FALSE)) {
while (pa_read(m->wakeup_pipe[0], &c, sizeof(c), &m->wakeup_pipe_type) == sizeof(c))
;
- m->wakeup_requested = 0;
}
}
diff --git a/src/pulse/stream.c b/src/pulse/stream.c
index 2b6d306..f692d37 100644
--- a/src/pulse/stream.c
+++ b/src/pulse/stream.c
@@ -1593,9 +1593,17 @@ int pa_stream_peek(pa_stream *s, const void **data, size_t *length) {
if (!s->peek_memchunk.memblock) {
if (pa_memblockq_peek(s->record_memblockq, &s->peek_memchunk) < 0) {
+ /* record_memblockq is empty. */
*data = NULL;
*length = 0;
return 0;
+
+ } else if (!s->peek_memchunk.memblock) {
+ /* record_memblockq isn't empty, but it doesn't have any data at
+ * the current read index. */
+ *data = NULL;
+ *length = s->peek_memchunk.length;
+ return 0;
}
s->peek_data = pa_memblock_acquire(s->peek_memchunk.memblock);
@@ -1614,7 +1622,7 @@ int pa_stream_drop(pa_stream *s) {
PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED);
PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
PA_CHECK_VALIDITY(s->context, s->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE);
- PA_CHECK_VALIDITY(s->context, s->peek_memchunk.memblock, PA_ERR_BADSTATE);
+ PA_CHECK_VALIDITY(s->context, s->peek_memchunk.length > 0, PA_ERR_BADSTATE);
pa_memblockq_drop(s->record_memblockq, s->peek_memchunk.length);
@@ -1622,9 +1630,13 @@ int pa_stream_drop(pa_stream *s) {
if (s->timing_info_valid && !s->timing_info.read_index_corrupt)
s->timing_info.read_index += (int64_t) s->peek_memchunk.length;
- pa_assert(s->peek_data);
- pa_memblock_release(s->peek_memchunk.memblock);
- pa_memblock_unref(s->peek_memchunk.memblock);
+ if (s->peek_memchunk.memblock) {
+ pa_assert(s->peek_data);
+ s->peek_data = NULL;
+ pa_memblock_release(s->peek_memchunk.memblock);
+ pa_memblock_unref(s->peek_memchunk.memblock);
+ }
+
pa_memchunk_reset(&s->peek_memchunk);
return 0;
diff --git a/src/pulse/stream.h b/src/pulse/stream.h
index b4464fa..a6785ec 100644
--- a/src/pulse/stream.h
+++ b/src/pulse/stream.h
@@ -534,11 +534,21 @@ int pa_stream_write(
pa_seek_mode_t seek /**< Seek mode, must be PA_SEEK_RELATIVE for upload streams */);
/** Read the next fragment from the buffer (for recording streams).
- * \a data will point to the actual data and \a nbytes will contain the size
- * of the data in bytes (which can be less or more than a complete
- * fragment). Use pa_stream_drop() to actually remove the data from
- * the buffer. If no data is available this will return a NULL
- * pointer. */
+ * If there is data at the current read index, \a data will point to
+ * the actual data and \a nbytes will contain the size of the data in
+ * bytes (which can be less or more than a complete fragment).
+ *
+ * If there is no data at the current read index, it means that either
+ * the buffer is empty or it contains a hole (that is, the write index
+ * is ahead of the read index but there's no data where the read index
+ * points at). If the buffer is empty, \a data will be NULL and
+ * \a nbytes will be 0. If there is a hole, \a data will be NULL and
+ * \a nbytes will contain the length of the hole.
+ *
+ * Use pa_stream_drop() to actually remove the data from the buffer
+ * and move the read index forward. pa_stream_drop() should not be
+ * called if the buffer is empty, but it should be called if there is
+ * a hole. */
int pa_stream_peek(
pa_stream *p /**< The stream to use */,
const void **data /**< Pointer to pointer that will point to data */,
diff --git a/src/pulsecore/resampler.c b/src/pulsecore/resampler.c
index 38c5202..a13e700 100644
--- a/src/pulsecore/resampler.c
+++ b/src/pulsecore/resampler.c
@@ -237,7 +237,10 @@ pa_resampler* pa_resampler_new(
#ifdef HAVE_SPEEX
method = PA_RESAMPLER_SPEEX_FLOAT_BASE + 3;
#else
- method = PA_RESAMPLER_FFMPEG;
+ if (flags & PA_RESAMPLER_VARIABLE_RATE)
+ method = PA_RESAMPLER_TRIVIAL;
+ else
+ method = PA_RESAMPLER_FFMPEG;
#endif
}
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 7a7575a..a5edd21 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -371,10 +371,7 @@ int pa_sink_input_new(
pa_log_info("Trying to change sample rate");
if (pa_sink_update_rate(data->sink, data->sample_spec.rate, pa_sink_input_new_data_is_passthrough(data)) == TRUE)
- pa_log_info("Rate changed to %u Hz",
- data->sink->sample_spec.rate);
- else
- pa_log_info("Resampling enabled to %u Hz", data->sink->sample_spec.rate);
+ pa_log_info("Rate changed to %u Hz", data->sink->sample_spec.rate);
}
/* Due to the fixing of the sample spec the volume might not match anymore */
@@ -1662,11 +1659,7 @@ int pa_sink_input_finish_move(pa_sink_input *i, pa_sink *dest, pa_bool_t save) {
pa_log_info("Trying to change sample rate");
if (pa_sink_update_rate(dest, i->sample_spec.rate, pa_sink_input_is_passthrough(i)) == TRUE)
- pa_log_info("Rate changed to %u Hz",
- dest->sample_spec.rate);
- else
- pa_log_info("Resampling enabled to %u Hz",
- dest->sample_spec.rate);
+ pa_log_info("Rate changed to %u Hz", dest->sample_spec.rate);
}
if (i->moving)
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index 9958be6..4512470 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -938,9 +938,6 @@ void pa_sink_process_rewind(pa_sink *s, size_t nbytes) {
s->thread_info.rewind_nbytes = 0;
s->thread_info.rewind_requested = FALSE;
- if (s->thread_info.state == PA_SINK_SUSPENDED)
- return;
-
if (nbytes > 0) {
pa_log_debug("Processing rewind...");
if (s->flags & PA_SINK_DEFERRED_VOLUME)
@@ -1392,6 +1389,9 @@ pa_bool_t pa_sink_update_rate(pa_sink *s, uint32_t rate, pa_bool_t passthrough)
desired_rate = rate; /* use stream sampling rate, discard default/alternate settings */
}
+ if (desired_rate == s->sample_spec.rate)
+ return FALSE;
+
if (!passthrough && pa_sink_used_by(s) > 0)
return FALSE;
@@ -2926,9 +2926,6 @@ void pa_sink_request_rewind(pa_sink*s, size_t nbytes) {
pa_sink_assert_io_context(s);
pa_assert(PA_SINK_IS_LINKED(s->thread_info.state));
- if (s->thread_info.state == PA_SINK_SUSPENDED)
- return;
-
if (nbytes == (size_t) -1)
nbytes = s->thread_info.max_rewind;
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index 1297ec7..85045e7 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -350,10 +350,7 @@ int pa_source_output_new(
pa_log_info("Trying to change sample rate");
if (pa_source_update_rate(data->source, data->sample_spec.rate, pa_source_output_new_data_is_passthrough(data)) == TRUE)
- pa_log_info("Rate changed to %u Hz",
- data->source->sample_spec.rate);
- else
- pa_log_info("Resampling enabled to %u Hz", data->source->sample_spec.rate);
+ pa_log_info("Rate changed to %u Hz", data->source->sample_spec.rate);
}
if (data->resample_method == PA_RESAMPLER_INVALID)
@@ -1425,11 +1422,7 @@ int pa_source_output_finish_move(pa_source_output *o, pa_source *dest, pa_bool_t
pa_log_info("Trying to change sample rate");
if (pa_source_update_rate(dest, o->sample_spec.rate, pa_source_output_is_passthrough(o)) == TRUE)
- pa_log_info("Rate changed to %u Hz",
- dest->sample_spec.rate);
- else
- pa_log_info("Resampling enabled to %u Hz",
- dest->sample_spec.rate);
+ pa_log_info("Rate changed to %u Hz", dest->sample_spec.rate);
}
if (o->moving)
diff --git a/src/pulsecore/source.c b/src/pulsecore/source.c
index 7af86f5..e9c3669 100644
--- a/src/pulsecore/source.c
+++ b/src/pulsecore/source.c
@@ -1000,6 +1000,9 @@ pa_bool_t pa_source_update_rate(pa_source *s, uint32_t rate, pa_bool_t passthrou
desired_rate = rate; /* use stream sampling rate, discard default/alternate settings */
}
+ if (desired_rate == s->sample_spec.rate)
+ return FALSE;
+
if (!passthrough && pa_source_used_by(s) > 0)
return FALSE;
diff --git a/src/tests/alsa-time-test.c b/src/tests/alsa-time-test.c
index a7cd938..ab194ee 100644
--- a/src/tests/alsa-time-test.c
+++ b/src/tests/alsa-time-test.c
@@ -6,21 +6,17 @@
#include <inttypes.h>
#include <time.h>
-#include <check.h>
-
#include <alsa/asoundlib.h>
-static const char *dev;
-static int cap;
-
static uint64_t timespec_us(const struct timespec *ts) {
return
ts->tv_sec * 1000000LLU +
ts->tv_nsec / 1000LLU;
}
-START_TEST (alsa_time_test) {
- int r;
+int main(int argc, char *argv[]) {
+ const char *dev;
+ int r, cap;
snd_pcm_hw_params_t *hwparams;
snd_pcm_sw_params_t *swparams;
snd_pcm_status_t *status;
@@ -41,97 +37,100 @@ START_TEST (alsa_time_test) {
snd_pcm_status_alloca(&status);
r = clock_gettime(CLOCK_MONOTONIC, &start);
- fail_unless(r == 0);
+ assert(r == 0);
start_us = timespec_us(&start);
+ dev = argc > 1 ? argv[1] : "front:AudioPCI";
+ cap = argc > 2 ? atoi(argv[2]) : 0;
+
if (cap == 0)
r = snd_pcm_open(&pcm, dev, SND_PCM_STREAM_PLAYBACK, 0);
else
r = snd_pcm_open(&pcm, dev, SND_PCM_STREAM_CAPTURE, 0);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_hw_params_any(pcm, hwparams);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_hw_params_set_rate_resample(pcm, hwparams, 0);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_hw_params_set_access(pcm, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_hw_params_set_format(pcm, hwparams, SND_PCM_FORMAT_S16_LE);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_hw_params_set_rate_near(pcm, hwparams, &rate, NULL);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_hw_params_set_channels(pcm, hwparams, 2);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_hw_params_set_periods_integer(pcm, hwparams);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_hw_params_set_periods_near(pcm, hwparams, &periods, &dir);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_hw_params_set_buffer_size_near(pcm, hwparams, &buffer_size);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_hw_params(pcm, hwparams);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_hw_params_current(pcm, hwparams);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_sw_params_current(pcm, swparams);
- fail_unless(r == 0);
+ assert(r == 0);
if (cap == 0)
r = snd_pcm_sw_params_set_avail_min(pcm, swparams, 1);
else
r = snd_pcm_sw_params_set_avail_min(pcm, swparams, 0);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_sw_params_set_period_event(pcm, swparams, 0);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_hw_params_get_buffer_size(hwparams, &buffer_size);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_sw_params_set_start_threshold(pcm, swparams, buffer_size);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_sw_params_get_boundary(swparams, &boundary);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_sw_params_set_stop_threshold(pcm, swparams, boundary);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_sw_params_set_tstamp_mode(pcm, swparams, SND_PCM_TSTAMP_ENABLE);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_sw_params(pcm, swparams);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_prepare(pcm);
- fail_unless(r == 0);
+ assert(r == 0);
r = snd_pcm_sw_params_current(pcm, swparams);
- fail_unless(r == 0);
+ assert(r == 0);
-/* fail_unless(snd_pcm_hw_params_is_monotonic(hwparams) > 0); */
+/* assert(snd_pcm_hw_params_is_monotonic(hwparams) > 0); */
n_pollfd = snd_pcm_poll_descriptors_count(pcm);
- fail_unless(n_pollfd > 0);
+ assert(n_pollfd > 0);
pollfds = malloc(sizeof(struct pollfd) * n_pollfd);
- fail_unless(pollfds != NULL);
+ assert(pollfds);
r = snd_pcm_poll_descriptors(pcm, pollfds, n_pollfd);
- fail_unless(r == n_pollfd);
+ assert(r == n_pollfd);
if (cap) {
r = snd_pcm_start(pcm);
- fail_unless(r == 0);
+ assert(r == 0);
}
for (;;) {
@@ -144,24 +143,24 @@ START_TEST (alsa_time_test) {
unsigned long long pos;
r = poll(pollfds, n_pollfd, 0);
- fail_unless(r >= 0);
+ assert(r >= 0);
r = snd_pcm_poll_descriptors_revents(pcm, pollfds, n_pollfd, &revents);
- fail_unless(r == 0);
+ assert(r == 0);
if (cap == 0)
- fail_unless((revents & ~POLLOUT) == 0);
+ assert((revents & ~POLLOUT) == 0);
else
- fail_unless((revents & ~POLLIN) == 0);
+ assert((revents & ~POLLIN) == 0);
avail = snd_pcm_avail(pcm);
- fail_unless(avail >= 0);
+ assert(avail >= 0);
r = snd_pcm_status(pcm, status);
- fail_unless(r == 0);
+ assert(r == 0);
/* This assertion fails from time to time. ALSA seems to be broken */
-/* fail_unless(avail == (snd_pcm_sframes_t) snd_pcm_status_get_avail(status)); */
+/* assert(avail == (snd_pcm_sframes_t) snd_pcm_status_get_avail(status)); */
/* printf("%lu %lu\n", (unsigned long) avail, (unsigned long) snd_pcm_status_get_avail(status)); */
snd_pcm_status_get_htstamp(status, &timestamp);
@@ -169,9 +168,9 @@ START_TEST (alsa_time_test) {
state = snd_pcm_status_get_state(status);
r = clock_gettime(CLOCK_MONOTONIC, &now);
- fail_unless(r == 0);
+ assert(r == 0);
- fail_unless(!revents || avail > 0);
+ assert(!revents || avail > 0);
if ((!cap && avail) || (cap && (unsigned)avail >= buffer_size)) {
snd_pcm_sframes_t sframes;
@@ -182,7 +181,7 @@ START_TEST (alsa_time_test) {
sframes = snd_pcm_writei(pcm, psamples, 1);
else
sframes = snd_pcm_readi(pcm, csamples, 1);
- fail_unless(sframes == 1);
+ assert(sframes == 1);
handled = 1;
sample_count++;
@@ -216,35 +215,14 @@ START_TEST (alsa_time_test) {
state);
if (cap == 0)
- /** When this fail_unless is hit, most likely something bad
+ /** When this assert is hit, most likely something bad
* happened, i.e. the avail jumped suddenly. */
- fail_unless((unsigned) avail <= buffer_size);
+ assert((unsigned) avail <= buffer_size);
last_avail = avail;
last_delay = delay;
last_timestamp = timestamp;
}
-}
-END_TEST
-
-int main(int argc, char *argv[]) {
- int failed = 0;
- Suite *s;
- TCase *tc;
- SRunner *sr;
-
- dev = argc > 1 ? argv[1] : "front:AudioPCI";
- cap = argc > 2 ? atoi(argv[2]) : 0;
-
- s = suite_create("ALSA Time");
- tc = tcase_create("alsatime");
- tcase_add_test(tc, alsa_time_test);
- suite_add_tcase(s, tc);
-
- sr = srunner_create(s);
- srunner_run_all(sr, CK_NORMAL);
- failed = srunner_ntests_failed(sr);
- srunner_free(sr);
- return (failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+ return 0;
}