diff --git a/common/JackAudioDriver.cpp b/common/JackAudioDriver.cpp index 94fd9bcb..b99cb492 100644 --- a/common/JackAudioDriver.cpp +++ b/common/JackAudioDriver.cpp @@ -5,11 +5,11 @@ Copyright (C) 2004-2006 Grame This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +(at your option) any later version. + GNU General Public License for more details. You should have received a copy of the GNU General Public License @@ -90,8 +90,8 @@ int JackAudioDriver::Attach() jack_error("driver: cannot register port for %s", buf); return -1; } - port = fGraphManager->GetPort(port_index); - port->Rename("system:capture_%d", i + 1); + port = fGraphManager->GetPort(port_index); + port->Rename("system:capture_%d", i + 1); port->SetLatency(fEngineControl->fBufferSize + fCaptureLatency); fCapturePortList[i] = port_index; JackLog("JackAudioDriver::Attach fCapturePortList[i] %ld = \n", port_index); @@ -105,12 +105,12 @@ int JackAudioDriver::Attach() jack_error("driver: cannot register port for %s", buf); return -1; } - port = fGraphManager->GetPort(port_index); - port->Rename("system:playback_%d", i + 1); + port = fGraphManager->GetPort(port_index); + port->Rename("system:playback_%d", i + 1); port->SetLatency(fEngineControl->fBufferSize + fPlaybackLatency); fPlaybackPortList[i] = port_index; JackLog("JackAudioDriver::Attach fPlaybackPortList[i] %ld = \n", port_index); - + // Monitor ports if (fWithMonitorPorts) { JackLog("Create monitor port \n"); diff --git a/common/JackRequest.h b/common/JackRequest.h index 2dd1d0f5..d94f7fed 100644 --- a/common/JackRequest.h +++ b/common/JackRequest.h @@ -124,7 +124,7 @@ struct JackClientCheckRequest : public JackRequest { char fName[JACK_CLIENT_NAME_SIZE + 1]; - int fOptions; + int fOptions; JackClientCheckRequest() {} @@ -453,7 +453,7 @@ struct JackPortConnectNameRequest : public JackRequest { CheckRes(trans->Read(&fRefNum, sizeof(int))); CheckRes(trans->Read(&fSrc, JACK_PORT_NAME_SIZE + 1)); - CheckRes(trans->Read(&fDst,JACK_PORT_NAME_SIZE + 1)); + CheckRes(trans->Read(&fDst, JACK_PORT_NAME_SIZE + 1)); return 0; } diff --git a/linux/alsa/JackAlsaDriver.cpp b/linux/alsa/JackAlsaDriver.cpp index 74bf7cdd..6cf59ddb 100644 --- a/linux/alsa/JackAlsaDriver.cpp +++ b/linux/alsa/JackAlsaDriver.cpp @@ -2081,7 +2081,7 @@ int JackAlsaDriver::Attach() assert(fCaptureChannels < PORT_NUM); assert(fPlaybackChannels < PORT_NUM); - alsa_driver_t* alsa_driver = (alsa_driver_t*)fDriver; + alsa_driver_t* alsa_driver = (alsa_driver_t*)fDriver; JackLog("JackAudioDriver::Attach fBufferSize %ld fSampleRate %ld\n", fEngineControl->fBufferSize, fEngineControl->fSampleRate); @@ -2092,6 +2092,7 @@ int JackAlsaDriver::Attach() return -1; } port = fGraphManager->GetPort(port_index); + port->Rename("system:capture_%d", i + 1); port->SetLatency(alsa_driver->frames_per_cycle + alsa_driver->capture_frame_latency); fCapturePortList[i] = port_index; JackLog("JackAudioDriver::Attach fCapturePortList[i] %ld \n", port_index); @@ -2106,22 +2107,23 @@ int JackAlsaDriver::Attach() return -1; } port = fGraphManager->GetPort(port_index); + port->Rename("system:playback_%d", i + 1); port->SetLatency((alsa_driver->frames_per_cycle * (alsa_driver->user_nperiods - 1)) + alsa_driver->playback_frame_latency); fPlaybackPortList[i] = port_index; JackLog("JackAudioDriver::Attach fPlaybackPortList[i] %ld \n", port_index); - // Monitor ports - if (fWithMonitorPorts) { - JackLog("Create monitor port \n"); - snprintf(buf, sizeof(buf) - 1, "%s:monitor_%lu",fClientControl->fName, i + 1); - if ((port_index = fGraphManager->AllocatePort(fClientControl->fRefNum, buf, JackPortIsOutput)) == NO_PORT) { - jack_error ("ALSA: cannot register monitor port for %s", buf); - } else { - port = fGraphManager->GetPort(port_index); - port->SetLatency(alsa_driver->frames_per_cycle); - fMonitorPortList[i] = port_index; - } + // Monitor ports + if (fWithMonitorPorts) { + JackLog("Create monitor port \n"); + snprintf(buf, sizeof(buf) - 1, "%s:monitor_%lu",fClientControl->fName, i + 1); + if ((port_index = fGraphManager->AllocatePort(fClientControl->fRefNum, buf, JackPortIsOutput)) == NO_PORT) { + jack_error ("ALSA: cannot register monitor port for %s", buf); + } else { + port = fGraphManager->GetPort(port_index); + port->SetLatency(alsa_driver->frames_per_cycle); + fMonitorPortList[i] = port_index; } + } } return 0;