pulseaudio: launch pulseaudio in system mode
By launching in system mode it is possible to play music from a shell using pulseaudio. With change all platforms and images (with or without graphical support) have pulseaudio working. https://onedigi.atlassian.net/browse/DEL-8417 Signed-off-by: Tatiana Leon <Tatiana.Leon@digi.com>
This commit is contained in:
parent
e7b0a7affc
commit
ef9e14ab5b
|
|
@ -5,7 +5,6 @@ if [ "$USER" == "root" ]; then
|
||||||
export ECORE_EVAS_ENGINE=wayland_shm
|
export ECORE_EVAS_ENGINE=wayland_shm
|
||||||
export ECORE_EVAS_ENGINE=wayland_shm
|
export ECORE_EVAS_ENGINE=wayland_shm
|
||||||
export GDK_BACKEND=wayland
|
export GDK_BACKEND=wayland
|
||||||
export PULSE_RUNTIME_PATH=/run/user/`id -u root`
|
|
||||||
if [ -e $XDG_RUNTIME_DIR/wayland-0 ]; then
|
if [ -e $XDG_RUNTIME_DIR/wayland-0 ]; then
|
||||||
export WAYLAND_DISPLAY=wayland-0
|
export WAYLAND_DISPLAY=wayland-0
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,6 @@ readonly DEMOSERVER_BINARY="/srv/www/demoserver.py"
|
||||||
readonly STOP_TIMEOUT="5"
|
readonly STOP_TIMEOUT="5"
|
||||||
readonly PULSEAUDIO_START_COMMAND="pulseaudio --start"
|
readonly PULSEAUDIO_START_COMMAND="pulseaudio --start"
|
||||||
|
|
||||||
[ -z "${XDG_RUNTIME_DIR}" ] && export XDG_RUNTIME_DIR=/run/user/$UID
|
|
||||||
|
|
||||||
stop_process() {
|
stop_process() {
|
||||||
# try to stop gracefully
|
# try to stop gracefully
|
||||||
pkill -f "${1}" >/dev/null 2>&1
|
pkill -f "${1}" >/dev/null 2>&1
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Export the XDG_RUNTIME_DIR and DBUS_SESSION_BUS_ADDRESS variables
|
|
||||||
# prior to starting pulseaudio. XDG_RUNTIME_DIR is sourced from a
|
|
||||||
# different file depending on the backend (xwayland or x11).
|
|
||||||
[ -f "/etc/profile.d/weston.sh" ] && source /etc/profile.d/weston.sh
|
|
||||||
[ -f "/etc/X11/Xsession.d/13xdgbasedirs.sh" ] && source /etc/X11/Xsession.d/13xdgbasedirs.sh
|
|
||||||
|
|
||||||
[ -z ${UID} ] && export UID="$(id -u)"
|
|
||||||
[ -z "${XDG_RUNTIME_DIR}" ] && export XDG_RUNTIME_DIR=/run/user/$UID
|
|
||||||
|
|
||||||
export DBUS_SESSION_BUS_ADDRESS=unix:path=${XDG_RUNTIME_DIR}/bus
|
|
||||||
|
|
||||||
type journalctl >/dev/null 2>&1 && log_target=journal || log_target=syslog
|
type journalctl >/dev/null 2>&1 && log_target=journal || log_target=syslog
|
||||||
pulseaudio --start --log-target="${log_target}"
|
pulseaudio --system --daemon --log-target="${log_target}"
|
||||||
|
|
||||||
# Create a symlink to the daemon's PID file in a more accesible directory
|
|
||||||
ln -sf ${XDG_RUNTIME_DIR}/pulse/pid /run/pulse.pid
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ After=dbus.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=forking
|
Type=forking
|
||||||
PIDFile=/run/pulse.pid
|
PIDFile=/run/pulse/pid
|
||||||
ExecStart=/etc/pulseaudio-init
|
ExecStart=/etc/pulseaudio-init
|
||||||
ExecStop=kill -HUP $MAINPID
|
ExecStop=kill -HUP $MAINPID
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,8 @@ SRC_URI:append:mx9-nxp-bsp = " \
|
||||||
file://default.pa \
|
file://default.pa \
|
||||||
"
|
"
|
||||||
|
|
||||||
# Enable allow-autospawn-for-root as default
|
# Disable allow-autospawn-for-root as default
|
||||||
PACKAGECONFIG:append = " autospawn-for-root"
|
PACKAGECONFIG:remove = "autospawn-for-root"
|
||||||
|
|
||||||
EXTRA_OECONF:append:ccimx6 = " --disable-memfd"
|
EXTRA_OECONF:append:ccimx6 = " --disable-memfd"
|
||||||
|
|
||||||
|
|
@ -105,6 +105,8 @@ do_install:append() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -i -e '/load-module module-suspend-on-idle/{s,$, timeout=0,g}' ${D}${sysconfdir}/pulse/default.pa
|
sed -i -e '/load-module module-suspend-on-idle/{s,$, timeout=0,g}' ${D}${sysconfdir}/pulse/default.pa
|
||||||
|
sed -i -e '/load-module module-suspend-on-idle/{s,$, timeout=0,g}' ${D}${sysconfdir}/pulse/system.pa
|
||||||
|
sed -i -e '/load-module module-native-protocol-unix/{/ auth-anonymous=true/! s/$/ auth-anonymous=true/g}' ${D}${sysconfdir}/pulse/system.pa
|
||||||
}
|
}
|
||||||
|
|
||||||
# Pulse audio configuration files installation
|
# Pulse audio configuration files installation
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue