#!/bin/sh # First argument of this script is the package name # Reading system configuration informations, functions and package versions. source ../sysinfos source ../functions source ../packages-list CUR_DIR=$(pwd) # Applying patches (if any) apply_patches ${1} && hv_groupadd pulse && hv_groupadd pulse-access && hv_useradd -g pulse -d /var/run/pulse pulse && gpasswd -a hugo pulse-access # Il faut ajouter l'usager pulse au groupe audio. gpasswd -a pulse audio cd ${LFS_TMP}/${1}-build && ../${1}/configure \ --prefix=/usr \ --sysconfdir=/etc \ --localstatedir=/var && # Workaround pour éliminer les messages de warning # reliés à SHM... sed -i -e "s!\(#define HAVE_SHM_OPEN 1\)!/* \1 */!g" config.h && make && make install && ldconfig && cat > /etc/pulse/daemon.conf << "EOF" && ## Extra verbositiy verbose = debug ## Daemonize after startup daemonize = 1 ## Quit if startup fails fail = 1 ## Renice the daemon to level -15 and try to get SCHED_FIFO ## scheduling. This a good idea if you hear annyoing noise in the ## playback. However, this is a certain security issue, since it works ## when called SUID root only. root is dropped immediately after gaining ## the nice level and SCHED_FIFO scheduling on startup. high-priority = 1 ## The resampling algorithm to use. Use one of src-sinc-best-quality, ## src-sinc-medium-quality, src-sinc-fastest, src-zero-order-hold, ## src-linear, trivial. See the documentation of libsamplerate for an ## explanation for the different methods. The method 'trivial' is the ## only algorithm implemented without usage of floating point ## numbers. If you're tight on CPU consider using this. On the other ## hand it has the worst quality of all. resample-method = src-sinc-best-quality ## Create a PID file in /tmp/pulseaudio-$USER/pid. Of this is enabled ## you may use commands like "pulseaudio --kill" or "pulseaudio ## --check". If you are planning to start more than one pulseaudio ## process per user, you better disable this option since it ## effectively disables multiple instances. use-pid-file = 1 ## Do not install the CPU load limit, even on platforms where it is ## supported. This option is useful when debugging/profiling ## PulseAudio to disable disturbing SIGXCPU signals. no-cpu-limit = 1 ## Run the daemon as system-wide instance, requires root priviliges system-instance = 1 ## Disable shared memory data transfer disable-shm = 1 EOF cat > /etc/pulse/default.pa << "EOF" && #!/usr/bin/pulseaudio -nF # ---------------- # SOURCE | PulseAudio | SINK # --------->| |---------> # ALSA | Daemon | EsounD # ---------------- # # SOURCE: Application -> Alsa -> PulseAudio load-module module-alsa-source device=default # SINK: PulseAudio -> Network load-module module-esound-sink server=via:16001 # Network protocols load-module module-esound-protocol-unix auth-anonymous=1 # The native protocol is used for communications between # ALSA and PulseAudio. load-module module-native-protocol-unix auth-anonymous=1 # Automatically restore the volume of playback streams load-module module-volume-restore # Automatically move streams to the default sink if the sink they are # connected to dies, similar for sources load-module module-rescue-streams EOF install -v -m740 ${CUR_DIR}/bootscripts/pulseaudio /etc/rc.d/init.d && # script-name start stop bootscript_add_rc3 pulseaudio 95 16 # Return last error exit $?