[pulseaudio-discuss] jack module cannot use real-time scheduling errors

Tanu Kaskinen tanuk at iki.fi
Wed Jun 27 07:19:02 UTC 2018


On Thu, 2018-06-21 at 09:58 -0500, dag dg wrote:
> I use pulse with jack via jackdbus. I've been trying to narrow down
> the cause of a series of errors I've been seeing in my pulseaudio logs
> for some time:
> 
> Jun 21 08:43:46 localhost pulseaudio[1988]: W: [pulseaudio]
> module-jack-sink.c: JACK error >Cannot use real-time scheduling
> (RR/15)(1: Operation not permitted)<
> Jun 21 08:43:46 localhost pulseaudio[1988]: W: [pulseaudio]
> module-jack-source.c: JACK error >Cannot use real-time scheduling
> (RR/15)(1: Operation not permitted)<
> Jun 21 08:44:40 localhost pulseaudio[2596]: W: [pulseaudio]
> module-jack-sink.c: JACK error >Cannot use real-time scheduling
> (RR/15)(1: Operation not permitted)<
> Jun 21 08:44:40 localhost pulseaudio[2596]: W: [pulseaudio]
> module-jack-source.c: JACK error >Cannot use real-time scheduling
> (RR/15)(1: Operation not permitted)<
> 
> Running pulse in a higher verbosity I get:
> 
> I: [pulseaudio] module-jack-sink.c: Successfully connected as
> 'PulseAudio JACK Sink'
> I: [pulseaudio] module-device-restore.c: Restoring volume for sink
> jack_out: front-left: 45922 /  70%,   front-right: 45922 /  70%
> I: [pulseaudio] module-device-restore.c: Restoring mute state for sink
> jack_out: unmuted
> W: [pulseaudio] sink.c: Default and alternate sample rates are the same.
> I: [pulseaudio] sink.c: Created sink 3 "jack_out" with sample spec
> float32le 2ch 48000Hz and channel map front-left,front-right
> I: [pulseaudio] sink.c:     device.api = "jack"
> I: [pulseaudio] sink.c:     device.description = "Jack sink
> (PulseAudio JACK Sink)"
> I: [pulseaudio] sink.c:     jack.client_name = "PulseAudio JACK Sink"
> I: [pulseaudio] sink.c:     device.icon_name = "audio-card"
> I: [pulseaudio] module-device-restore.c: Restoring volume for source
> jack_out.monitor: front-left: 65536 / 100%,   front-right: 65536 /
> 100%
> I: [pulseaudio] source.c: Created source 5 "jack_out.monitor" with
> sample spec float32le 2ch 48000Hz and channel map
> front-left,front-right
> I: [pulseaudio] source.c:     device.description = "Monitor of Jack
> sink (PulseAudio JACK Sink)"
> I: [pulseaudio] source.c:     device.class = "monitor"
> I: [pulseaudio] source.c:     device.icon_name = "audio-input-microphone"
> I: [pulseaudio] module-jack-sink.c: JACK thread starting up.
> I: [pulseaudio] core-util.c: Successfully enabled SCHED_RR scheduling
> for thread, with priority 9.
> I: [jack-sink] core-util.c: Successfully enabled SCHED_RR scheduling
> for thread, with priority 5.
> I: [pulseaudio] module-jack-sink.c: JACK buffer size changed.
> I: [pulseaudio] module-jack-sink.c: JACK thread starting up.
> I: [pulseaudio] core-util.c: Successfully enabled SCHED_RR scheduling
> for thread, with priority 9.
> W: [pulseaudio] module-jack-sink.c: JACK error >Cannot use real-time
> scheduling (RR/15)(1: Operation not permitted)<
> W: [pulseaudio] module-jack-sink.c: JACK error
> > JackClient::AcquireSelfRealTime error<
> 
> I: [pulseaudio] module-jack-sink.c: JACK thread starting up.
> I: [pulseaudio] core-util.c: Successfully enabled SCHED_RR scheduling
> for thread, with priority 9.
> I: [pulseaudio] module.c: Loaded "module-jack-sink" (index: #24;
> argument: "connect=no channels=2").
> I: [pulseaudio] module-jackdbus-detect.c: Successfully started module-jack-sink.
> I: [pulseaudio] module-jack-source.c: Successfully connected as
> 'PulseAudio JACK Source'
> I: [pulseaudio] module-device-restore.c: Restoring volume for source
> jack_in: front-left: 65536 / 100%,   front-right: 65536 / 100%
> I: [pulseaudio] module-device-restore.c: Restoring mute state for
> source jack_in: unmuted
> W: [pulseaudio] source.c: Default and alternate sample rates are the same.
> I: [pulseaudio] source.c: Created source 6 "jack_in" with sample spec
> float32le 2ch 48000Hz and channel map front-left,front-right
> I: [pulseaudio] source.c:     device.api = "jack"
> I: [pulseaudio] source.c:     device.description = "Jack source
> (PulseAudio JACK Source)"
> I: [pulseaudio] source.c:     jack.client_name = "PulseAudio JACK Source"
> I: [pulseaudio] source.c:     device.icon_name = "audio-input-microphone"
> I: [pulseaudio] module-jack-source.c: JACK thread starting up.
> I: [pulseaudio] core-util.c: Successfully enabled SCHED_RR scheduling
> for thread, with priority 9.
> I: [jack-source] core-util.c: Successfully enabled SCHED_RR scheduling
> for thread, with priority 5.
> I: [pulseaudio] module-jack-source.c: JACK thread starting up.
> I: [pulseaudio] core-util.c: Successfully enabled SCHED_RR scheduling
> for thread, with priority 9.
> W: [pulseaudio] module-jack-source.c: JACK error >Cannot use real-time
> scheduling (RR/15)(1: Operation not permitted)<
> W: [pulseaudio] module-jack-source.c: JACK error
> > JackClient::AcquireSelfRealTime error<
> 
> I: [pulseaudio] module-jack-source.c: JACK thread starting up.
> I: [pulseaudio] core-util.c: Successfully enabled SCHED_RR scheduling
> for thread, with priority 9.
> I: [pulseaudio] module.c: Loaded "module-jack-source" (index: #25;
> argument: "connect=no channels=2").
> I: [pulseaudio] module-jackdbus-detect.c: Successfully started
> module-jack-source.
> 
> I've played around with ulimit and cgroups but by distro
> defaults(Fedora 28) seem to be fine as I can run processes via prlimit
> 
> [user at localhost ~]$ sudo cat /etc/security/limits.d/95-jack.conf
> # Default limits for users of jack-audio-connection-kit
> 
> @jackuser - rtprio 70
> @jackuser - memlock 4194304
> 
> @pulse-rt - rtprio 20
> @pulse-rt - nice -20
> [user at localhost ~]$ prlimit --rtprio=70 --rttime=unlimited echo
> 
> [user at localhost ~]$ echo $?
> 0
> [user at localhost ~]$ prlimit --rtprio=71 --rttime=unlimited echo
> prlimit: failed to set the RTPRIO resource limit: Operation not permitted
> [user at localhost ~]$ echo $?
> 1
> 
> So the settings appear to be correct yet the pulse jack module still
> complains about not being able to properly set the RT priority? Any
> insight would be appreciated.

My guess is that when libjack creates a thread for the pulseaudio
process, it tries to set priority 15 for the thread, but the pulseaudio
process priority limit is something lower (probably 9, since that's the
default). Try setting "rlimit-rtprio = 15" in /etc/pulse/daemon.conf.

-- 
Tanu

https://liberapay.com/tanuk
https://www.patreon.com/tanuk


More information about the pulseaudio-discuss mailing list