Merge lp:~diwic/udev/lp826662 into lp:~ubuntu-core-dev/ubuntu/oneiric/udev/ubuntu

Proposed by David Henningsson
Status: Merged
Merged at revision: 2716
Proposed branch: lp:~diwic/udev/lp826662
Merge into: lp:~ubuntu-core-dev/ubuntu/oneiric/udev/ubuntu
Diff against target: 109 lines (+89/-0)
3 files modified
debian/changelog (+7/-0)
debian/patches/jack-detection.patch (+81/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~diwic/udev/lp826662
Reviewer Review Type Date Requested Status
Martin Pitt Approve
Review via email: mp+71537@code.launchpad.net

Description of the change

The PulseAudio jack detection is currently blocking on the current user not being able to access the input devices.

To post a comment you must log in.
Revision history for this message
Martin Pitt (pitti) wrote :

This was rejected upstream, but let's keep this at least for oneiric as a quick fix.

review: Approve

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 2011-07-28 14:38:54 +0000
3+++ debian/changelog 2011-08-15 10:15:31 +0000
4@@ -1,3 +1,10 @@
5+udev (172-0ubuntu6) oneiric; urgency=low
6+
7+ * To enable jack detection in PulseAudio, make jack detection input
8+ devices world-readable, just as being done for joysticks (LP: #826662).
9+
10+ -- David Henningsson <david.henningsson@canonical.com> Mon, 15 Aug 2011 12:03:16 +0200
11+
12 udev (172-0ubuntu5) oneiric; urgency=low
13
14 * The kernel won't mount devtmpfs automatically when /init exists, which
15
16=== added file 'debian/patches/jack-detection.patch'
17--- debian/patches/jack-detection.patch 1970-01-01 00:00:00 +0000
18+++ debian/patches/jack-detection.patch 2011-08-15 10:15:31 +0000
19@@ -0,0 +1,81 @@
20+From a45276437c8c3fe62fc001f43d715bfe931dd438 Mon Sep 17 00:00:00 2001
21+From: David Henningsson <david.henningsson@canonical.com>
22+Date: Wed, 15 Jun 2011 20:36:16 +0200
23+Subject: [PATCH] udev: Allow ALSA input jacks to be accessed by the current user
24+
25+One missing piece for userspace (PulseAudio etc) to actually be able
26+to use the jack input devices that ALSA create, is that these devices
27+are accessible by root only. This patch makes the input device nodes
28+world readable, just as for joysticks.
29+
30+Signed-off-by: David Henningsson <david.henningsson@canonical.com>
31+---
32+ extras/input_id/input_id.c | 23 +++++++++++++++++++++++
33+ extras/udev-acl/70-acl.rules | 1 +
34+ rules/rules.d/60-persistent-input.rules | 1 +
35+ 3 files changed, 25 insertions(+), 0 deletions(-)
36+
37+Index: udev-172/extras/input_id/input_id.c
38+===================================================================
39+--- udev-172.orig/extras/input_id/input_id.c 2011-06-06 18:31:56.632539135 +0200
40++++ udev-172/extras/input_id/input_id.c 2011-08-08 07:34:32.621109570 +0200
41+@@ -189,6 +189,25 @@
42+ puts("ID_INPUT_KEYBOARD=1");
43+ }
44+
45++static void test_sound (struct udev_device *dev,
46++ const unsigned long* bitmask_sw)
47++{
48++
49++ struct udev_device *snd_dev;
50++
51++ /* Ensure parent is sound card */
52++ snd_dev = udev_device_get_parent_with_subsystem_devtype(dev, "sound", NULL);
53++ if (!snd_dev)
54++ return;
55++
56++ /* Check that there is at least one relevant switch type */
57++ if (test_bit(SW_HEADPHONE_INSERT, bitmask_sw) ||
58++ test_bit(SW_MICROPHONE_INSERT, bitmask_sw) ||
59++ test_bit(SW_LINEOUT_INSERT, bitmask_sw) ||
60++ test_bit(SW_VIDEOOUT_INSERT, bitmask_sw))
61++ puts("ID_INPUT_SNDJACK=1");
62++}
63++
64+ static void help(void)
65+ {
66+ printf("Usage: input_id [options] <device path>\n"
67+@@ -212,6 +231,7 @@
68+ unsigned long bitmask_abs[NBITS(ABS_MAX)];
69+ unsigned long bitmask_key[NBITS(KEY_MAX)];
70+ unsigned long bitmask_rel[NBITS(REL_MAX)];
71++ unsigned long bitmask_sw[NBITS(SW_MAX)];
72+
73+ udev = udev_new();
74+ if (udev == NULL)
75+@@ -272,10 +292,13 @@
76+ get_cap_mask (dev, "capabilities/abs", bitmask_abs, sizeof (bitmask_abs));
77+ get_cap_mask (dev, "capabilities/rel", bitmask_rel, sizeof (bitmask_rel));
78+ get_cap_mask (dev, "capabilities/key", bitmask_key, sizeof (bitmask_key));
79++ get_cap_mask (dev, "capabilities/sw", bitmask_sw, sizeof (bitmask_sw));
80+
81+ test_pointers(bitmask_ev, bitmask_abs, bitmask_key, bitmask_rel);
82+
83+ test_key(udev, bitmask_ev, bitmask_key);
84+
85++ test_sound(dev, bitmask_sw);
86++
87+ return 0;
88+ }
89+Index: udev-172/rules/rules.d/60-persistent-input.rules
90+===================================================================
91+--- udev-172.orig/rules/rules.d/60-persistent-input.rules 2011-07-10 16:41:50.524235883 +0200
92++++ udev-172/rules/rules.d/60-persistent-input.rules 2011-08-08 07:38:21.001106179 +0200
93+@@ -12,6 +12,7 @@
94+ ENV{ID_INPUT_TOUCHPAD}=="?*", ENV{.INPUT_CLASS}="mouse"
95+ ENV{ID_INPUT_TABLET}=="?*", ENV{.INPUT_CLASS}="mouse"
96+ ENV{ID_INPUT_JOYSTICK}=="?*", ENV{.INPUT_CLASS}="joystick"
97++ENV{ID_INPUT_SNDJACK}=="?*", ENV{.INPUT_CLASS}="sndjack", MODE="0644"
98+ DRIVERS=="pcspkr", ENV{.INPUT_CLASS}="spkr"
99+ ATTRS{name}=="*dvb*|*DVB*|* IR *", ENV{.INPUT_CLASS}="ir"
100+
101
102=== modified file 'debian/patches/series'
103--- debian/patches/series 2011-07-12 05:56:39 +0000
104+++ debian/patches/series 2011-08-15 10:15:31 +0000
105@@ -2,3 +2,4 @@
106 load-fbcon.patch
107 ignore-eucalyptus-virtual-ifaces.patch
108 use_run_tmpfs
109+jack-detection.patch

Subscribers

People subscribed via source and target branches