diff options
author | Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp> | 2024-10-01 00:13:10 +0900 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2024-10-09 14:03:15 +0000 |
commit | d7d2f57df5a852d5bedd0072072183d80680e9bc (patch) | |
tree | b3f6704b2ca31f4ab241770c34c2f224e36c06be /meta-agl-ic-container/recipes-multimedia/pulseaudio | |
parent | 24f2da7bfd7fa66e8a3b8ed7e5d8c09ef6956c68 (diff) |
Enable QtMultimedia sound support
The QtMultimedia is using plusaudio to support audio.
It has alsa support, but that alsa support has restriction.
And QtMulitimedia is not support pipwire.
This change enable pulseaudio as a temporary solution of Qt6 support.
Bug-AGL: SPEC-5162
Change-Id: Ic7cf20d49612feb4deaebfc501831bdbe5a00142
Signed-off-by: Naoto Yamaguchi <naoto.yamaguchi@aisin.co.jp>
Diffstat (limited to 'meta-agl-ic-container/recipes-multimedia/pulseaudio')
6 files changed, 231 insertions, 0 deletions
diff --git a/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/daemon.conf b/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/daemon.conf new file mode 100644 index 00000000..58a2ab6f --- /dev/null +++ b/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/daemon.conf @@ -0,0 +1,92 @@ +# This file is part of PulseAudio. +# +# PulseAudio is free software; you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PulseAudio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. + +## Configuration file for the PulseAudio daemon. See pulse-daemon.conf(5) for +## more information. Default values are commented out. Use either ; or # for +## commenting. + +; daemonize = no +; fail = yes +; allow-module-loading = yes +; allow-exit = yes +; use-pid-file = yes +; system-instance = no +; local-server-type = user +; enable-shm = yes +; enable-memfd = yes +; shm-size-bytes = 0 # setting this 0 will use the system-default, usually 64 MiB +; lock-memory = no +; cpu-limit = no + +; high-priority = yes +; nice-level = -11 + +realtime-scheduling = yes +realtime-priority = 5 + +; exit-idle-time = 20 +; scache-idle-time = 20 + +; dl-search-path = (depends on architecture) + +; load-default-script-file = yes +; default-script-file = /etc/pulse/default.pa + +; log-target = auto +; log-level = notice +; log-meta = no +; log-time = no +; log-backtrace = 0 + +; resample-method = speex-float-1 +; avoid-resampling = false +; enable-remixing = yes +; remixing-use-all-sink-channels = yes +; remixing-produce-lfe = no +; remixing-consume-lfe = no +; lfe-crossover-freq = 0 + +; flat-volumes = no + +; rescue-streams = yes + +; rlimit-fsize = -1 +; rlimit-data = -1 +; rlimit-stack = -1 +; rlimit-core = -1 +; rlimit-as = -1 +; rlimit-rss = -1 +; rlimit-nproc = -1 +; rlimit-nofile = 256 +; rlimit-memlock = -1 +; rlimit-locks = -1 +; rlimit-sigpending = -1 +; rlimit-msgqueue = -1 +; rlimit-nice = 31 +; rlimit-rtprio = 9 +; rlimit-rttime = 200000 + +default-sample-format = s16le +default-sample-rate = 48000 +alternate-sample-rate = 48000 +default-sample-channels = 2 +default-channel-map = front-left,front-right + +default-fragments = 2 +default-fragment-size-msec = 5 + +; enable-deferred-volume = yes +; deferred-volume-safety-margin-usec = 8000 +; deferred-volume-extra-delay-usec = 0 diff --git a/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/nanopct6/system.pa b/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/nanopct6/system.pa new file mode 100644 index 00000000..f9bffb05 --- /dev/null +++ b/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/nanopct6/system.pa @@ -0,0 +1,33 @@ +#!/usr/bin/pulseaudio -nF +# +# This file is part of PulseAudio. +# +# PulseAudio is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PulseAudio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. + +# This startup script is used only if PulseAudio is started in system +# mode. + +### Automatically restore the volume of streams and devices +load-module module-device-restore +load-module module-stream-restore +load-module module-card-restore + +### Use the static hardware detection module (for systems that lack udev/hal support) +load-module module-alsa-sink device=hw:1,0 + +### Load several protocols +load-module module-native-protocol-unix auth-anonymous=1 + +.nofail +.include /etc/pulse/system.pa.d diff --git a/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio.service b/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio.service new file mode 100644 index 00000000..2cafafcd --- /dev/null +++ b/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/pulseaudio.service @@ -0,0 +1,13 @@ +[Unit] +Description=Pulse Audio Service +After=basic.target +Before=multi-user.target + +[Service] +Type=notify +ExecStart=/usr/bin/pulseaudio --system --daemonize=no --disallow-exit --disallow-module-loading --log-target=journal +MemoryDenyWriteExecute=yes +Restart=on-failure + +[Install] +WantedBy=basic.target diff --git a/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/raspberrypi4-64/system.pa b/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/raspberrypi4-64/system.pa new file mode 100644 index 00000000..5bb33743 --- /dev/null +++ b/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/raspberrypi4-64/system.pa @@ -0,0 +1,33 @@ +#!/usr/bin/pulseaudio -nF +# +# This file is part of PulseAudio. +# +# PulseAudio is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PulseAudio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. + +# This startup script is used only if PulseAudio is started in system +# mode. + +### Automatically restore the volume of streams and devices +load-module module-device-restore +load-module module-stream-restore +load-module module-card-restore + +### Use the static hardware detection module (for systems that lack udev/hal support) +load-module module-alsa-sink device=hw:"Device" + +### Load several protocols +load-module module-native-protocol-unix auth-anonymous=1 + +.nofail +.include /etc/pulse/system.pa.d diff --git a/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/rcar-gen3/system.pa b/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/rcar-gen3/system.pa new file mode 100644 index 00000000..6891574f --- /dev/null +++ b/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio/rcar-gen3/system.pa @@ -0,0 +1,33 @@ +#!/usr/bin/pulseaudio -nF +# +# This file is part of PulseAudio. +# +# PulseAudio is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# PulseAudio is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with PulseAudio; if not, see <http://www.gnu.org/licenses/>. + +# This startup script is used only if PulseAudio is started in system +# mode. + +### Automatically restore the volume of streams and devices +load-module module-device-restore +load-module module-stream-restore +load-module module-card-restore + +### Use the static hardware detection module (for systems that lack udev/hal support) +load-module module-alsa-sink device=hw:0,0 + +### Load several protocols +load-module module-native-protocol-unix auth-anonymous=1 + +.nofail +.include /etc/pulse/system.pa.d diff --git a/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend b/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend new file mode 100644 index 00000000..ae1a20c6 --- /dev/null +++ b/meta-agl-ic-container/recipes-multimedia/pulseaudio/pulseaudio_%.bbappend @@ -0,0 +1,27 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/pulseaudio:" + +SRC_URI:append = " \ + file://pulseaudio.service \ + file://system.pa \ + file://daemon.conf \ + " + +do_install:append() { + install -Dm644 ${WORKDIR}/system.pa ${D}${sysconfdir}/pulse/system.pa + install -Dm644 ${WORKDIR}/daemon.conf ${D}${sysconfdir}/pulse/daemon.conf + rm ${D}${sysconfdir}/pulse/default.pa + + install -d ${D}/${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/pulseaudio.service ${D}/${systemd_unitdir}/system + rm ${D}/${systemd_unitdir}/user/* +} + +FILES:${PN}-server:append = " ${systemd_unitdir}/*" +CONFFILES:pulseaudio-server = "\ + ${sysconfdir}/pulse/daemon.conf \ + ${sysconfdir}/pulse/system.pa \ +" + +SYSTEMD_PACKAGES:append = " ${PN}-server" +SYSTEMD_SERVICE:${PN}-server = "pulseaudio.service" +SYSTEMD_AUTO_ENABLE:${PN}-server = "enable" |