Ticket #287: dice-restart.patch
File dice-restart.patch, 3.8 kB (added by adi, 14 years ago) |
---|
-
src/dice/dice_avdevice.cpp
old new 1149 1149 return false; 1150 1150 } 1151 1151 1152 if (result != DICE_OWNER_NO_OWNER ) {1152 if (result != DICE_OWNER_NO_OWNER && result != swap_value) { 1153 1153 debugWarning("Could not register ourselves as device owner, unexpected register value: 0x%016"PRIX64"\n", result); 1154 1154 return false; 1155 1155 } … … 1304 1304 } 1305 1305 if(reg_isoch != 0xFFFFFFFFUL) { 1306 1306 debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08"PRIX32") for ATX %d\n", reg_isoch, n); 1307 p->setChannel(-1); 1307 /* The ISO channel has already been registered, probably 1308 * because the device was running before and jackd just 1309 * crashed. Let's simply reuse the previously selected 1310 * ISO channel. 1311 * 1312 * FIXME: try to reset the channel register and 1313 * return to a clean state 1314 */ 1308 1315 deallocateIsoChannel(isochannel); 1309 return false; 1316 p->setChannel(reg_isoch); 1317 #if 0 1318 /* FIXME: Looks like it's not necessary to ask the IRM. 1319 * Just use the already registered ISO channel. 1320 */ 1321 // ask the IRM to use this channel 1322 if (get1394Service().allocateFixedIsoChannelGeneric(reg_isoch,p->getMaxPacketSize()) < 0) { 1323 debugError("Cannot allocate iso channel (0x%08"PRIX32") for ATX %d\n", reg_isoch, n); 1324 } 1325 #endif 1326 isochannel=reg_isoch; 1310 1327 } 1311 1328 1312 1329 // write value of ISO_CHANNEL register … … 1355 1372 } 1356 1373 if(reg_isoch != 0xFFFFFFFFUL) { 1357 1374 debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08"PRIX32") for ARX %d\n", reg_isoch, n); 1358 p->setChannel(-1); 1375 /* The ISO channel has already been registered, probably 1376 * because the device was running before and jackd just 1377 * crashed. Let's simply reuse the previously selected 1378 * ISO channel. 1379 * 1380 * FIXME: try to reset the channel register and 1381 * return to a clean state 1382 */ 1359 1383 deallocateIsoChannel(isochannel); 1360 return false; 1384 p->setChannel(reg_isoch); 1385 #if 0 1386 /* FIXME: Looks like it's not necessary to ask the IRM. 1387 * Just use the already registered ISO channel. 1388 */ 1389 // ask the IRM to use this channel 1390 if (get1394Service().allocateFixedIsoChannelGeneric(reg_isoch,p->getMaxPacketSize()) < 0) { 1391 debugError("Cannot allocate iso channel (0x%08"PRIX32") for ARX %d\n", reg_isoch, n); 1392 } 1393 #endif 1394 isochannel=reg_isoch; 1361 1395 } 1362 1396 1363 1397 // write value of ISO_CHANNEL register … … 1690 1724 } 1691 1725 } 1692 1726 1727 // FIXME: after a crash, the device might still be streaming. We 1728 // simply force a stop now (unless in snoopMode) to return to a 1729 // clean state. 1730 bool snoopMode = false; 1731 if(!getOption("snoopMode", snoopMode)) { 1732 debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 1733 } 1734 1735 if (!snoopMode) { 1736 disableIsoStreaming(); 1737 } 1738 1693 1739 debugOutput(DEBUG_LEVEL_VERBOSE,"DICE Parameter Space info:\n"); 1694 1740 debugOutput(DEBUG_LEVEL_VERBOSE," Global : offset=%04X size=%04d\n", m_global_reg_offset, m_global_reg_size); 1695 1741 debugOutput(DEBUG_LEVEL_VERBOSE," TX : offset=%04X size=%04d\n", m_tx_reg_offset, m_tx_reg_size);