[pulseaudio-discuss] System-wide PulseAudio instance with realtime priority as non-root from systemd

Jürgen Herrmann t-5 at t-5.eu
Fri Oct 30 22:17:15 UTC 2020


Look here: 
https://t-5.eu/hp/Software/Pulseaudio%20Crossover%20Rack/OnlineHelp/#scheduling

Best regards, Jürgen

Am 30. Oktober 2020 23:13:55 schrieb Matt Garman <matthew.garman at gmail.com>:

> My use case is as follows: I am trying to set up a Raspberry Pi as a
> sound server for my Linux PC.  My Linux PC will use PulseAudio's
> networking capability to send the audio to the Raspberry Pi, which is
> connected to a stereo system.
>
> All the examples I've found online for doing this seem to suggest
> running the PulseAudio instance on the RPi in system mode.  But with
> all the warnings about system mode, I thought I'd try to achieve this
> running Pulse in user mode.
>
> Furthermore, I want to have Pulse start automatically at boot time on
> the RPI, and run with real time priority.  I want PulseAudio to run as
> user "pulse".
>
> I have this in /etc/security/limits.conf:
>
> pulse   -       rtprio 90
> pulse   -       nice    -19
>
> And this in /etc/pulse/daemon.conf
>
> realtime-scheduling = yes
> realtime-priority = 5
>
> And it seems to work as expected when launched from the CLI:
>
> # runuser -u pulse -- /usr/bin/pulseaudio --daemonize=no
> --disallow-module-loading --disallow-exit=yes --disable-shm=no
> --verbose
>
> Pulse prints this when starting:
>
> I: [pulseaudio] core-util.c: Successfully gained nice level -11
>
> And looking at the process via "top" or "ps" shows that it is indeed
> running as the user "pulse".
>
> I have this in my systemd service file:
>
> [Service]
> User=pulse
> Group=pulse
> Type=simple
> BusName=org.pulseaudio.Server
> ExecStartPre=/bin/mkdir -p /var/run/pulse
> ExecStartPre=/bin/chown -R pulse:pulse /var/run/pulse
> ExecStart=/usr/bin/pulseaudio --daemonize=no --disallow-module-loading
> --disallow-exit=yes --disable-shm=no --verbose
> Restart=always
>
> And when I to "systemctl start pulseaudio", it starts, but not with
> realtime priority, and I have this in journalctl:
>
> Oct 30 17:09:00 dietpi-music pulseaudio[1104]: I: [pulseaudio] main.c:
> setrlimit(RLIMIT_NICE, (31, 31)) failed: Operation not permitted
> Oct 30 17:09:00 dietpi-music pulseaudio[1104]: I: [pulseaudio] main.c:
> setrlimit(RLIMIT_RTPRIO, (9, 9)) failed: Operation not permitted
>
> What am I missing?
>
> Thanks,
> Matt
> _______________________________________________
> pulseaudio-discuss mailing list
> pulseaudio-discuss at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


Mit Aqua Mail Android
https://www.mobisystems.com/aqua-mail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20201030/5610d7f9/attachment.htm>


More information about the pulseaudio-discuss mailing list