fix MCP ports hang on device change and multi-surface device reconnect.
authorLen Ovens <len@ovenwerks.net>
Wed, 14 Oct 2015 05:19:36 +0000 (22:19 -0700)
committerLen Ovens <len@ovenwerks.net>
Wed, 14 Oct 2015 05:19:36 +0000 (22:19 -0700)
libs/surfaces/mackie/mackie_control_protocol.cc
libs/surfaces/mackie/surface.cc

index 9e1a2bbce73a5a28cfd78a6eecb3b1750cf1d9a8..93b54e7d6af76b3f87271756771e0cce8501723f 100644 (file)
@@ -809,7 +809,7 @@ MackieControlProtocol::create_surfaces ()
                        XMLNodeList const& devices = configuration_state->children();
                        for (XMLNodeList::const_iterator d = devices.begin(); d != devices.end(); ++d) {
                                XMLProperty* prop = (*d)->property (X_("name"));
-                               if (prop && prop->value() == device_name) {
+                               if (prop && prop->value() == _device_info.name()) {
                                        this_device = *d;
                                        break;
                                }
index 8c4c10a33623756cf9695226b6897f455d16138d..954aeebca5529f06a889934828f62bebdaa76b5d 100644 (file)
@@ -166,7 +166,9 @@ Surface::~Surface ()
 
        delete _jog_wheel;
        delete _port;
-
+       // the ports take time to release and we may be rebuilding right away
+       // in the case of changing devices.
+       g_usleep (100000);
        DEBUG_TRACE (DEBUG::MackieControl, "Surface::~Surface done\n");
 }