[media-sound/pulseaudio] add patch from GIT that could mitigate alsa-PA conflicts, revision bump
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
AUX pulseaudio-0.9.15-alsa-monitor-device-reservation.patch 5864 RMD160 ea1c6dfbb932447bbb652d5315e8f6242d4944cb SHA1 6d536161af87c3e7752ce3857e509c1d736999fe SHA256 53d727db62d828df3c4175e2b4e4e005591dc6d833a7fa162532989039af86b5
|
||||
AUX pulseaudio.conf.d 275 RMD160 6317cb5be41a768428056c0057d8f5b1f189e804 SHA1 22ed7f1de0f2a18a608c5e9a91635ee66addac4d SHA256 c03661e8cc902d27ff6b52f291207f2b008957571b942abdd92a873a52aae0dd
|
||||
AUX pulseaudio.init.d-4 1849 RMD160 e91b9cc6da3b89827ad2c7dbe6b040669e94e7bd SHA1 e35530e8bf70339945eb7ebdfbe1cefcee4c62de SHA256 fd20883258e97d70fe957b01e70a9f73c58e843595dc3e53bffa658652659f99
|
||||
DIST pulseaudio-0.9.15.tar.gz 1704374 RMD160 7cab0d9ab44180b6440ae7f151a6cbb91928b321 SHA1 56fb71e4e88c901d9941d85bfe142612c30e5c8e SHA256 1e8ad5b7c5cf3485bd0738c296274ff2c99d26d12a25a225dc250eddea25b9f1
|
||||
EBUILD pulseaudio-0.9.15-r1.ebuild 5969 RMD160 156eff1a7cc4081bc5b8a2b911d490b68aae93d9 SHA1 9dcff18bba24835d21e060a1c921afe0527f09a0 SHA256 09134e1ec515c4abc6be43126bc301dd2edb43b7e45550eed0baae89309dbdb6
|
||||
EBUILD pulseaudio-0.9.15-r2.ebuild 6035 RMD160 fcbf8e7bb96a160c1f5b4f5cd07349013364a8f3 SHA1 4c1e87d00f77c210f8cd6e4a8b8db539aadc3e85 SHA256 9423efdec8a18fdda8d1b9703c7f16723ff0dabe4453afff71285708087b378a
|
||||
MISC ChangeLog 22760 RMD160 934b5a53b69d8925ce9f06b96fbe2951efaea4ef SHA1 465a733137c5f4bb03105e032c884d6589dc91a9 SHA256 73848795b7a39432fa90bdd316609cd8c7ba03cff21e1a8a454870fca04382c8
|
||||
MISC Reasons 233 RMD160 5686b851b10c987676b5e3bf960ef6844469462b SHA1 b2993414718eed1ec438d1e092e6cf430ff82ce2 SHA256 abdaf7e1dbdb29216373e1178f699ec5b3bcec75b2173a55fbb87a4c4d1e76a5
|
||||
|
||||
@@ -0,0 +1,207 @@
|
||||
From 561c0af8518dd8a2bac07284d306b0970c304f9f Mon Sep 17 00:00:00 2001
|
||||
From: Lennart Poettering <lennart@poettering.net>
|
||||
Date: Fri, 5 Jun 2009 19:05:42 +0200
|
||||
Subject: [PATCH] alsa: monitor device reservation status and resume automatically when device becomes unused
|
||||
|
||||
---
|
||||
src/modules/alsa/alsa-sink.c | 65 ++++++++++++++++++++++++++++++++++++++--
|
||||
src/modules/alsa/alsa-source.c | 65 ++++++++++++++++++++++++++++++++++++++--
|
||||
2 files changed, 124 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/modules/alsa/alsa-sink.c b/src/modules/alsa/alsa-sink.c
|
||||
index b1adc52..98ebac3 100644
|
||||
--- a/src/modules/alsa/alsa-sink.c
|
||||
+++ b/src/modules/alsa/alsa-sink.c
|
||||
@@ -116,6 +116,8 @@ struct userdata {
|
||||
|
||||
pa_reserve_wrapper *reserve;
|
||||
pa_hook_slot *reserve_slot;
|
||||
+ pa_reserve_monitor_wrapper *monitor;
|
||||
+ pa_hook_slot *monitor_slot;
|
||||
};
|
||||
|
||||
static void userdata_free(struct userdata *u);
|
||||
@@ -185,6 +187,57 @@ static int reserve_init(struct userdata *u, const char *dname) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static pa_hook_result_t monitor_cb(pa_reserve_monitor_wrapper *w, void* busy, struct userdata *u) {
|
||||
+ pa_bool_t b;
|
||||
+
|
||||
+ pa_assert(w);
|
||||
+ pa_assert(u);
|
||||
+
|
||||
+ b = PA_PTR_TO_UINT(busy) && !u->reserve;
|
||||
+
|
||||
+ pa_sink_suspend(u->sink, b, PA_SUSPEND_APPLICATION);
|
||||
+ return PA_HOOK_OK;
|
||||
+}
|
||||
+
|
||||
+static void monitor_done(struct userdata *u) {
|
||||
+ pa_assert(u);
|
||||
+
|
||||
+ if (u->monitor_slot) {
|
||||
+ pa_hook_slot_free(u->monitor_slot);
|
||||
+ u->monitor_slot = NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (u->monitor) {
|
||||
+ pa_reserve_monitor_wrapper_unref(u->monitor);
|
||||
+ u->monitor = NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int reserve_monitor_init(struct userdata *u, const char *dname) {
|
||||
+ char *rname;
|
||||
+
|
||||
+ pa_assert(u);
|
||||
+ pa_assert(dname);
|
||||
+
|
||||
+ if (pa_in_system_mode())
|
||||
+ return 0;
|
||||
+
|
||||
+ /* We are resuming, try to lock the device */
|
||||
+ if (!(rname = pa_alsa_get_reserve_name(dname)))
|
||||
+ return 0;
|
||||
+
|
||||
+ u->monitor = pa_reserve_monitor_wrapper_get(u->core, rname);
|
||||
+ pa_xfree(rname);
|
||||
+
|
||||
+ if (!(u->monitor))
|
||||
+ return -1;
|
||||
+
|
||||
+ pa_assert(!u->monitor_slot);
|
||||
+ u->monitor_slot = pa_hook_connect(pa_reserve_monitor_wrapper_hook(u->monitor), PA_HOOK_NORMAL, (pa_hook_cb_t) monitor_cb, u);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void fix_min_sleep_wakeup(struct userdata *u) {
|
||||
size_t max_use, max_use_2;
|
||||
|
||||
@@ -1580,9 +1633,14 @@ pa_sink *pa_alsa_sink_new(pa_module *m, pa_modargs *ma, const char*driver, pa_ca
|
||||
pa_rtclock_usec(),
|
||||
TRUE);
|
||||
|
||||
- if (reserve_init(u, pa_modargs_get_value(
|
||||
- ma, "device_id",
|
||||
- pa_modargs_get_value(ma, "device", DEFAULT_DEVICE))) < 0)
|
||||
+ dev_id = pa_modargs_get_value(
|
||||
+ ma, "device_id",
|
||||
+ pa_modargs_get_value(ma, "device", DEFAULT_DEVICE));
|
||||
+
|
||||
+ if (reserve_init(u, dev_id) < 0)
|
||||
+ goto fail;
|
||||
+
|
||||
+ if (reserve_monitor_init(u, dev_id) < 0)
|
||||
goto fail;
|
||||
|
||||
b = use_mmap;
|
||||
@@ -1828,6 +1886,7 @@ static void userdata_free(struct userdata *u) {
|
||||
pa_smoother_free(u->smoother);
|
||||
|
||||
reserve_done(u);
|
||||
+ monitor_done(u);
|
||||
|
||||
pa_xfree(u->device_name);
|
||||
pa_xfree(u);
|
||||
diff --git a/src/modules/alsa/alsa-source.c b/src/modules/alsa/alsa-source.c
|
||||
index 68f697d..277b110 100644
|
||||
--- a/src/modules/alsa/alsa-source.c
|
||||
+++ b/src/modules/alsa/alsa-source.c
|
||||
@@ -114,6 +114,8 @@ struct userdata {
|
||||
|
||||
pa_reserve_wrapper *reserve;
|
||||
pa_hook_slot *reserve_slot;
|
||||
+ pa_reserve_monitor_wrapper *monitor;
|
||||
+ pa_hook_slot *monitor_slot;
|
||||
};
|
||||
|
||||
static void userdata_free(struct userdata *u);
|
||||
@@ -183,6 +185,57 @@ static int reserve_init(struct userdata *u, const char *dname) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static pa_hook_result_t monitor_cb(pa_reserve_monitor_wrapper *w, void* busy, struct userdata *u) {
|
||||
+ pa_bool_t b;
|
||||
+
|
||||
+ pa_assert(w);
|
||||
+ pa_assert(u);
|
||||
+
|
||||
+ b = PA_PTR_TO_UINT(busy) && !u->reserve;
|
||||
+
|
||||
+ pa_source_suspend(u->source, b, PA_SUSPEND_APPLICATION);
|
||||
+ return PA_HOOK_OK;
|
||||
+}
|
||||
+
|
||||
+static void monitor_done(struct userdata *u) {
|
||||
+ pa_assert(u);
|
||||
+
|
||||
+ if (u->monitor_slot) {
|
||||
+ pa_hook_slot_free(u->monitor_slot);
|
||||
+ u->monitor_slot = NULL;
|
||||
+ }
|
||||
+
|
||||
+ if (u->monitor) {
|
||||
+ pa_reserve_monitor_wrapper_unref(u->monitor);
|
||||
+ u->monitor = NULL;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static int reserve_monitor_init(struct userdata *u, const char *dname) {
|
||||
+ char *rname;
|
||||
+
|
||||
+ pa_assert(u);
|
||||
+ pa_assert(dname);
|
||||
+
|
||||
+ if (pa_in_system_mode())
|
||||
+ return 0;
|
||||
+
|
||||
+ /* We are resuming, try to lock the device */
|
||||
+ if (!(rname = pa_alsa_get_reserve_name(dname)))
|
||||
+ return 0;
|
||||
+
|
||||
+ u->monitor = pa_reserve_monitor_wrapper_get(u->core, rname);
|
||||
+ pa_xfree(rname);
|
||||
+
|
||||
+ if (!(u->monitor))
|
||||
+ return -1;
|
||||
+
|
||||
+ pa_assert(!u->monitor_slot);
|
||||
+ u->monitor_slot = pa_hook_connect(pa_reserve_monitor_wrapper_hook(u->monitor), PA_HOOK_NORMAL, (pa_hook_cb_t) monitor_cb, u);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void fix_min_sleep_wakeup(struct userdata *u) {
|
||||
size_t max_use, max_use_2;
|
||||
pa_assert(u);
|
||||
@@ -1438,9 +1491,14 @@ pa_source *pa_alsa_source_new(pa_module *m, pa_modargs *ma, const char*driver, p
|
||||
pa_rtclock_usec(),
|
||||
FALSE);
|
||||
|
||||
- if (reserve_init(u, pa_modargs_get_value(
|
||||
- ma, "device_id",
|
||||
- pa_modargs_get_value(ma, "device", DEFAULT_DEVICE))) < 0)
|
||||
+ dev_id = pa_modargs_get_value(
|
||||
+ ma, "device_id",
|
||||
+ pa_modargs_get_value(ma, "device", DEFAULT_DEVICE));
|
||||
+
|
||||
+ if (reserve_init(u, dev_id) < 0)
|
||||
+ goto fail;
|
||||
+
|
||||
+ if (reserve_monitor_init(u, dev_id) < 0)
|
||||
goto fail;
|
||||
|
||||
b = use_mmap;
|
||||
@@ -1676,6 +1734,7 @@ static void userdata_free(struct userdata *u) {
|
||||
pa_smoother_free(u->smoother);
|
||||
|
||||
reserve_done(u);
|
||||
+ monitor_done(u);
|
||||
|
||||
pa_xfree(u->device_name);
|
||||
pa_xfree(u);
|
||||
--
|
||||
1.6.2.4
|
||||
|
||||
+2
@@ -78,6 +78,8 @@ src_unpack() {
|
||||
unpack ${A}
|
||||
cd "${S}"
|
||||
|
||||
epatch "${FILESDIR}"/${P}-alsa-monitor-device-reservation.patch
|
||||
|
||||
elibtoolize
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user