Send fixed number of samples when no output stream (not correct for asynch)

This commit is contained in:
Ed Clarke
2018-10-31 14:45:16 +00:00
parent 90d1a60595
commit c352a08c55
2 changed files with 8 additions and 4 deletions

View File

@@ -63,19 +63,21 @@ void AudioHub(server i2s_frame_callback_if i2s,
for (int i = 0; i < n_chans; i++) out_samps[i] = samples_out[i];
break;
//Exchange samples with mics & host
case i2s.restart_check() -> i2s_restart_t restart:
restart = I2S_NO_RESTART; // Keep on looping
timer tmr; int t0, t1; tmr :> t0;
for (int i = 0; i < NUM_USB_CHAN_OUT; i++) c_audio :> samples_out[i];
for (int i = 0; i < NUM_USB_CHAN_IN; i++) c_audio <: raw_mics[i];
//tmr :> t1; debug_printf("%d\n", t1 - t0);
//delay_microseconds(15); //Test backpressure tolerance
//Grab mics
current = mic_array_get_next_time_domain_frame(c_ds_output, decimatorCount, buffer, mic_audio_frame, dc);
unsafe {
raw_mics[0] = current->data[0][0];
raw_mics[1] = current->data[1][0];
}
//tmr :> t1; debug_printf("%d\n", t1 - t0);
delay_microseconds(15); //Test backpressure tolerance
break;
}
}