Open jmatsushita opened 4 years ago
@jmatsushita I faced the same issue while trying to run librespeaker code from within systemd (dedicated service based on this lib).
Checking different forums and SO lead me to the hint about "Realtime Priority" option which equals 99 while running in a normal user-mode. And systemd sets it equal to 0 by default. You can adjust the real-time priority via ulimit -r
command from the terminal. However, on a service level, it's called LimitRTPRIO
. Anyway, when I added this option to my systemd service, the permission issue has gone. But unfortunately, it wasn't the last one.
Finally, I came up with a bit different approach - creating service via pm2 library (popular process manager). Technically, it's started as a systemd service as well. But I believe the main difference is that it spawns other processes from within itself. I'm not sure about its internals but adding LimitRTPRIO=99
to the pm2 service and configuring my app (based on librespeaker) to be started automatically via pm2 did the trick. You can find details in my voice streaming project.
After installing manually following only these lines from the install script (to not install Alexa related code) https://github.com/respeaker/respeakerd/blob/master/scripts/install_all.sh#L39-L88
Also checking that pulse audio was configured properly, the systemd service failed with
Setting
Fixed the problem, but it is supposed to be a dangerous setting https://access.redhat.com/solutions/1604133
Since librespeaker is not open source as far as I can tell (calling it libre is really misinformation :( ) I can't check what's happening in
pulse_collector_node.cc
Possible Solution
Open source
librespeaker