|
@@ -426,7 +426,7 @@ namespace Jack |
|
|
if (((rx_bytes = fSocket.Recv(fRxBuffer, size, flags)) == SOCKET_ERROR) && fRunning) { |
|
|
if (((rx_bytes = fSocket.Recv(fRxBuffer, size, flags)) == SOCKET_ERROR) && fRunning) { |
|
|
FatalRecvError(); |
|
|
FatalRecvError(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
packet_header_t* header = reinterpret_cast<packet_header_t*>(fRxBuffer); |
|
|
packet_header_t* header = reinterpret_cast<packet_header_t*>(fRxBuffer); |
|
|
PacketHeaderNToH(header, header); |
|
|
PacketHeaderNToH(header, header); |
|
|
return rx_bytes; |
|
|
return rx_bytes; |
|
@@ -485,8 +485,13 @@ namespace Jack |
|
|
return SOCKET_ERROR; |
|
|
return SOCKET_ERROR; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
while ((strcmp(rx_head->fPacketType, "header") != 0) && (rx_head->fDataType != 's')); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (strcmp(rx_head->fPacketType, "header") != 0); |
|
|
|
|
|
|
|
|
|
|
|
if (rx_head->fDataType != 's') { |
|
|
|
|
|
jack_error("Wrong packet type : %c\n", rx_head->fDataType); |
|
|
|
|
|
return -1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
fCurrentCycleOffset = fTxHeader.fCycle - rx_head->fCycle; |
|
|
fCurrentCycleOffset = fTxHeader.fCycle - rx_head->fCycle; |
|
|
|
|
|
|
|
|
if (fCurrentCycleOffset < fMaxCycleOffset) { |
|
|
if (fCurrentCycleOffset < fMaxCycleOffset) { |
|
@@ -541,7 +546,9 @@ namespace Jack |
|
|
// This method contains every step of sync packet informations coding |
|
|
// This method contains every step of sync packet informations coding |
|
|
// first of all, clear sync packet |
|
|
// first of all, clear sync packet |
|
|
memset(fTxData, 0, PACKET_AVAILABLE_SIZE(&fParams)); |
|
|
memset(fTxData, 0, PACKET_AVAILABLE_SIZE(&fParams)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Transport not used for now... |
|
|
|
|
|
/* |
|
|
// then, first step : transport |
|
|
// then, first step : transport |
|
|
if (fParams.fTransportSync) { |
|
|
if (fParams.fTransportSync) { |
|
|
EncodeTransportData(); |
|
|
EncodeTransportData(); |
|
@@ -551,9 +558,8 @@ namespace Jack |
|
|
} |
|
|
} |
|
|
// then others (freewheel etc.) |
|
|
// then others (freewheel etc.) |
|
|
// ... |
|
|
// ... |
|
|
|
|
|
|
|
|
// Transport not used for now... |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
// Write active ports list |
|
|
// Write active ports list |
|
|
fTxHeader.fActivePorts = (fNetAudioPlaybackBuffer) ? fNetAudioPlaybackBuffer->ActivePortsToNetwork(fTxData) : 0; |
|
|
fTxHeader.fActivePorts = (fNetAudioPlaybackBuffer) ? fNetAudioPlaybackBuffer->ActivePortsToNetwork(fTxData) : 0; |
|
|
} |
|
|
} |
|
@@ -561,6 +567,9 @@ namespace Jack |
|
|
void JackNetMasterInterface::DecodeSyncPacket() |
|
|
void JackNetMasterInterface::DecodeSyncPacket() |
|
|
{ |
|
|
{ |
|
|
// This method contains every step of sync packet informations decoding process |
|
|
// This method contains every step of sync packet informations decoding process |
|
|
|
|
|
|
|
|
|
|
|
// Transport not used for now... |
|
|
|
|
|
/* |
|
|
// first : transport |
|
|
// first : transport |
|
|
if (fParams.fTransportSync) { |
|
|
if (fParams.fTransportSync) { |
|
|
// copy received transport data to transport data structure |
|
|
// copy received transport data to transport data structure |
|
@@ -570,8 +579,8 @@ namespace Jack |
|
|
} |
|
|
} |
|
|
// then others |
|
|
// then others |
|
|
// ... |
|
|
// ... |
|
|
|
|
|
|
|
|
// Transport not used for now... |
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
packet_header_t* rx_head = reinterpret_cast<packet_header_t*>(fRxBuffer); |
|
|
packet_header_t* rx_head = reinterpret_cast<packet_header_t*>(fRxBuffer); |
|
|
|
|
|
|
|
|
// Read active ports list |
|
|
// Read active ports list |
|
@@ -862,8 +871,13 @@ namespace Jack |
|
|
return rx_bytes; |
|
|
return rx_bytes; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
while ((strcmp(rx_head->fPacketType, "header") != 0) && (rx_head->fDataType != 's')); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (strcmp(rx_head->fPacketType, "header") != 0); |
|
|
|
|
|
|
|
|
|
|
|
if (rx_head->fDataType != 's') { |
|
|
|
|
|
jack_error("Wrong packet type : %c\n", rx_head->fDataType); |
|
|
|
|
|
return -1; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
fRxHeader.fIsLastPckt = rx_head->fIsLastPckt; |
|
|
fRxHeader.fIsLastPckt = rx_head->fIsLastPckt; |
|
|
|
|
|
|
|
|
SetRcvTimeOut(); |
|
|
SetRcvTimeOut(); |
|
@@ -942,6 +956,8 @@ namespace Jack |
|
|
memset(fTxData, 0, PACKET_AVAILABLE_SIZE(&fParams)); |
|
|
memset(fTxData, 0, PACKET_AVAILABLE_SIZE(&fParams)); |
|
|
|
|
|
|
|
|
// then first step : transport |
|
|
// then first step : transport |
|
|
|
|
|
// Transport is not used for now... |
|
|
|
|
|
/* |
|
|
if (fParams.fTransportSync) { |
|
|
if (fParams.fTransportSync) { |
|
|
EncodeTransportData(); |
|
|
EncodeTransportData(); |
|
|
TransportDataHToN(&fReturnTransportData, &fReturnTransportData); |
|
|
TransportDataHToN(&fReturnTransportData, &fReturnTransportData); |
|
@@ -950,8 +966,7 @@ namespace Jack |
|
|
} |
|
|
} |
|
|
// then others |
|
|
// then others |
|
|
// ... |
|
|
// ... |
|
|
|
|
|
|
|
|
// Transport is not used for now... |
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
// Write active ports list |
|
|
// Write active ports list |
|
|
fTxHeader.fActivePorts = (fNetAudioCaptureBuffer) ? fNetAudioCaptureBuffer->ActivePortsToNetwork(fTxData) : 0; |
|
|
fTxHeader.fActivePorts = (fNetAudioCaptureBuffer) ? fNetAudioCaptureBuffer->ActivePortsToNetwork(fTxData) : 0; |
|
@@ -960,6 +975,9 @@ namespace Jack |
|
|
void JackNetSlaveInterface::DecodeSyncPacket() |
|
|
void JackNetSlaveInterface::DecodeSyncPacket() |
|
|
{ |
|
|
{ |
|
|
// This method contains every step of sync packet informations decoding process |
|
|
// This method contains every step of sync packet informations decoding process |
|
|
|
|
|
|
|
|
|
|
|
// Transport not used for now... |
|
|
|
|
|
/* |
|
|
// first : transport |
|
|
// first : transport |
|
|
if (fParams.fTransportSync) { |
|
|
if (fParams.fTransportSync) { |
|
|
// copy received transport data to transport data structure |
|
|
// copy received transport data to transport data structure |
|
@@ -969,8 +987,8 @@ namespace Jack |
|
|
} |
|
|
} |
|
|
// then others |
|
|
// then others |
|
|
// ... |
|
|
// ... |
|
|
|
|
|
|
|
|
// Transport not used for now... |
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
packet_header_t* rx_head = reinterpret_cast<packet_header_t*>(fRxBuffer); |
|
|
packet_header_t* rx_head = reinterpret_cast<packet_header_t*>(fRxBuffer); |
|
|
|
|
|
|
|
|
// Read active ports list |
|
|
// Read active ports list |
|
|