kill obsolete patches

This commit is contained in:
Lennart Poettering 2009-02-12 19:17:28 +00:00
parent ad0d037863
commit c92da67470
36 changed files with 0 additions and 1967 deletions

View File

@ -1,32 +0,0 @@
From b6a802717b02ca77689b044773956462d58df12d Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 7 Oct 2008 02:00:07 +0200
Subject: [PATCH] Initialize exit_idle_time to -1 instead of 0 when in system mode.
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Spotted by Rafał Mużyło.
---
src/daemon/main.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/daemon/main.c b/src/daemon/main.c
index fad635f..bc8bc63 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -646,9 +646,9 @@ int main(int argc, char *argv[]) {
conf->disable_shm = TRUE;
}
- if (conf->system_instance && conf->exit_idle_time > 0) {
+ if (conf->system_instance && conf->exit_idle_time >= 0) {
pa_log_notice(_("Running in system mode, forcibly disabling exit idle time!"));
- conf->exit_idle_time = 0;
+ conf->exit_idle_time = -1;
}
if (conf->cmd == PA_CMD_START) {
--
1.6.0.3

View File

@ -1,114 +0,0 @@
From 31318274ff84e2d359aa762ffcde09eae115d2d4 Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.dentz@openbossa.org>
Date: Mon, 6 Oct 2008 14:59:15 -0300
Subject: [PATCH] Unload module-bluetooth-device if the remote device disconnects.
---
src/modules/bluetooth/module-bluetooth-discover.c | 55 ++++++++++++++++----
1 files changed, 44 insertions(+), 11 deletions(-)
diff --git a/src/modules/bluetooth/module-bluetooth-discover.c b/src/modules/bluetooth/module-bluetooth-discover.c
index 0601e9a..a33ca64 100644
--- a/src/modules/bluetooth/module-bluetooth-discover.c
+++ b/src/modules/bluetooth/module-bluetooth-discover.c
@@ -91,6 +91,16 @@ static void module_free(struct module *m) {
pa_xfree(m);
}
+static struct module* module_find(struct device *d, const char *profile) {
+ struct module *m;
+
+ for (m = d->module_list; d; d = d->next)
+ if (pa_streq(m->profile, profile))
+ return m;
+
+ return NULL;
+}
+
static struct uuid *uuid_new(const char *uuid) {
struct uuid *node;
@@ -345,6 +355,21 @@ static void load_module_for_device(struct userdata *u, struct device *d, const c
PA_LLIST_PREPEND(struct module, d->module_list, m);
}
+static void unload_module_for_device(struct userdata *u, struct device *d, const char *profile) {
+ struct module *m;
+
+ pa_assert(u);
+ pa_assert(d);
+
+ if (!(m = module_find(d, profile)))
+ return;
+
+ pa_module_unload_request(m->pa_m, TRUE);
+
+ PA_LLIST_REMOVE(struct module, d->module_list, m);
+ module_free(m);
+}
+
static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *msg, void *userdata) {
DBusMessageIter arg_i;
DBusError err;
@@ -387,6 +412,7 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *msg, void *
struct device *d;
const char *profile;
DBusMessageIter variant_i;
+ dbus_bool_t connected;
if (!dbus_message_iter_init(msg, &arg_i)) {
pa_log("dbus: message has no parameters");
@@ -400,6 +426,9 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *msg, void *
dbus_message_iter_get_basic(&arg_i, &value);
+ if (!pa_streq(value, "Connected"))
+ goto done;
+
if (!dbus_message_iter_next(&arg_i)) {
pa_log("Property value missing");
goto done;
@@ -412,25 +441,29 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *msg, void *
dbus_message_iter_recurse(&arg_i, &variant_i);
- if (dbus_message_iter_get_arg_type(&variant_i) == DBUS_TYPE_BOOLEAN) {
- dbus_bool_t connected;
- dbus_message_iter_get_basic(&variant_i, &connected);
-
- if (!pa_streq(value, "Connected") || !connected)
- goto done;
+ if (dbus_message_iter_get_arg_type(&variant_i) != DBUS_TYPE_BOOLEAN) {
+ pa_log("Property value not a boolean.");
+ goto done;
}
- if (!(d = device_find(u, dbus_message_get_path(msg)))) {
- d = device_new(dbus_message_get_path(msg));
- PA_LLIST_PREPEND(struct device, u->device_list, d);
- }
+ dbus_message_iter_get_basic(&variant_i, &connected);
if (dbus_message_is_signal(msg, "org.bluez.Headset", "PropertyChanged"))
profile = "hsp";
else
profile = "a2dp";
- load_module_for_device(u, d, profile);
+ d = device_find(u, dbus_message_get_path(msg));
+
+ if (connected) {
+ if (!d) {
+ d = device_new(dbus_message_get_path(msg));
+ PA_LLIST_PREPEND(struct device, u->device_list, d);
+ }
+
+ load_module_for_device(u, d, profile);
+ } else if (d)
+ unload_module_for_device(u, d, profile);
}
done:
--
1.6.0.3

View File

@ -1,28 +0,0 @@
From fc2ba1f914b2d015c9c43951c6ffb917977257b1 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 7 Oct 2008 22:42:13 +0200
Subject: [PATCH] instead of resetting virtual_volume unconditionally on initialization, do so only when no volume was set before
---
src/pulsecore/sink-input.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 4f70347..508591e 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -150,8 +150,10 @@ pa_sink_input* pa_sink_input_new(
pa_return_null_if_fail(pa_channel_map_valid(&data->channel_map));
pa_return_null_if_fail(data->channel_map.channels == data->sample_spec.channels);
- if (!data->volume_is_set)
+ if (!data->volume_is_set) {
pa_cvolume_reset(&data->volume, data->sample_spec.channels);
+ pa_cvolume_reset(&data->virtual_volume, data->sample_spec.channels);
+ }
pa_return_null_if_fail(pa_cvolume_valid(&data->volume));
pa_return_null_if_fail(data->volume.channels == data->sample_spec.channels);
--
1.6.0.3

View File

@ -1,39 +0,0 @@
From 215f1fbffa18caa1cfb8ac4c7c3a108dc740a2c6 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 7 Oct 2008 22:45:37 +0200
Subject: [PATCH] use pa_channel_map_init_extend() instead of pa_channel_map_init_auto() as channel map for sink inputs/source outputs in case no map is specified
---
src/pulsecore/sink-input.c | 2 +-
src/pulsecore/source-output.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 508591e..89aaf55 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -144,7 +144,7 @@ pa_sink_input* pa_sink_input_new(
if (data->sink->channel_map.channels == data->sample_spec.channels)
data->channel_map = data->sink->channel_map;
else
- pa_return_null_if_fail(pa_channel_map_init_auto(&data->channel_map, data->sample_spec.channels, PA_CHANNEL_MAP_DEFAULT));
+ pa_channel_map_init_extend(&data->channel_map, data->sample_spec.channels, PA_CHANNEL_MAP_DEFAULT);
}
pa_return_null_if_fail(pa_channel_map_valid(&data->channel_map));
diff --git a/src/pulsecore/source-output.c b/src/pulsecore/source-output.c
index d76f6e4..c66c6fa 100644
--- a/src/pulsecore/source-output.c
+++ b/src/pulsecore/source-output.c
@@ -127,7 +127,7 @@ pa_source_output* pa_source_output_new(
if (data->source->channel_map.channels == data->sample_spec.channels)
data->channel_map = data->source->channel_map;
else
- pa_return_null_if_fail(pa_channel_map_init_auto(&data->channel_map, data->sample_spec.channels, PA_CHANNEL_MAP_DEFAULT));
+ pa_channel_map_init_extend(&data->channel_map, data->sample_spec.channels, PA_CHANNEL_MAP_DEFAULT);
}
pa_return_null_if_fail(pa_channel_map_valid(&data->channel_map));
--
1.6.0.3

View File

@ -1,35 +0,0 @@
From f0a2294f685985fd6edcf3a52018cc833eb5fa11 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 7 Oct 2008 22:46:18 +0200
Subject: [PATCH] if the channel map was modified due to PA_SINK_INPUT_FIX_CHANNELS, remap the specified volume properly
---
src/pulsecore/sink-input.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 89aaf55..cade0db 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -167,6 +167,8 @@ pa_sink_input* pa_sink_input_new(
if (flags & PA_SINK_INPUT_FIX_RATE)
data->sample_spec.rate = data->sink->sample_spec.rate;
+ original_cm = data->channel_map;
+
if (flags & PA_SINK_INPUT_FIX_CHANNELS) {
data->sample_spec.channels = data->sink->sample_spec.channels;
data->channel_map = data->sink->channel_map;
@@ -176,8 +178,7 @@ pa_sink_input* pa_sink_input_new(
pa_assert(pa_channel_map_valid(&data->channel_map));
/* Due to the fixing of the sample spec the volume might not match anymore */
- if (data->volume.channels != data->sample_spec.channels)
- pa_cvolume_set(&data->volume, data->sample_spec.channels, pa_cvolume_avg(&data->volume));
+ pa_cvolume_remap(&data->volume, &original_cm, &data->channel_map);
if (data->resample_method == PA_RESAMPLER_INVALID)
data->resample_method = core->resample_method;
--
1.6.0.3

View File

@ -1,125 +0,0 @@
From 220c9c0c207c9e3a205596b540277825c8a917cd Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 8 Oct 2008 04:02:10 +0200
Subject: [PATCH] define 0dB in PA as maximum amplification
---
src/modules/module-alsa-sink.c | 10 ++++++----
src/modules/module-alsa-source.c | 10 ++++++----
2 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c
index 0e15da3..4044de1 100644
--- a/src/modules/module-alsa-sink.c
+++ b/src/modules/module-alsa-sink.c
@@ -796,7 +796,7 @@ static int sink_get_volume_cb(pa_sink *s) {
VALGRIND_MAKE_MEM_DEFINED(&alsa_vol, sizeof(alsa_vol));
#endif
- r.values[i] = pa_sw_volume_from_dB((double) alsa_vol / 100.0);
+ r.values[i] = pa_sw_volume_from_dB((double) (alsa_vol - u->hw_dB_max) / 100.0);
} else {
if ((err = snd_mixer_selem_get_playback_volume(u->mixer_elem, u->mixer_map[i], &alsa_vol)) < 0)
@@ -818,7 +818,7 @@ static int sink_get_volume_cb(pa_sink *s) {
VALGRIND_MAKE_MEM_DEFINED(&alsa_vol, sizeof(alsa_vol));
#endif
- pa_cvolume_set(&r, s->sample_spec.channels, pa_sw_volume_from_dB((double) alsa_vol / 100.0));
+ pa_cvolume_set(&r, s->sample_spec.channels, pa_sw_volume_from_dB((double) (alsa_vol - u->hw_dB_max) / 100.0));
} else {
@@ -875,6 +875,7 @@ static int sink_set_volume_cb(pa_sink *s) {
if (u->hw_dB_supported) {
alsa_vol = (long) (pa_sw_volume_to_dB(vol) * 100);
+ alsa_vol += u->hw_dB_max;
alsa_vol = PA_CLAMP_UNLIKELY(alsa_vol, u->hw_dB_min, u->hw_dB_max);
if ((err = snd_mixer_selem_set_playback_dB(u->mixer_elem, u->mixer_map[i], alsa_vol, 1)) < 0)
@@ -883,7 +884,7 @@ static int sink_set_volume_cb(pa_sink *s) {
if ((err = snd_mixer_selem_get_playback_dB(u->mixer_elem, u->mixer_map[i], &alsa_vol)) < 0)
goto fail;
- r.values[i] = pa_sw_volume_from_dB((double) alsa_vol / 100.0);
+ r.values[i] = pa_sw_volume_from_dB((double) (alsa_vol - u->hw_dB_max) / 100.0);
} else {
alsa_vol = to_alsa_volume(u, vol);
@@ -906,6 +907,7 @@ static int sink_set_volume_cb(pa_sink *s) {
if (u->hw_dB_supported) {
alsa_vol = (long) (pa_sw_volume_to_dB(vol) * 100);
+ alsa_vol += u->hw_dB_max;
alsa_vol = PA_CLAMP_UNLIKELY(alsa_vol, u->hw_dB_min, u->hw_dB_max);
if ((err = snd_mixer_selem_set_playback_dB_all(u->mixer_elem, alsa_vol, 1)) < 0)
@@ -914,7 +916,7 @@ static int sink_set_volume_cb(pa_sink *s) {
if ((err = snd_mixer_selem_get_playback_dB(u->mixer_elem, SND_MIXER_SCHN_MONO, &alsa_vol)) < 0)
goto fail;
- pa_cvolume_set(&r, s->volume.channels, pa_sw_volume_from_dB((double) alsa_vol / 100.0));
+ pa_cvolume_set(&r, s->volume.channels, pa_sw_volume_from_dB((double) (alsa_vol - u->hw_dB_max) / 100.0));
} else {
alsa_vol = to_alsa_volume(u, vol);
diff --git a/src/modules/module-alsa-source.c b/src/modules/module-alsa-source.c
index 2827ecf..a743776 100644
--- a/src/modules/module-alsa-source.c
+++ b/src/modules/module-alsa-source.c
@@ -742,7 +742,7 @@ static int source_get_volume_cb(pa_source *s) {
VALGRIND_MAKE_MEM_DEFINED(&alsa_vol, sizeof(alsa_vol));
#endif
- r.values[i] = pa_sw_volume_from_dB((double) alsa_vol / 100.0);
+ r.values[i] = pa_sw_volume_from_dB((double) (alsa_vol - u->hw_dB_max) / 100.0);
} else {
if ((err = snd_mixer_selem_get_capture_volume(u->mixer_elem, u->mixer_map[i], &alsa_vol)) < 0)
@@ -764,7 +764,7 @@ static int source_get_volume_cb(pa_source *s) {
VALGRIND_MAKE_MEM_DEFINED(&alsa_vol, sizeof(alsa_vol));
#endif
- pa_cvolume_set(&r, s->sample_spec.channels, pa_sw_volume_from_dB((double) alsa_vol / 100.0));
+ pa_cvolume_set(&r, s->sample_spec.channels, pa_sw_volume_from_dB((double) (alsa_vol - u->hw_dB_max) / 100.0));
} else {
@@ -821,6 +821,7 @@ static int source_set_volume_cb(pa_source *s) {
if (u->hw_dB_supported) {
alsa_vol = (long) (pa_sw_volume_to_dB(vol) * 100);
+ alsa_vol += u->hw_dB_max;
alsa_vol = PA_CLAMP_UNLIKELY(alsa_vol, u->hw_dB_min, u->hw_dB_max);
if ((err = snd_mixer_selem_set_capture_dB(u->mixer_elem, u->mixer_map[i], alsa_vol, 1)) < 0)
@@ -829,7 +830,7 @@ static int source_set_volume_cb(pa_source *s) {
if ((err = snd_mixer_selem_get_capture_dB(u->mixer_elem, u->mixer_map[i], &alsa_vol)) < 0)
goto fail;
- r.values[i] = pa_sw_volume_from_dB((double) alsa_vol / 100.0);
+ r.values[i] = pa_sw_volume_from_dB((double) (alsa_vol - u->hw_dB_max) / 100.0);
} else {
alsa_vol = to_alsa_volume(u, vol);
@@ -852,6 +853,7 @@ static int source_set_volume_cb(pa_source *s) {
if (u->hw_dB_supported) {
alsa_vol = (long) (pa_sw_volume_to_dB(vol) * 100);
+ alsa_vol += u->hw_dB_max;
alsa_vol = PA_CLAMP_UNLIKELY(alsa_vol, u->hw_dB_min, u->hw_dB_max);
if ((err = snd_mixer_selem_set_capture_dB_all(u->mixer_elem, alsa_vol, 1)) < 0)
@@ -860,7 +862,7 @@ static int source_set_volume_cb(pa_source *s) {
if ((err = snd_mixer_selem_get_capture_dB(u->mixer_elem, SND_MIXER_SCHN_MONO, &alsa_vol)) < 0)
goto fail;
- pa_cvolume_set(&r, s->volume.channels, pa_sw_volume_from_dB((double) alsa_vol / 100.0));
+ pa_cvolume_set(&r, s->volume.channels, pa_sw_volume_from_dB((double) (alsa_vol - u->hw_dB_max) / 100.0));
} else {
alsa_vol = to_alsa_volume(u, vol);
--
1.6.0.3

View File

@ -1,41 +0,0 @@
From c72a7db3b1e08b9ebef3a0f7da0b8e669f7e79fa Mon Sep 17 00:00:00 2001
From: Colin Guthrie <pulse@colin.guthr.ie>
Date: Wed, 8 Oct 2008 22:56:12 +0200
Subject: [PATCH] Fix a potential C++/C99 ism, add a log message on error condition
Signed-off-by: Lennart Poettering <lennart@poettering.net>
---
src/pulsecore/pid.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/pulsecore/pid.c b/src/pulsecore/pid.c
index ce8ef19..99ba3e1 100644
--- a/src/pulsecore/pid.c
+++ b/src/pulsecore/pid.c
@@ -211,6 +211,7 @@ int pa_pid_file_create(const char *procname) {
if ((pid = read_pid(fn, fd)) == (pid_t) -1)
pa_log_warn("Corrupt PID file, overwriting.");
else if (pid > 0) {
+ int ours = 1;
#ifdef OS_IS_WIN32
if ((process = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, pid)) != NULL) {
@@ -218,11 +219,13 @@ int pa_pid_file_create(const char *procname) {
#else
if (kill(pid, 0) >= 0 || errno != ESRCH) {
#endif
- int ours = 1;
if (procname)
- if ((ours = proc_name_ours(pid, procname)) < 0)
+ if ((ours = proc_name_ours(pid, procname)) < 0) {
+ pa_log_warn("Could not check to see if pid %lu is a pulseaudio process. "
+ "Asssuming it is and the daemon is already running.", (unsigned long) pid);
goto fail;
+ }
if (ours) {
pa_log("Daemon already running.");
--
1.6.0.3

View File

@ -1,34 +0,0 @@
From cab7cc3dfdbcc7dbe55862a3b39d9c6950a93c12 Mon Sep 17 00:00:00 2001
From: Colin Guthrie <pulse@colin.guthr.ie>
Date: Sat, 11 Oct 2008 18:20:06 +0100
Subject: [PATCH] Fix two typos that broke tunnels
---
src/modules/module-tunnel.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index 4bbb11a..a46d6e5 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -508,7 +508,7 @@ static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t off
switch (code) {
- case PA_SINK_MESSAGE_SET_STATE: {
+ case PA_SOURCE_MESSAGE_SET_STATE: {
int r;
if ((r = pa_source_process_msg(o, code, data, offset, chunk)) >= 0)
@@ -520,7 +520,7 @@ static int source_process_msg(pa_msgobject *o, int code, void *data, int64_t off
case PA_SOURCE_MESSAGE_GET_LATENCY: {
pa_usec_t yr, yl, *usec = data;
- yl = pa_bytes_to_usec((uint64_t) u->counter, &PA_SINK(o)->sample_spec);
+ yl = pa_bytes_to_usec((uint64_t) u->counter, &PA_SOURCE(o)->sample_spec);
yr = pa_smoother_get(u->smoother, pa_rtclock_usec());
*usec = yr > yl ? yr - yl : 0;
--
1.6.0.3

View File

@ -1,41 +0,0 @@
From 9fd82c196432f3b5aadd0970a810fc778804bb34 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 13 Oct 2008 19:52:02 +0200
Subject: [PATCH] properly remove dbus matches an filters when unloading m-b-d
---
src/modules/bluetooth/module-bluetooth-discover.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diff --git a/src/modules/bluetooth/module-bluetooth-discover.c b/src/modules/bluetooth/module-bluetooth-discover.c
index a33ca64..ad436f3 100644
--- a/src/modules/bluetooth/module-bluetooth-discover.c
+++ b/src/modules/bluetooth/module-bluetooth-discover.c
@@ -485,8 +485,23 @@ void pa__done(pa_module* m) {
device_free(i);
}
- if (u->conn)
+ if (u->conn) {
+ DBusError error;
+ dbus_error_init(&error);
+
+ dbus_bus_remove_match(pa_dbus_connection_get(u->conn), "type='signal',sender='org.bluez',interface='org.bluez.Adapter',member='DeviceRemoved'", &error);
+ dbus_error_free(&error);
+
+ dbus_bus_remove_match(pa_dbus_connection_get(u->conn), "type='signal',sender='org.bluez',interface='org.bluez.Headset',member='PropertyChanged'", &error);
+ dbus_error_free(&error);
+
+ dbus_bus_remove_match(pa_dbus_connection_get(u->conn), "type='signal',sender='org.bluez',interface='org.bluez.AudioSink',member='PropertyChanged'", &error);
+ dbus_error_free(&error);
+
+ dbus_connection_remove_filter(pa_dbus_connection_get(u->conn), filter_cb, u);
+
pa_dbus_connection_unref(u->conn);
+ }
pa_xfree(u);
}
--
1.6.0.3

View File

@ -1,25 +0,0 @@
From 6ad65da869df57a93a6f0a53eb5744126ce439ba Mon Sep 17 00:00:00 2001
From: Luiz Augusto von Dentz <luiz.dentz@openbossa.org>
Date: Thu, 9 Oct 2008 19:31:43 -0300
Subject: [PATCH] Fix possible invalid read while attempting to load module-bluetooth-device.
---
src/modules/bluetooth/module-bluetooth-discover.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/modules/bluetooth/module-bluetooth-discover.c b/src/modules/bluetooth/module-bluetooth-discover.c
index ad436f3..36c0a35 100644
--- a/src/modules/bluetooth/module-bluetooth-discover.c
+++ b/src/modules/bluetooth/module-bluetooth-discover.c
@@ -346,7 +346,7 @@ static void load_module_for_device(struct userdata *u, struct device *d, const c
pa_m = pa_module_load(u->module->core, "module-bluetooth-device", args);
pa_xfree(args);
- if (!m) {
+ if (!pa_m) {
pa_log_debug("Failed to load module for device %s", d->object_path);
return;
}
--
1.6.0.3

View File

@ -1,33 +0,0 @@
From af133f504f83b7e657d3d9d1fda88d767e324b42 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Sun, 19 Oct 2008 22:24:18 +0200
Subject: [PATCH] always check for libtool prefix binary name to avoid confusion when using both installed and run-from-build-tree versions of PA in parallel
---
src/pulsecore/pid.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/pulsecore/pid.c b/src/pulsecore/pid.c
index 99ba3e1..bf9ba98 100644
--- a/src/pulsecore/pid.c
+++ b/src/pulsecore/pid.c
@@ -171,14 +171,14 @@ static int proc_name_ours(pid_t pid, const char *procname) {
good = pa_startswith(stored, expected);
pa_xfree(expected);
-#if !defined(__OPTIMIZE__)
+/*#if !defined(__OPTIMIZE__)*/
if (!good) {
/* libtool likes to rename our binary names ... */
expected = pa_sprintf_malloc("%lu (lt-%s)", (unsigned long) pid, procname);
good = pa_startswith(stored, expected);
pa_xfree(expected);
}
-#endif
+/*#endif*/
return !!good;
}
--
1.6.0.3

View File

@ -1,79 +0,0 @@
From ac4b0afadbd58b5313ed9d2c6b71999cb3898c13 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Sun, 19 Oct 2008 22:25:58 +0200
Subject: [PATCH] Fix spelling of privilige
---
src/daemon/caps.c | 2 +-
src/daemon/main.c | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/daemon/caps.c b/src/daemon/caps.c
index 707b532..b5cbbc6 100644
--- a/src/daemon/caps.c
+++ b/src/daemon/caps.c
@@ -60,7 +60,7 @@ void pa_drop_root(void) {
if (uid == 0 || geteuid() != 0)
return;
- pa_log_info(_("Dropping root priviliges."));
+ pa_log_info(_("Dropping root privileges."));
#if defined(HAVE_SETRESUID)
pa_assert_se(setresuid(uid, uid, uid) >= 0);
diff --git a/src/daemon/main.c b/src/daemon/main.c
index bc8bc63..2306483 100644
--- a/src/daemon/main.c
+++ b/src/daemon/main.c
@@ -222,7 +222,7 @@ static int change_user(void) {
#elif defined(HAVE_SETREGID)
r = setregid(gr->gr_gid, gr->gr_gid);
#else
-#error "No API to drop priviliges"
+#error "No API to drop privileges"
#endif
if (r < 0) {
@@ -238,7 +238,7 @@ static int change_user(void) {
#elif defined(HAVE_SETREUID)
r = setreuid(pw->pw_uid, pw->pw_uid);
#else
-#error "No API to drop priviliges"
+#error "No API to drop privileges"
#endif
if (r < 0) {
@@ -382,7 +382,7 @@ int main(int argc, char *argv[]) {
/* Drop all capabilities except CAP_SYS_NICE */
pa_limit_caps();
- /* Drop priviliges, but keep CAP_SYS_NICE */
+ /* Drop privileges, but keep CAP_SYS_NICE */
pa_drop_root();
/* After dropping root, the effective set is reset, hence,
@@ -476,9 +476,9 @@ int main(int argc, char *argv[]) {
pa_drop_caps();
if (conf->high_priority || conf->realtime_scheduling)
- pa_log_notice(_("Called SUID root and real-time/high-priority scheduling was requested in the configuration. However, we lack the necessary priviliges:\n"
- "We are not in group '"PA_REALTIME_GROUP"' and PolicyKit refuse to grant us priviliges. Dropping SUID again.\n"
- "For enabling real-time scheduling please acquire the appropriate PolicyKit priviliges, or become a member of '"PA_REALTIME_GROUP"', or increase the RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user."));
+ pa_log_notice(_("Called SUID root and real-time/high-priority scheduling was requested in the configuration. However, we lack the necessary privileges:\n"
+ "We are not in group '"PA_REALTIME_GROUP"' and PolicyKit refuse to grant us privileges. Dropping SUID again.\n"
+ "For enabling real-time scheduling please acquire the appropriate PolicyKit privileges, or become a member of '"PA_REALTIME_GROUP"', or increase the RLIMIT_NICE/RLIMIT_RTPRIO resource limits for this user."));
}
}
@@ -626,7 +626,7 @@ int main(int argc, char *argv[]) {
if (real_root && !conf->system_instance)
pa_log_warn(_("This program is not intended to be run as root (unless --system is specified)."));
else if (!real_root && conf->system_instance) {
- pa_log(_("Root priviliges required."));
+ pa_log(_("Root privileges required."));
goto finish;
}
--
1.6.0.3

View File

@ -1,25 +0,0 @@
From f3770fa7afa6c9f8a38336c4d0ee735bbb60216c Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Mon, 20 Oct 2008 20:33:28 +0200
Subject: [PATCH] Make missing git-changelog.perl non-fatal
---
Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index facce0d..ebc5e69 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -58,7 +58,7 @@ dist-hook:
if test -d .git ; then \
git pull ; \
chmod u+w ${distdir}/ChangeLog || true ; \
- git-changelog.perl > ${distdir}/ChangeLog ; \
+ ( git-changelog.perl || echo "git-changelog.perl failed." ) > ${distdir}/ChangeLog 2>&1 ; \
fi
.PHONY: homepage distcleancheck doxygen
--
1.6.0.3

View File

@ -1,25 +0,0 @@
From 74898ff657ff85a3a3ce481d74d75438d79fde25 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 21 Oct 2008 18:22:28 +0200
Subject: [PATCH] fix invalid validity check
---
src/pulsecore/sink-input.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index cade0db..5368f31 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -156,7 +156,7 @@ pa_sink_input* pa_sink_input_new(
}
pa_return_null_if_fail(pa_cvolume_valid(&data->volume));
- pa_return_null_if_fail(data->volume.channels == data->sample_spec.channels);
+ pa_return_null_if_fail(pa_cvolume_compatible(&data->volume, &data->sample_spec));
if (!data->muted_is_set)
data->muted = FALSE;
--
1.6.0.3

View File

@ -1,25 +0,0 @@
From ab1139ffd3b33e55cd0a480e6e6ed86f5f1b53f1 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 21 Oct 2008 18:27:25 +0200
Subject: [PATCH] convert argument to boolean int in PA_UNLIKELY, too
---
src/pulsecore/macro.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h
index 39e9b58..2d031da 100644
--- a/src/pulsecore/macro.h
+++ b/src/pulsecore/macro.h
@@ -40,7 +40,7 @@
#ifndef PA_LIKELY
#ifdef __GNUC__
#define PA_LIKELY(x) (__builtin_expect(!!(x),1))
-#define PA_UNLIKELY(x) (__builtin_expect((x),0))
+#define PA_UNLIKELY(x) (__builtin_expect(!!(x),0))
#else
#define PA_LIKELY(x) (x)
#define PA_UNLIKELY(x) (x)
--
1.6.0.3

View File

@ -1,32 +0,0 @@
From b041aac9b104008240cf4f3571de6a4637d94b1d Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 21 Oct 2008 18:40:01 +0200
Subject: [PATCH] include log.h near the end so that macro.h can be included in log.h and defines pa_bool_t properly
---
src/pulsecore/macro.h | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h
index 2d031da..cf02696 100644
--- a/src/pulsecore/macro.h
+++ b/src/pulsecore/macro.h
@@ -30,7 +30,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <pulsecore/log.h>
#include <pulse/gccmacro.h>
#ifndef PACKAGE
@@ -221,4 +220,7 @@ typedef int pa_bool_t;
#endif
+/* We include this at the very last place */
+#include <pulsecore/log.h>
+
#endif
--
1.6.0.3

View File

@ -1,166 +0,0 @@
From 0796f5a2d6bf8e175a16d7f58cd0a18783fb4590 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 21 Oct 2008 20:00:36 +0200
Subject: [PATCH] Try to catch certain driver errors
... by verifying return values of snd_pcm_avail_update() and
snd_pcm_begin_mmap() for their sanenness.
---
src/modules/alsa-util.c | 60 ++++++++++++++++++++++++++++++++++++++
src/modules/alsa-util.h | 3 ++
src/modules/module-alsa-sink.c | 6 ++--
src/modules/module-alsa-source.c | 6 ++--
4 files changed, 69 insertions(+), 6 deletions(-)
diff --git a/src/modules/alsa-util.c b/src/modules/alsa-util.c
index ffe7795..39cea49 100644
--- a/src/modules/alsa-util.c
+++ b/src/modules/alsa-util.c
@@ -30,6 +30,7 @@
#include <pulse/sample.h>
#include <pulse/xmalloc.h>
+#include <pulse/timeval.h>
#include <pulsecore/log.h>
#include <pulsecore/macro.h>
@@ -1109,3 +1110,62 @@ pa_rtpoll_item* pa_alsa_build_pollfd(snd_pcm_t *pcm, pa_rtpoll *rtpoll) {
return item;
}
+
+snd_pcm_sframes_t pa_alsa_safe_avail_update(snd_pcm_t *pcm, size_t hwbuf_size, const pa_sample_spec *ss) {
+ snd_pcm_sframes_t n;
+ size_t k;
+
+ pa_assert(pcm);
+ pa_assert(hwbuf_size > 0);
+ pa_assert(ss);
+
+ /* Some ALSA driver expose weird bugs, let's inform the user about
+ * what is going on */
+
+ n = snd_pcm_avail_update(pcm);
+
+ if (n <= 0)
+ return n;
+
+ k = (size_t) n * pa_frame_size(ss);
+
+ if (k >= hwbuf_size * 3 ||
+ k >= pa_bytes_per_second(ss)*10)
+ pa_log("snd_pcm_avail_update() returned a value that is exceptionally large: %lu bytes (%lu ms) "
+ "Most likely this is an ALSA driver bug. Please report this issue to the PulseAudio developers.",
+ (unsigned long) k, (unsigned long) pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC);
+
+ return n;
+}
+
+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) {
+ int r;
+ snd_pcm_uframes_t before;
+ size_t k;
+
+ pa_assert(pcm);
+ pa_assert(areas);
+ pa_assert(offset);
+ pa_assert(frames);
+ pa_assert(hwbuf_size > 0);
+ pa_assert(ss);
+
+ before = *frames;
+
+ r = snd_pcm_mmap_begin(pcm, areas, offset, frames);
+
+ if (r < 0)
+ return r;
+
+ k = (size_t) *frames * pa_frame_size(ss);
+
+ if (*frames > before ||
+ k >= hwbuf_size * 3 ||
+ k >= pa_bytes_per_second(ss)*10)
+
+ pa_log("snd_pcm_mmap_begin() returned a value that is exceptionally large: %lu bytes (%lu ms) "
+ "Most likely this is an ALSA driver bug. Please report this issue to the PulseAudio developers.",
+ (unsigned long) k, (unsigned long) pa_bytes_to_usec(k, ss) / PA_USEC_PER_MSEC);
+
+ return r;
+}
diff --git a/src/modules/alsa-util.h b/src/modules/alsa-util.h
index b66adc1..aaa01c7 100644
--- a/src/modules/alsa-util.h
+++ b/src/modules/alsa-util.h
@@ -92,4 +92,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_update(snd_pcm_t *pcm, size_t hwbuf_size, const pa_sample_spec *ss);
+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);
+
#endif
diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c
index 4044de1..af83103 100644
--- a/src/modules/module-alsa-sink.c
+++ b/src/modules/module-alsa-sink.c
@@ -261,7 +261,7 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec) {
/* First we determine how many samples are missing to fill the
* buffer up to 100% */
- if (PA_UNLIKELY((n = snd_pcm_avail_update(u->pcm_handle)) < 0)) {
+ if (PA_UNLIKELY((n = pa_alsa_safe_avail_update(u->pcm_handle, u->hwbuf_size, &u->sink->sample_spec)) < 0)) {
if ((r = try_recover(u, "snd_pcm_avail_update", (int) n)) == 0)
continue;
@@ -299,7 +299,7 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec) {
/* pa_log_debug("%lu frames to write", (unsigned long) frames); */
- if (PA_UNLIKELY((err = snd_pcm_mmap_begin(u->pcm_handle, &areas, &offset, &frames)) < 0)) {
+ if (PA_UNLIKELY((err = pa_alsa_safe_mmap_begin(u->pcm_handle, &areas, &offset, &frames, u->hwbuf_size, &u->sink->sample_spec)) < 0)) {
if ((r = try_recover(u, "snd_pcm_mmap_begin", err)) == 0)
continue;
@@ -374,7 +374,7 @@ static int unix_write(struct userdata *u, pa_usec_t *sleep_usec) {
snd_pcm_hwsync(u->pcm_handle);
- if (PA_UNLIKELY((n = snd_pcm_avail_update(u->pcm_handle)) < 0)) {
+ if (PA_UNLIKELY((n = pa_alsa_safe_avail_update(u->pcm_handle, u->hwbuf_size, &u->sink->sample_spec)) < 0)) {
if ((r = try_recover(u, "snd_pcm_avail_update", (int) n)) == 0)
continue;
diff --git a/src/modules/module-alsa-source.c b/src/modules/module-alsa-source.c
index a743776..dd6ca97 100644
--- a/src/modules/module-alsa-source.c
+++ b/src/modules/module-alsa-source.c
@@ -255,7 +255,7 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec) {
snd_pcm_hwsync(u->pcm_handle);
- if (PA_UNLIKELY((n = snd_pcm_avail_update(u->pcm_handle)) < 0)) {
+ if (PA_UNLIKELY((n = pa_alsa_safe_avail_update(u->pcm_handle, u->hwbuf_size, &u->source->sample_spec)) < 0)) {
if ((r = try_recover(u, "snd_pcm_avail_update", (int) n)) == 0)
continue;
@@ -282,7 +282,7 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec) {
/* pa_log_debug("%lu frames to read", (unsigned long) frames); */
- if (PA_UNLIKELY((err = snd_pcm_mmap_begin(u->pcm_handle, &areas, &offset, &frames)) < 0)) {
+ if (PA_UNLIKELY((err = pa_alsa_safe_mmap_begin(u->pcm_handle, &areas, &offset, &frames, u->hwbuf_size, &u->source->sample_spec)) < 0)) {
if ((r = try_recover(u, "snd_pcm_mmap_begin", err)) == 0)
continue;
@@ -353,7 +353,7 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec) {
snd_pcm_hwsync(u->pcm_handle);
- if (PA_UNLIKELY((n = snd_pcm_avail_update(u->pcm_handle)) < 0)) {
+ if (PA_UNLIKELY((n = pa_alsa_safe_avail_update(u->pcm_handle, u->hwbuf_size, &u->source->sample_spec)) < 0)) {
if ((r = try_recover(u, "snd_pcm_avail_update", (int) n)) == 0)
continue;
--
1.6.0.3

View File

@ -1,29 +0,0 @@
From 8e2a48a7a2baa49a900b9c42e8d08aca5db90d1f Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Tue, 21 Oct 2008 22:04:22 +0200
Subject: [PATCH] make the debug trap macro a proper macro in macro.h
---
src/pulsecore/macro.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/pulsecore/macro.h b/src/pulsecore/macro.h
index cf02696..f9ce949 100644
--- a/src/pulsecore/macro.h
+++ b/src/pulsecore/macro.h
@@ -220,6 +220,12 @@ typedef int pa_bool_t;
#endif
+#if defined(__i386__) || defined(__x86_64__)
+#define PA_DEBUG_TRAP __asm__("int $3")
+#else
+#define PA_DEBUG_TRAP raise(SIGTRAP)
+#endif
+
/* We include this at the very last place */
#include <pulsecore/log.h>
--
1.6.0.3

View File

@ -1,41 +0,0 @@
From bfdad535da00ca0a06aeafd774d3168b4f79c82c Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 22 Oct 2008 22:48:53 +0200
Subject: [PATCH] don't set the volume of pacat unless it is explicitly set
---
src/utils/pacat.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/utils/pacat.c b/src/utils/pacat.c
index 99df5b9..ea736e2 100644
--- a/src/utils/pacat.c
+++ b/src/utils/pacat.c
@@ -57,6 +57,7 @@ static char *stream_name = NULL, *client_name = NULL, *device = NULL;
static int verbose = 0;
static pa_volume_t volume = PA_VOLUME_NORM;
+static int volume_is_set = 0;
static pa_sample_spec sample_spec = {
.format = PA_SAMPLE_S16LE,
@@ -283,7 +284,7 @@ static void context_state_callback(pa_context *c, void *userdata) {
if (mode == PLAYBACK) {
pa_cvolume cv;
- if ((r = pa_stream_connect_playback(stream, device, latency > 0 ? &buffer_attr : NULL, flags, pa_cvolume_set(&cv, sample_spec.channels, volume), NULL)) < 0) {
+ if ((r = pa_stream_connect_playback(stream, device, latency > 0 ? &buffer_attr : NULL, flags, volume_is_set ? pa_cvolume_set(&cv, sample_spec.channels, volume) : NULL, NULL)) < 0) {
fprintf(stderr, _("pa_stream_connect_playback() failed: %s\n"), pa_strerror(pa_context_errno(c)));
goto fail;
}
@@ -627,6 +628,7 @@ int main(int argc, char *argv[]) {
case ARG_VOLUME: {
int v = atoi(optarg);
volume = v < 0 ? 0U : (pa_volume_t) v;
+ volume_is_set = 1;
break;
}
--
1.6.0.3

View File

@ -1,267 +0,0 @@
From 09279f76342a1f3b261c04232821c3dc225312c3 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Wed, 22 Oct 2008 23:55:52 +0200
Subject: [PATCH] warn if ALSA wakes us up and there is actually nothing to do
---
src/modules/alsa-util.c | 6 +++++
src/modules/module-alsa-sink.c | 41 +++++++++++++++++++++++++++----------
src/modules/module-alsa-source.c | 41 +++++++++++++++++++++++++++----------
3 files changed, 66 insertions(+), 22 deletions(-)
diff --git a/src/modules/alsa-util.c b/src/modules/alsa-util.c
index 39cea49..20dc400 100644
--- a/src/modules/alsa-util.c
+++ b/src/modules/alsa-util.c
@@ -1051,6 +1051,12 @@ int pa_alsa_recover_from_poll(snd_pcm_t *pcm, int revents) {
pa_log_warn("Got POLLNVAL from ALSA");
if (revents & POLLHUP)
pa_log_warn("Got POLLHUP from ALSA");
+ if (revents & POLLPRI)
+ pa_log_warn("Got POLLPRI from ALSA");
+ if (revents & POLLIN)
+ pa_log_warn("Got POLLIN from ALSA");
+ if (revents & POLLOUT)
+ pa_log_warn("Got POLLOUT from ALSA");
state = snd_pcm_state(pcm);
pa_log_warn("PCM state is %s", snd_pcm_state_name(state));
diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c
index af83103..6dea172 100644
--- a/src/modules/module-alsa-sink.c
+++ b/src/modules/module-alsa-sink.c
@@ -241,7 +241,7 @@ static size_t check_left_to_play(struct userdata *u, snd_pcm_sframes_t n) {
return left_to_play;
}
-static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec) {
+static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled) {
int work_done = 0;
pa_usec_t max_sleep_usec = 0, process_usec = 0;
size_t left_to_play;
@@ -279,14 +279,23 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec) {
* need to guarantee that clients only have to keep around
* a single hw buffer length. */
- if (pa_bytes_to_usec(left_to_play, &u->sink->sample_spec) > process_usec+max_sleep_usec/2)
+ if (!polled &&
+ pa_bytes_to_usec(left_to_play, &u->sink->sample_spec) > process_usec+max_sleep_usec/2)
break;
- if (PA_UNLIKELY(n <= u->hwbuf_unused_frames))
+ if (PA_UNLIKELY(n <= u->hwbuf_unused_frames)) {
+
+ if (polled)
+ pa_log("ALSA woke us up to write new data to the device, but there was actually nothing to write! "
+ "Most likely this is an ALSA driver bug. Please report this issue to the PulseAudio developers.");
+
break;
+ }
n -= u->hwbuf_unused_frames;
+ polled = FALSE;
+
/* pa_log_debug("Filling up"); */
for (;;) {
@@ -357,7 +366,7 @@ static int mmap_write(struct userdata *u, pa_usec_t *sleep_usec) {
return work_done;
}
-static int unix_write(struct userdata *u, pa_usec_t *sleep_usec) {
+static int unix_write(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled) {
int work_done = 0;
pa_usec_t max_sleep_usec = 0, process_usec = 0;
size_t left_to_play;
@@ -392,14 +401,23 @@ static int unix_write(struct userdata *u, pa_usec_t *sleep_usec) {
* need to guarantee that clients only have to keep around
* a single hw buffer length. */
- if (pa_bytes_to_usec(left_to_play, &u->sink->sample_spec) > process_usec+max_sleep_usec/2)
+ if (!polled &&
+ pa_bytes_to_usec(left_to_play, &u->sink->sample_spec) > process_usec+max_sleep_usec/2)
break;
- if (PA_UNLIKELY(n <= u->hwbuf_unused_frames))
+ if (PA_UNLIKELY(n <= u->hwbuf_unused_frames)) {
+
+ if (polled)
+ pa_log("ALSA woke us up to write new data to the device, but there was actually nothing to write! "
+ "Most likely this is an ALSA driver bug. Please report this issue to the PulseAudio developers.");
+
break;
+ }
n -= u->hwbuf_unused_frames;
+ polled = FALSE;
+
for (;;) {
snd_pcm_sframes_t frames;
void *p;
@@ -1084,6 +1102,7 @@ finish:
static void thread_func(void *userdata) {
struct userdata *u = userdata;
+ unsigned short revents = 0;
pa_assert(u);
@@ -1110,9 +1129,9 @@ static void thread_func(void *userdata) {
goto fail;
if (u->use_mmap)
- work_done = mmap_write(u, &sleep_usec);
+ work_done = mmap_write(u, &sleep_usec, revents & POLLOUT);
else
- work_done = unix_write(u, &sleep_usec);
+ work_done = unix_write(u, &sleep_usec, revents & POLLOUT);
if (work_done < 0)
goto fail;
@@ -1180,7 +1199,6 @@ static void thread_func(void *userdata) {
/* Tell ALSA about this and process its response */
if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
struct pollfd *pollfd;
- unsigned short revents = 0;
int err;
unsigned n;
@@ -1191,7 +1209,7 @@ static void thread_func(void *userdata) {
goto fail;
}
- if (revents & (POLLERR|POLLNVAL|POLLHUP|POLLPRI)) {
+ if (revents & (POLLIN|POLLERR|POLLNVAL|POLLHUP|POLLPRI)) {
if (pa_alsa_recover_from_poll(u->pcm_handle, revents) < 0)
goto fail;
@@ -1201,7 +1219,8 @@ static void thread_func(void *userdata) {
if (revents && u->use_tsched)
pa_log_debug("Wakeup from ALSA!%s%s", (revents & POLLIN) ? " INPUT" : "", (revents & POLLOUT) ? " OUTPUT" : "");
- }
+ } else
+ revents = 0;
}
fail:
diff --git a/src/modules/module-alsa-source.c b/src/modules/module-alsa-source.c
index dd6ca97..f796ef1 100644
--- a/src/modules/module-alsa-source.c
+++ b/src/modules/module-alsa-source.c
@@ -238,7 +238,7 @@ static size_t check_left_to_record(struct userdata *u, snd_pcm_sframes_t n) {
return left_to_record;
}
-static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec) {
+static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled) {
int work_done = 0;
pa_usec_t max_sleep_usec = 0, process_usec = 0;
size_t left_to_record;
@@ -266,11 +266,20 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec) {
left_to_record = check_left_to_record(u, n);
if (u->use_tsched)
- if (pa_bytes_to_usec(left_to_record, &u->source->sample_spec) > process_usec+max_sleep_usec/2)
+ if (!polled &&
+ pa_bytes_to_usec(left_to_record, &u->source->sample_spec) > process_usec+max_sleep_usec/2)
break;
- if (PA_UNLIKELY(n <= 0))
+ if (PA_UNLIKELY(n <= 0)) {
+
+ if (polled)
+ pa_log("ALSA woke us up to read new data from the device, but there was actually nothing to read! "
+ "Most likely this is an ALSA driver bug. Please report this issue to the PulseAudio device.");
+
break;
+ }
+
+ polled = FALSE;
for (;;) {
int err;
@@ -336,7 +345,7 @@ static int mmap_read(struct userdata *u, pa_usec_t *sleep_usec) {
return work_done;
}
-static int unix_read(struct userdata *u, pa_usec_t *sleep_usec) {
+static int unix_read(struct userdata *u, pa_usec_t *sleep_usec, pa_bool_t polled) {
int work_done = 0;
pa_usec_t max_sleep_usec = 0, process_usec = 0;
size_t left_to_record;
@@ -364,11 +373,20 @@ static int unix_read(struct userdata *u, pa_usec_t *sleep_usec) {
left_to_record = check_left_to_record(u, n);
if (u->use_tsched)
- if (pa_bytes_to_usec(left_to_record, &u->source->sample_spec) > process_usec+max_sleep_usec/2)
+ if (!polled &&
+ pa_bytes_to_usec(left_to_record, &u->source->sample_spec) > process_usec+max_sleep_usec/2)
break;
- if (PA_UNLIKELY(n <= 0))
+ if (PA_UNLIKELY(n <= 0)) {
+
+ if (polled)
+ pa_log("ALSA woke us up to read new data from the device, but there was actually nothing to read! "
+ "Most likely this is an ALSA driver bug. Please report this issue to the PulseAudio developers.");
+
return work_done;
+ }
+
+ polled = FALSE;
for (;;) {
void *p;
@@ -950,6 +968,7 @@ static void source_update_requested_latency_cb(pa_source *s) {
static void thread_func(void *userdata) {
struct userdata *u = userdata;
+ unsigned short revents = 0;
pa_assert(u);
@@ -972,9 +991,9 @@ static void thread_func(void *userdata) {
pa_usec_t sleep_usec = 0;
if (u->use_mmap)
- work_done = mmap_read(u, &sleep_usec);
+ work_done = mmap_read(u, &sleep_usec, revents & POLLIN);
else
- work_done = unix_read(u, &sleep_usec);
+ work_done = unix_read(u, &sleep_usec, revents & POLLIN);
if (work_done < 0)
goto fail;
@@ -1016,7 +1035,6 @@ static void thread_func(void *userdata) {
/* Tell ALSA about this and process its response */
if (PA_SOURCE_IS_OPENED(u->source->thread_info.state)) {
struct pollfd *pollfd;
- unsigned short revents = 0;
int err;
unsigned n;
@@ -1027,7 +1045,7 @@ static void thread_func(void *userdata) {
goto fail;
}
- if (revents & (POLLERR|POLLNVAL|POLLHUP|POLLPRI)) {
+ if (revents & (POLLOUT|POLLERR|POLLNVAL|POLLHUP|POLLPRI)) {
if (pa_alsa_recover_from_poll(u->pcm_handle, revents) < 0)
goto fail;
@@ -1036,7 +1054,8 @@ static void thread_func(void *userdata) {
if (revents && u->use_tsched)
pa_log_debug("Wakeup from ALSA!%s%s", (revents & POLLIN) ? " INPUT" : "", (revents & POLLOUT) ? " OUTPUT" : "");
- }
+ } else
+ revents = 0;
}
fail:
--
1.6.0.3

View File

@ -1,32 +0,0 @@
From 6f4b228742398ef1cc28257aa82ddffdd5884e70 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 23 Oct 2008 23:23:39 +0200
Subject: [PATCH] fix build
---
src/pulsecore/sink-input.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/pulsecore/sink-input.c b/src/pulsecore/sink-input.c
index 5368f31..bed3d32 100644
--- a/src/pulsecore/sink-input.c
+++ b/src/pulsecore/sink-input.c
@@ -119,6 +119,7 @@ pa_sink_input* pa_sink_input_new(
pa_sink_input *i;
pa_resampler *resampler = NULL;
char st[PA_SAMPLE_SPEC_SNPRINT_MAX], cm[PA_CHANNEL_MAP_SNPRINT_MAX];
+ pa_channel_map original_cm;
pa_assert(core);
pa_assert(data);
@@ -152,7 +153,6 @@ pa_sink_input* pa_sink_input_new(
if (!data->volume_is_set) {
pa_cvolume_reset(&data->volume, data->sample_spec.channels);
- pa_cvolume_reset(&data->virtual_volume, data->sample_spec.channels);
}
pa_return_null_if_fail(pa_cvolume_valid(&data->volume));
--
1.6.0.3

View File

@ -1,43 +0,0 @@
From ac8af20d8fb42523c70fc364030ce4242d230076 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Fri, 24 Oct 2008 04:34:10 +0200
Subject: [PATCH] make sure to use 64bit rounding even on 32bit machines when converting to pa_usec_t
---
src/pulsecore/time-smoother.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/pulsecore/time-smoother.c b/src/pulsecore/time-smoother.c
index 6a2ffaa..6562194 100644
--- a/src/pulsecore/time-smoother.c
+++ b/src/pulsecore/time-smoother.c
@@ -313,7 +313,7 @@ static void estimate(pa_smoother *s, pa_usec_t x, pa_usec_t *y, double *deriv) {
/* Move back from origin */
ty += (double) s->ey;
- *y = ty >= 0 ? (pa_usec_t) lrint(ty) : 0;
+ *y = ty >= 0 ? (pa_usec_t) llrint(ty) : 0;
/* Horner scheme */
if (deriv)
@@ -360,7 +360,7 @@ void pa_smoother_put(pa_smoother *s, pa_usec_t x, pa_usec_t y) {
/* And calculate when we want to be on track again */
s->px = s->ex + s->adjust_time;
- s->py = s->ry + (pa_usec_t) lrint(s->dp * (double) s->adjust_time);
+ s->py = s->ry + (pa_usec_t) llrint(s->dp * (double) s->adjust_time);
s->abc_valid = FALSE;
@@ -456,7 +456,7 @@ pa_usec_t pa_smoother_translate(pa_smoother *s, pa_usec_t x, pa_usec_t y_delay)
/* pa_log_debug("translate(%llu) = %llu (%0.2f)", (unsigned long long) y_delay, (unsigned long long) ((double) y_delay / nde), nde); */
- return (pa_usec_t) lrint((double) y_delay / nde);
+ return (pa_usec_t) llrint((double) y_delay / nde);
}
void pa_smoother_reset(pa_smoother *s) {
--
1.6.0.3

View File

@ -1,31 +0,0 @@
From 68e9a48bb96f195ee13a093d7741a658d89591a7 Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Sat, 1 Nov 2008 21:41:07 +0100
Subject: [PATCH] make shm marker architecture independant, patch from michich, closes #401
---
src/pulsecore/shm.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/pulsecore/shm.c b/src/pulsecore/shm.c
index b299757..c59d247 100644
--- a/src/pulsecore/shm.c
+++ b/src/pulsecore/shm.c
@@ -73,10 +73,10 @@
struct shm_marker PA_GCC_PACKED {
pa_atomic_t marker; /* 0xbeefcafe */
pa_atomic_t pid;
- uint64_t *_reserverd1;
- uint64_t *_reserverd2;
- uint64_t *_reserverd3;
- uint64_t *_reserverd4;
+ uint64_t _reserved1;
+ uint64_t _reserved2;
+ uint64_t _reserved3;
+ uint64_t _reserved4;
};
static char *segment_name(char *fn, size_t l, unsigned id) {
--
1.6.0.3

View File

@ -1,40 +0,0 @@
From 3bef1a94b4a757292f6077b9c93285f74210752f Mon Sep 17 00:00:00 2001
From: Lennart Poettering <lennart@poettering.net>
Date: Sat, 1 Nov 2008 21:11:48 +0100
Subject: [PATCH] Make sure libpulse never gets unloaded
When an .so is unloaded during runtime all TLS keys it has registered
need to be freed because the destructor callbacks of the TLS key might
otherwise point to invalid code. Hence it would appear sensible to
destruct the TLS keys from a function marked as __attribute__
((destructor)). However functions marked like that are also called when
an application terminates, on exit(). If a thread continues to run until
the very exit it might still want to access that TLS data. The
destructor functions are called while all other threads are still
running. If __attribute ((destructor)) is used to destruct TLS keys for
such threads this might hence cause a crash when the application shuts
down.
To circumvent this problem we'll now compile libpulse with -z nodelete,
to make it unnecessary to delete the TLS data ever and thus avoiding the
problem. It's suboptimal, but for now I see no better solution.
---
src/Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/Makefile.am b/src/Makefile.am
index f277198..a4e4944 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -66,7 +66,7 @@ AM_LIBADD = $(PTHREAD_LIBS) $(INTLLIBS)
AM_LDADD = $(PTHREAD_LIBS) $(INTLLIBS)
# Only required on some platforms but defined for all to avoid errors
-AM_LDFLAGS = -Wl,-no-undefined -Wl,--gc-sections
+AM_LDFLAGS = -Wl,-no-undefined -Wl,--gc-sections -Wl,-z,nodelete
if STATIC_BINS
BINLDFLAGS = -static
--
1.6.0.3

View File

@ -1,36 +0,0 @@
diff -up pulseaudio-0.9.12/src/pulsecore/core-util.c.dotpulse pulseaudio-0.9.12/src/pulsecore/core-util.c
--- pulseaudio-0.9.12/src/pulsecore/core-util.c.dotpulse 2008-09-15 22:06:10.000000000 -0400
+++ pulseaudio-0.9.12/src/pulsecore/core-util.c 2008-09-15 22:08:39.000000000 -0400
@@ -1370,6 +1370,7 @@ static int make_random_dir_and_link(mode
char *pa_get_runtime_dir(void) {
char *d, *k = NULL, *p = NULL, *t = NULL, *mid;
struct stat st;
+ mode_t m;
/* The runtime directory shall contain dynamic data that needs NOT
* to be kept accross reboots and is usuallly private to the user,
@@ -1378,10 +1379,9 @@ char *pa_get_runtime_dir(void) {
* this directory, we link it to a random subdir in /tmp, if it
* was not explicitly configured. */
- if ((d = getenv("PULSE_RUNTIME_PATH"))) {
- mode_t m;
+ m = pa_in_system_mode() ? 0755U : 0700U;
- m = pa_in_system_mode() ? 0755U : 0700U;
+ if ((d = getenv("PULSE_RUNTIME_PATH"))) {
if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1) < 0) {
pa_log_error("Failed to create secure directory: %s", pa_cstrerror(errno));
@@ -1394,6 +1394,11 @@ char *pa_get_runtime_dir(void) {
if (!(d = get_pulse_home()))
goto fail;
+ if (pa_make_secure_dir(d, m, (uid_t) -1, (gid_t) -1) < 0) {
+ pa_log_error("Failed to create secure directory: %s", pa_cstrerror(errno));
+ goto fail;
+ }
+
if (!(mid = pa_machine_id())) {
pa_xfree(d);
goto fail;

View File

@ -1,61 +0,0 @@
diff --git a/src/modules/module-console-kit.c b/src/modules/module-console-kit.c
index 3adee99..3b7b57e 100644
--- a/src/modules/module-console-kit.c
+++ b/src/modules/module-console-kit.c
@@ -71,7 +71,7 @@ struct userdata {
static void add_session(struct userdata *u, const char *id) {
DBusError error;
DBusMessage *m = NULL, *reply = NULL;
- int32_t uid;
+ uid_t uid;
struct session *session;
char *t;
@@ -92,10 +92,12 @@ static void add_session(struct userdata *u, const char *id) {
goto fail;
}
- /* FIXME: Why is this in int32? and not an uint32? */
- if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INT32, &uid, DBUS_TYPE_INVALID)) {
- pa_log("Failed to parse GetUnixUser() result: %s: %s", error.name, error.message);
- goto fail;
+ /* CK 0.3 this changed from int32 to uint32 */
+ if (!dbus_message_get_args(reply, &error, DBUS_TYPE_UINT32, &uid, DBUS_TYPE_INVALID)) {
+ if (!dbus_message_get_args(reply, &error, DBUS_TYPE_INT32, &uid, DBUS_TYPE_INVALID)) {
+ pa_log("Failed to parse GetUnixUser() result: %s: %s", error.name, error.message);
+ goto fail;
+ }
}
/* We only care about our own sessions */
@@ -163,18 +165,24 @@ static DBusHandlerResult filter_cb(DBusConnection *bus, DBusMessage *message, vo
if (dbus_message_is_signal(message, "org.freedesktop.ConsoleKit.Seat", "SessionAdded")) {
- if (!dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID) || dbus_error_is_set(&error)) {
- pa_log_error("Failed to parse SessionAdded message: %s: %s", error.name, error.message);
- goto finish;
+ /* CK API changed to match spec in 0.3 */
+ if (!dbus_message_get_args(message, &error, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) {
+ if (!dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID)) {
+ pa_log_error("Failed to parse SessionAdded message: %s: %s", error.name, error.message);
+ goto finish;
+ }
}
add_session(u, path);
} else if (dbus_message_is_signal(message, "org.freedesktop.ConsoleKit.Seat", "SessionRemoved")) {
- if (!dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID) || dbus_error_is_set(&error)) {
- pa_log_error("Failed to parse SessionRemoved message: %s: %s", error.name, error.message);
- goto finish;
+ /* CK API changed to match spec in 0.3 */
+ if (!dbus_message_get_args(message, &error, DBUS_TYPE_OBJECT_PATH, &path, DBUS_TYPE_INVALID)) {
+ if (!dbus_message_get_args(message, &error, DBUS_TYPE_STRING, &path, DBUS_TYPE_INVALID)) {
+ pa_log_error("Failed to parse SessionRemoved message: %s: %s", error.name, error.message);
+ goto finish;
+ }
}
remove_session(u, path);

View File

@ -1,157 +0,0 @@
From: Lennart Poettering <lennart@poettering.net>
Date: Thu, 8 Jan 2009 00:03:42 +0000 (+0100)
Subject: Prefer mixer controls with volumes over switches
X-Git-Url: http://git.0pointer.de/?p=pulseaudio.git;a=commitdiff_plain;h=c2450501af82d1c9d1994e4f4ce80d506d3c90ae
Prefer mixer controls with volumes over switches
When we look for a mixer control prefer controls that have both volume
and a mute switch over those that have only a volume switch over those
that only have a mute switch.
Originally pointed out by Adel Gadllah.
---
diff --git a/src/modules/alsa-util.c b/src/modules/alsa-util.c
index 75b84c4..ff3af19 100644
--- a/src/modules/alsa-util.c
+++ b/src/modules/alsa-util.c
@@ -760,8 +760,32 @@ int pa_alsa_prepare_mixer(snd_mixer_t *mixer, const char *dev) {
return 0;
}
-snd_mixer_elem_t *pa_alsa_find_elem(snd_mixer_t *mixer, const char *name, const char *fallback) {
- snd_mixer_elem_t *elem;
+static pa_bool_t elem_has_volume(snd_mixer_elem_t *elem, pa_bool_t playback) {
+ pa_assert(elem);
+
+ if (playback && snd_mixer_selem_has_playback_volume(elem))
+ return TRUE;
+
+ if (!playback && snd_mixer_selem_has_capture_volume(elem))
+ return TRUE;
+
+ return FALSE;
+}
+
+static pa_bool_t elem_has_switch(snd_mixer_elem_t *elem, pa_bool_t playback) {
+ pa_assert(elem);
+
+ if (playback && snd_mixer_selem_has_playback_switch(elem))
+ return TRUE;
+
+ if (!playback && snd_mixer_selem_has_capture_switch(elem))
+ return TRUE;
+
+ return FALSE;
+}
+
+snd_mixer_elem_t *pa_alsa_find_elem(snd_mixer_t *mixer, const char *name, const char *fallback, pa_bool_t playback) {
+ snd_mixer_elem_t *elem = NULL, *fallback_elem = NULL;
snd_mixer_selem_id_t *sid = NULL;
snd_mixer_selem_id_alloca(&sid);
@@ -771,17 +795,57 @@ snd_mixer_elem_t *pa_alsa_find_elem(snd_mixer_t *mixer, const char *name, const
snd_mixer_selem_id_set_name(sid, name);
- if (!(elem = snd_mixer_find_selem(mixer, sid))) {
- pa_log_info("Cannot find mixer control \"%s\".", snd_mixer_selem_id_get_name(sid));
+ if ((elem = snd_mixer_find_selem(mixer, sid))) {
+
+ if (elem_has_volume(elem, playback) &&
+ elem_has_switch(elem, playback))
+ goto success;
+
+ if (!elem_has_volume(elem, playback) &&
+ !elem_has_switch(elem, playback))
+ elem = NULL;
+ }
+
+ pa_log_info("Cannot find mixer control \"%s\" or mixer control is no combination of switch/volume.", snd_mixer_selem_id_get_name(sid));
+
+ if (fallback) {
+ snd_mixer_selem_id_set_name(sid, fallback);
+
+ if ((fallback_elem = snd_mixer_find_selem(mixer, sid))) {
+
+ if (elem_has_volume(fallback_elem, playback) &&
+ elem_has_switch(fallback_elem, playback)) {
+ elem = fallback_elem;
+ goto success;
+ }
+
+ if (!elem_has_volume(fallback_elem, playback) &&
+ !elem_has_switch(fallback_elem, playback))
+ fallback_elem = NULL;
+ }
+
+ pa_log_warn("Cannot find fallback mixer control \"%s\" or mixer control is no combination of switch/volume.", snd_mixer_selem_id_get_name(sid));
+ }
+
+ if (elem && fallback_elem) {
- if (fallback) {
- snd_mixer_selem_id_set_name(sid, fallback);
+ /* Hmm, so we have both elements, but neither has both mute
+ * and volume. Let's prefer the one with the volume */
- if (!(elem = snd_mixer_find_selem(mixer, sid)))
- pa_log_warn("Cannot find fallback mixer control \"%s\".", snd_mixer_selem_id_get_name(sid));
+ if (elem_has_volume(elem, playback))
+ goto success;
+
+ if (elem_has_volume(fallback_elem, playback)) {
+ elem = fallback_elem;
+ goto success;
}
}
+ if (!elem && fallback_elem)
+ elem = fallback_elem;
+
+success:
+
if (elem)
pa_log_info("Using mixer control \"%s\".", snd_mixer_selem_id_get_name(sid));
diff --git a/src/modules/alsa-util.h b/src/modules/alsa-util.h
index aaa01c7..95bb983 100644
--- a/src/modules/alsa-util.h
+++ b/src/modules/alsa-util.h
@@ -52,7 +52,7 @@ int pa_alsa_set_hw_params(
int pa_alsa_set_sw_params(snd_pcm_t *pcm, snd_pcm_uframes_t avail_min);
int pa_alsa_prepare_mixer(snd_mixer_t *mixer, const char *dev);
-snd_mixer_elem_t *pa_alsa_find_elem(snd_mixer_t *mixer, const char *name, const char *fallback);
+snd_mixer_elem_t *pa_alsa_find_elem(snd_mixer_t *mixer, const char *name, const char *fallback, pa_bool_t playback);
snd_pcm_t *pa_alsa_open_by_device_id(
const char *dev_id,
diff --git a/src/modules/module-alsa-sink.c b/src/modules/module-alsa-sink.c
index 6dea172..95a8c97 100644
--- a/src/modules/module-alsa-sink.c
+++ b/src/modules/module-alsa-sink.c
@@ -1409,7 +1409,7 @@ int pa__init(pa_module*m) {
}
if (found)
- if (!(u->mixer_elem = pa_alsa_find_elem(u->mixer_handle, "Master", "PCM")))
+ if (!(u->mixer_elem = pa_alsa_find_elem(u->mixer_handle, "Master", "PCM", TRUE)))
found = FALSE;
if (!found) {
diff --git a/src/modules/module-alsa-source.c b/src/modules/module-alsa-source.c
index f796ef1..b6c6ed1 100644
--- a/src/modules/module-alsa-source.c
+++ b/src/modules/module-alsa-source.c
@@ -1236,7 +1236,7 @@ int pa__init(pa_module*m) {
}
if (found)
- if (!(u->mixer_elem = pa_alsa_find_elem(u->mixer_handle, "Capture", "Mic")))
+ if (!(u->mixer_elem = pa_alsa_find_elem(u->mixer_handle, "Capture", "Mic", FALSE)))
found = FALSE;
if (!found) {

View File

@ -1,15 +0,0 @@
Abort instead of cleanly exiting, so we can obtain a core dump and find out
what was wrong. (#438594)
diff -urp pulseaudio-0.9.8.orig/src/daemon/cpulimit.c pulseaudio-0.9.8/src/daemon/cpulimit.c
--- pulseaudio-0.9.8.orig/src/daemon/cpulimit.c 2007-11-01 02:42:37.000000000 +0100
+++ pulseaudio-0.9.8/src/daemon/cpulimit.c 2008-03-27 19:26:27.000000000 +0100
@@ -151,7 +151,7 @@ static void signal_handler(int sig) {
} else if (phase == PHASE_SOFT) {
write_err("Hard CPU time limit exhausted, terminating forcibly.\n");
- _exit(1); /* Forced exit */
+ abort(); /* Forced exit */
}
errno = saved_errno;

View File

@ -1,21 +0,0 @@
Index: src/pulsecore/core-util.c
===================================================================
--- src/pulsecore/core-util.c (revision 2077)
+++ src/pulsecore/core-util.c (revision 2078)
@@ -1129,8 +1129,15 @@
if ((e = getenv("PULSE_CONFIG_PATH")))
fn = lfn = pa_sprintf_malloc("%s/%s", e, local);
- else if (pa_get_home_dir(h, sizeof(h)))
+ else if (pa_get_home_dir(h, sizeof(h))) {
+ char *d;
+
+ d = pa_sprintf_malloc("%s/.pulse", h);
+ mkdir(d, 0755);
+ pa_xfree(d);
+
fn = lfn = pa_sprintf_malloc("%s/.pulse/%s", h, local);
+ }
if (lfn) {
FILE *f;

View File

@ -1,21 +0,0 @@
diff -up pulseaudio-0.9.8/src/daemon/main.c.jx pulseaudio-0.9.8/src/daemon/main.c
--- pulseaudio-0.9.8/src/daemon/main.c.jx 2008-03-12 16:06:03.000000000 -0400
+++ pulseaudio-0.9.8/src/daemon/main.c 2008-03-12 16:17:59.000000000 -0400
@@ -416,7 +416,7 @@ int main(int argc, char *argv[]) {
#ifdef HAVE_POLKIT
if (conf->high_priority) {
- if (pa_polkit_check("org.pulseaudio.acquire-high-priority") > 0) {
+ if (0 && pa_polkit_check("org.pulseaudio.acquire-high-priority") > 0) {
pa_log_info("PolicyKit grants us acquire-high-priority privilige.");
allow_high_priority = TRUE;
} else
@@ -424,7 +424,7 @@ int main(int argc, char *argv[]) {
}
if (conf->realtime_scheduling) {
- if (pa_polkit_check("org.pulseaudio.acquire-real-time") > 0) {
+ if (0 && pa_polkit_check("org.pulseaudio.acquire-real-time") > 0) {
pa_log_info("PolicyKit grants us acquire-real-time privilige.");
allow_realtime = TRUE;
} else

View File

@ -1,112 +0,0 @@
Fail when dropping root privileges is not successful.
https://bugzilla.novell.com/show_bug.cgi?id=347822
https://bugzilla.redhat.com/show_bug.cgi?id=425481
Lubomir Kundrak <lkundrak@redhat.com>
Index: src/daemon/main.c
===================================================================
--- src/daemon/main.c (revision 2098)
+++ src/daemon/main.c (working copy)
@@ -372,7 +372,8 @@
pa_limit_caps();
/* Drop priviliges, but keep CAP_SYS_NICE */
- pa_drop_root();
+ if (pa_drop_root() < 0)
+ goto finish;
/* After dropping root, the effective set is reset, hence,
* let's raise it again */
@@ -443,7 +444,8 @@
* let's give it up early */
pa_drop_caps();
- pa_drop_root();
+ if (pa_drop_root() < 0)
+ goto finish;
suid_root = real_root = FALSE;
if (conf->high_priority || conf->realtime_scheduling)
@@ -497,7 +499,8 @@
if (drop) {
pa_drop_caps();
- pa_drop_root();
+ if (pa_drop_root() < 0)
+ goto finish;
suid_root = real_root = FALSE;
}
}
Index: src/daemon/caps.c
===================================================================
--- src/daemon/caps.c (revision 2098)
+++ src/daemon/caps.c (working copy)
@@ -54,27 +54,36 @@
#ifdef HAVE_GETUID
/* Drop root rights when called SUID root */
-void pa_drop_root(void) {
+int pa_drop_root(void) {
uid_t uid = getuid();
+ int error = 0;
if (uid == 0 || geteuid() != 0)
- return;
+ return 0;
pa_log_info("Dropping root priviliges.");
#if defined(HAVE_SETRESUID)
- setresuid(uid, uid, uid);
+ error += setresuid(uid, uid, uid);
#elif defined(HAVE_SETREUID)
- setreuid(uid, uid);
+ error += setreuid(uid, uid);
#else
- setuid(uid);
- seteuid(uid);
+ error += setuid(uid);
+ error += seteuid(uid);
#endif
+
+ if (error != 0) {
+ pa_log_error("Could not drop root priviliges.");
+ return -1;
+ }
+
+ return 0;
}
#else
-void pa_drop_root(void) {
+int pa_drop_root(void) {
+ return 0;
}
#endif
@@ -142,8 +151,7 @@
}
int pa_drop_caps(void) {
- pa_drop_root();
- return 0;
+ return pa_drop_root();
}
#endif
Index: src/daemon/caps.h
===================================================================
--- src/daemon/caps.h (revision 2098)
+++ src/daemon/caps.h (working copy)
@@ -24,7 +24,7 @@
USA.
***/
-void pa_drop_root(void);
+int pa_drop_root(void);
int pa_limit_caps(void);
int pa_drop_caps(void);

View File

@ -1,11 +0,0 @@
Index: /trunk/src/pulse/stream.c
===================================================================
--- /trunk/src/pulse/stream.c (revision 2067)
+++ /trunk/src/pulse/stream.c (revision 2074)
@@ -587,5 +587,5 @@
}
- if (s->context->version >= 12) {
+ if (s->context->version >= 12 && s->direction != PA_STREAM_UPLOAD) {
pa_sample_spec ss;
pa_channel_map cm;

View File

@ -1,12 +0,0 @@
Index: src/daemon/ltdl-bind-now.c
===================================================================
--- src/daemon/ltdl-bind-now.c (revision 2098)
+++ src/daemon/ltdl-bind-now.c (working copy)
@@ -153,7 +153,6 @@
}
void pa_ltdl_done(void) {
- pa_assert_se(lt_dlexit() == 0);
pa_mutex_free(libtool_mutex);
libtool_mutex = NULL;
}

View File

@ -1,102 +0,0 @@
Attempt to resolve the multilib conflicts by getting all the config files
look equally for all plattforms. This includes getting rid go pathnames
with libdir; let's make ps search for files with relative paths there.
https://bugzilla.redhat.com/show_bug.cgi?id=228383
Lubomir Kundrak <lkundrak@redhat.com>
diff -urp pulseaudio-0.9.8.orig/src/daemon/daemon.conf.in pulseaudio-0.9.8/src/daemon/daemon.conf.in
--- pulseaudio-0.9.8.orig/src/daemon/daemon.conf.in 2008-02-29 12:44:07.000000000 +0100
+++ pulseaudio-0.9.8/src/daemon/daemon.conf.in 2008-02-29 12:43:27.000000000 +0100
@@ -38,7 +38,7 @@
; module-idle-time = 20
; scache-idle-time = 20
-; dl-search-path = @PA_DLSEARCHPATH@
+; dl-search-path = (depends on architecture)
; default-script-file = @PA_DEFAULT_CONFIG_FILE@
diff -urp pulseaudio-0.9.8.orig/src/daemon/default.pa.in pulseaudio-0.9.8/src/daemon/default.pa.in
--- pulseaudio-0.9.8.orig/src/daemon/default.pa.in 2008-02-29 12:44:07.000000000 +0100
+++ pulseaudio-0.9.8/src/daemon/default.pa.in 2008-02-29 12:43:27.000000000 +0100
@@ -37,7 +37,7 @@ load-sample-lazy pulse-hotplug /usr/shar
#load-module module-pipe-sink
### Automatically load driver modules depending on the hardware available
-.ifexists @PA_DLSEARCHPATH@/module-hal-detect@PA_SOEXT@
+.ifexists module-hal-detect@PA_SOEXT@
load-module module-hal-detect
.else
### Alternatively use the static hardware detection module (for systems that
@@ -79,7 +79,7 @@ load-module module-suspend-on-idle
#load-module module-x11-bell sample=x11-bell
### Publish connection data in the X11 root window
-.ifexists @PA_DLSEARCHPATH@/module-x11-publish@PA_SOEXT@
+.ifexists module-x11-publish@PA_SOEXT@
load-module module-x11-publish
.endif
@@ -91,7 +91,7 @@ load-module module-x11-publish
### Load additional modules from GConf settings. This can be configured with the paprefs tool.
### Please keep in mind that the modules configured by paprefs might conflict with manually
### loaded modules.
-.ifexists @PA_DLSEARCHPATH@/module-gconf@PA_SOEXT@
+.ifexists module-gconf@PA_SOEXT@
load-module module-gconf
.endif
diff -urp pulseaudio-0.9.8.orig/src/pulsecore/cli-command.c pulseaudio-0.9.8/src/pulsecore/cli-command.c
--- pulseaudio-0.9.8.orig/src/pulsecore/cli-command.c 2008-02-29 12:44:07.000000000 +0100
+++ pulseaudio-0.9.8/src/pulsecore/cli-command.c 2008-02-29 12:44:48.000000000 +0100
@@ -31,6 +31,7 @@
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>
+#include <ltdl.h>
#include <pulse/xmalloc.h>
@@ -1314,9 +1315,39 @@ int pa_cli_command_execute_line_stateful
return -1;
} else {
const char *filename = cs+l+strspn(cs+l, whitespace);
+ char *saveptr = NULL;
+ char *paths;
+ char *path;
+
+ /* Search DL_SEARCH_PATH unless the filename is absolute */
+ if (filename[0] == '/') {
+ paths = strdup ("/");
+ } else {
+ paths = strdup (lt_dlgetsearchpath ());
+ }
- *ifstate = access(filename, F_OK) == 0 ? IFSTATE_TRUE : IFSTATE_FALSE;
- pa_log_debug("Checking for existance of '%s': %s", filename, *ifstate == IFSTATE_TRUE ? "success" : "failure");
+ if (paths == NULL)
+ return -1;
+
+ for (path = strtok_r (paths, ":", &saveptr); path; path = strtok_r (NULL, ":", &saveptr)) {
+ char *pathname = malloc (strlen(path) + strlen(filename) + 2);
+ if (pathname == NULL)
+ return -1;
+ pathname[0] = '\0';
+
+ strcat(pathname, path);
+ strcat(pathname, "/"); /* XXX: Is this OK for Windows? */
+ strcat(pathname, filename);
+
+ *ifstate = access(pathname, F_OK) == 0 ? IFSTATE_TRUE : IFSTATE_FALSE;
+ pa_log_debug("Checking for existance of '%s': %s", pathname, *ifstate == IFSTATE_TRUE ? "success" : "failure");
+
+ pa_xfree (pathname);
+
+ if (*ifstate == IFSTATE_TRUE)
+ break;
+ }
+ pa_xfree (paths);
}
} else {
pa_strbuf_printf(buf, "Invalid meta command: %s\n", cs);

View File

@ -1,25 +0,0 @@
From d91b6d26e698ad63761faf722850ad0cec52d4e4 Mon Sep 17 00:00:00 2001
From: CJ van den Berg <cj@vdbonline.com>
Date: Wed, 28 Nov 2007 22:26:14 +0100
Subject: [PATCH] Force module-tunnel to use protocol version 11
PulseAudio 0.9.8 uses protocol version 12, but module-tunnel does not
support the new opcodes in version 12 yet. This should prevent
module-tunnel reporting "protocol error" and unloading.
---
src/modules/module-tunnel.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/modules/module-tunnel.c b/src/modules/module-tunnel.c
index 43a10ce..5ff0416 100644
--- a/src/modules/module-tunnel.c
+++ b/src/modules/module-tunnel.c
@@ -1145,7 +1145,7 @@ static void on_connection(pa_socket_client *sc, pa_iochannel *io, void *userdata
t = pa_tagstruct_new(NULL, 0);
pa_tagstruct_putu32(t, PA_COMMAND_AUTH);
pa_tagstruct_putu32(t, tag = u->ctag++);
- pa_tagstruct_putu32(t, PA_PROTOCOL_VERSION);
+ pa_tagstruct_putu32(t, 11);
pa_tagstruct_put_arbitrary(t, u->auth_cookie, sizeof(u->auth_cookie));
#ifdef HAVE_CREDS

View File

@ -1,12 +0,0 @@
diff -up pulseaudio-0.9.11/src/modules/module-default-device-restore.c.wrong-assert pulseaudio-0.9.11/src/modules/module-default-device-restore.c
--- pulseaudio-0.9.11/src/modules/module-default-device-restore.c.wrong-assert 2008-05-17 22:14:43.000000000 -0400
+++ pulseaudio-0.9.11/src/modules/module-default-device-restore.c 2008-05-17 22:14:50.000000000 -0400
@@ -158,7 +158,7 @@ static void subscribe_cb(pa_core *c, pa_
int pa__init(pa_module *m) {
struct userdata *u;
- pa_assert(u);
+ pa_assert(m);
u = pa_xnew0(struct userdata, 1);
u->core = m->core;