[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, 0.9.19-stable, updated. v0.9.19-31-g2c12df9
Lennart Poettering
gitmailer-noreply at 0pointer.de
Tue Nov 10 20:30:41 PST 2009
This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.
The 0.9.19-stable branch has been updated
from cc1e90f94b159cdf2d59dfb604613bf04582be50 (commit)
- Log -----------------------------------------------------------------
2c12df9 core: make cpuid code compile cleanly with 32bit PIC
ed5af77 core: adjust volume only when there is actually a memory block
9ad5671 protocol: use the right sample rate for sources
409a9d0 jack: never try to autoconnect to MIDI ports
75f3b19 man: fix build with --disable-manpages
3b25302 alsa: disable timer-based scheduling inside a VM
5da0297 daemon: during startup say whether we run in a VM
1460374 core-util: add call to detect if we are called from within a VM
b47a9e7 alsa: introduce more standard path names
ab573f2 alsa: cover 'Analog Output' control
4323c9f alsa: create a seperate mixer path for Speaker elements
8a26fbf alsa: leave other headphone control enabled if possible
08d0654 alsa: lower priority for Headphone2 path
18018b3 alsa: cover Input Source:AUX IN
d711caa alsa: cover Headphone2 mixer element
82d7b75 alsa: cover 'Digital Input Source' element
6fad765 alsa: cover Mic Jack Mode element
70da8d6 bluetooth: do not hand out access to devices that are not fully configured yet
bfb1735 daemon: realpath segfault fix
973a4eb sink: simplify silence checks
320d76f daemon: don't crash if pa_realpath() fails
732b468 protocol-native: if a client set volume/mute/device store it since it is user input
3dcdab6 libpulse: explain semantics of pa_stream_connect_playback() in more detail
0c31723 protocol-native: declare that user configured volumes are always absolute
84e77cb libpulse: add missing includes
8d612d5 Fix build when using -fweb, accept both register and memory constraints.
3201aec position-event-sounds: never position test sounds in space
833bf30 alsa: disable period event only with tsched=1
c15bd97 loopback: Setting latency of module-loopback
df49370 bluetooth: don't set auto_connect flag when discovering bt devices
-----------------------------------------------------------------------
Summary of changes:
man/Makefile.am | 46 +++++-----
src/Makefile.am | 2 +
src/daemon/main.c | 26 +++---
src/modules/alsa/alsa-mixer.c | 24 +++--
src/modules/alsa/alsa-sink.c | 7 +-
src/modules/alsa/alsa-source.c | 7 +-
src/modules/alsa/alsa-util.c | 28 ++++++-
src/modules/alsa/alsa-util.h | 5 +-
.../alsa/mixer/paths/analog-input.conf.common | 31 +++++++-
...t-mono.conf => analog-output-headphones-2.conf} | 26 +++---
.../alsa/mixer/paths/analog-output-headphones.conf | 7 ++
.../mixer/paths/analog-output-lfe-on-mono.conf | 4 +
.../alsa/mixer/paths/analog-output-mono.conf | 4 +
...alog-output.conf => analog-output-speaker.conf} | 7 ++-
src/modules/alsa/mixer/paths/analog-output.conf | 15 ++--
.../alsa/mixer/paths/analog-output.conf.common | 17 ++++
src/modules/alsa/mixer/profile-sets/default.conf | 14 ++--
src/modules/bluetooth/bluetooth-util.c | 10 ++-
src/modules/bluetooth/module-bluetooth-device.c | 13 +++-
src/modules/bluetooth/module-bluetooth-discover.c | 2 +-
src/modules/jack/module-jack-sink.c | 2 +-
src/modules/jack/module-jack-source.c | 2 +-
src/modules/module-loopback.c | 2 +-
src/modules/module-position-event-sounds.c | 18 ++++-
src/pulse/ext-stream-restore.h | 2 +
src/pulse/stream.h | 19 ++++-
src/pulsecore/core-util.c | 91 ++++++++++++++++++++
src/pulsecore/core-util.h | 3 +
src/pulsecore/protocol-native.c | 16 +++-
src/pulsecore/sink-input.c | 11 ++-
src/pulsecore/sink.c | 22 ++---
src/pulsecore/svolume_mmx.c | 4 +-
src/pulsecore/svolume_sse.c | 4 +-
33 files changed, 373 insertions(+), 118 deletions(-)
copy src/modules/alsa/mixer/paths/{analog-output-mono.conf => analog-output-headphones-2.conf} (84%)
copy src/modules/alsa/mixer/paths/{analog-output.conf => analog-output-speaker.conf} (94%)
-----------------------------------------------------------------------
commit df4937045d280684c23c92354d4db20d12f313f9
Author: Lennart Poettering <lennart at poettering.net>
Date: Sun Oct 4 13:00:51 2009 +0200
bluetooth: don't set auto_connect flag when discovering bt devices
diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 4592fca..0ba1421 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -74,7 +74,8 @@ PA_MODULE_USAGE(
"profile=<a2dp|hsp> "
"rate=<sample rate> "
"channels=<number of channels> "
- "path=<device object path>");
+ "path=<device object path> "
+ "auto_connect=<automatically connect?>");
/*
#ifdef NOKIA
@@ -98,6 +99,7 @@ static const char* const valid_modargs[] = {
"rate",
"channels",
"path",
+ "auto_connect",
#ifdef NOKIA
"sco_sink",
"sco_source",
@@ -141,6 +143,7 @@ struct userdata {
char *address;
char *path;
pa_bluetooth_discovery *discovery;
+ pa_bool_t auto_connect;
pa_dbus_connection *connection;
@@ -399,7 +402,7 @@ static int get_caps(struct userdata *u, uint8_t seid) {
pa_assert(u->profile == PROFILE_HSP);
msg.getcaps_req.transport = BT_CAPABILITIES_TRANSPORT_SCO;
}
- msg.getcaps_req.flags = BT_FLAG_AUTOCONNECT;
+ msg.getcaps_req.flags = u->auto_connect ? BT_FLAG_AUTOCONNECT : 0;
if (service_send(u, &msg.getcaps_req.h) < 0)
return -1;
@@ -2363,6 +2366,12 @@ int pa__init(pa_module* m) {
goto fail;
}
+ u->auto_connect = TRUE;
+ if (pa_modargs_get_value_boolean(ma, "auto_connect", &u->auto_connect)) {
+ pa_log("Failed to parse auto_connect= argument");
+ goto fail;
+ }
+
channels = u->sample_spec.channels;
if (pa_modargs_get_value_u32(ma, "channels", &channels) < 0 ||
channels <= 0 || channels > PA_CHANNELS_MAX) {
diff --git a/src/modules/bluetooth/module-bluetooth-discover.c b/src/modules/bluetooth/module-bluetooth-discover.c
index 02fd424..0085fa8 100644
--- a/src/modules/bluetooth/module-bluetooth-discover.c
+++ b/src/modules/bluetooth/module-bluetooth-discover.c
@@ -117,7 +117,7 @@ static pa_hook_result_t load_module_for_device(pa_bluetooth_discovery *y, const
#endif
if (d->audio_source_state >= PA_BT_AUDIO_STATE_CONNECTED)
- args = pa_sprintf_malloc("%s profile=\"a2dp_source\"", args);
+ args = pa_sprintf_malloc("%s profile=\"a2dp_source\" auto_connect=no", args);
pa_log_debug("Loading module-bluetooth-device %s", args);
m = pa_module_load(u->module->core, "module-bluetooth-device", args);
commit c15bd97282212e12adafd20ae228c94c73be367c
Author: Tor-Björn Claesson <tclaesson at gmail.com>
Date: Fri Oct 2 14:13:59 2009 +0200
loopback: Setting latency of module-loopback
I checked the source code, and latency_msec is missing from the list
of valid module arguments. Attaching a patch to add it.
diff --git a/src/modules/module-loopback.c b/src/modules/module-loopback.c
index 29c3dda..bb0182b 100644
--- a/src/modules/module-loopback.c
+++ b/src/modules/module-loopback.c
@@ -102,7 +102,7 @@ struct userdata {
static const char* const valid_modargs[] = {
"source",
"sink",
- "latency",
+ "latency_msec",
"format",
"rate",
"channels",
commit 833bf30cb9a4ce10774abfe0b916da99709fbb0a
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Oct 6 00:17:24 2009 +0200
alsa: disable period event only with tsched=1
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 22e88b4..37419d9 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -927,7 +927,7 @@ static int update_sw_params(struct userdata *u) {
pa_log_debug("setting avail_min=%lu", (unsigned long) avail_min);
- if ((err = pa_alsa_set_sw_params(u->pcm_handle, avail_min)) < 0) {
+ if ((err = pa_alsa_set_sw_params(u->pcm_handle, avail_min, !u->use_tsched)) < 0) {
pa_log("Failed to set software parameters: %s", pa_alsa_strerror(err));
return err;
}
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index fa3ac0a..37dd647 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -877,7 +877,7 @@ static int update_sw_params(struct userdata *u) {
pa_log_debug("setting avail_min=%lu", (unsigned long) avail_min);
- if ((err = pa_alsa_set_sw_params(u->pcm_handle, avail_min)) < 0) {
+ if ((err = pa_alsa_set_sw_params(u->pcm_handle, avail_min, !u->use_tsched)) < 0) {
pa_log("Failed to set software parameters: %s", pa_alsa_strerror(err));
return err;
}
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 43a8e82..0e22d17 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -403,7 +403,7 @@ finish:
return ret;
}
-int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min) {
+int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min, pa_bool_t period_event) {
snd_pcm_sw_params_t *swparams;
snd_pcm_uframes_t boundary;
int err;
@@ -417,7 +417,7 @@ int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min) {
return err;
}
- if ((err = snd_pcm_sw_params_set_period_event(pcm, swparams, 0)) < 0) {
+ if ((err = snd_pcm_sw_params_set_period_event(pcm, swparams, period_event)) < 0) {
pa_log_warn("Unable to disable period event: %s\n", pa_alsa_strerror(err));
return err;
}
diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
index 265cd28..f6206fe 100644
--- a/src/modules/alsa/alsa-util.h
+++ b/src/modules/alsa/alsa-util.h
@@ -51,7 +51,8 @@ int pa_alsa_set_hw_params(
int pa_alsa_set_sw_params(
snd_pcm_t *pcm,
- snd_pcm_uframes_t avail_min);
+ snd_pcm_uframes_t avail_min,
+ pa_bool_t period_event);
/* Picks a working mapping from the profile set based on the specified ss/map */
snd_pcm_t *pa_alsa_open_by_device_id_auto(
commit 3201aecea0ca8fe246c8434e744fb7116aefca76
Author: Lennart Poettering <lennart at poettering.net>
Date: Tue Oct 6 23:34:22 2009 +0200
position-event-sounds: never position test sounds in space
diff --git a/src/modules/module-position-event-sounds.c b/src/modules/module-position-event-sounds.c
index 7221b14..ee4c8c8 100644
--- a/src/modules/module-position-event-sounds.c
+++ b/src/modules/module-position-event-sounds.c
@@ -74,7 +74,7 @@ static int parse_pos(const char *pos, double *f) {
}
static pa_hook_result_t sink_input_fixate_hook_callback(pa_core *core, pa_sink_input_new_data *data, struct userdata *u) {
- const char *hpos, *vpos, *role;
+ const char *hpos, *vpos, *role, *id;
double f;
char t[PA_CVOLUME_SNPRINT_MAX];
pa_cvolume v;
@@ -87,6 +87,22 @@ static pa_hook_result_t sink_input_fixate_hook_callback(pa_core *core, pa_sink_i
if (!pa_streq(role, "event"))
return PA_HOOK_OK;
+ if ((id = pa_proplist_gets(data->proplist, PA_PROP_EVENT_ID))) {
+
+ /* The test sounds should never be positioned in space, since
+ * they might be trigered themselves to configure the speakers
+ * in space, which we don't want to mess up. */
+
+ if (pa_startswith(id, "audio-channel-"))
+ return PA_HOOK_OK;
+
+ if (pa_streq(id, "audio-volume-change"))
+ return PA_HOOK_OK;
+
+ if (pa_streq(id, "audio-test-signal"))
+ return PA_HOOK_OK;
+ }
+
if (!(hpos = pa_proplist_gets(data->proplist, PA_PROP_EVENT_MOUSE_HPOS)))
hpos = pa_proplist_gets(data->proplist, PA_PROP_WINDOW_HPOS);
commit 8d612d514229f22b6602111259159e574b15d5c7
Author: Diego Elio 'Flameeyes' Pettenò <flameeyes at gmail.com>
Date: Wed Oct 7 19:31:11 2009 +0200
Fix build when using -fweb, accept both register and memory constraints.
This was reported as Gentoo bug #287391 by Torsten Kaiser, and the fix was
suggested by Mike Frysinger.
diff --git a/src/pulsecore/svolume_mmx.c b/src/pulsecore/svolume_mmx.c
index aa04a52..46923ed 100644
--- a/src/pulsecore/svolume_mmx.c
+++ b/src/pulsecore/svolume_mmx.c
@@ -154,7 +154,7 @@ pa_volume_s16ne_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi
" emms \n\t"
: "+r" (samples), "+r" (volumes), "+r" (length), "=D" ((pa_reg_x86)channel), "=&r" (temp)
- : "X" ((pa_reg_x86)channels)
+ : "rm" ((pa_reg_x86)channels)
: "cc"
);
}
@@ -230,7 +230,7 @@ pa_volume_s16re_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi
" emms \n\t"
: "+r" (samples), "+r" (volumes), "+r" (length), "=D" ((pa_reg_x86)channel), "=&r" (temp)
- : "X" ((pa_reg_x86)channels)
+ : "rm" ((pa_reg_x86)channels)
: "cc"
);
}
diff --git a/src/pulsecore/svolume_sse.c b/src/pulsecore/svolume_sse.c
index ab9394f..1cc4e0a 100644
--- a/src/pulsecore/svolume_sse.c
+++ b/src/pulsecore/svolume_sse.c
@@ -149,7 +149,7 @@ pa_volume_s16ne_sse2 (int16_t *samples, int32_t *volumes, unsigned channels, uns
"8: \n\t"
: "+r" (samples), "+r" (volumes), "+r" (length), "=D" (channel), "=&r" (temp)
- : "X" ((pa_reg_x86)channels)
+ : "rm" ((pa_reg_x86)channels)
: "cc"
);
}
@@ -237,7 +237,7 @@ pa_volume_s16re_sse2 (int16_t *samples, int32_t *volumes, unsigned channels, uns
"8: \n\t"
: "+r" (samples), "+r" (volumes), "+r" (length), "=D" (channel), "=&r" (temp)
- : "X" ((pa_reg_x86)channels)
+ : "rm" ((pa_reg_x86)channels)
: "cc"
);
}
commit 84e77cb13d71a41a67a78ac6ec4354d0cb9324db
Author: Lennart Poettering <lennart at poettering.net>
Date: Mon Oct 12 21:20:45 2009 +0200
libpulse: add missing includes
diff --git a/src/pulse/ext-stream-restore.h b/src/pulse/ext-stream-restore.h
index 0b5d8eb..54516f6 100644
--- a/src/pulse/ext-stream-restore.h
+++ b/src/pulse/ext-stream-restore.h
@@ -24,6 +24,8 @@
#include <pulse/context.h>
#include <pulse/version.h>
+#include <pulse/volume.h>
+#include <pulse/channelmap.h>
/** \file
*
diff --git a/src/pulse/stream.h b/src/pulse/stream.h
index 21dd0a8..2e8e71a 100644
--- a/src/pulse/stream.h
+++ b/src/pulse/stream.h
@@ -31,6 +31,8 @@
#include <pulse/def.h>
#include <pulse/cdecl.h>
#include <pulse/operation.h>
+#include <pulse/context.h>
+#include <pulse/proplist.h>
/** \page streams Audio Streams
*
commit 0c31723a8b4428b518a0bb60e3140a30fdec318f
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Oct 28 23:47:21 2009 +0100
protocol-native: declare that user configured volumes are always absolute
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index d06dd4e..b7471c0 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1047,8 +1047,10 @@ static playback_stream* playback_stream_new(
data.sink = sink;
pa_sink_input_new_data_set_sample_spec(&data, ss);
pa_sink_input_new_data_set_channel_map(&data, map);
- if (volume)
+ if (volume) {
pa_sink_input_new_data_set_volume(&data, volume);
+ data.volume_is_absolute = TRUE;
+ }
if (muted_set)
pa_sink_input_new_data_set_muted(&data, muted);
data.sync_base = ssync ? ssync->sink_input : NULL;
commit 3dcdab6e8d84c0b8941051c9b95d7e73a65ce15c
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Oct 28 23:47:50 2009 +0100
libpulse: explain semantics of pa_stream_connect_playback() in more detail
diff --git a/src/pulse/stream.h b/src/pulse/stream.h
index 2e8e71a..bc54a11 100644
--- a/src/pulse/stream.h
+++ b/src/pulse/stream.h
@@ -401,7 +401,22 @@ int pa_stream_is_suspended(pa_stream *s);
* not, and negative on error. \since 0.9.11 */
int pa_stream_is_corked(pa_stream *s);
-/** Connect the stream to a sink */
+/** Connect the stream to a sink. It is strongly recommended to pass
+ * NULL in both dev and volume and not to set either
+ * PA_STREAM_START_MUTED nor PA_STREAM_START_UNMUTED -- unless these
+ * options are directly dependant on user input or configuration. If
+ * you follow this rule then the sound server will have the full
+ * flexibility to choose the device, volume and mute status
+ * automatically, based on server-side policies, heuristics and stored
+ * information from previous uses. Also the server may choose to
+ * reconfigure audio devices to make other sinks/sources or
+ * capabilities available to be able to accept the stream. Before
+ * 0.9.20 it was not defined whether the 'volume' parameter was
+ * interpreted relative to the sink's current volume or treated as
+ * absolute device volume. Since 0.9.20 it is an absolute volume when
+ * the sink is in flat volume mode, and relative otherwise, thus
+ * making sure the volume passed here has always the same semantics as
+ * the volume passed to pa_context_set_sink_input_volume(). */
int pa_stream_connect_playback(
pa_stream *s /**< The stream to connect to a sink */,
const char *dev /**< Name of the sink to connect to, or NULL for default */ ,
commit 732b468d66a6341d3f1744548ad3ca7e90d1b06d
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Oct 28 23:50:42 2009 +0100
protocol-native: if a client set volume/mute/device store it since it is user input
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index b7471c0..010420e 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -1044,15 +1044,21 @@ static playback_stream* playback_stream_new(
data.driver = __FILE__;
data.module = c->options->module;
data.client = c->client;
- data.sink = sink;
+ if (sink) {
+ data.sink = sink;
+ data.save_sink = TRUE;
+ }
pa_sink_input_new_data_set_sample_spec(&data, ss);
pa_sink_input_new_data_set_channel_map(&data, map);
if (volume) {
pa_sink_input_new_data_set_volume(&data, volume);
data.volume_is_absolute = TRUE;
+ data.save_volume = TRUE;
}
- if (muted_set)
+ if (muted_set) {
pa_sink_input_new_data_set_muted(&data, muted);
+ data.save_muted = TRUE;
+ }
data.sync_base = ssync ? ssync->sink_input : NULL;
data.flags = flags;
commit 320d76f1581c40b05c359936a755126f38b1b0c9
Author: Lennart Poettering <lennart at poettering.net>
Date: Fri Oct 30 05:08:48 2009 +0100
daemon: don't crash if pa_realpath() fails
diff --git a/src/daemon/main.c b/src/daemon/main.c
index 2e16c18..ff30908 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -423,21 +423,24 @@ int main(int argc, char *argv[]) {
pa_set_env("LD_BIND_NOW", "1");
- canonical_rp = pa_realpath(PA_BINARY);
+ if (!(canonical_rp = pa_realpath(PA_BINARY))) {
- if ((rp = pa_readlink("/proc/self/exe"))) {
+ if ((rp = pa_readlink("/proc/self/exe"))) {
- if (pa_streq(rp, canonical_rp))
- pa_assert_se(execv(rp, argv) == 0);
- else
- pa_log_warn("/proc/self/exe does not point to %s, cannot self execute. Are you playing games?", canonical_rp);
+ if (pa_streq(rp, canonical_rp))
+ pa_assert_se(execv(rp, argv) == 0);
+ else
+ pa_log_warn("/proc/self/exe does not point to %s, cannot self execute. Are you playing games?", canonical_rp);
- pa_xfree(rp);
+ pa_xfree(rp);
- } else
- pa_log_warn("Couldn't read /proc/self/exe, cannot self execute. Running in a chroot()?");
+ } else
+ pa_log_warn("Couldn't read /proc/self/exe, cannot self execute. Running in a chroot()?");
- pa_xfree(canonical_rp);
+ pa_xfree(canonical_rp);
+
+ } else
+ pa_log_warn("Couldn't canonicalize binary path, cannot self execute.");
}
#endif
commit 973a4ebdba1eb229c664889ffef9b4e557d7a9b1
Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date: Thu Oct 29 12:47:42 2009 +0100
sink: simplify silence checks
diff --git a/src/pulsecore/sink.c b/src/pulsecore/sink.c
index bda92fc..e6d718f 100644
--- a/src/pulsecore/sink.c
+++ b/src/pulsecore/sink.c
@@ -926,18 +926,16 @@ void pa_sink_render(pa_sink*s, size_t length, pa_memchunk *result) {
pa_sw_cvolume_multiply(&volume, &s->thread_info.soft_volume, &info[0].volume);
- if (s->thread_info.soft_muted || !pa_cvolume_is_norm(&volume)) {
- if (s->thread_info.soft_muted || pa_cvolume_is_muted(&volume)) {
- pa_memblock_unref(result->memblock);
- pa_silence_memchunk_get(&s->core->silence_cache,
- s->core->mempool,
- result,
- &s->sample_spec,
- result->length);
- } else {
- pa_memchunk_make_writable(result, 0);
- pa_volume_memchunk(result, &s->sample_spec, &volume);
- }
+ if (s->thread_info.soft_muted || pa_cvolume_is_muted(&volume)) {
+ pa_memblock_unref(result->memblock);
+ pa_silence_memchunk_get(&s->core->silence_cache,
+ s->core->mempool,
+ result,
+ &s->sample_spec,
+ result->length);
+ } else if (!pa_cvolume_is_norm(&volume)) {
+ pa_memchunk_make_writable(result, 0);
+ pa_volume_memchunk(result, &s->sample_spec, &volume);
}
} else {
void *ptr;
commit bfb17357cdda34d3595ebd573b04adb5b80489f2
Author: David Yoder <davidmyoder at gmail.com>
Date: Fri Oct 30 09:54:08 2009 -0500
daemon: realpath segfault fix
Lennart,
Apparently I was debugging this at the same time as you. I can't figure out
why my Fedora 11 install with glibc-2.10 has a glibc realpath that doesn't
match the gnu documentation and returns null. But it does.
Your commit aa8ce5bb9b159abb2ffb0f43996340566fc2e9c6 almost fixed my
problem, but it needs a tweak.
Thanks,
David Yoder
diff --git a/src/daemon/main.c b/src/daemon/main.c
index ff30908..b462501 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -423,7 +423,7 @@ int main(int argc, char *argv[]) {
pa_set_env("LD_BIND_NOW", "1");
- if (!(canonical_rp = pa_realpath(PA_BINARY))) {
+ if ((canonical_rp = pa_realpath(PA_BINARY))) {
if ((rp = pa_readlink("/proc/self/exe"))) {
commit 70da8d65d4dc138e162cd3d2649048a8664c85e5
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 31 02:05:54 2009 +0100
bluetooth: do not hand out access to devices that are not fully configured yet
diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index f8c5b77..47d6200 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -723,12 +723,14 @@ const pa_bluetooth_device* pa_bluetooth_discovery_get_by_address(pa_bluetooth_di
while ((d = pa_hashmap_iterate(y->devices, &state, NULL)))
if (pa_streq(d->address, address))
- return d;
+ return device_is_audio(d) ? d : NULL;
return NULL;
}
const pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_discovery *y, const char* path) {
+ pa_bluetooth_device *d;
+
pa_assert(y);
pa_assert(PA_REFCNT_VALUE(y) > 0);
pa_assert(path);
@@ -736,7 +738,11 @@ const pa_bluetooth_device* pa_bluetooth_discovery_get_by_path(pa_bluetooth_disco
if (!pa_hook_is_firing(&y->hook))
pa_bluetooth_discovery_sync(y);
- return pa_hashmap_get(y->devices, path);
+ if ((d = pa_hashmap_get(y->devices, path)))
+ if (device_is_audio(d))
+ return d;
+
+ return NULL;
}
static int setup_dbus(pa_bluetooth_discovery *y) {
commit 6fad76558ddc8bd109680096ab0333f5a2fc48b1
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 31 02:49:44 2009 +0100
alsa: cover Mic Jack Mode element
As used by some HDA chips:
https://bugzilla.redhat.com/attachment.cgi?id=366816
diff --git a/src/modules/alsa/mixer/paths/analog-input.conf.common b/src/modules/alsa/mixer/paths/analog-input.conf.common
index 87af38b..d883b32 100644
--- a/src/modules/alsa/mixer/paths/analog-input.conf.common
+++ b/src/modules/alsa/mixer/paths/analog-input.conf.common
@@ -98,7 +98,7 @@ priority = 18
name = input-docking
priority = 17
-;;; ' Capture Source'
+;;; 'Capture Source'
[Element Capture Source]
enumeration = select
@@ -244,6 +244,17 @@ name = input-docking
[Option Capture Source:Dock Mic]
name = input-docking-microphone
+;;; 'Mic Jack Mode'
+
+[Element Mic Jack Mode]
+enumeration = select
+
+[Option Mic Jack Mode:Mic In]
+name = input-microphone
+
+[Option Mic Jack Mode:Line In]
+name = input-linein
+
;;; Various Boosts
[Element Capture Boost]
commit 82d7b75528bc6cad63e5647b13877e1dcd786227
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 31 02:56:57 2009 +0100
alsa: cover 'Digital Input Source' element
As used by some HDA devices:
https://bugzilla.redhat.com/attachment.cgi?id=365290
diff --git a/src/modules/alsa/mixer/paths/analog-input.conf.common b/src/modules/alsa/mixer/paths/analog-input.conf.common
index d883b32..007bb21 100644
--- a/src/modules/alsa/mixer/paths/analog-input.conf.common
+++ b/src/modules/alsa/mixer/paths/analog-input.conf.common
@@ -255,6 +255,20 @@ name = input-microphone
[Option Mic Jack Mode:Line In]
name = input-linein
+;;; 'Digital Input Source'
+
+[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:Digital Mic 2]
+name = input-microphone
+
;;; Various Boosts
[Element Capture Boost]
commit d711caa38cbe60d7776142cff0cc4aa551b89187
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 31 03:10:00 2009 +0100
alsa: cover Headphone2 mixer element
As seen on some drivers:
https://bugzilla.redhat.com/show_bug.cgi?id=498612
diff --git a/src/Makefile.am b/src/Makefile.am
index 6544e2a..264edb5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -139,6 +139,7 @@ EXTRA_DIST = \
modules/alsa/mixer/paths/analog-output.conf \
modules/alsa/mixer/paths/analog-output.conf.common \
modules/alsa/mixer/paths/analog-output-headphones.conf \
+ modules/alsa/mixer/paths/analog-output-headphones-2.conf \
modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf \
modules/alsa/mixer/paths/analog-output-mono.conf
diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf b/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
similarity index 94%
copy from src/modules/alsa/mixer/paths/analog-output-headphones.conf
copy to src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
index 61d2e29..8b2968e 100644
--- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
@@ -14,7 +14,7 @@
# along with PulseAudio; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-; Path for mixers that have a 'Headphone' control
+; Path for mixers that have a 'Headphone2' control
;
; See analog-output.conf.common for an explanation on the directives
@@ -38,6 +38,10 @@ switch = off
volume = off
[Element Headphone]
+switch = off
+volume = off
+
+[Element Headphone2]
required = any
switch = mute
volume = merge
diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
index 61d2e29..6e79a78 100644
--- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
@@ -44,6 +44,10 @@ volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
+[Element Headphone2]
+switch = off
+volume = off
+
[Element Speaker]
switch = off
volume = off
diff --git a/src/modules/alsa/mixer/profile-sets/default.conf b/src/modules/alsa/mixer/profile-sets/default.conf
index ac41a8d..ffa1a4f 100644
--- a/src/modules/alsa/mixer/profile-sets/default.conf
+++ b/src/modules/alsa/mixer/profile-sets/default.conf
@@ -62,14 +62,14 @@ auto-profiles = yes
[Mapping analog-mono]
device-strings = hw:%f
channel-map = mono
-paths-output = analog-output analog-output-headphones analog-output-mono analog-output-lfe-on-mono
+paths-output = analog-output analog-output-headphones analog-output-headphones-2 analog-output-mono analog-output-lfe-on-mono
paths-input = analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line
priority = 1
[Mapping analog-stereo]
device-strings = front:%f hw:%f
channel-map = left,right
-paths-output = analog-output analog-output-headphones analog-output-mono analog-output-lfe-on-mono
+paths-output = analog-output analog-output-headphones analog-output-headphones-2 analog-output-mono analog-output-lfe-on-mono
paths-input = analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line
priority = 10
commit 18018b3ff3e4a6f640667733213d5c12d8a8fd04
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 31 03:25:32 2009 +0100
alsa: cover Input Source:AUX IN
As seen on some HDA chips:
https://bugzilla.redhat.com/attachment.cgi?id=359804
diff --git a/src/modules/alsa/mixer/paths/analog-input.conf.common b/src/modules/alsa/mixer/paths/analog-input.conf.common
index 007bb21..951e11f 100644
--- a/src/modules/alsa/mixer/paths/analog-input.conf.common
+++ b/src/modules/alsa/mixer/paths/analog-input.conf.common
@@ -98,6 +98,10 @@ priority = 18
name = input-docking
priority = 17
+[Option Input Source:AUX IN]
+name = input
+priority = 10
+
;;; 'Capture Source'
[Element Capture Source]
commit 08d065486719822eff9a4a8eddb8b08f5d00ed5a
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 31 03:41:21 2009 +0100
alsa: lower priority for Headphone2 path
diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf b/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
index 8b2968e..d1c3b22 100644
--- a/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
@@ -19,7 +19,7 @@
; See analog-output.conf.common for an explanation on the directives
[General]
-priority = 90
+priority = 89
[Element Hardware Master]
switch = mute
commit 8a26fbf863d0c4f13cf56f28ba779a50e7335671
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 31 03:42:42 2009 +0100
alsa: leave other headphone control enabled if possible
diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf b/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
index d1c3b22..f2fd31c 100644
--- a/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-headphones-2.conf
@@ -37,9 +37,12 @@ override-map.2 = all-left,all-right
switch = off
volume = off
+; This profile path is intended to control the second headphones, not
+; the first headphones. But it should not hurt if we leave the
+; headphone jack enabled nonetheless.
[Element Headphone]
-switch = off
-volume = off
+switch = mute
+volume = zero
[Element Headphone2]
required = any
diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
index 6e79a78..2131cfe 100644
--- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
@@ -44,9 +44,12 @@ volume = merge
override-map.1 = all
override-map.2 = all-left,all-right
+; This profile path is intended to control the first headphones, not
+; the second headphones. But it should not hurt if we leave the second
+; headphone jack enabled nonetheless.
[Element Headphone2]
-switch = off
-volume = off
+switch = mute
+volume = zero
[Element Speaker]
switch = off
diff --git a/src/modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf b/src/modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf
index 911361d..0a43e27 100644
--- a/src/modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-lfe-on-mono.conf
@@ -48,6 +48,10 @@ override-map.2 = lfe,lfe
switch = mute
volume = zero
+[Element Headphone2]
+switch = mute
+volume = zero
+
[Element Speaker]
switch = mute
volume = merge
diff --git a/src/modules/alsa/mixer/paths/analog-output-mono.conf b/src/modules/alsa/mixer/paths/analog-output-mono.conf
index 2fbc60b..542edc4 100644
--- a/src/modules/alsa/mixer/paths/analog-output-mono.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-mono.conf
@@ -45,6 +45,10 @@ override-map.2 = all-left,all-right
switch = mute
volume = zero
+[Element Headphone2]
+switch = mute
+volume = zero
+
[Element Speaker]
switch = mute
volume = merge
diff --git a/src/modules/alsa/mixer/paths/analog-output.conf b/src/modules/alsa/mixer/paths/analog-output.conf
index f71a05a..b10efc2 100644
--- a/src/modules/alsa/mixer/paths/analog-output.conf
+++ b/src/modules/alsa/mixer/paths/analog-output.conf
@@ -44,6 +44,10 @@ volume = off
switch = mute
volume = zero
+[Element Headphone2]
+switch = mute
+volume = zero
+
[Element Speaker]
switch = mute
volume = merge
commit 4323c9f22f17d8fdd2a44aad5e1af4997a87a189
Author: Lennart Poettering <lennart at poettering.net>
Date: Sat Oct 31 03:43:42 2009 +0100
alsa: create a seperate mixer path for Speaker elements
On some cards line-out is independant of Sepaker and it is a good idea
to cover that so that they can independantly be activated.
https://bugzilla.redhat.com/show_bug.cgi?id=520884
diff --git a/src/Makefile.am b/src/Makefile.am
index 264edb5..de15a8f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -137,6 +137,7 @@ EXTRA_DIST = \
modules/alsa/mixer/paths/analog-input-tvtuner.conf \
modules/alsa/mixer/paths/analog-input-video.conf \
modules/alsa/mixer/paths/analog-output.conf \
+ modules/alsa/mixer/paths/analog-output-speaker.conf \
modules/alsa/mixer/paths/analog-output.conf.common \
modules/alsa/mixer/paths/analog-output-headphones.conf \
modules/alsa/mixer/paths/analog-output-headphones-2.conf \
diff --git a/src/modules/alsa/mixer/paths/analog-output.conf b/src/modules/alsa/mixer/paths/analog-output-speaker.conf
similarity index 97%
copy from src/modules/alsa/mixer/paths/analog-output.conf
copy to src/modules/alsa/mixer/paths/analog-output-speaker.conf
index b10efc2..aea7853 100644
--- a/src/modules/alsa/mixer/paths/analog-output.conf
+++ b/src/modules/alsa/mixer/paths/analog-output-speaker.conf
@@ -14,7 +14,7 @@
# along with PulseAudio; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-; Intended for the 'default' output
+; Path for mixers that have a 'Speaker' control
;
; See analog-output.conf.common for an explanation on the directives
@@ -49,6 +49,7 @@ switch = mute
volume = zero
[Element Speaker]
+required = any
switch = mute
volume = merge
override-map.1 = all
diff --git a/src/modules/alsa/mixer/paths/analog-output.conf b/src/modules/alsa/mixer/paths/analog-output.conf
index b10efc2..d7c1223 100644
--- a/src/modules/alsa/mixer/paths/analog-output.conf
+++ b/src/modules/alsa/mixer/paths/analog-output.conf
@@ -14,12 +14,13 @@
# along with PulseAudio; if not, write to the Free Software Foundation,
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
-; Intended for the 'default' output
+; Intended for the 'default' output. Note that a-o-speaker.conf has a
+; higher priority than this
;
; See analog-output.conf.common for an explanation on the directives
[General]
-priority = 100
+priority = 99
[Element Hardware Master]
switch = mute
@@ -37,7 +38,7 @@ override-map.2 = all-left,all-right
switch = off
volume = off
-; This profile path is intended to control the speaker, not the
+; This profile path is intended to control the default output, not the
; headphones. But it should not hurt if we leave the headphone jack
; enabled nonetheless.
[Element Headphone]
@@ -50,9 +51,7 @@ volume = zero
[Element Speaker]
switch = mute
-volume = merge
-override-map.1 = all
-override-map.2 = all-left,all-right
+volume = off
[Element Front]
switch = mute
diff --git a/src/modules/alsa/mixer/profile-sets/default.conf b/src/modules/alsa/mixer/profile-sets/default.conf
index ffa1a4f..046938f 100644
--- a/src/modules/alsa/mixer/profile-sets/default.conf
+++ b/src/modules/alsa/mixer/profile-sets/default.conf
@@ -62,42 +62,42 @@ auto-profiles = yes
[Mapping analog-mono]
device-strings = hw:%f
channel-map = mono
-paths-output = analog-output analog-output-headphones analog-output-headphones-2 analog-output-mono analog-output-lfe-on-mono
+paths-output = analog-output analog-output-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono analog-output-lfe-on-mono
paths-input = analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line
priority = 1
[Mapping analog-stereo]
device-strings = front:%f hw:%f
channel-map = left,right
-paths-output = analog-output analog-output-headphones analog-output-headphones-2 analog-output-mono analog-output-lfe-on-mono
+paths-output = analog-output analog-output-speaker analog-output-headphones analog-output-headphones-2 analog-output-mono analog-output-lfe-on-mono
paths-input = analog-input analog-input-mic analog-input-linein analog-input-aux analog-input-video analog-input-tvtuner analog-input-fm analog-input-mic-line
priority = 10
[Mapping analog-surround-40]
device-strings = surround40:%f
channel-map = front-left,front-right,rear-left,rear-right
-paths-output = analog-output analog-output-lfe-on-mono
+paths-output = analog-output analog-output-speaker analog-output-lfe-on-mono
priority = 7
direction = output
[Mapping analog-surround-41]
device-strings = surround41:%f
channel-map = front-left,front-right,rear-left,rear-right,lfe
-paths-output = analog-output analog-output-lfe-on-mono
+paths-output = analog-output analog-output-speaker analog-output-lfe-on-mono
priority = 8
direction = output
[Mapping analog-surround-50]
device-strings = surround50:%f
channel-map = front-left,front-right,rear-left,rear-right,front-center
-paths-output = analog-output analog-output-lfe-on-mono
+paths-output = analog-output analog-output-speaker analog-output-lfe-on-mono
priority = 7
direction = output
[Mapping analog-surround-51]
device-strings = surround51:%f
channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe
-paths-output = analog-output analog-output-lfe-on-mono
+paths-output = analog-output analog-output-speaker analog-output-lfe-on-mono
priority = 8
direction = output
@@ -105,7 +105,7 @@ direction = output
device-strings = surround71:%f
channel-map = front-left,front-right,rear-left,rear-right,front-center,lfe,side-left,side-right
description = Analog Surround 7.1
-paths-output = analog-output analog-output-lfe-on-mono
+paths-output = analog-output analog-output-speaker analog-output-lfe-on-mono
priority = 7
direction = output
commit ab573f2e06f2444dff39a2d8720cad7345227a85
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Nov 4 00:15:47 2009 +0100
alsa: cover 'Analog Output' control
http://pulseaudio.org/ticket/702
diff --git a/src/modules/alsa/mixer/paths/analog-output.conf.common b/src/modules/alsa/mixer/paths/analog-output.conf.common
index 3c6ce80..fd7f0cf 100644
--- a/src/modules/alsa/mixer/paths/analog-output.conf.common
+++ b/src/modules/alsa/mixer/paths/analog-output.conf.common
@@ -109,3 +109,20 @@ priority = 10
[Option External Amplifier:off]
name = output-amplifier-off
priority = 0
+
+;;; 'Analog Output'
+
+[Element Analog Output]
+enumeration = select
+
+[Option Analog Output:Speakers]
+name = output-speaker
+priority = 10
+
+[Option Analog Output:Headphones]
+name = output-headphones
+priority = 9
+
+[Option Analog Output:FP Headphones]
+name = output-headphones
+priority = 8
commit b47a9e7ea47af29e53bff2bb66880c089435e0db
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Nov 5 03:21:10 2009 +0100
alsa: introduce more standard path names
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index f3ce681..8b13239 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -1712,7 +1712,9 @@ static int option_verify(pa_alsa_option *o) {
{ "input-boost-on", N_("Boost") },
{ "input-boost-off", N_("No Boost") },
{ "output-amplifier-on", N_("Amplifier") },
- { "output-amplifier-off", N_("No Amplifier") }
+ { "output-amplifier-off", N_("No Amplifier") },
+ { "output-speaker", N_("Speaker") },
+ { "output-headphones", N_("Headphones") }
};
pa_assert(o);
@@ -1770,15 +1772,17 @@ static int element_verify(pa_alsa_element *e) {
static int path_verify(pa_alsa_path *p) {
static const struct description_map well_known_descriptions[] = {
- { "analog-input", N_("Analog Input") },
- { "analog-input-microphone", N_("Analog Microphone") },
- { "analog-input-linein", N_("Analog Line-In") },
- { "analog-input-radio", N_("Analog Radio") },
- { "analog-input-video", N_("Analog Video") },
- { "analog-output", N_("Analog Output") },
- { "analog-output-headphones", N_("Analog Headphones") },
- { "analog-output-lfe-on-mono", N_("Analog Output (LFE)") },
- { "analog-output-mono", N_("Analog Mono Output") }
+ { "analog-input", N_("Analog Input") },
+ { "analog-input-microphone", N_("Analog Microphone") },
+ { "analog-input-linein", N_("Analog Line-In") },
+ { "analog-input-radio", N_("Analog Radio") },
+ { "analog-input-video", N_("Analog Video") },
+ { "analog-output", N_("Analog Output") },
+ { "analog-output-headphones", N_("Analog Headphones") },
+ { "analog-output-lfe-on-mono", N_("Analog Output (LFE)") },
+ { "analog-output-mono", N_("Analog Mono Output") },
+ { "analog-output-headphones-2", N_("Analog Headphones 2") },
+ { "analog-output-speaker", N_("Analog Speaker") }
};
pa_alsa_element *e;
commit 1460374c068b72a496d2bbc3cd62e0fa0447d358
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Nov 5 03:22:15 2009 +0100
core-util: add call to detect if we are called from within a VM
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 8e98e85..11e3d69 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -2867,3 +2867,90 @@ const char *pa_get_temp_dir(void) {
return "/tmp";
}
+
+char *pa_read_line_from_file(const char *fn) {
+ FILE *f;
+ char ln[256] = "", *r;
+
+ if (!(f = fopen(fn, "r")))
+ return NULL;
+
+ r = fgets(ln, sizeof(ln)-1, f);
+ fclose(f);
+
+ if (!r) {
+ errno = EIO;
+ return NULL;
+ }
+
+ pa_strip_nl(ln);
+ return pa_xstrdup(ln);
+}
+
+pa_bool_t pa_running_in_vm(void) {
+
+#if defined(__i386__) || defined(__x86_64__)
+
+ /* Both CPUID and DMI are x86 specific interfaces... */
+
+ uint32_t eax = 0x40000000;
+ union {
+ uint32_t sig32[3];
+ char text[13];
+ } sig;
+
+#ifdef __linux__
+ const char *const dmi_vendors[] = {
+ "/sys/class/dmi/id/sys_vendor",
+ "/sys/class/dmi/id/board_vendor",
+ "/sys/class/dmi/id/bios_vendor"
+ };
+
+ unsigned i;
+
+ for (i = 0; i < PA_ELEMENTSOF(dmi_vendors); i++) {
+ char *s;
+
+ if ((s = pa_read_line_from_file(dmi_vendors[i]))) {
+
+ if (pa_startswith(s, "QEMU") ||
+ /* http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458 */
+ pa_startswith(s, "VMware") ||
+ pa_startswith(s, "VMW") ||
+ pa_startswith(s, "Microsoft Corporation") ||
+ pa_startswith(s, "innotek GmbH") ||
+ pa_startswith(s, "Xen")) {
+
+ pa_xfree(s);
+ return TRUE;
+ }
+
+ pa_xfree(s);
+ }
+ }
+
+#endif
+
+ /* http://lwn.net/Articles/301888/ */
+ pa_zero(sig);
+
+ __asm__ __volatile__ (
+ " xor %%ebx, %%ebx \n\t"
+ " cpuid \n\t"
+
+ : "=a" (eax), "=b" (sig.sig32[0]), "=c" (sig.sig32[1]), "=d" (sig.sig32[2])
+ : "0" (eax)
+ );
+
+ if (pa_streq(sig.text, "XenVMMXenVMM") ||
+ pa_streq(sig.text, "KVMKVMKVM") ||
+ /* http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1009458 */
+ pa_streq(sig.text, "VMwareVMware") ||
+ /* http://msdn.microsoft.com/en-us/library/bb969719.aspx */
+ pa_streq(sig.text, "Microsoft Hv"))
+ return TRUE;
+
+#endif
+
+ return FALSE;
+}
diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h
index 84752d4..eba1b40 100644
--- a/src/pulsecore/core-util.h
+++ b/src/pulsecore/core-util.h
@@ -251,4 +251,7 @@ pa_bool_t pa_run_from_build_tree(void);
const char *pa_get_temp_dir(void);
+char *pa_read_line_from_file(const char *fn);
+pa_bool_t pa_running_in_vm(void);
+
#endif
commit 5da02977444805aabb6665d14bd74563941a7b15
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Nov 5 03:22:48 2009 +0100
daemon: during startup say whether we run in a VM
diff --git a/src/daemon/main.c b/src/daemon/main.c
index b462501..0a8e57d 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -618,7 +618,6 @@ int main(int argc, char *argv[]) {
if (conf->daemonize) {
pid_t child;
- int tty_fd;
if (pa_stdio_acquire() < 0) {
pa_log(_("Failed to acquire stdio."));
@@ -751,6 +750,8 @@ int main(int argc, char *argv[]) {
pa_log_debug(_("Running in valgrind mode: %s"), pa_yes_no(pa_in_valgrind()));
+ pa_log_debug(_("Running in VM: %s"), pa_yes_no(pa_running_in_vm()));
+
#ifdef __OPTIMIZE__
pa_log_debug(_("Optimized build: yes"));
#else
commit 3b2530255460e5700766fcd7c7443b7065240f61
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Nov 5 03:23:08 2009 +0100
alsa: disable timer-based scheduling inside a VM
In virtual machines sound card clocks and OS scheduling tend to become
unreliable, adding various 'uneven' latencies. The adaptive algorithm
that handles drop-outs does not handle it this well: in contrast to
drop-outs on real machines that are evenly distributed, small and can
easily be encountered via the adpative algorithms, drop-outs in VMs tend
to happen abruptly, and massively, which is not easy to counter.
This patch simply disables timer based scheduling in VMs reverting to
classic IO based scheduling. This should help make PA perform better in
VMs.
https://bugzilla.redhat.com/show_bug.cgi?id=532775
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
index 37419d9..856adb1 100644
--- a/src/modules/alsa/alsa-sink.c
+++ b/src/modules/alsa/alsa-sink.c
@@ -1698,10 +1698,7 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
goto fail;
}
- if (use_tsched && !pa_rtclock_hrtimer()) {
- pa_log_notice("Disabling timer-based scheduling because high-resolution timers are not available from the kernel.");
- use_tsched = FALSE;
- }
+ use_tsched = pa_alsa_may_tsched(use_tsched);
u = pa_xnew0(struct userdata, 1);
u->core = m->core;
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
index 37dd647..e775b20 100644
--- a/src/modules/alsa/alsa-source.c
+++ b/src/modules/alsa/alsa-source.c
@@ -1541,10 +1541,7 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
goto fail;
}
- if (use_tsched && !pa_rtclock_hrtimer()) {
- pa_log_notice("Disabling timer-based scheduling because high-resolution timers are not available from the kernel.");
- use_tsched = FALSE;
- }
+ use_tsched = pa_alsa_may_tsched(use_tsched);
u = pa_xnew0(struct userdata, 1);
u->core = m->core;
diff --git a/src/modules/alsa/alsa-util.c b/src/modules/alsa/alsa-util.c
index 0e22d17..b8d1357 100644
--- a/src/modules/alsa/alsa-util.c
+++ b/src/modules/alsa/alsa-util.c
@@ -43,6 +43,7 @@
#include <pulsecore/once.h>
#include <pulsecore/thread.h>
#include <pulsecore/conf-parser.h>
+#include <pulsecore/core-rtclock.h>
#include "alsa-util.h"
#include "alsa-mixer.h"
@@ -1308,3 +1309,26 @@ const char* pa_alsa_strerror(int errnum) {
return translated;
}
+
+pa_bool_t pa_alsa_may_tsched(pa_bool_t want) {
+
+ if (!want)
+ return FALSE;
+
+ if (!pa_rtclock_hrtimer()) {
+ /* We cannot depend on being woken up in time when the timers
+ are inaccurate, so let's fallback to classic IO based playback
+ then. */
+ pa_log_notice("Disabling timer-based scheduling because high-resolution timers are not available from the kernel.");
+ return FALSE; }
+
+ if (pa_running_in_vm()) {
+ /* We cannot depend on being woken up when we ask for in a VM,
+ * so let's fallback to classic IO based playback then. */
+ pa_log_notice("Disabling timer-based scheduling because running inside a VM.");
+ return FALSE;
+ }
+
+
+ return TRUE;
+}
diff --git a/src/modules/alsa/alsa-util.h b/src/modules/alsa/alsa-util.h
index f6206fe..1d1256b 100644
--- a/src/modules/alsa/alsa-util.h
+++ b/src/modules/alsa/alsa-util.h
@@ -142,4 +142,6 @@ pa_bool_t pa_alsa_pcm_is_modem(snd_pcm_t *pcm);
const char* pa_alsa_strerror(int errnum);
+pa_bool_t pa_alsa_may_tsched(pa_bool_t want);
+
#endif
commit 75f3b195c3ff1682aa53449417d696bfe255b292
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Nov 5 05:08:50 2009 +0100
man: fix build with --disable-manpages
http://pulseaudio.org/ticket/698
diff --git a/man/Makefile.am b/man/Makefile.am
index 9b229f5..7793fe7 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -20,21 +20,6 @@ pulseconfdir=$(sysconfdir)/pulse
CLEANFILES = \
$(noinst_DATA)
-dist_man_MANS = \
- pulseaudio.1 \
- esdcompat.1 \
- pax11publish.1 \
- paplay.1 \
- pacat.1 \
- pacmd.1 \
- pactl.1 \
- pasuspender.1 \
- padsp.1 \
- pabrowse.1 \
- pulse-daemon.conf.5 \
- pulse-client.conf.5 \
- default.pa.5
-
noinst_DATA = \
pulseaudio.1.xml \
esdcompat.1.xml \
@@ -50,24 +35,39 @@ noinst_DATA = \
pulse-client.conf.5.xml \
default.pa.5.xml
-if BUILD_MANPAGES
-
-CLEANFILES += \
- $(dist_man_MANS)
-
%.xml: %.xml.in Makefile
sed -e 's, at pulseconfdir\@,$(pulseconfdir),g' \
-e 's, at PACKAGE_BUGREPORT\@,$(PACKAGE_BUGREPORT),g' \
-e 's, at PACKAGE_URL\@,$(PACKAGE_URL),g' $< > $@
-%: %.xml Makefile
- perl $(srcdir)/xmltoman $< > $@ || rm -f $@
-
xmllint: $(noinst_DATA)
for f in $(noinst_DATA) ; do \
xmllint --noout --valid "$$f" || exit 1 ; \
done
+if BUILD_MANPAGES
+
+dist_man_MANS = \
+ pulseaudio.1 \
+ esdcompat.1 \
+ pax11publish.1 \
+ paplay.1 \
+ pacat.1 \
+ pacmd.1 \
+ pactl.1 \
+ pasuspender.1 \
+ padsp.1 \
+ pabrowse.1 \
+ pulse-daemon.conf.5 \
+ pulse-client.conf.5 \
+ default.pa.5
+
+CLEANFILES += \
+ $(dist_man_MANS)
+
+%: %.xml Makefile
+ perl $(srcdir)/xmltoman $< > $@ || rm -f $@
+
endif
EXTRA_DIST = \
commit 409a9d01cd545b5b9c030785d0c68fc3c69dfc9b
Author: Lennart Poettering <lennart at poettering.net>
Date: Thu Nov 5 05:18:10 2009 +0100
jack: never try to autoconnect to MIDI ports
Original patch supplied by 'adi'
http://pulseaudio.org/ticket/669
diff --git a/src/modules/jack/module-jack-sink.c b/src/modules/jack/module-jack-sink.c
index fc976fa..9f3e071 100644
--- a/src/modules/jack/module-jack-sink.c
+++ b/src/modules/jack/module-jack-sink.c
@@ -334,7 +334,7 @@ int pa__init(pa_module*m) {
goto fail;
}
- ports = jack_get_ports(u->client, NULL, NULL, JackPortIsPhysical|JackPortIsInput);
+ ports = jack_get_ports(u->client, NULL, JACK_DEFAULT_AUDIO_TYPE, JackPortIsPhysical|JackPortIsInput);
channels = 0;
for (p = ports; *p; p++)
diff --git a/src/modules/jack/module-jack-source.c b/src/modules/jack/module-jack-source.c
index a898e0e..6c68527 100644
--- a/src/modules/jack/module-jack-source.c
+++ b/src/modules/jack/module-jack-source.c
@@ -286,7 +286,7 @@ int pa__init(pa_module*m) {
goto fail;
}
- ports = jack_get_ports(u->client, NULL, NULL, JackPortIsPhysical|JackPortIsOutput);
+ ports = jack_get_ports(u->client, NULL, JACK_DEFAULT_AUDIO_TYPE, JackPortIsPhysical|JackPortIsOutput);
channels = 0;
for (p = ports; *p; p++)
commit 9ad567167ef6abf4598a83edabf4f6aa9642d86f
Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date: Tue Nov 10 13:21:55 2009 +0100
protocol: use the right sample rate for sources
Use the correct sample rate for reporting about the timing.
diff --git a/src/pulsecore/protocol-native.c b/src/pulsecore/protocol-native.c
index 010420e..6e35762 100644
--- a/src/pulsecore/protocol-native.c
+++ b/src/pulsecore/protocol-native.c
@@ -2620,7 +2620,7 @@ static void command_get_record_latency(pa_pdispatch *pd, uint32_t command, uint3
pa_tagstruct_put_usec(reply, s->current_monitor_latency);
pa_tagstruct_put_usec(reply,
s->current_source_latency +
- pa_bytes_to_usec(s->on_the_fly_snapshot, &s->source_output->sample_spec));
+ pa_bytes_to_usec(s->on_the_fly_snapshot, &s->source_output->source->sample_spec));
pa_tagstruct_put_boolean(reply,
pa_source_get_state(s->source_output->source) == PA_SOURCE_RUNNING &&
pa_source_output_get_state(s->source_output) == PA_SOURCE_OUTPUT_RUNNING);
commit ed5af775b1f150aa1717964afd452c382ed85152
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Nov 11 04:18:10 2009 +0100
core: adjust volume only when there is actually a memory block
Fixes an assert that is hit in somne niche cases:
https://bugzilla.redhat.com/show_bug.cgi?id=533482
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 1af2823..aa84ccb 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -717,14 +717,15 @@ void pa_sink_input_peek(pa_sink_input *i, size_t slength /* in sink frames */, p
pa_memchunk rchunk;
pa_resampler_run(i->thread_info.resampler, &wchunk, &rchunk);
- if (nvfs) {
- pa_memchunk_make_writable(&rchunk, 0);
- pa_volume_memchunk(&rchunk, &i->sink->sample_spec, &i->volume_factor_sink);
- }
-
/* pa_log_debug("pushing %lu", (unsigned long) rchunk.length); */
if (rchunk.memblock) {
+
+ if (nvfs) {
+ pa_memchunk_make_writable(&rchunk, 0);
+ pa_volume_memchunk(&rchunk, &i->sink->sample_spec, &i->volume_factor_sink);
+ }
+
pa_memblockq_push_align(i->thread_info.render_memblockq, &rchunk);
pa_memblock_unref(rchunk.memblock);
}
commit 2c12df9001433b3701e2ee81a4248b2834a13552
Author: Lennart Poettering <lennart at poettering.net>
Date: Wed Nov 11 04:50:32 2009 +0100
core: make cpuid code compile cleanly with 32bit PIC
diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 11e3d69..258e8ee 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -117,6 +117,7 @@
#include <pulsecore/strbuf.h>
#include <pulsecore/usergroup.h>
#include <pulsecore/strlist.h>
+#include <pulsecore/cpu-x86.h>
#include "core-util.h"
@@ -2935,10 +2936,13 @@ pa_bool_t pa_running_in_vm(void) {
pa_zero(sig);
__asm__ __volatile__ (
- " xor %%ebx, %%ebx \n\t"
+ /* ebx/rbx is being used for PIC! */
+ " push %%"PA_REG_b" \n\t"
" cpuid \n\t"
+ " mov %%ebx, %1 \n\t"
+ " pop %%"PA_REG_b" \n\t"
- : "=a" (eax), "=b" (sig.sig32[0]), "=c" (sig.sig32[1]), "=d" (sig.sig32[2])
+ : "=a" (eax), "=r" (sig.sig32[0]), "=c" (sig.sig32[1]), "=d" (sig.sig32[2])
: "0" (eax)
);
--
hooks/post-receive
PulseAudio Sound Server
More information about the pulseaudio-commits
mailing list