From 57dba6f603a4e9499ce508c91928232e3349fbc9 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Sun, 19 Jan 2014 13:53:55 +0100 Subject: fix dependency problems, add startup script --- package/pulseaudio/files/pulseaudio.init | 32 ++++++++++++++++++++++++++++ package/pulseaudio/files/pulseaudio.postinst | 7 ++++++ 2 files changed, 39 insertions(+) create mode 100644 package/pulseaudio/files/pulseaudio.init create mode 100644 package/pulseaudio/files/pulseaudio.postinst (limited to 'package/pulseaudio/files') diff --git a/package/pulseaudio/files/pulseaudio.init b/package/pulseaudio/files/pulseaudio.init new file mode 100644 index 000000000..029174628 --- /dev/null +++ b/package/pulseaudio/files/pulseaudio.init @@ -0,0 +1,32 @@ +#!/bin/sh +#PKG pulseaudio +#INIT 60 +. /etc/rc.conf + +case $1 in +autostop) ;; +autostart) + test x"${pulseaudio:-NO}" = x"NO" && exit 0 + exec sh $0 start + ;; +start) + if [ ! -d /var/run/pulse ]; then + mkdir -p /var/run/pulse && chown pulse.pulse /var/run/pulse && chmod 750 /var/run/pulse + fi + if [ ! -d /var/lib/pulse ]; then + mkdir -p /var/lib/pulse && chown pulse.pulse /var/lib/pulse && chmod 750 /var/lib/pulse + fi + /usr/bin/pulseaudio $pulseaudio_flags + ;; +stop) + kill $(pgrep -f /usr/bin/pulseaudio) + ;; +restart) + sh $0 stop + sh $0 start + ;; +*) + echo "usage: $0 {start | stop | restart}" + exit 1 +esac +exit $? diff --git a/package/pulseaudio/files/pulseaudio.postinst b/package/pulseaudio/files/pulseaudio.postinst new file mode 100644 index 000000000..3e5b348a9 --- /dev/null +++ b/package/pulseaudio/files/pulseaudio.postinst @@ -0,0 +1,7 @@ +#!/bin/sh +. $IPKG_INSTROOT/etc/functions.sh +add_rcconf pulseaudio pulseaudio NO +gid=$(get_next_gid) +add_user pulse $(get_next_uid) $gid /var/run/pulse +add_group pulse $gid +add_rcconf pulseaudio_flags pulseaudio_flags "--system --disallow-exit --disallow-module-loading --disable-shm --exit-idle-time=-1 --realtime=false" -- cgit v1.2.3 From 98bb4fd81aeb876160e32fbce742598df0eeafcd Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 20 Jan 2014 12:10:40 +0100 Subject: start pulseaudio in daemon mode, create cookie dir, dbus dependency --- package/pulseaudio/files/pulseaudio.init | 4 ++-- package/pulseaudio/files/pulseaudio.postinst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'package/pulseaudio/files') diff --git a/package/pulseaudio/files/pulseaudio.init b/package/pulseaudio/files/pulseaudio.init index 029174628..ca7465105 100644 --- a/package/pulseaudio/files/pulseaudio.init +++ b/package/pulseaudio/files/pulseaudio.init @@ -11,10 +11,10 @@ autostart) ;; start) if [ ! -d /var/run/pulse ]; then - mkdir -p /var/run/pulse && chown pulse.pulse /var/run/pulse && chmod 750 /var/run/pulse + mkdir -p /var/run/pulse/.pulse-cookie && chown -R pulse.pulse /var/run/pulse && chmod 750 /var/run/pulse fi if [ ! -d /var/lib/pulse ]; then - mkdir -p /var/lib/pulse && chown pulse.pulse /var/lib/pulse && chmod 750 /var/lib/pulse + mkdir -p /var/lib/pulse/.pulse-cookie && chown -R pulse.pulse /var/lib/pulse && chmod 750 /var/lib/pulse fi /usr/bin/pulseaudio $pulseaudio_flags ;; diff --git a/package/pulseaudio/files/pulseaudio.postinst b/package/pulseaudio/files/pulseaudio.postinst index 3e5b348a9..b339de93f 100644 --- a/package/pulseaudio/files/pulseaudio.postinst +++ b/package/pulseaudio/files/pulseaudio.postinst @@ -4,4 +4,4 @@ add_rcconf pulseaudio pulseaudio NO gid=$(get_next_gid) add_user pulse $(get_next_uid) $gid /var/run/pulse add_group pulse $gid -add_rcconf pulseaudio_flags pulseaudio_flags "--system --disallow-exit --disallow-module-loading --disable-shm --exit-idle-time=-1 --realtime=false" +add_rcconf pulseaudio_flags pulseaudio_flags "-D --system --disallow-exit --disallow-module-loading --disable-shm --exit-idle-time=-1 --realtime=false" -- cgit v1.2.3 From 67714c4684478fc14a979ee72d81d8f3a90ab41f Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Tue, 21 Jan 2014 08:33:15 +0100 Subject: add dbus configs --- package/pulseaudio/files/pulseaudio.init | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'package/pulseaudio/files') diff --git a/package/pulseaudio/files/pulseaudio.init b/package/pulseaudio/files/pulseaudio.init index ca7465105..f928e3fe6 100644 --- a/package/pulseaudio/files/pulseaudio.init +++ b/package/pulseaudio/files/pulseaudio.init @@ -11,7 +11,7 @@ autostart) ;; start) if [ ! -d /var/run/pulse ]; then - mkdir -p /var/run/pulse/.pulse-cookie && chown -R pulse.pulse /var/run/pulse && chmod 750 /var/run/pulse + mkdir -p /var/run/pulse/ && chown -R pulse.pulse /var/run/pulse && chmod 750 /var/run/pulse fi if [ ! -d /var/lib/pulse ]; then mkdir -p /var/lib/pulse/.pulse-cookie && chown -R pulse.pulse /var/lib/pulse && chmod 750 /var/lib/pulse -- cgit v1.2.3 From e31358b57662bb44613874e6cb5d5569309910af Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Thu, 23 Jan 2014 10:42:59 +0100 Subject: add minimal example configs --- package/pulseaudio/files/client.conf | 2 ++ package/pulseaudio/files/daemon.conf | 26 ++++++++++++++++++++++++++ package/pulseaudio/files/pulseaudio.postinst | 2 +- package/pulseaudio/files/system.pa | 27 +++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 package/pulseaudio/files/client.conf create mode 100644 package/pulseaudio/files/daemon.conf create mode 100644 package/pulseaudio/files/system.pa (limited to 'package/pulseaudio/files') diff --git a/package/pulseaudio/files/client.conf b/package/pulseaudio/files/client.conf new file mode 100644 index 000000000..8e4fa9f29 --- /dev/null +++ b/package/pulseaudio/files/client.conf @@ -0,0 +1,2 @@ +autospawn = no +cookie-file = /var/run/pulse/cookie diff --git a/package/pulseaudio/files/daemon.conf b/package/pulseaudio/files/daemon.conf new file mode 100644 index 000000000..cfb58724d --- /dev/null +++ b/package/pulseaudio/files/daemon.conf @@ -0,0 +1,26 @@ +daemonize = yes +allow-module-loading = no +allow-exit = no +use-pid-file = yes +high-priority = yes +nice-level = -11 +fail = yes +system-instance = yes +enable-shm = no +realtime-scheduling = yes +realtime-priority = 5 +resample-method = src-sinc-fastest +exit-idle-time = -1 +load-default-script-file = yes +default-script-file = /etc/pulse/system.pa +log-target = syslog +log-level = error +log-time = yes +; default-sample-format = s16le +; default-sample-rate = 44100 +; alternate-sample-rate = 48000 +; default-sample-channels = 2 +; default-channel-map = front-left,front-right + +; default-fragments = 4 +; default-fragment-size-msec = 25 diff --git a/package/pulseaudio/files/pulseaudio.postinst b/package/pulseaudio/files/pulseaudio.postinst index b339de93f..0ec666ee5 100644 --- a/package/pulseaudio/files/pulseaudio.postinst +++ b/package/pulseaudio/files/pulseaudio.postinst @@ -4,4 +4,4 @@ add_rcconf pulseaudio pulseaudio NO gid=$(get_next_gid) add_user pulse $(get_next_uid) $gid /var/run/pulse add_group pulse $gid -add_rcconf pulseaudio_flags pulseaudio_flags "-D --system --disallow-exit --disallow-module-loading --disable-shm --exit-idle-time=-1 --realtime=false" +add_rcconf pulseaudio_flags pulseaudio_flags "" diff --git a/package/pulseaudio/files/system.pa b/package/pulseaudio/files/system.pa new file mode 100644 index 000000000..035f4a6db --- /dev/null +++ b/package/pulseaudio/files/system.pa @@ -0,0 +1,27 @@ +#!/usr/bin/pulseaudio -nF + +load-module module-native-protocol-unix + +### Automatically restore the volume of streams and devices +load-module module-stream-restore +load-module module-device-restore + +### Automatically restore the default sink/source when changed by the user +### during runtime +### NOTE: This should be loaded as early as possible so that subsequent modules +### that look up the default sink/source get the right value +load-module module-default-device-restore + +### Automatically move streams to the default sink if the sink they are +### connected to dies, similar for sources +load-module module-rescue-streams + +### Make sure we always have a sink around, even if it is a null sink. +load-module module-always-sink + +### Enable positioned event sounds +load-module module-position-event-sounds + +load-module module-null-sink sink_name=rtp format=s16be channels=2 +load-module module-rtp-send source=rtp.monitor destination=224.0.0.56 + -- cgit v1.2.3