OBS User unknown 2008-11-28 14:53:14 +00:00 committed by Git OBS Bridge
parent 0168d8f9d8
commit b6da101d4d
3 changed files with 33 additions and 54 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Mon Nov 24 11:42:43 CET 2008 - rodrigo@novell.com
- Use /etc/alsa-pulse.conf for ALSA when enabling PulseAudio, as we
already do in GNOME, instead of touching /etc/alsa.conf
- Don't run the script if user is not root (bnc#445997)
-------------------------------------------------------------------
Wed Nov 19 13:14:25 CET 2008 - rodrigo@novell.com

View File

@ -22,7 +22,7 @@ Name: pulseaudio
%define drvver 0.9
Summary: A Networked Sound Server
Version: 0.9.12
Release: 8
Release: 9
License: GPL v2 or later; LGPL v2.1 or later
Group: System/Sound Daemons
Source: %{name}-%{version}.tar.bz2
@ -548,6 +548,10 @@ groupadd -r pulse-access &>/dev/null || :
%{_mandir}/man1/pax11publish.1.gz
%changelog
* Mon Nov 24 2008 rodrigo@novell.com
- Use /etc/alsa-pulse.conf for ALSA when enabling PulseAudio, as we
already do in GNOME, instead of touching /etc/alsa.conf
- Don't run the script if user is not root (bnc#445997)
* Wed Nov 19 2008 rodrigo@novell.com
- Some fixes in setup-pulseaudio script (bnc#445015)
* Wed Nov 19 2008 rodrigo@novell.com

View File

@ -9,60 +9,27 @@ show_help() {
echo " --enable Enables PulseAudio"
echo " --disable Disables PulseAudio"
echo " --status Shows activation state (disabled or enabled) for PulseAudio"
echo ""
echo "You need to be root for this command to succeed"
exit
}
check_root() {
id=`id -u`
if [ "x$id" = "x0" ]; then
true
else
echo "You need to be root in order to enable/disable pulseaudio"
false
fi
}
enable_alsa() {
echo "Enabling PulseAudio for ALSA..."
# Add PCM PA device
if test -f /etc/asound.conf; then
if grep pcm.pulse /etc/asound.conf; then
echo "pcm.pulse device already in /etc/asound.conf"
else
echo "" >> /etc/asound.conf
echo "pcm.pulse {" >> /etc/asound.conf
echo " type pulse" >> /etc/asound.conf
echo "}" >> /etc/asound.conf
fi
# Add CTL PA device
if grep ctl.pulse /etc/asound.conf; then
echo "ctl.pulse device already in /etc/asound.conf"
else
echo "" >> /etc/asound.conf
echo "ctl.pulse {" >> /etc/asound.conf
echo " type pulse" >> /etc/asound.conf
echo "}" >> /etc/asound.conf
fi
if grep "ALSA_CONFIG_PATH" /etc/environment; then
echo "PulseAudio config for ALSA already in use"
else
echo "" >> /etc/asound.conf
echo "pcm.pulse {" >> /etc/asound.conf
echo " type pulse" >> /etc/asound.conf
echo "}" >> /etc/asound.conf
echo "" >> /etc/asound.conf
echo "ctl.pulse {" >> /etc/asound.conf
echo " type pulse" >> /etc/asound.conf
echo "}" >> /etc/asound.conf
fi
# Now set the default devices
if grep "pcm.!default" /etc/asound.conf; then
echo ""
else
echo "" >> /etc/asound.conf
echo "pcm.!default {" >> /etc/asound.conf
echo " type pulse" >> /etc/asound.conf
echo "}" >> /etc/asound.conf
fi
if grep "ctl.!default" /etc/asound.conf; then
echo ""
else
echo "" >> /etc/asound.conf
echo "ctl.!default {" >> /etc/asound.conf
echo " type pulse" >> /etc/asound.conf
echo "}" >> /etc/asound.conf
echo "ALSA_CONFIG_PATH=/etc/alsa-pulse.conf" >> /etc/environment
fi
}
@ -116,7 +83,7 @@ enable_sdl() {
echo "Enabling PulseAudio for SDL..."
# For SDL, we just add an environment variable, so that apps use the PA audio driver
if grep SDL_AUDIODRIVER /etc/environment; then
sed s/SDL_AUDIODRIVER*/SDL_AUDIODRIVER=pulse /etc/environment
echo "SDL already setup to use PulseAudio"
else
echo "SDL_AUDIODRIVER=pulse" >> /etc/environment
fi
@ -140,8 +107,7 @@ enable_xine() {
disable_alsa() {
echo "Disabling PulseAudio for ALSA..."
# FIXME: perl -pi -e ...
echo ""
perl -pi -e "s|ALSA_CONFIG_PATH=/etc/alsa-pulse.conf||g;" /etc/environment
}
disable_libao() {
@ -174,7 +140,7 @@ disable_oss() {
disable_sdl() {
echo "Disabling PulseAudio for SDL..."
if grep "SDL_AUDIODRIVER=pulse" /etc/environment; then
sed s/SDL_AUDIODRIVER=pulse// /etc/environment
perl -pi -e "s|SDL_AUDIODRIVER=pulse||g;" /etc/environment
fi
}
@ -191,6 +157,7 @@ disable_xine() {
case $1 in
--enable)
check_root || exit
ENABLE=1
enable_alsa
enable_libao
@ -202,6 +169,7 @@ case $1 in
enable_xine
;;
--disable)
check_root || exit
ENABLE=0
disable_alsa
disable_libao
@ -241,4 +209,4 @@ else
fi
fi
/sbin/SuSEconfig
/sbin/SuSEconfig