Thank you V1del for suggesting the systemd user service!
I just had to remove the "USER=..." line from my service file since this is now obsolete. Now my systemd-user-service-espeak can chime in with audacious.
For some reason enabling the service doesn't work (yet). I can start the service and it works. I can enable it and a symlink is created. But when I re-login, it's incative (dead). What went wrong with enabling it?
Time to read the systemd/user article:
When systemd user instance starts, it brings up the target default.target
So I used default.target instead of multi-user.target. Doing!
Problem solved. With hindsight this was pretty staightforward.
Marked as [SOLVED].
Thanks everybody for your time and effort!
]]>Unfortunately I am unfamiliar with systemd user services. Following the wiki article you pointed me at, I created ~/.config/systemd/user and moved my service and timer files there (previously at /usr/lib/systemd/system/). Then I executed (as non-root) "systemctl --user enable reportlowbattery.timer" (which did not print the usual "Created symlink from..." line) and logged out and in again. "systemctl status reportlowbattery.timer" now yields
● reportlowbattery.timer
Loaded: not-found (Reason: No such file or directory)
Active: inactive (dead)
Did I miss something?
Also: If I want this timer to be run for every user, do I then put the timer files at /etc/systemd/user/ ?
Edit: Added that enabling the timer did not create a symlink.
]]>I replaced /etc/asound.conf with the preinstalled one:
# Use PulseAudio by default
pcm.!default {
type pulse
fallback "sysdefault"
hint {
show on
description "Default ALSA Output (currently PulseAudio Sound Server)"
}
}
ctl.!default {
type pulse
fallback "sysdefault"
}
# vim:set ft=alsaconf:
Unfortunately, this did not change things. The script only works with "/usr/bin/espeak -ven 'test test' | paplay" as long as audacious is closed. Otherwise I get "ALSA lib pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave".
Do you think I should use "pcm.!default { type dmix" instead of "pcm.!default { type pulse"?
]]>I recently figured out how to make a systemd timer play a sound with espeak. As it turns out, this works only if no other application (audacious in my case) is playing sound already.
I tired to pipe espeak to aplay without success. The same goes for paplay. For both cases, I specified various devices for (p)aplay but to no avail. I suspect things to be connected to the dmix plugin. But after reading tons of articles on alsa and pulseaudio, I still can't figure out how to solve this. Interestingly, though, whatever I tried does indeed work outside my systemd timer. That is, I can play sound simultaneously with audacious and aplay/espeak/paplay without any trouble. So it seems to be connected to systemd. Running my timer as User=fromminttoarch does not produce the desired result, either.
Sound ouput of systemd works as soon as I close audacious.
Can someone give me any pointers on how to proceed?
Edit: Marked as [SOLVED].
]]>