[pulseaudio-discuss] [PATCH] core: Expose API to elevate a thread to realtime priority

Arun Raghavan arun at arunraghavan.net
Fri May 4 13:48:01 UTC 2018



On Sat, 21 Apr 2018, at 3:53 PM, Georg Chini wrote:
> On 21.04.2018 06:21, Arun Raghavan wrote:
> > This should make it easier for clients to elevate their audio threads to
> > real time priority without having to dig through much through specific
> > system internals.
> > ---
> >   src/modules/alsa/alsa-sink.c                 |   3 +-
> >   src/modules/alsa/alsa-source.c               |   3 +-
> >   src/modules/bluetooth/module-bluez5-device.c |   2 +-
> >   src/modules/jack/module-jack-sink.c          |   4 +-
> >   src/modules/jack/module-jack-source.c        |   4 +-
> >   src/modules/macosx/module-coreaudio-device.c |   2 +-
> >   src/modules/module-combine-sink.c            |   3 +-
> >   src/modules/module-solaris.c                 |   2 +-
> >   src/modules/module-waveout.c                 |   2 +-
> >   src/modules/oss/module-oss.c                 |   2 +-
> >   src/pulse/util.c                             | 176 +++++++++++++++++++++++++++
> >   src/pulse/util.h                             |   3 +
> >   src/pulsecore/core-util.c                    | 171 +-------------------------
> >   src/pulsecore/core-util.h                    |   1 -
> >   src/tests/lo-test-util.c                     |   2 +-
> >   src/tests/rtstutter.c                        |   2 +-
> >   16 files changed, 198 insertions(+), 184 deletions(-)
> >
> >
> > diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h
> > index e28b6aa7c..32579739b 100644
> > --- a/src/pulsecore/core-util.h
> > +++ b/src/pulsecore/core-util.h
> > @@ -81,7 +81,6 @@ char *pa_strlcpy(char *b, const char *s, size_t l);
> >   
> >   char *pa_parent_dir(const char *fn);
> >   
> > -int pa_make_realtime(int rtprio);
> >   int pa_raise_priority(int nice_level);
> >   void pa_reset_priority(void);
> >   
> 
> Should pa_raise_priority() and pa_reset_priority() also be moved to util.c?
> I think, if a client can make a thread real time it should also be able to
> reset the priority to normal.
> Otherwise LGTM.

I didn't move those because it looked like they might not cover all the OSes that pa_make_realtime() did. I figured we could move that if there was a request for it (after first updating those).

Cheers,
Arun


More information about the pulseaudio-discuss mailing list