alsa + dummy backend, proper [re]initialization
This commit is contained in:
parent
1c87f6adec
commit
d7fc573cb8
@ -475,6 +475,9 @@ AlsaAudioBackend::_start (bool for_latency_measurement)
|
||||
return -1;
|
||||
}
|
||||
|
||||
engine.sample_rate_change (_samplerate);
|
||||
engine.buffer_size_change (_samples_per_period);
|
||||
|
||||
if (engine.reestablish_ports ()) {
|
||||
PBD::error << _("AlsaAudioBackend: Could not re-establish ports.") << endmsg;
|
||||
delete _pcmi; _pcmi = 0;
|
||||
@ -482,7 +485,6 @@ AlsaAudioBackend::_start (bool for_latency_measurement)
|
||||
return -1;
|
||||
}
|
||||
|
||||
engine.buffer_size_change (_samples_per_period);
|
||||
engine.reconnect_ports ();
|
||||
_run = true;
|
||||
|
||||
@ -1284,6 +1286,8 @@ AlsaAudioBackend::main_process_thread ()
|
||||
_pcmi->pcm_start ();
|
||||
int no_proc_errors = 0;
|
||||
|
||||
manager.graph_order_callback();
|
||||
|
||||
while (_run) {
|
||||
long nr;
|
||||
bool xrun = false;
|
||||
|
@ -311,13 +311,15 @@ DummyAudioBackend::_start (bool /*for_latency_measurement*/)
|
||||
return -1;
|
||||
}
|
||||
|
||||
engine.sample_rate_change (_samplerate);
|
||||
engine.buffer_size_change (_samples_per_period);
|
||||
|
||||
if (engine.reestablish_ports ()) {
|
||||
PBD::error << _("DummyAudioBackend: Could not re-establish ports.") << endmsg;
|
||||
stop ();
|
||||
return -1;
|
||||
}
|
||||
|
||||
engine.buffer_size_change (_samples_per_period);
|
||||
engine.reconnect_ports ();
|
||||
|
||||
if (pthread_create (&_main_thread, NULL, pthread_process, this)) {
|
||||
@ -1004,6 +1006,8 @@ DummyAudioBackend::main_process_thread ()
|
||||
_running = true;
|
||||
_processed_samples = 0;
|
||||
|
||||
manager.graph_order_callback();
|
||||
|
||||
uint64_t clock1, clock2;
|
||||
clock1 = g_get_monotonic_time();
|
||||
while (_running) {
|
||||
|
Loading…
Reference in New Issue
Block a user