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
=== modified file 'debian/changelog'
--- debian/changelog 2013-02-21 10:48:08 +0000
+++ debian/changelog 2013-02-21 13:22:53 +0000
@@ -1,3 +1,15 @@
1pulseaudio (1:3.0-0ubuntu4) UNRELEASED; urgency=low
2
3 * 0108-module-jackdbus-detect-channel-config.patch
4 0109-module-jackdbus-detect-channel-config-fix.patch
5 Adds channel configuration to module-jackdbus-detect
6 * 0022-module-jackdbus-detect-channel-config-default.patch
7 Sets default channel config for module-jackdbus-detect to 2,
8 as jack is not well adapted for anything beyond mono or stereo
9 connections.
10
11 -- Kaj Ailomaa <zequence@mousike.me> Thu, 21 Feb 2013 14:13:50 +0100
12
1pulseaudio (1:3.0-0ubuntu3) raring; urgency=low13pulseaudio (1:3.0-0ubuntu3) raring; urgency=low
214
3 * 0106-reserve-Move-get_name_owner-to-the-public-rd_device-.patch,15 * 0106-reserve-Move-get_name_owner-to-the-public-rd_device-.patch,
416
=== added file 'debian/patches/0022-module-jackdbus-detect-channel-config-default.patch'
--- debian/patches/0022-module-jackdbus-detect-channel-config-default.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/0022-module-jackdbus-detect-channel-config-default.patch 2013-02-21 13:22:53 +0000
@@ -0,0 +1,14 @@
1Description: Sets the default number of channels for module-jackdbus-detect to two
2Author: Kaj Ailomaa <zequence@mousike.me>
3
4--- pulseaudio-3.0.orig/src/daemon/default.pa.in
5+++ pulseaudio-3.0/src/daemon/default.pa.in
6@@ -78,7 +78,7 @@ load-module module-detect
7 ### Automatically connect sink and source if JACK server is present
8 .ifexists module-jackdbus-detect@PA_SOEXT@
9 .nofail
10-load-module module-jackdbus-detect
11+load-module module-jackdbus-detect channels=2
12 .fail
13 .endif
14
015
=== added file 'debian/patches/0108-module-jackdbus-detect-channel-config.patch'
--- debian/patches/0108-module-jackdbus-detect-channel-config.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/0108-module-jackdbus-detect-channel-config.patch 2013-02-21 13:22:53 +0000
@@ -0,0 +1,78 @@
1From: commit c1f36347298214eca090a394451fb5bc82ae28aa
2Author: Peter Nelson <peter@fuzzle.org>
3Date: Sat Dec 22 22:18:52 2012 +0000
4
5 jackdbus-detect: Add channel count override.
6
7 Allow configuration of number of channels when using module-jackdbus-detect
8 to load jack-sink and jack-source. This is useful when the default channel
9 count doesn't match the logical channel count desired, e.g. with multi-
10 channel audio interfaces.
11
12 Signed-off-by: Peter Nelson <peter@fuzzle.org>
13
14diff --git a/src/modules/jack/module-jackdbus-detect.c b/src/modules/jack/module-jackdbus-detect.c
15index 10408ea..ba0b364 100644
16--- a/src/modules/jack/module-jackdbus-detect.c
17+++ b/src/modules/jack/module-jackdbus-detect.c
18@@ -40,7 +40,9 @@ PA_MODULE_AUTHOR("David Henningsson");
19 PA_MODULE_DESCRIPTION("Adds JACK sink/source ports when JACK is started");
20 PA_MODULE_LOAD_ONCE(TRUE);
21 PA_MODULE_VERSION(PACKAGE_VERSION);
22-PA_MODULE_USAGE("connect=<connect ports?>");
23+PA_MODULE_USAGE(
24+ "channels=<number of channels> "
25+ "connect=<connect ports?>");
26
27 #define JACK_SERVICE_NAME "org.jackaudio.service"
28 #define JACK_INTERFACE_NAME "org.jackaudio.JackControl"
29@@ -60,6 +62,7 @@ PA_MODULE_USAGE("connect=<connect ports?>");
30 "member='" _a "'"
31
32 static const char* const valid_modargs[] = {
33+ "channels",
34 "connect",
35 NULL
36 };
37@@ -81,6 +84,7 @@ struct userdata {
38 pa_bool_t filter_added, match_added;
39 pa_bool_t is_service_started;
40 pa_bool_t autoconnect_ports;
41+ uint32_t channels;
42 /* Using index here protects us from module unloading without us knowing */
43 int jack_module_index[JACK_SS_COUNT];
44 };
45@@ -106,7 +110,11 @@ static void ensure_ports_started(struct userdata* u) {
46 if (!u->jack_module_index[i]) {
47 char* args;
48 pa_module* m;
49- args = pa_sprintf_malloc("connect=%s", pa_yes_no(u->autoconnect_ports));
50+ if (u->channels > 0) {
51+ args = pa_sprintf_malloc("connect=%s channels=%" PRIu32, pa_yes_no(u->autoconnect_ports), u->channels);
52+ } else {
53+ args = pa_sprintf_malloc("connect=%s", pa_yes_no(u->autoconnect_ports));
54+ }
55 m = pa_module_load(u->core, modnames[i], args);
56 pa_xfree(args);
57
58@@ -226,12 +234,20 @@ int pa__init(pa_module *m) {
59 u->core = m->core;
60 u->module = m;
61 u->autoconnect_ports = TRUE;
62+ u->channels = 0;
63
64 if (pa_modargs_get_value_boolean(ma, "connect", &u->autoconnect_ports) < 0) {
65 pa_log("Failed to parse connect= argument.");
66 goto fail;
67 }
68
69+ if (pa_modargs_get_value_u32(ma, "channels", &u->channels) < 0 ||
70+ u->channels <= 0 ||
71+ u->channels > PA_CHANNELS_MAX) {
72+ pa_log("Failed to parse channels= argument.");
73+ goto fail;
74+ }
75+
76 if (!(connection = pa_dbus_bus_get(m->core, DBUS_BUS_SESSION, &error)) || dbus_error_is_set(&error)) {
77
78 if (connection)
079
=== added file 'debian/patches/0109-module-jackdbus-detect-channel-config-fix.patch'
--- debian/patches/0109-module-jackdbus-detect-channel-config-fix.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/0109-module-jackdbus-detect-channel-config-fix.patch 2013-02-21 13:22:53 +0000
@@ -0,0 +1,27 @@
1From: commit f26bcae28e1064d7eab48ee0d29a8658ac19acf5
2Author: Tanu Kaskinen <tanuk@iki.fi>
3Date: Tue Jan 22 08:42:27 2013 +0200
4
5 jack: Don't fail module-jackdbus-detect loading if the channels argument is not given.
6
7 The u->channels <= 0 check failed if the channels argument was not
8 given at all, making the whole module loading fail. I don't think the
9 check is necessary at all - negative values are not possible, and if
10 someone gives 0 as the argument, it's probably ok if we act as if
11 there was no channels argument at all.
12
13diff --git a/src/modules/jack/module-jackdbus-detect.c b/src/modules/jack/module-jackdbus-detect.c
14index ba0b364..25ac495 100644
15--- a/src/modules/jack/module-jackdbus-detect.c
16+++ b/src/modules/jack/module-jackdbus-detect.c
17@@ -241,9 +241,7 @@ int pa__init(pa_module *m) {
18 goto fail;
19 }
20
21- if (pa_modargs_get_value_u32(ma, "channels", &u->channels) < 0 ||
22- u->channels <= 0 ||
23- u->channels > PA_CHANNELS_MAX) {
24+ if (pa_modargs_get_value_u32(ma, "channels", &u->channels) < 0 || u->channels > PA_CHANNELS_MAX) {
25 pa_log("Failed to parse channels= argument.");
26 goto fail;
27 }
028
=== modified file 'debian/patches/series'
--- debian/patches/series 2013-02-21 10:48:08 +0000
+++ debian/patches/series 2013-02-21 13:22:53 +0000
@@ -7,6 +7,7 @@
70019-disable-dbus-protocol.patch70019-disable-dbus-protocol.patch
80020-stream-Return-error-in-case-a-client-peeks-to-early.patch80020-stream-Return-error-in-case-a-client-peeks-to-early.patch
90021-disable-ucm.patch90021-disable-ucm.patch
100022-module-jackdbus-detect-channel-config-default.patch
1011
11# From upstream12# From upstream
120101-alsa-mixer-Fix-the-analog-output-speaker-always-path.patch130101-alsa-mixer-Fix-the-analog-output-speaker-always-path.patch
@@ -16,3 +17,4 @@
160105-udev-Add-use_ucm-module-argument.patch170105-udev-Add-use_ucm-module-argument.patch
170106-reserve-Move-get_name_owner-to-the-public-rd_device-.patch180106-reserve-Move-get_name_owner-to-the-public-rd_device-.patch
180107-reserve-Fix-leaking-NameLost-signals-after-release-a.patch190107-reserve-Fix-leaking-NameLost-signals-after-release-a.patch
200108-module-jackdbus-detect-channel-config.patch

Subscribers

People subscribed via source and target branches