diff options
author | Arun Raghavan <arun@arunraghavan.net> | 2016-05-09 15:09:57 +0530 |
---|---|---|
committer | Arun Raghavan <arun@arunraghavan.net> | 2016-05-11 09:11:26 +0530 |
commit | 408b9f8cc048fac657553aec615d6946563c3cef (patch) | |
tree | df06ab7acfc84a8feaee8f86470c0a3b452a28c4 /src/pulsecore | |
parent | fb52a6a6e6c94c8d7cb43b924f63e67d1c160d60 (diff) |
alsa: Reread and upate jack status when a card is unsuspended
This is needed so we don't keep stale jack availability information
while the card is suspended.
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=93259
Signed-off-by: Arun Raghavan <arun@arunraghavan.net>
Diffstat (limited to 'src/pulsecore')
-rw-r--r-- | src/pulsecore/card.c | 13 | ||||
-rw-r--r-- | src/pulsecore/core.h | 1 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/pulsecore/card.c b/src/pulsecore/card.c index 72ecd4e80..410746bf6 100644 --- a/src/pulsecore/card.c +++ b/src/pulsecore/card.c @@ -358,16 +358,25 @@ void pa_card_set_preferred_port(pa_card *c, pa_direction_t direction, pa_device_ int pa_card_suspend(pa_card *c, bool suspend, pa_suspend_cause_t cause) { pa_sink *sink; pa_source *source; + pa_suspend_cause_t suspend_cause; uint32_t idx; int ret = 0; pa_assert(c); pa_assert(cause != 0); + suspend_cause = c->suspend_cause; + if (suspend) - c->suspend_cause |= cause; + suspend_cause |= cause; else - c->suspend_cause &= ~cause; + suspend_cause &= ~cause; + + if (c->suspend_cause != suspend_cause) { + pa_log_debug("Card suspend causes/state changed"); + c->suspend_cause = suspend_cause; + pa_hook_fire(&c->core->hooks[PA_CORE_HOOK_CARD_SUSPEND_CHANGED], c); + } PA_IDXSET_FOREACH(sink, c->sinks, idx) { int r; diff --git a/src/pulsecore/core.h b/src/pulsecore/core.h index 69ab4d0ca..00d7f2f2d 100644 --- a/src/pulsecore/core.h +++ b/src/pulsecore/core.h @@ -124,6 +124,7 @@ typedef enum pa_core_hook { PA_CORE_HOOK_CARD_PROFILE_CHANGED, PA_CORE_HOOK_CARD_PROFILE_ADDED, PA_CORE_HOOK_CARD_PROFILE_AVAILABLE_CHANGED, + PA_CORE_HOOK_CARD_SUSPEND_CHANGED, PA_CORE_HOOK_PORT_AVAILABLE_CHANGED, PA_CORE_HOOK_PORT_LATENCY_OFFSET_CHANGED, PA_CORE_HOOK_DEFAULT_SINK_CHANGED, |