[pulseaudio-discuss] [PATCH 4/6] alsa-card: Prioritize plugged jacks moving the availability to no

Sjoerd Simons sjoerd at luon.net
Fri Oct 31 14:01:27 PDT 2014


When using a jack being plugged in to disable an output (e.g. make
line-out become unavailable if headset is plugged in) it should override
the available of any other state a jack on that output might have.
---
 src/modules/alsa/module-alsa-card.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/modules/alsa/module-alsa-card.c b/src/modules/alsa/module-alsa-card.c
index 0026e0f..563c1ea 100644
--- a/src/modules/alsa/module-alsa-card.c
+++ b/src/modules/alsa/module-alsa-card.c
@@ -333,6 +333,11 @@ static void report_port_state(pa_device_port *p, struct userdata *u) {
         if (p != port)
             continue;
 
+        if (jack->plugged_in && jack->state_plugged == PA_AVAILABLE_NO) {
+          pa = PA_AVAILABLE_NO;
+          break;
+        }
+
         cpa = jack->plugged_in ? jack->state_plugged : jack->state_unplugged;
 
         /* Prefer going towards _YES in case of multiple jacks */
-- 
2.1.1



More information about the pulseaudio-discuss mailing list