Reverting waits
Waits are still overlapping. Will discuss with Robin for advice on how he wants to manage them. My attempt stopped the over lap but broke the loading.
This commit is contained in:
+2
-2
@@ -2086,8 +2086,8 @@ public:
|
||||
virtual void UpdateServerConfiguration(const JackServerSettings &jackServerSettings,
|
||||
std::function<void(bool success, const std::string &errorMessage)> onComplete)
|
||||
{
|
||||
// Only allow one restart operation at a time.
|
||||
CleanRestartThreads(true);
|
||||
|
||||
|
||||
std::lock_guard guard(restart_mutex);
|
||||
RestartThread *pShutdown = new RestartThread(this, jackServerSettings, onComplete);
|
||||
restartThreads.push_back(pShutdown);
|
||||
|
||||
+4
-54
@@ -1377,31 +1377,6 @@ void PiPedalModel::RestartAudio(bool useDummyAudioDriver)
|
||||
jackServerSettings.UseDummyAudioDevice();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
auto jackConfiguration = this->jackConfiguration;
|
||||
jackConfiguration.AlsaInitialize(jackServerSettings);
|
||||
if (!jackConfiguration.isValid())
|
||||
@@ -2772,31 +2747,6 @@ static bool HasAlsaDevice(const std::vector<AlsaDeviceInfo> devices, const std::
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void PiPedalModel::StartHotspotMonitoring()
|
||||
{
|
||||
this->avahiService = std::make_unique<AvahiService>();
|
||||
@@ -3065,15 +3015,15 @@ void PiPedalModel::OnAlsaDriverTerminatedAbnormally()
|
||||
auto now = clock::now();
|
||||
clock::duration timeSinceLastRetry = now-this->lastRestartTime;
|
||||
this->lastRestartTime = now;
|
||||
if (timeSinceLastRetry > std::chrono::duration_cast<clock::duration>(std::chrono::seconds(6))) {
|
||||
if (timeSinceLastRetry > std::chrono::duration_cast<clock::duration>(std::chrono::milliseconds(1000))) {
|
||||
audioRestartRetries = 0;
|
||||
}
|
||||
CancelAudioRetry();
|
||||
|
||||
if (audioRestartRetries == 0)
|
||||
{
|
||||
this->audioRetryPostHandle = this->PostDelayed(
|
||||
std::chrono::seconds(5),
|
||||
this->audioRetryPostHandle = this->Post(
|
||||
|
||||
// No lock to avoid deadlocks!
|
||||
[this]() {
|
||||
Lv2Log::info("Restarting audio.");
|
||||
@@ -3083,7 +3033,7 @@ void PiPedalModel::OnAlsaDriverTerminatedAbnormally()
|
||||
} else if (audioRestartRetries < 3)
|
||||
{
|
||||
this->audioRetryPostHandle = this->PostDelayed(
|
||||
std::chrono::seconds(5),
|
||||
std::chrono::milliseconds(100 * audioRestartRetries),
|
||||
[this]() {
|
||||
if (closed) {
|
||||
return;
|
||||
|
||||
@@ -473,10 +473,10 @@ const JackServerSettingsDialog = withStyles(
|
||||
super.componentWillUnmount();
|
||||
this.mounted = false;
|
||||
this.stopStatusTimer();
|
||||
if (this.originalJackServerSettings) {
|
||||
this.model.setJackServerSettings(this.originalJackServerSettings);
|
||||
this.originalJackServerSettings = undefined;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
getSelectedDevice(deviceId: string): AlsaDeviceInfo | undefined {
|
||||
@@ -562,9 +562,9 @@ const JackServerSettingsDialog = withStyles(
|
||||
let s = this.state.jackServerSettings.clone();
|
||||
s.valid = true;
|
||||
this.props.onApply(s);
|
||||
// Prevent componentWillUnmount from reverting after the
|
||||
// settings have been saved.
|
||||
this.originalJackServerSettings = undefined;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
handleWarningProceed() {
|
||||
@@ -619,7 +619,7 @@ const JackServerSettingsDialog = withStyles(
|
||||
const handleClose = () => {
|
||||
if (this.originalJackServerSettings) {
|
||||
this.model.setJackServerSettings(this.originalJackServerSettings);
|
||||
this.originalJackServerSettings = undefined;
|
||||
|
||||
}
|
||||
onClose();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user