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