Editing System-wide speakup
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 26: | Line 26: | ||
# Linux boots | # Linux boots | ||
# systemd gives root the current audio device | # systemd gives root the current audio device | ||
# systemd starts espeakup as root | # systemd starts starts espeakup as root | ||
# You can read the login prompt or login as root | # You can read the login prompt or login as root | ||
# You log in as your own user | # You log in as your own user | ||
Line 56: | Line 56: | ||
Running PipeWire system-wide is a little more complicated: You need to run both the PipeWire daemon and a session manager system-wide. This session manager needs to lock hardware and not give it up on seat switch. | Running PipeWire system-wide is a little more complicated: You need to run both the PipeWire daemon and a session manager system-wide. This session manager needs to lock hardware and not give it up on seat switch. | ||
=== Running espeakup as your user === | === Running espeakup as your user === | ||
Line 81: | Line 79: | ||
This will cause the speakup kernel modules to load at boot. | This will cause the speakup kernel modules to load at boot. | ||
Step 2: Put this in <code>/etc/udev/ | Step 2: Put this in <code>/etc/udev/rule.d/99-speakup.conf</code> | ||
--- PASTE START --- | --- PASTE START --- | ||
Line 99: | Line 97: | ||
[Unit] | [Unit] | ||
Description=Software speech output for Speakup | Description=Software speech output for Speakup | ||
[Service] | [Service] | ||
Environment="default_voice= ALSA_CARD=" | Environment="default_voice= ALSA_CARD=" | ||
Line 107: | Line 104: | ||
OOMScoreAdjust=-900 | OOMScoreAdjust=-900 | ||
[Install] | [Install] | ||
After=pulseaudio.service | |||
WantedBy=default.target | WantedBy=default.target | ||
--- PASTE END --- | --- PASTE END --- | ||
Line 114: | Line 112: | ||
Change <code>pulseaudio.service</code> to <code>pipewire.service</code> if you're using on PipeWire. | Change <code>pulseaudio.service</code> to <code>pipewire.service</code> if you're using on PipeWire. | ||
Step 4: Run these commands | Step 4: Run these commands: | ||
--- PASTE START --- | --- PASTE START --- | ||
Line 128: | Line 126: | ||
# Add your user to the audio group | # Add your user to the audio group | ||
Step 5: Reboot and | Step 5: Reboot and run espeakup as your user. | ||
There's two downsides to this method: | There's two downsides to this method: | ||
# Your user can see what other users are reading | # Your user can see what other users are reading | ||
# Other users can't play audio | # Other users can't play audio | ||
Line 138: | Line 136: | ||
There are some ideas I've considered to solve this problem. | There are some ideas I've considered to solve this problem. | ||
=== | === Locking PulseAudio after boot === | ||
TODO: ... | |||
=== Sharing Speakup === | |||
- logind can proxy/share fds | |||
- have a proxy that sits between speakup and espeak | |||
- send messages to espeakup instances based on current active UID | |||
- during a switch between instances, wait for the current instance to finish talking OR the stop talking control is sent. then start feeding the new instance data | |||
- have a shim that blocks pulseaudio from starting until it has permission, but also don't consume the buffer | |||
i do not like how i'm basically reinventing flow control but poorly | |||
ok so it turns out i was WRONG: you can't share speakup protocol between multiple synths! the protocol is stateful! ie if you tell it to change voice and switch synth the voice change won't be applied. YAY | |||
=== Sharing espeakup | === Sharing espeakup === | ||
so this makes the only viable solution to send PCM data from a root espeakup instance. | |||
on top of that this also means i have to modify espeakup to handle some flow control AND output to a buffer instead of the sound card | |||
=== Loaning PulseAudio to root === | |||
- the main case here is with root who doesn't have a pulseaudio setup | |||
- doesn't solve sharing speakup but maybe things could take turns? | |||