~diwic/pulseaudio/ubuntu.precise.jackdetection

« back to all changes in this revision

Viewing changes to debian/patches/0607-Add-possibility-to-configure-connection-to-jack-inpu.patch

  • Committer: David Henningsson
  • Date: 2012-01-09 17:04:39 UTC
  • Revision ID: david.henningsson@canonical.com-20120109170439-l1jj2v4vioo6hv2z
Replace jack detection patches with the ones from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From ef18bcd1402441fc0e54176a1a8bc309ea4fe468 Mon Sep 17 00:00:00 2001
2
 
From: David Henningsson <david.henningsson@canonical.com>
3
 
Date: Fri, 26 Aug 2011 14:24:32 +0200
4
 
Subject: [PATCH 607/613] Add possibility to configure connection to jack
5
 
 input devices
6
 
 
7
 
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
8
 
---
9
 
 src/modules/alsa/alsa-mixer.c                      |    9 +++++++++
10
 
 src/modules/alsa/alsa-mixer.h                      |    3 +++
11
 
 .../alsa/mixer/paths/analog-input-dock-mic.conf    |    4 ++++
12
 
 .../alsa/mixer/paths/analog-input-front-mic.conf   |    4 ++++
13
 
 src/modules/alsa/mixer/paths/analog-input-mic.conf |    3 +++
14
 
 .../alsa/mixer/paths/analog-input-rear-mic.conf    |    4 ++++
15
 
 .../alsa/mixer/paths/analog-output-headphones.conf |    3 +++
16
 
 .../alsa/mixer/paths/analog-output.conf.common     |    3 +++
17
 
 9 files changed, 37 insertions(+), 0 deletions(-)
18
 
 
19
 
diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
20
 
index 1926117..e68258d 100644
21
 
--- a/src/modules/alsa/alsa-mixer.c
22
 
+++ b/src/modules/alsa/alsa-mixer.c
23
 
@@ -2325,6 +2325,10 @@ pa_alsa_path* pa_alsa_path_new(const char *fname, pa_alsa_direction_t direction)
24
 
         { "description",         pa_config_parse_string,            NULL, "General" },
25
 
         { "name",                pa_config_parse_string,            NULL, "General" },
26
 
 
27
 
+        /* [Jack_InputDevice] */
28
 
+        { "name",                pa_config_parse_string,            NULL, "Jack_InputDevice" },
29
 
+        { "code",                pa_config_parse_string,            NULL, "Jack_InputDevice" },
30
 
+
31
 
         /* [Option ...] */
32
 
         { "priority",            option_parse_priority,             NULL, NULL },
33
 
         { "name",                option_parse_name,                 NULL, NULL },
34
 
@@ -2356,6 +2360,9 @@ pa_alsa_path* pa_alsa_path_new(const char *fname, pa_alsa_direction_t direction)
35
 
     items[1].data = &p->description;
36
 
     items[2].data = &p->name;
37
 
 
38
 
+    items[3].data = &p->jack_inputdev_name;
39
 
+    items[4].data = &p->jack_inputdev_code;
40
 
+
41
 
     fn = pa_maybe_prefix_path(fname,
42
 
                               pa_run_from_build_tree() ? PA_BUILDDIR "/modules/alsa/mixer/paths/" :
43
 
                               PA_ALSA_PATHS_DIR);
44
 
@@ -3047,6 +3054,8 @@ static void path_set_condense(pa_alsa_path_set *ps, snd_mixer_t *m) {
45
 
             if (p == p2)
46
 
                 continue;
47
 
 
48
 
+            /* FIXME: a is not a subset of b if a has a matched port and b has not. */
49
 
+
50
 
             /* Compare the elements of each set... */
51
 
             pa_assert_se(ea = p->elements);
52
 
             pa_assert_se(eb = p2->elements);
53
 
diff --git a/src/modules/alsa/alsa-mixer.h b/src/modules/alsa/alsa-mixer.h
54
 
index c20904b..1d99b13 100644
55
 
--- a/src/modules/alsa/alsa-mixer.h
56
 
+++ b/src/modules/alsa/alsa-mixer.h
57
 
@@ -166,6 +166,9 @@ struct pa_alsa_path {
58
 
     char *description;
59
 
     unsigned priority;
60
 
 
61
 
+    char *jack_inputdev_name;
62
 
+    char *jack_inputdev_code;
63
 
+
64
 
     pa_bool_t probed:1;
65
 
     pa_bool_t supported:1;
66
 
     pa_bool_t has_mute:1;
67
 
diff --git a/src/modules/alsa/mixer/paths/analog-input-dock-mic.conf b/src/modules/alsa/mixer/paths/analog-input-dock-mic.conf
68
 
index 489cf90..9d9fc0a 100644
69
 
--- a/src/modules/alsa/mixer/paths/analog-input-dock-mic.conf
70
 
+++ b/src/modules/alsa/mixer/paths/analog-input-dock-mic.conf
71
 
@@ -22,6 +22,10 @@
72
 
 priority = 78
73
 
 name = analog-input-microphone-dock
74
 
 
75
 
+[Jack_InputDevice]
76
 
+code = Microphone
77
 
+name = Dock
78
 
+
79
 
 [Element Dock Mic Boost]
80
 
 required-any = any
81
 
 switch = select
82
 
diff --git a/src/modules/alsa/mixer/paths/analog-input-front-mic.conf b/src/modules/alsa/mixer/paths/analog-input-front-mic.conf
83
 
index 5ae516c..12da7d8 100644
84
 
--- a/src/modules/alsa/mixer/paths/analog-input-front-mic.conf
85
 
+++ b/src/modules/alsa/mixer/paths/analog-input-front-mic.conf
86
 
@@ -22,6 +22,10 @@
87
 
 priority = 85
88
 
 name = analog-input-microphone-front
89
 
 
90
 
+[Jack_InputDevice]
91
 
+code = Microphone
92
 
+name = Front
93
 
+
94
 
 [Element Front Mic Boost]
95
 
 required-any = any
96
 
 switch = select
97
 
diff --git a/src/modules/alsa/mixer/paths/analog-input-mic.conf b/src/modules/alsa/mixer/paths/analog-input-mic.conf
98
 
index 50d4c45..8ca00fd 100644
99
 
--- a/src/modules/alsa/mixer/paths/analog-input-mic.conf
100
 
+++ b/src/modules/alsa/mixer/paths/analog-input-mic.conf
101
 
@@ -22,6 +22,9 @@
102
 
 priority = 87
103
 
 name = analog-input-microphone
104
 
 
105
 
+[Jack_InputDevice]
106
 
+code = Microphone
107
 
+
108
 
 [Element Mic Boost]
109
 
 required-any = any
110
 
 switch = select
111
 
diff --git a/src/modules/alsa/mixer/paths/analog-input-rear-mic.conf b/src/modules/alsa/mixer/paths/analog-input-rear-mic.conf
112
 
index 4046106..deeb812 100644
113
 
--- a/src/modules/alsa/mixer/paths/analog-input-rear-mic.conf
114
 
+++ b/src/modules/alsa/mixer/paths/analog-input-rear-mic.conf
115
 
@@ -22,6 +22,10 @@
116
 
 priority = 82
117
 
 name = analog-input-microphone-rear
118
 
 
119
 
+[Jack_InputDevice]
120
 
+code = Microphone
121
 
+name = Rear
122
 
+
123
 
 [Element Rear Mic Boost]
124
 
 required-any = any
125
 
 switch = select
126
 
diff --git a/src/modules/alsa/mixer/paths/analog-output-headphones.conf b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
127
 
index 7f95f0a..b16c070 100644
128
 
--- a/src/modules/alsa/mixer/paths/analog-output-headphones.conf
129
 
+++ b/src/modules/alsa/mixer/paths/analog-output-headphones.conf
130
 
@@ -22,6 +22,9 @@
131
 
 priority = 90
132
 
 name = analog-output-headphones
133
 
 
134
 
+[Jack_InputDevice]
135
 
+code = Headphone
136
 
+
137
 
 [Element Hardware Master]
138
 
 switch = mute
139
 
 volume = merge
140
 
diff --git a/src/modules/alsa/mixer/paths/analog-output.conf.common b/src/modules/alsa/mixer/paths/analog-output.conf.common
141
 
index db6b473..75f673a 100644
142
 
--- a/src/modules/alsa/mixer/paths/analog-output.conf.common
143
 
+++ b/src/modules/alsa/mixer/paths/analog-output.conf.common
144
 
@@ -57,6 +57,9 @@
145
 
 ; priority = ...                         # Priority for this path
146
 
 ; description = ...
147
 
 ;
148
 
+; [Jack_InputDev]
149
 
+; name = ...                                                # Name of jack input device must contain this string
150
 
+; code = Headphone | Microphone | LineOut | VideoOut        # Type of switch events to listen to
151
 
 ; [Option ...:...]                       # For each option of an enumeration or switch element
152
 
 ;                                        # that shall be exposed as a sink/source port. Needs to
153
 
 ;                                        # be named after the Element, followed by a colon, followed
154
 
1.7.5.4
155