git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2298 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.90
@@ -20,6 +20,10 @@ Fernando Lopez-Lezcano | |||||
Jackdmp changes log | Jackdmp changes log | ||||
--------------------------- | --------------------------- | ||||
2008-05-21 Stephane Letz <letz@grame.fr> | |||||
* Correct JackEngine::PortUnRegister, JackEngine::ClientCloseAux and JackEngine::ClientDeactivate to correctly send notifications. | |||||
2008-05-20 Stephane Letz <letz@grame.fr> | 2008-05-20 Stephane Letz <letz@grame.fr> | ||||
* Package number bumped to 1.90 everywhere. | * Package number bumped to 1.90 everywhere. | ||||
@@ -28,7 +32,6 @@ Fernando Lopez-Lezcano | |||||
2008-05-19 Stephane Letz <letz@grame.fr> | 2008-05-19 Stephane Letz <letz@grame.fr> | ||||
* Use of placement new for dynamic port allocation is possibly not safe... so avoid that until a definitive answer is found. | * Use of placement new for dynamic port allocation is possibly not safe... so avoid that until a definitive answer is found. | ||||
* Cleanup. | |||||
* JackAudioDriver::ProcessAsync and JackAudioDriver::ProcessSync were broken at some point : 0 has to be returned in all cases. | * JackAudioDriver::ProcessAsync and JackAudioDriver::ProcessSync were broken at some point : 0 has to be returned in all cases. | ||||
2008-05-16 Stephane Letz <letz@grame.fr> | 2008-05-16 Stephane Letz <letz@grame.fr> | ||||
@@ -279,16 +279,14 @@ int JackClient::Deactivate() | |||||
GetClientControl()->fTransportSync = false; | GetClientControl()->fTransportSync = false; | ||||
GetClientControl()->fTransportTimebase = false; | GetClientControl()->fTransportTimebase = false; | ||||
// We need to wait for the new engine cycle before stopping the RT thread, but this is done by ClientDeactivate | |||||
int result = -1; | int result = -1; | ||||
fChannel->ClientDeactivate(GetClientControl()->fRefNum, &result); | fChannel->ClientDeactivate(GetClientControl()->fRefNum, &result); | ||||
jack_log("JackClient::Deactivate res = %ld ", result); | |||||
// We need to wait for the new engine cycle before stopping the RT thread, but this is done by ClientDeactivate | |||||
jack_log("JackClient::Deactivate res = %ld", result); | |||||
// RT thread is stopped only when needed... | // RT thread is stopped only when needed... | ||||
if (IsRealTime()) { | |||||
if (IsRealTime()) | |||||
fThread->Kill(); | fThread->Kill(); | ||||
} | |||||
return result; | return result; | ||||
} | } | ||||
@@ -560,22 +560,22 @@ int JackEngine::ClientCloseAux(int refnum, JackClientInterface* client, bool wai | |||||
refnum, | refnum, | ||||
(client->GetClientControl()) ? client->GetClientControl()->fName : "No name"); | (client->GetClientControl()) ? client->GetClientControl()->fName : "No name"); | ||||
// Remove the client from the table | |||||
ReleaseRefnum(refnum); | |||||
// Notify unregister | |||||
// Unregister all ports ==> notifications are sent | |||||
jack_int_t ports[PORT_NUM_FOR_CLIENT]; | jack_int_t ports[PORT_NUM_FOR_CLIENT]; | ||||
int i; | int i; | ||||
fGraphManager->GetInputPorts(refnum, ports); | fGraphManager->GetInputPorts(refnum, ports); | ||||
for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) { | for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) { | ||||
NotifyPortRegistation(ports[i], false); | |||||
PortUnRegister(refnum, ports[i]); | |||||
} | } | ||||
fGraphManager->GetOutputPorts(refnum, ports); | fGraphManager->GetOutputPorts(refnum, ports); | ||||
for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) { | for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) { | ||||
NotifyPortRegistation(ports[i], false); | |||||
PortUnRegister(refnum, ports[i]); | |||||
} | } | ||||
// Remove the client from the table | |||||
ReleaseRefnum(refnum); | |||||
// Remove all ports | // Remove all ports | ||||
fGraphManager->RemoveAllPorts(refnum); | fGraphManager->RemoveAllPorts(refnum); | ||||
@@ -624,6 +624,21 @@ int JackEngine::ClientDeactivate(int refnum) | |||||
return -1; | return -1; | ||||
jack_log("JackEngine::ClientDeactivate ref = %ld name = %s", refnum, client->GetClientControl()->fName); | jack_log("JackEngine::ClientDeactivate ref = %ld name = %s", refnum, client->GetClientControl()->fName); | ||||
// Disconnect all ports ==> notifications are sent | |||||
jack_int_t ports[PORT_NUM_FOR_CLIENT]; | |||||
int i; | |||||
fGraphManager->GetInputPorts(refnum, ports); | |||||
for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) { | |||||
PortDisconnect(refnum, ports[i], ALL_PORTS); | |||||
} | |||||
fGraphManager->GetOutputPorts(refnum, ports); | |||||
for (i = 0; (i < PORT_NUM_FOR_CLIENT) && (ports[i] != EMPTY) ; i++) { | |||||
PortDisconnect(refnum, ports[i], ALL_PORTS); | |||||
} | |||||
fGraphManager->Deactivate(refnum); | fGraphManager->Deactivate(refnum); | ||||
fLastSwitchUsecs = 0; // Force switch to occur next cycle, even when called with "dead" clients | fLastSwitchUsecs = 0; // Force switch to occur next cycle, even when called with "dead" clients | ||||
@@ -664,6 +679,9 @@ int JackEngine::PortUnRegister(int refnum, jack_port_id_t port_index) | |||||
{ | { | ||||
jack_log("JackEngine::PortUnRegister ref = %ld port_index = %ld", refnum, port_index); | jack_log("JackEngine::PortUnRegister ref = %ld port_index = %ld", refnum, port_index); | ||||
assert(fClientTable[refnum]); | assert(fClientTable[refnum]); | ||||
// Disconnect port ==> notification is sent | |||||
PortDisconnect(refnum, port_index, ALL_PORTS); | |||||
if (fGraphManager->ReleasePort(refnum, port_index) == 0) { | if (fGraphManager->ReleasePort(refnum, port_index) == 0) { | ||||
NotifyPortRegistation(port_index, false); | NotifyPortRegistation(port_index, false); | ||||
@@ -413,7 +413,7 @@ void JackGraphManager::DisconnectAllPorts(int refnum) | |||||
// Server | // Server | ||||
void JackGraphManager::DisconnectAllInput(jack_port_id_t port_index) | void JackGraphManager::DisconnectAllInput(jack_port_id_t port_index) | ||||
{ | { | ||||
jack_log("JackGraphManager::DisconnectAllInput port_index = %ld ", port_index); | |||||
jack_log("JackGraphManager::DisconnectAllInput port_index = %ld", port_index); | |||||
JackConnectionManager* manager = WriteNextStateStart(); | JackConnectionManager* manager = WriteNextStateStart(); | ||||
for (int i = 0; i < PORT_NUM; i++) { | for (int i = 0; i < PORT_NUM; i++) { | ||||
@@ -476,20 +476,18 @@ void JackGraphManager::Activate(int refnum) | |||||
// Server | // Server | ||||
void JackGraphManager::Deactivate(int refnum) | void JackGraphManager::Deactivate(int refnum) | ||||
{ | { | ||||
DisconnectAllPorts(refnum); | |||||
// Disconnect only when needed | // Disconnect only when needed | ||||
if (IsDirectConnection(refnum, FREEWHEEL_DRIVER_REFNUM)) { | if (IsDirectConnection(refnum, FREEWHEEL_DRIVER_REFNUM)) { | ||||
DirectDisconnect(refnum, FREEWHEEL_DRIVER_REFNUM); | DirectDisconnect(refnum, FREEWHEEL_DRIVER_REFNUM); | ||||
} else { | } else { | ||||
jack_log("JackServer::Deactivate: client = %ld was not activated ", refnum); | |||||
jack_log("JackServer::Deactivate client = %ld was not activated", refnum); | |||||
} | } | ||||
// Disconnect only when needed | // Disconnect only when needed | ||||
if (IsDirectConnection(FREEWHEEL_DRIVER_REFNUM, refnum)) { | if (IsDirectConnection(FREEWHEEL_DRIVER_REFNUM, refnum)) { | ||||
DirectDisconnect(FREEWHEEL_DRIVER_REFNUM, refnum); | DirectDisconnect(FREEWHEEL_DRIVER_REFNUM, refnum); | ||||
} else { | } else { | ||||
jack_log("JackServer::Deactivate: client = %ld was not activated ", refnum); | |||||
jack_log("JackServer::Deactivate client = %ld was not activated", refnum); | |||||
} | } | ||||
} | } | ||||
@@ -523,14 +521,14 @@ int JackGraphManager::Connect(jack_port_id_t port_src, jack_port_id_t port_dst) | |||||
if (!src->fInUse || !dst->fInUse) { | if (!src->fInUse || !dst->fInUse) { | ||||
if (!src->fInUse) | if (!src->fInUse) | ||||
jack_error("JackGraphManager::Connect: port_src = %ld not used name = %s", port_src, GetPort(port_src)->fName); | |||||
jack_error("JackGraphManager::Connect port_src = %ld not used name = %s", port_src, GetPort(port_src)->fName); | |||||
if (!dst->fInUse) | if (!dst->fInUse) | ||||
jack_error("JackGraphManager::Connect: port_dst = %ld not used name = %s", port_dst, GetPort(port_dst)->fName); | |||||
jack_error("JackGraphManager::Connect port_dst = %ld not used name = %s", port_dst, GetPort(port_dst)->fName); | |||||
res = -1; | res = -1; | ||||
goto end; | goto end; | ||||
} | } | ||||
if (src->fTypeId != dst->fTypeId) { | if (src->fTypeId != dst->fTypeId) { | ||||
jack_error("JackGraphManager::Connect: different port types: port_src = %ld port_dst = %ld", port_src, port_dst); | |||||
jack_error("JackGraphManager::Connect different port types port_src = %ld port_dst = %ld", port_src, port_dst); | |||||
res = -1; | res = -1; | ||||
goto end; | goto end; | ||||
} | } | ||||