Re: [meta-arago][master][PATCH v2] pulseaudio-service: Add systemd service for system-wide audio daemon

Denys Dmytriyenko <[email protected]>
Newsgroups org.yoctoproject.lists.meta-arago
Message-ID <[email protected]>
On Wed, Feb 04, 2026 at 09:38:13PM +0530, Jeevan via lists.yoctoproject.org wrote:
> Add a systemd service to run PulseAudio in system mode where multiple
> applications need audio access without user sessions. Depends on
> pulseaudio-server to ensure audio/pulse groups exist.
> 
> Enable this service by default to provide system-wide audio for all
> applications.
> 
> Signed-off-by: Telukula Jeevan Kumar Sahu <[email protected]>
> ---
> Changes in v2: Add SUMMARY, PV and PR.
> 
>  .../pulseaudio/files/pulseaudio.service       | 11 ++++++
>  .../pulseaudio/pulseaudio-service.bb          | 39 +++++++++++++++++++
>  2 files changed, 50 insertions(+)
>  create mode 100644 meta-arago-extras/recipes-multimedia/pulseaudio/files/pulseaudio.service
>  create mode 100644 meta-arago-extras/recipes-multimedia/pulseaudio/pulseaudio-service.bb
> 
> diff --git a/meta-arago-extras/recipes-multimedia/pulseaudio/files/pulseaudio.service b/meta-arago-extras/recipes-multimedia/pulseaudio/files/pulseaudio.service
> new file mode 100644
> index 00000000..1d3ac435
> --- /dev/null
> +++ b/meta-arago-extras/recipes-multimedia/pulseaudio/files/pulseaudio.service
> @@ -0,0 +1,11 @@
> +[Unit]
> +Description=PulseAudio Sound System
> +After=alsa-restore.service
> +
> +[Service]
> +BusName=org.pulseaudio.Server
> +ExecStart=/usr/bin/pulseaudio --system
> +Restart=always
> +
> +[Install]
> +WantedBy=multi-user.target
> diff --git a/meta-arago-extras/recipes-multimedia/pulseaudio/pulseaudio-service.bb b/meta-arago-extras/recipes-multimedia/pulseaudio/pulseaudio-service.bb
> new file mode 100644
> index 00000000..5ce849fc
> --- /dev/null
> +++ b/meta-arago-extras/recipes-multimedia/pulseaudio/pulseaudio-service.bb
> @@ -0,0 +1,39 @@
> +SUMMARY = "PulseAudio systemd service for system-wide audio"
> +DESCRIPTION = "Systemd service to run PulseAudio in system mode for embedded systems"
> +LICENSE = "MIT"
> +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
> +
> +PV = "1.0"
> +PR = "r0"

These days PR is managed automatically, so it is advised against tweaking it 
manually.


> +inherit ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}
> +inherit useradd
> +
> +DEPENDS = "pulseaudio"
> +
> +# Ensure pulseaudio-server is installed to create audio group
> +RDEPENDS:${PN} = "pulseaudio-server"
> +
> +SRC_URI = "\
> +    file://pulseaudio.service \
> +"
> +
> +S = "${UNPACKDIR}"
> +
> +SYSTEMD_PACKAGES = "${PN}"
> +SYSTEMD_SERVICE:${PN} = "pulseaudio.service"
> +SYSTEMD_AUTO_ENABLE:${PN} = "disable"
> +
> +FILES:${PN} = " \
> +    ${systemd_system_unitdir}/pulseaudio.service \
> +"
> +
> +USERADD_PACKAGES = "${PN}"
> +GROUPMEMS_PARAM:${PN} = "--add root --group audio"
> +
> +do_install() {
> +    if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
> +        install -d ${D}${systemd_system_unitdir}
> +        install -m 0644 ${S}/pulseaudio.service ${D}${systemd_system_unitdir}/
> +    fi
> +}
> -- 
> 2.34.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.