|
|
|
@@ -393,12 +393,12 @@ int JackAlsaDriver::Write() |
|
|
|
return alsa_driver_write((alsa_driver_t *)fDriver, fEngineControl->fBufferSize); |
|
|
|
} |
|
|
|
|
|
|
|
void JackAlsaDriver::ReadInputAux() |
|
|
|
void JackAlsaDriver::ReadInputAux(jack_nframes_t orig_nframes, snd_pcm_sframes_t contiguous, snd_pcm_sframes_t nread) |
|
|
|
{ |
|
|
|
int chn; |
|
|
|
for (chn = 0; chn < fCaptureChannels; chn++) { |
|
|
|
if (fGraphManager->GetConnectionsNum(fCapturePortList[chn]) > 0) { |
|
|
|
buf = (jack_default_audio_sample_t*)fGraphManager->GetBuffer(fCapturePortList[chn], orig_nframes); |
|
|
|
jack_default_audio_sample_t* buf = (jack_default_audio_sample_t*)fGraphManager->GetBuffer(fCapturePortList[chn], orig_nframes); |
|
|
|
alsa_driver_read_from_channel((alsa_driver_t *)fDriver, chn, buf + nread, contiguous); |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -410,7 +410,7 @@ void JackAlsaDriver::MonitorInputAux() |
|
|
|
for (chn = 0; chn < fCaptureChannels; chn++) { |
|
|
|
JackPort* port = fGraphManager->GetPort(fCapturePortList[chn]); |
|
|
|
if (port->MonitoringInput()) { |
|
|
|
driver->input_monitor_mask |= (1 << chn); |
|
|
|
((alsa_driver_t *)fDriver)->input_monitor_mask |= (1 << chn); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -418,10 +418,10 @@ void JackAlsaDriver::MonitorInputAux() |
|
|
|
void JackAlsaDriver::ClearOutputAux() |
|
|
|
{ |
|
|
|
int chn; |
|
|
|
for (chn = 0; i < fPlaybackChannels; chn++) { |
|
|
|
for (chn = 0; chn < fPlaybackChannels; chn++) { |
|
|
|
jack_default_audio_sample_t* buf = |
|
|
|
(jack_default_audio_sample_t*)fGraphManager->GetBuffer(fPlaybackPortList[chn], fEngineControl->fBufferSize); |
|
|
|
memset (buf, 0, sizeof (jack_default_audio_sample_t) * fEngineControl->fBufferSize); |
|
|
|
memset(buf, 0, sizeof (jack_default_audio_sample_t) * fEngineControl->fBufferSize); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@@ -430,22 +430,19 @@ void JackAlsaDriver::SetTimetAux(jack_time_t time) |
|
|
|
fBeginDateUst = time; |
|
|
|
} |
|
|
|
|
|
|
|
void JackAlsaDriver::WriteOutputAux() |
|
|
|
void JackAlsaDriver::WriteOutputAux(jack_nframes_t orig_nframes, snd_pcm_sframes_t contiguous, snd_pcm_sframes_t nwritten) |
|
|
|
{ |
|
|
|
int chn; |
|
|
|
jack_default_audio_sample_t* buf; |
|
|
|
snd_pcm_sframes_t nwritten; |
|
|
|
snd_pcm_sframes_t contiguous; |
|
|
|
snd_pcm_uframes_t offset; |
|
|
|
|
|
|
|
|
|
|
|
for (chn = 0; chn < fPlaybackChannels; chn++) { |
|
|
|
// Ouput ports |
|
|
|
if (fGraphManager->GetConnectionsNum(fPlaybackPortList[chn]) > 0) { |
|
|
|
buf = (jack_default_audio_sample_t*)fGraphManager->GetBuffer(fPlaybackPortList[chn], orig_nframes); |
|
|
|
alsa_driver_write_to_channel(driver, chn, buf + nwritten, contiguous); |
|
|
|
alsa_driver_write_to_channel(((alsa_driver_t *)fDriver), chn, buf + nwritten, contiguous); |
|
|
|
// Monitor ports |
|
|
|
if (fWithMonitorPorts && fGraphManager->GetConnectionsNum(fMonitorPortList[chn]) > 0) { |
|
|
|
monbuf = (jack_default_audio_sample_t*)fGraphManager->GetBuffer(fMonitorPortList[chn], orig_nframes); |
|
|
|
jack_default_audio_sample_t* monbuf = (jack_default_audio_sample_t*)fGraphManager->GetBuffer(fMonitorPortList[chn], orig_nframes); |
|
|
|
memcpy(monbuf + nwritten, buf + nwritten, contiguous * sizeof(jack_default_audio_sample_t)); |
|
|
|
} |
|
|
|
} |
|
|
|
@@ -755,6 +752,7 @@ dither_opt (char c, DitherAlgorithm* dither) |
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
SERVER_EXPORT const jack_driver_desc_t* driver_get_descriptor () |
|
|
|
{ |
|
|
|
jack_driver_desc_t * desc; |
|
|
|
@@ -933,6 +931,7 @@ SERVER_EXPORT const jack_driver_desc_t* driver_get_descriptor () |
|
|
|
desc->params = params; |
|
|
|
return desc; |
|
|
|
} |
|
|
|
*/ |
|
|
|
|
|
|
|
static Jack::JackAlsaDriver* g_alsa_driver; |
|
|
|
|
|
|
|
@@ -1065,7 +1064,7 @@ SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLocke |
|
|
|
g_alsa_driver = new Jack::JackAlsaDriver("system", "alsa_pcm", engine, table); |
|
|
|
Jack::JackDriverClientInterface* threaded_driver = new Jack::JackThreadedDriver(g_alsa_driver); |
|
|
|
// Special open for ALSA driver... |
|
|
|
if (alsa_driver->Open(frames_per_interrupt, user_nperiods, srate, hw_monitoring, hw_metering, capture, playback, dither, soft_mode, monitor, |
|
|
|
if (g_alsa_driver->Open(frames_per_interrupt, user_nperiods, srate, hw_monitoring, hw_metering, capture, playback, dither, soft_mode, monitor, |
|
|
|
user_capture_nchnls, user_playback_nchnls, shorts_first, capture_pcm_name, playback_pcm_name, |
|
|
|
systemic_input_latency, systemic_output_latency, midi_driver) == 0) { |
|
|
|
return threaded_driver; |
|
|
|
@@ -1077,9 +1076,9 @@ SERVER_EXPORT Jack::JackDriverClientInterface* driver_initialize(Jack::JackLocke |
|
|
|
|
|
|
|
// Code to be used in alsa_driver.c |
|
|
|
|
|
|
|
void ReadInput(); |
|
|
|
void ReadInput(jack_nframes_t orig_nframes, snd_pcm_sframes_t contiguous, snd_pcm_sframes_t nread) |
|
|
|
{ |
|
|
|
g_alsa_driver->ReadInputAux(); |
|
|
|
g_alsa_driver->ReadInputAux(orig_nframes, contiguous, nread); |
|
|
|
} |
|
|
|
void MonitorInput() |
|
|
|
{ |
|
|
|
@@ -1089,9 +1088,9 @@ void ClearOutput() |
|
|
|
{ |
|
|
|
g_alsa_driver->ClearOutputAux(); |
|
|
|
} |
|
|
|
void WriteOutput() |
|
|
|
void WriteOutput(jack_nframes_t orig_nframes, snd_pcm_sframes_t contiguous, snd_pcm_sframes_t nwritten) |
|
|
|
{ |
|
|
|
g_alsa_driver->WriteOutputAux(); |
|
|
|
g_alsa_driver->WriteOutputAux(orig_nframes, contiguous, nwritten); |
|
|
|
} |
|
|
|
void SetTimet(jack_time_t time) |
|
|
|
{ |
|
|
|
|