summaryrefslogtreecommitdiffstats
path: root/perl-install/harddrake
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2009-04-14 15:26:27 +0000
committerThierry Vignaud <tv@mandriva.org>2009-04-14 15:26:27 +0000
commit6c2f639c921e860f1c357f9966c3b3ca89838166 (patch)
tree3ea49ec5fb6de0959a23642fe743a19748a541bf /perl-install/harddrake
parentf037800bf205284de4572a36bfa025559b4c682c (diff)
downloaddrakx-backup-do-not-use-6c2f639c921e860f1c357f9966c3b3ca89838166.tar
drakx-backup-do-not-use-6c2f639c921e860f1c357f9966c3b3ca89838166.tar.gz
drakx-backup-do-not-use-6c2f639c921e860f1c357f9966c3b3ca89838166.tar.bz2
drakx-backup-do-not-use-6c2f639c921e860f1c357f9966c3b3ca89838166.tar.xz
drakx-backup-do-not-use-6c2f639c921e860f1c357f9966c3b3ca89838166.zip
(is_pulseaudio_glitchfree_enabled,set_pulseaudio_glitchfree) enable to enable/disable glitch-free feature of PA
Diffstat (limited to 'perl-install/harddrake')
-rw-r--r--perl-install/harddrake/sound.pm28
1 files changed, 28 insertions, 0 deletions
diff --git a/perl-install/harddrake/sound.pm b/perl-install/harddrake/sound.pm
index f237c8eab..d0ecbc24d 100644
--- a/perl-install/harddrake/sound.pm
+++ b/perl-install/harddrake/sound.pm
@@ -241,6 +241,27 @@ sub set_pulseaudio_routing {
}
+my $pa_defaultsconfig_file = "$::prefix/etc/pulse/default.pa";
+
+sub is_pulseaudio_glitchfree_enabled() {
+ return -f $pa_defaultsconfig_file &&
+ cat_($pa_defaultsconfig_file) !~ /^load-module\s+module-hal-detect\s+tsched=0/m;
+}
+
+sub set_pulseaudio_glitchfree {
+ my ($val) = @_;
+ my $string = "load-module module-hal-detect tsched=0\n";
+ substInFile {
+ if (/^load-module\s*module-hal-detect/) {
+ if ($val) {
+ s/\s*tsched=0//;
+ } else {
+ $_ = $string;
+ }
+ }
+ } $pa_defaultsconfig_file;
+}
+
my $pa_client_conffile = "$::prefix/etc/pulse/client.conf";
sub set_PA_autospan {
@@ -335,6 +356,7 @@ sub switch {
my $is_pulseaudio_enabled = is_pulseaudio_enabled();
my $is_pulseaudio_routing_enabled = is_pulseaudio_routing_enabled();
+ my $is_pulseaudio_glitchfree_enabled = is_pulseaudio_glitchfree_enabled();
my $is_5_1_in_pulseaudio_enabled = is_5_1_in_pulseaudio_enabled();
my $is_user_switching = is_user_switching_enabled();
@@ -343,6 +365,7 @@ sub switch {
my $write_config = sub {
set_pulseaudio($is_pulseaudio_enabled);
set_pulseaudio_routing($is_pulseaudio_enabled && $is_pulseaudio_routing_enabled);
+ set_pulseaudio_glitchfree($is_pulseaudio_glitchfree_enabled);
set_PA_autospan($is_pulseaudio_enabled);
set_5_1_in_pulseaudio($is_5_1_in_pulseaudio_enabled);
set_user_switching($is_user_switching);
@@ -378,6 +401,11 @@ sub switch {
type => 'bool', val => \$is_user_switching,
},
{
+ text => N("Use Glitch-Free mode"),
+ type => 'bool', val => \$is_pulseaudio_glitchfree_enabled,
+ disabled => sub { !$is_pulseaudio_enabled },
+ },
+ {
advanced => 1,
val => N("Reset sound mixer to default values"),
clicked => sub { run_program::run('reset_sound') }