Skip to content

Commit

Permalink
Addresses issue #47 where rtpMIDI doesn't hear Feedback messages over…
Browse files Browse the repository at this point in the history
… the control port
  • Loading branch information
Dave Kelly committed Dec 31, 2019
1 parent e94eab6 commit 862bfd5
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ remote.connect
To connect directly to a server/port, use the format:
remote.connect = [address]:port
A port number must be specified if making a direct connection.
remote.use_control
Indicates whether CK (AppleMIDI Feedback) messages are sent to the a remote connection using the control port.
Default is yes
client.name
Name to use when connecting to remote service. If not defined, service.name will be used.
network.socket_timeout
Expand Down
5 changes: 5 additions & 0 deletions raveloxmidi/man/raveloxmidi.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ To connect directly to a server/port, use the format:
.br
A port number \fBmust\fP be specified if making a direct connection.
.TP
.B remote.use_control
Indicates whether CK (AppleMIDI Feedback) messages are sent to the a remote connection using the control port.
.br
Default is yes
.TP
.B network.socket_timeout
Polling timeout for the listening sockets.
.br
Expand Down
12 changes: 11 additions & 1 deletion raveloxmidi/src/remote_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ static void *remote_connect_sync_thread( void *data )
fd_set read_fds;
struct timeval tv;
int sync_interval = 0;
int use_control = 0;

logging_printf( LOGGING_DEBUG, "remote_connect_sync_thread: start\n");
logging_printf( LOGGING_DEBUG, "rmeote_connect_sync_thread: sync.interval=%s\n", config_string_get("sync.interval"));
Expand All @@ -286,6 +287,15 @@ static void *remote_connect_sync_thread( void *data )
remote_service_name = config_string_get("remote.connect");
sync_interval = config_int_get("sync.interval");

/* Determine if CK messages are sent over the control port or not */
/* This is a workaround for rtpMIDI not responding unless CK messages are sent via the data port */
if( config_is_set("remote.use_control") )
{
use_control = ( is_yes( config_string_get("remote.use_control") ) ? 1 : 0 );
} else {
use_control = 1;
}

do
{
ctx = net_ctx_find_by_name( remote_service_name );
Expand All @@ -306,7 +316,7 @@ static void *remote_connect_sync_thread( void *data )
break;
}
response = net_response_sync( ctx->send_ssrc , ctx->start );
net_ctx_send( ctx, response->buffer, response->len, USE_CONTROL_PORT );
net_ctx_send( ctx, response->buffer, response->len, use_control );
hex_dump( response->buffer, response->len );
net_response_destroy( &response );
} while( 1 );
Expand Down

0 comments on commit 862bfd5

Please sign in to comment.