Gentoo Archives: gentoo-accessibility

From: Keith Wessel <keith@××××××.com>
To: gentoo-accessibility@l.g.o
Subject: RE: [gentoo-accessibility] brltty udev rules
Date: Wed, 12 Feb 2014 15:26:18
Message-Id: 000101cf2806$c38b8810$4aa29830$@wessel.com
In Reply to: [gentoo-accessibility] brltty udev rules by Chris Brannon
1 I don't use brltty for speech, but it seems you could disable braille and
2 just have speech using the virtual vraille driver (code vr). Of course, you
3 could also set it to a port and display that you don't have, but that would
4 give some ugly log warnings and is more of a hack than a solution IMHO.
5
6 I do like the udev idea; not sure why it never occurred to me instead of
7 using init. I assume this will work with systemd's version of udev, too?
8 Will try that once I finally reboot and try the system start script.
9
10 Keith
11
12
13 -----Original Message-----
14 From: Chris Brannon [mailto:teiresias@g.o]
15 Sent: Wednesday, February 12, 2014 2:07 AM
16 To: gentoo-accessibility@l.g.o
17 Subject: [gentoo-accessibility] brltty udev rules
18
19 Here's a fragment of the brltty udev rules:
20
21 LABEL="brltty_add"
22 SYMLINK+="brltty/$env{BRLTTY_BRAILLE_DRIVER}-$env{BRLTTY_BRAILLE_DEVICE}"
23 RUN+="/bin/brltty -E -P$env{BRLTTY_PID_FILE}"
24 GOTO="brltty_end"
25
26 LABEL="brltty_remove"
27 RUN+="/bin/sh -c 'kill -TERM `cat $env{BRLTTY_PID_FILE}`'"
28 GOTO="brltty_end"
29
30 So basically, this starts *an instance* of brltty whenever a braille display
31 is connected and kills the corresponding instance when the display is
32 unplugged.
33 Yes, this seems quite reasonable. It's plug-and-play, and I can see why
34 folks like that, even though I'm an old curmudgeon.
35 But if you're using those rules, you'd better not start the daemon at all
36 from your init system. If you do, you've got a problem, because you'll have
37 two running daemons trying to communicate with the same display!
38 At least, that's what happens with the default configuration, because it
39 autodetects the braille driver.
40 Also, if you have a speech-driver setting in your /etc/brltty.conf, you'll
41 probably end up with two daemons trying to provide speech. I haven't
42 verified this, however.
43
44 This is only a problem if you want to use brltty for both speech and
45 braille. If you just want it for braille, then don't start it from the init
46 system. Let udev start it automatically for you, and you're golden. If you
47 want to use brltty for both speech and braille, you're going to have to work
48 around this somehow.
49
50 As far as I can tell, there's no way to select a "null" braille driver.
51 So if you want to use this udev autostart scheme, you don't have the option
52 of spawning a brltty that will only be used for speech.
53 In short, the udev scheme is incompatible with using brltty for both speech
54 and braille.
55
56 Probably your best bet is to override the udev rules. First copy
57 /lib/udev/rules.d/70-brltty.rules to /etc/udev/rules.d/70-brltty.rules.
58 Edit /etc/udev/rules.d/70-brltty.rules, and delete the lines that contain
59 RUN+= Right now, there are just two of them:
60 RUN+="/bin/brltty -E -P$env{BRLTTY_PID_FILE}"
61 and
62 RUN+="/bin/sh -c 'kill -TERM `cat $env{BRLTTY_PID_FILE}`'"
63 You'll need to repeat this procedure every time you upgrade brltty, just to
64 keep your modified rules from getting out of sync with the rules from
65 /lib/udev/rules.d.
66 Yeah, overriding files in /lib or /usr/lib with files in /etc is fragile in
67 the face of updates, but that's the way udev does things...
68 Anyway, this disables autostarting of brltty from udev.
69
70 Now, someone please tell me that there's a better way to do this, and that
71 I'm seeing problems that do not exist. I'd love to believe that I'm
72 delusional!
73
74 -- Chris