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

Tanu Kaskinen tanuk at iki.fi
Fri May 4 14:59:08 UTC 2018


On Sat, 2018-04-21 at 09:51 +0530, 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(-)

src/map-file is not updated.

> 
> diff --git a/src/pulse/util.h b/src/pulse/util.h
> index e4a62da65..bdd8cd60c 100644
> --- a/src/pulse/util.h
> +++ b/src/pulse/util.h
> @@ -54,6 +54,9 @@ char *pa_path_get_filename(const char *p);
>  /** Wait t milliseconds */
>  int pa_msleep(unsigned long t);
>  
> +/** Make a thread realtime if we can */
> +int pa_thread_make_realtime(int rtprio);

The documentation needs a \since tag. Also, this is for application
developers, which is why I think the documentation should have more
details, at least "a thread" -> "the calling thread". It would probably
be good to explain what happens under the hood (rtkit and stuff).

-- 
Tanu

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


More information about the pulseaudio-discuss mailing list