diff options
Diffstat (limited to 'perl-install/harddrake/sound.pm')
-rw-r--r-- | perl-install/harddrake/sound.pm | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/perl-install/harddrake/sound.pm b/perl-install/harddrake/sound.pm index d06dd708d..8b6efeb5c 100644 --- a/perl-install/harddrake/sound.pm +++ b/perl-install/harddrake/sound.pm @@ -190,6 +190,10 @@ sub set_pulseaudio { my ($val) = @_; my $alterative = '/etc/sound/profiles/' . ($val ? 'pulse' : 'alsa'); + if ( ! -d $alterative ) { + return; + } + common::symlinkf_update_alternatives('soundprofile', $alterative); # (cg) This config file will eventually be dropped, but it is still needed for now @@ -216,6 +220,11 @@ sub is_pulseaudio_glitchfree_enabled() { sub set_pulseaudio_glitchfree { my ($val) = @_; + + if ( ! -f $pa_defaultsconfig_file ) { + return; + } + substInFile { if ($val) { s/^(load-module\s+module-(udev|hal)-detect)\s+tsched=0/$1/; @@ -229,6 +238,11 @@ my $pa_client_conffile = "$::prefix/etc/pulse/client.conf"; sub set_PA_autospan { my ($val) = @_; + + if ( ! -f $pa_client_conffile ) { + return; + } + $val = 'autospawn = ' . bool2yesno($val) . "\n"; my $done; substInFile { @@ -298,6 +312,7 @@ sub switch { push @alternative, $driver; my %des = modules::category2modules_and_description('multimedia/sound'); + my $is_pulseaudio_installed = ( -f $pa_defaultsconfig_file && -f $pa_client_conffile && -d '/etc/sound/profiles/pulse' ); my $is_pulseaudio_enabled = is_pulseaudio_enabled(); my $is_pulseaudio_glitchfree_enabled = is_pulseaudio_glitchfree_enabled(); @@ -323,11 +338,12 @@ sub switch { { text => N("Enable PulseAudio"), type => 'bool', val => \$is_pulseaudio_enabled, + disabled => sub { !$is_pulseaudio_installed }, }, { text => N("Use Glitch-Free mode"), type => 'bool', val => \$is_pulseaudio_glitchfree_enabled, - disabled => sub { !$is_pulseaudio_enabled }, + disabled => sub { !$is_pulseaudio_installed || !$is_pulseaudio_enabled }, }, { advanced => 1, |