Permalink
Browse files

Merge branch 'master' of github.com:pcbsd/pcbsd

  • Loading branch information...
2 parents f5ad808 + 25ff000 commit 68b1db6e515ff3347ef837309027fc8ba8380581 Ken Moore committed Mar 5, 2014
Binary file not shown.
@@ -78,6 +78,11 @@ void sndDialog::slotSave()
QString tmp;
tmp.setNum(comboSound->currentIndex());
system("sysctl hw.snd.default_unit=" + tmp.toLatin1());
+
+ // Try to set the default pulseaudio sink as well
+ QString username = QString::fromLocal8Bit(getenv("LOGNAME"));
+ system("su " + username.toLatin1() + " -c \"pactl set-default-sink " + tmp.toLatin1() + "\"");
+
pcbsd::Utils::setConfFileValue( "/etc/sysctl.conf", "hw.snd.default_unit=", "hw.snd.default_unit=" + tmp );
refreshDevices();
}
@@ -81,6 +81,12 @@ set_new_dev()
# make new device the default one
sysctl hw.snd.default_unit=$mixerNum
+ # Look for pulseaudio daemons to change audio sinks on
+ for user in `ps -auwwx | grep 'pulseaudio --start' | grep -v 'grep' | awk '{print $1}'`
+ do
+ su $user -c "pactl set-default-sink $mixerNum"
+ done
+
}
# Update device based upon action

0 comments on commit 68b1db6

Please sign in to comment.