[SRU] Service activation via Systemd socket
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
speech-dispatcher (Ubuntu) |
Fix Released
|
High
|
Nathan Teodosio | ||
Jammy |
Fix Released
|
High
|
Nathan Teodosio | ||
Kinetic |
Fix Released
|
High
|
Nathan Teodosio | ||
Lunar |
Fix Released
|
High
|
Nathan Teodosio |
Bug Description
[Description]
Systemd socket activation for Speech Dispatcher.
- Creates the speech-
- Modifies the server so that it can detect it was automatically launched by that socket activation; and
- Modifies the Autotools files accordingly.
[Impact]
Its relevance is described in [1], of which I quote the essential parts [my notes in brackets]:
> Sandboxed applications [snaps] that use Speech Dispatcher currently bundle it inside of the sandbox, so that each application has its own "private" instance of Speech Dispatcher running. This works more or less, but it has the downside that speech dispatcher cannot coordinate simultaneous messages from multiple apps. When multiple sandboxed apps use Speech Dispatcher at the same time, the text reading overlaps.
>
> In order to solve this issue, I would really like to give sandboxed apps access to the Speech Dispatcher instance of the host.
That can be done by implementing the action of the speech dispatcher service via a Systemd socket:
> The only issue I see is having it auto launch. I think it would probably be a good step forward for speech-dispatcher to be auto launched by a systemd socket like other daemons already do on demand. That way the host speech-dispatcher with it's configuration would be used by all snaps,
[Additional information]
The changes are already merged upstream[
I have built and installed the package in Mantic and verified that running spd-say from inside a snap causes the host's dispatcher to spawn and emit sound — see 'Test case' for more details. This has also been verified in Jammy by Lissyx[31][32] and there is a merge proposal[4] for the Firefox snap that assumes the incorporation of this delta in speech-dispatcher.
Note: Either the installed socket needs to be started manually to function correctly or the session must be restarted or the system needs to be rebooted.
[Test case]
Install the proposed speech-dispatcher and the snap[5] containing spd-say. Restart the user session so the new systemd unit gets activated. Then,
snap run --shell geheim
$ XDG_RUNTIME_
should say "hi" through your loudspeakers. If you have no loudspeakers or if you are testing in a virtual machine, you can use Pavucontrol to verify that the dummy output device meter shows activity right after you issue the last command.
[Regression potential]
If the socket communication were not working (e.g. connection refused), then this would result in text-to-speech failing, even for a not sandboxed program.
Do note, however, that if the socket were not available for whatever reason (e.g. the user didn't start it manually nor rebooted), then the sd_listen_fds(0) >= 1 test would be false and no regression would be observed, as then the program would fallback to its usual operation.
[1] https:/
[21] https:/
[22] https:/
[23] https:/
[31] https:/
[32] https:/
[4] https:/
[5] https:/
summary: |
- Feature freeze exception: Socket activation + [FFe] Socket activation |
description: | updated |
Changed in speech-dispatcher (Ubuntu): | |
status: | Fix Released → In Progress |
summary: |
- [FFe] Socket activation + Service activation via Systemd socket |
Changed in speech-dispatcher (Ubuntu Focal): | |
assignee: | nobody → Nathan Teodosio (nteodosio) |
Changed in speech-dispatcher (Ubuntu Jammy): | |
assignee: | nobody → Nathan Teodosio (nteodosio) |
Changed in speech-dispatcher (Ubuntu Kinetic): | |
assignee: | nobody → Nathan Teodosio (nteodosio) |
Changed in speech-dispatcher (Ubuntu Lunar): | |
assignee: | nobody → Nathan Teodosio (nteodosio) |
Changed in speech-dispatcher (Ubuntu Focal): | |
importance: | Undecided → High |
Changed in speech-dispatcher (Ubuntu Jammy): | |
importance: | Undecided → High |
Changed in speech-dispatcher (Ubuntu Kinetic): | |
importance: | Undecided → High |
Changed in speech-dispatcher (Ubuntu Lunar): | |
importance: | Undecided → High |
description: | updated |
description: | updated |
description: | updated |
tags: | removed: kinetic |
summary: |
- Service activation via Systemd socket + [SRU] Service activation via Systemd socket |
no longer affects: | speech-dispatcher (Ubuntu Focal) |
description: | updated |
description: | updated |
Hi Nathan,
Thank you for filing the FFe bug. The bug is well documented and supported via attached logs and diff. Whilst this looks good for FFe, please wait for an ACK from the actual Release team member. Thanks! \o/