Merge lp:~zequence/pulseaudio/module-jackdbus-detect-channel-config into lp:~ubuntu-audio-dev/pulseaudio/ubuntu

Proposed by Kaj Ailomaa
Status: Merged
Merge reported by: David Henningsson
Merged at revision: not available
Proposed branch: lp:~zequence/pulseaudio/module-jackdbus-detect-channel-config
Merge into: lp:~ubuntu-audio-dev/pulseaudio/ubuntu
Diff against target: 170 lines (+133/-0)
5 files modified
debian/changelog (+12/-0)
debian/patches/0022-module-jackdbus-detect-channel-config-default.patch (+14/-0)
debian/patches/0108-module-jackdbus-detect-channel-config.patch (+78/-0)
debian/patches/0109-module-jackdbus-detect-channel-config-fix.patch (+27/-0)
debian/patches/series (+2/-0)
To merge this branch: bzr merge lp:~zequence/pulseaudio/module-jackdbus-detect-channel-config
Reviewer Review Type Date Requested Status
David Henningsson Approve
Review via email: mp+149827@code.launchpad.net

Description of the change

Add channel configuration for module-jackdbus-detect and set the default to 2, as jack is not well adapted for anything beyond mono or stereo connections (i.e. 5.1, 7.1 and similar are difficult to use with jack).

To post a comment you must log in.
Revision history for this message
David Henningsson (diwic) wrote :

Hi and thanks for your merge proposal,

I'm wondering about "0022-module-jackdbus-detect-channel-config-default.patch" - isn't 2 already the default if no channels argument is specified?

review: Needs Information
Revision history for this message
Kaj Ailomaa (zequence) wrote :

It'll create as many channels as there are channels on the audio device
that jack is running.
So, if there are 8 I/O on the audio device, the module will create a 7.1
interface for it with labels like "left", "right", "front", "back", etc.
If more than 8, instead of being called "left", "right", "front", etc in
the PA interface, you get "aux0", "aux1"..
If there are only 2 I/O, then the module creates a stereo interface.

So, making sure the module always uses a stereo interface by default
should help integrate PA easier with jack, as jack thinks more in terms of
multiple mono channels.

On Thu, 21 Feb 2013 23:08:17 +0100, David Henningsson
<email address hidden> wrote:

> Review: Needs Information
>
> Hi and thanks for your merge proposal,
>
> I'm wondering about
> "0022-module-jackdbus-detect-channel-config-default.patch" - isn't 2
> already the default if no channels argument is specified?

Revision history for this message
Kaj Ailomaa (zequence) wrote :

On Fri, 22 Feb 2013 01:06:59 +0100, Kaj Ailomaa <email address hidden>
wrote:

> If more than 8, instead of being called "left", "right", "front", etc in
> the PA interface, you get "aux0", "aux1"..

..on top of the existing "left", "right", "front"

Revision history for this message
David Henningsson (diwic) wrote :

Well, if a user has a 5.1 card, and wants to use JACK with it and PulseAudio on top of that, is there something wrong with providing a sink with a channel map for all six channels that matches that? I'm not following.

Revision history for this message
Kaj Ailomaa (zequence) wrote :

I think the case when someone wants to use 5.1 is much rarer than using
stereo. I also think of this solution as a temporary one, one which I
believe most jack users will prefer, as most jack users use stereo
monitoring for audio production.

It would be best if one could choose a profile for the jack sink and
source from the PA mixer, as you can for devices (I guess those are based
on alsa vard profiles?).

Revision history for this message
Kaj Ailomaa (zequence) wrote :

Or, for rather, a profile for the output. The input I don't really know how that should work, what PA is considered.

Revision history for this message
David Henningsson (diwic) :
review: Approve
Revision history for this message
David Henningsson (diwic) wrote :

Merged and uploaded, thanks for your contribution!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2013-02-21 10:48:08 +0000
3+++ debian/changelog 2013-02-21 13:22:53 +0000
4@@ -1,3 +1,15 @@
5+pulseaudio (1:3.0-0ubuntu4) UNRELEASED; urgency=low
6+
7+ * 0108-module-jackdbus-detect-channel-config.patch
8+ 0109-module-jackdbus-detect-channel-config-fix.patch
9+ Adds channel configuration to module-jackdbus-detect
10+ * 0022-module-jackdbus-detect-channel-config-default.patch
11+ Sets default channel config for module-jackdbus-detect to 2,
12+ as jack is not well adapted for anything beyond mono or stereo
13+ connections.
14+
15+ -- Kaj Ailomaa <zequence@mousike.me> Thu, 21 Feb 2013 14:13:50 +0100
16+
17 pulseaudio (1:3.0-0ubuntu3) raring; urgency=low
18
19 * 0106-reserve-Move-get_name_owner-to-the-public-rd_device-.patch,
20
21=== added file 'debian/patches/0022-module-jackdbus-detect-channel-config-default.patch'
22--- debian/patches/0022-module-jackdbus-detect-channel-config-default.patch 1970-01-01 00:00:00 +0000
23+++ debian/patches/0022-module-jackdbus-detect-channel-config-default.patch 2013-02-21 13:22:53 +0000
24@@ -0,0 +1,14 @@
25+Description: Sets the default number of channels for module-jackdbus-detect to two
26+Author: Kaj Ailomaa <zequence@mousike.me>
27+
28+--- pulseaudio-3.0.orig/src/daemon/default.pa.in
29++++ pulseaudio-3.0/src/daemon/default.pa.in
30+@@ -78,7 +78,7 @@ load-module module-detect
31+ ### Automatically connect sink and source if JACK server is present
32+ .ifexists module-jackdbus-detect@PA_SOEXT@
33+ .nofail
34+-load-module module-jackdbus-detect
35++load-module module-jackdbus-detect channels=2
36+ .fail
37+ .endif
38+
39
40=== added file 'debian/patches/0108-module-jackdbus-detect-channel-config.patch'
41--- debian/patches/0108-module-jackdbus-detect-channel-config.patch 1970-01-01 00:00:00 +0000
42+++ debian/patches/0108-module-jackdbus-detect-channel-config.patch 2013-02-21 13:22:53 +0000
43@@ -0,0 +1,78 @@
44+From: commit c1f36347298214eca090a394451fb5bc82ae28aa
45+Author: Peter Nelson <peter@fuzzle.org>
46+Date: Sat Dec 22 22:18:52 2012 +0000
47+
48+ jackdbus-detect: Add channel count override.
49+
50+ Allow configuration of number of channels when using module-jackdbus-detect
51+ to load jack-sink and jack-source. This is useful when the default channel
52+ count doesn't match the logical channel count desired, e.g. with multi-
53+ channel audio interfaces.
54+
55+ Signed-off-by: Peter Nelson <peter@fuzzle.org>
56+
57+diff --git a/src/modules/jack/module-jackdbus-detect.c b/src/modules/jack/module-jackdbus-detect.c
58+index 10408ea..ba0b364 100644
59+--- a/src/modules/jack/module-jackdbus-detect.c
60++++ b/src/modules/jack/module-jackdbus-detect.c
61+@@ -40,7 +40,9 @@ PA_MODULE_AUTHOR("David Henningsson");
62+ PA_MODULE_DESCRIPTION("Adds JACK sink/source ports when JACK is started");
63+ PA_MODULE_LOAD_ONCE(TRUE);
64+ PA_MODULE_VERSION(PACKAGE_VERSION);
65+-PA_MODULE_USAGE("connect=<connect ports?>");
66++PA_MODULE_USAGE(
67++ "channels=<number of channels> "
68++ "connect=<connect ports?>");
69+
70+ #define JACK_SERVICE_NAME "org.jackaudio.service"
71+ #define JACK_INTERFACE_NAME "org.jackaudio.JackControl"
72+@@ -60,6 +62,7 @@ PA_MODULE_USAGE("connect=<connect ports?>");
73+ "member='" _a "'"
74+
75+ static const char* const valid_modargs[] = {
76++ "channels",
77+ "connect",
78+ NULL
79+ };
80+@@ -81,6 +84,7 @@ struct userdata {
81+ pa_bool_t filter_added, match_added;
82+ pa_bool_t is_service_started;
83+ pa_bool_t autoconnect_ports;
84++ uint32_t channels;
85+ /* Using index here protects us from module unloading without us knowing */
86+ int jack_module_index[JACK_SS_COUNT];
87+ };
88+@@ -106,7 +110,11 @@ static void ensure_ports_started(struct userdata* u) {
89+ if (!u->jack_module_index[i]) {
90+ char* args;
91+ pa_module* m;
92+- args = pa_sprintf_malloc("connect=%s", pa_yes_no(u->autoconnect_ports));
93++ if (u->channels > 0) {
94++ args = pa_sprintf_malloc("connect=%s channels=%" PRIu32, pa_yes_no(u->autoconnect_ports), u->channels);
95++ } else {
96++ args = pa_sprintf_malloc("connect=%s", pa_yes_no(u->autoconnect_ports));
97++ }
98+ m = pa_module_load(u->core, modnames[i], args);
99+ pa_xfree(args);
100+
101+@@ -226,12 +234,20 @@ int pa__init(pa_module *m) {
102+ u->core = m->core;
103+ u->module = m;
104+ u->autoconnect_ports = TRUE;
105++ u->channels = 0;
106+
107+ if (pa_modargs_get_value_boolean(ma, "connect", &u->autoconnect_ports) < 0) {
108+ pa_log("Failed to parse connect= argument.");
109+ goto fail;
110+ }
111+
112++ if (pa_modargs_get_value_u32(ma, "channels", &u->channels) < 0 ||
113++ u->channels <= 0 ||
114++ u->channels > PA_CHANNELS_MAX) {
115++ pa_log("Failed to parse channels= argument.");
116++ goto fail;
117++ }
118++
119+ if (!(connection = pa_dbus_bus_get(m->core, DBUS_BUS_SESSION, &error)) || dbus_error_is_set(&error)) {
120+
121+ if (connection)
122
123=== added file 'debian/patches/0109-module-jackdbus-detect-channel-config-fix.patch'
124--- debian/patches/0109-module-jackdbus-detect-channel-config-fix.patch 1970-01-01 00:00:00 +0000
125+++ debian/patches/0109-module-jackdbus-detect-channel-config-fix.patch 2013-02-21 13:22:53 +0000
126@@ -0,0 +1,27 @@
127+From: commit f26bcae28e1064d7eab48ee0d29a8658ac19acf5
128+Author: Tanu Kaskinen <tanuk@iki.fi>
129+Date: Tue Jan 22 08:42:27 2013 +0200
130+
131+ jack: Don't fail module-jackdbus-detect loading if the channels argument is not given.
132+
133+ The u->channels <= 0 check failed if the channels argument was not
134+ given at all, making the whole module loading fail. I don't think the
135+ check is necessary at all - negative values are not possible, and if
136+ someone gives 0 as the argument, it's probably ok if we act as if
137+ there was no channels argument at all.
138+
139+diff --git a/src/modules/jack/module-jackdbus-detect.c b/src/modules/jack/module-jackdbus-detect.c
140+index ba0b364..25ac495 100644
141+--- a/src/modules/jack/module-jackdbus-detect.c
142++++ b/src/modules/jack/module-jackdbus-detect.c
143+@@ -241,9 +241,7 @@ int pa__init(pa_module *m) {
144+ goto fail;
145+ }
146+
147+- if (pa_modargs_get_value_u32(ma, "channels", &u->channels) < 0 ||
148+- u->channels <= 0 ||
149+- u->channels > PA_CHANNELS_MAX) {
150++ if (pa_modargs_get_value_u32(ma, "channels", &u->channels) < 0 || u->channels > PA_CHANNELS_MAX) {
151+ pa_log("Failed to parse channels= argument.");
152+ goto fail;
153+ }
154
155=== modified file 'debian/patches/series'
156--- debian/patches/series 2013-02-21 10:48:08 +0000
157+++ debian/patches/series 2013-02-21 13:22:53 +0000
158@@ -7,6 +7,7 @@
159 0019-disable-dbus-protocol.patch
160 0020-stream-Return-error-in-case-a-client-peeks-to-early.patch
161 0021-disable-ucm.patch
162+0022-module-jackdbus-detect-channel-config-default.patch
163
164 # From upstream
165 0101-alsa-mixer-Fix-the-analog-output-speaker-always-path.patch
166@@ -16,3 +17,4 @@
167 0105-udev-Add-use_ucm-module-argument.patch
168 0106-reserve-Move-get_name_owner-to-the-public-rd_device-.patch
169 0107-reserve-Fix-leaking-NameLost-signals-after-release-a.patch
170+0108-module-jackdbus-detect-channel-config.patch

Subscribers

People subscribed via source and target branches