Browse Source

Correct Alsa driver

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1536 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.65
sletz 17 years ago
parent
commit
137db10dad
3 changed files with 23 additions and 21 deletions
  1. +7
    -7
      common/JackAudioDriver.cpp
  2. +2
    -2
      common/JackRequest.h
  3. +14
    -12
      linux/alsa/JackAlsaDriver.cpp

+ 7
- 7
common/JackAudioDriver.cpp View File

@@ -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");


+ 2
- 2
common/JackRequest.h View File

@@ -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;

}


+ 14
- 12
linux/alsa/JackAlsaDriver.cpp View File

@@ -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;


Loading…
Cancel
Save