+void MainWindow::slotDetectAudioDriver()
+{
+ //decide which audio driver is really best, in some cases SDL is wrong
+ if (KdenliveSettings::audiodrivername().isEmpty()) {
+ QString driver;
+ KProcess readProcess;
+ //PulseAudio needs to be selected if it exists, the ALSA pulse pcm device is not fast enough.
+ if (!KStandardDirs::findExe("pactl").isEmpty()) {
+ readProcess.setOutputChannelMode(KProcess::OnlyStdoutChannel);
+ readProcess.setProgram("pactl", QStringList() << "stat");
+ readProcess.execute(2000); // Kill it after 2 seconds
+
+ QString result = QString(readProcess.readAllStandardOutput());
+ kDebug() << "// / / / / / READING PACTL: ";
+ kDebug() << result;
+ if (!result.isEmpty()) {
+ driver = "pulse";
+ kDebug() << "// / / / / PULSEAUDIO DETECTED";
+ }
+ }
+ //put others here
+ KdenliveSettings::setAutoaudiodrivername(driver);
+ }
+}
+