Changeset 906 for trunk/libffado
- Timestamp:
- 03/06/08 04:22:38 (13 years ago)
- Files:
-
- trunk/libffado/config.h.in (modified) (1 diff)
- trunk/libffado/src/libieee1394/IsoHandler.cpp (modified) (6 diffs)
- trunk/libffado/src/libieee1394/IsoHandler.h (modified) (2 diffs)
- trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp (modified) (4 diffs)
- trunk/libffado/src/libstreaming/generic/StreamProcessor.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/libffado/config.h.in
r905 r906 52 52 // These are the result of a lot of trial and error 53 53 // due to weirdness in the kernel layer 54 #define MAX_XMIT_PACKET_SIZE 204855 #define MAX_XMIT_NB_BUFFERS 2054 #define MAX_XMIT_PACKET_SIZE (2048-16) 55 #define MAX_XMIT_NB_BUFFERS 40 56 56 57 57 #define ISOHANDLER_FLUSH_BEFORE_ITERATE 0 trunk/libffado/src/libieee1394/IsoHandler.cpp
r904 r906 47 47 unsigned char *data, unsigned int *length, 48 48 unsigned char *tag, unsigned char *sy, 49 int cycle, unsigned int dropped ) {49 int cycle, unsigned int dropped1) { 50 50 51 51 IsoHandler *xmitHandler = static_cast<IsoHandler *>(raw1394_get_userdata(handle)); 52 52 assert(xmitHandler); 53 54 return xmitHandler->getPacket(data, length, tag, sy, cycle, dropped); 53 unsigned int skipped = (dropped1 & 0xFFFF0000) >> 16; 54 unsigned int dropped = dropped1 & 0xFFFF; 55 56 return xmitHandler->getPacket(data, length, tag, sy, cycle, dropped, skipped); 55 57 } 56 58 … … 59 61 unsigned int length, unsigned char channel, 60 62 unsigned char tag, unsigned char sy, unsigned int cycle, 61 unsigned int dropped ) {63 unsigned int dropped1) { 62 64 63 65 IsoHandler *recvHandler = static_cast<IsoHandler *>(raw1394_get_userdata(handle)); 64 66 assert(recvHandler); 65 67 66 return recvHandler->putPacket(data, length, channel, tag, sy, cycle, dropped); 68 unsigned int skipped = (dropped1 & 0xFFFF0000) >> 16; 69 unsigned int dropped = dropped1 & 0xFFFF; 70 71 return recvHandler->putPacket(data, length, channel, tag, sy, cycle, dropped, skipped); 67 72 } 68 73 … … 403 408 unsigned char *data, unsigned int length, 404 409 unsigned char channel, unsigned char tag, unsigned char sy, 405 unsigned int cycle, unsigned int dropped ) {410 unsigned int cycle, unsigned int dropped, unsigned int skipped) { 406 411 407 412 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, … … 415 420 #endif 416 421 if(m_Client) { 417 return m_Client->putPacket(data, length, channel, tag, sy, cycle, dropped );422 return m_Client->putPacket(data, length, channel, tag, sy, cycle, dropped, skipped); 418 423 } 419 424 … … 425 430 IsoHandler::getPacket(unsigned char *data, unsigned int *length, 426 431 unsigned char *tag, unsigned char *sy, 427 int cycle, unsigned int dropped ) {432 int cycle, unsigned int dropped, unsigned int skipped) { 428 433 429 434 debugOutputExtreme(DEBUG_LEVEL_ULTRA_VERBOSE, … … 432 437 if(m_Client) { 433 438 enum raw1394_iso_disposition retval; 434 retval = m_Client->getPacket(data, length, tag, sy, cycle, dropped, m_max_packet_size);439 retval = m_Client->getPacket(data, length, tag, sy, cycle, dropped, skipped, m_max_packet_size); 435 440 #ifdef DEBUG 436 441 if (*length > m_max_packet_size) { trunk/libffado/src/libieee1394/IsoHandler.h
r904 r906 69 69 putPacket(unsigned char *data, unsigned int length, 70 70 unsigned char channel, unsigned char tag, unsigned char sy, 71 unsigned int cycle, unsigned int dropped );71 unsigned int cycle, unsigned int dropped, unsigned int skipped); 72 72 73 73 static enum raw1394_iso_disposition iso_transmit_handler(raw1394handle_t handle, … … 78 78 getPacket(unsigned char *data, unsigned int *length, 79 79 unsigned char *tag, unsigned char *sy, 80 int cycle, unsigned int dropped );80 int cycle, unsigned int dropped, unsigned int skipped); 81 81 82 82 public: trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp
r904 r906 266 266 StreamProcessor::putPacket(unsigned char *data, unsigned int length, 267 267 unsigned char channel, unsigned char tag, unsigned char sy, 268 unsigned int cycle, unsigned int dropped) { 268 unsigned int cycle, unsigned int dropped, 269 unsigned int skipped) { 269 270 #ifdef DEBUG 270 271 if(m_last_cycle == -1) { … … 277 278 dropped_cycles = diffCycles(cycle, m_last_cycle) - 1; 278 279 if (dropped_cycles < 0) { 279 debugWarning("(%p) dropped < 1 (%d), cycle: %d, last_cycle: %d, dropped: %d \n",280 this, dropped_cycles, cycle, m_last_cycle, dropped );280 debugWarning("(%p) dropped < 1 (%d), cycle: %d, last_cycle: %d, dropped: %d, 'skipped'=%u\n", 281 this, dropped_cycles, cycle, m_last_cycle, dropped, skipped); 281 282 } 282 283 if (dropped_cycles > 0) { 283 debugWarning("(%p) dropped %d packets on cycle %u, 'dropped'=%u, cycle=%d, m_last_cycle=%d\n",284 this, dropped_cycles, cycle, dropped, cycle, m_last_cycle);284 debugWarning("(%p) dropped %d packets on cycle %u, 'dropped'=%u, 'skipped'=%u, cycle=%d, m_last_cycle=%d\n", 285 this, dropped_cycles, cycle, dropped, skipped, cycle, m_last_cycle); 285 286 m_dropped += dropped_cycles; 286 287 m_last_cycle = cycle; … … 451 452 StreamProcessor::getPacket(unsigned char *data, unsigned int *length, 452 453 unsigned char *tag, unsigned char *sy, 453 int cycle, unsigned int dropped, unsigned int max_length) { 454 int cycle, unsigned int dropped, 455 unsigned int skipped, unsigned int max_length) { 454 456 if (cycle<0) { 455 457 *tag = 0; … … 472 474 if (m_last_cycle != cycle && m_last_cycle != -1) { 473 475 dropped_cycles = diffCycles(cycle, m_last_cycle) - 1; 476 // correct for skipped packets 477 // since those are not dropped, but only delayed 478 dropped_cycles =- skipped; 479 if(skipped) { 480 debugWarning("(%p) skipped %d cycles, cycle: %d, last_cycle: %d, dropped: %d\n", 481 this, skipped, cycle, m_last_cycle, dropped); 482 } 474 483 if (dropped_cycles < 0) { 475 debugWarning("(%p) dropped < 1 (%d), cycle: %d, last_cycle: %d, dropped: %d \n",476 this, dropped_cycles, cycle, m_last_cycle, dropped );484 debugWarning("(%p) dropped < 1 (%d), cycle: %d, last_cycle: %d, dropped: %d, skipped: %d\n", 485 this, dropped_cycles, cycle, m_last_cycle, dropped, skipped); 477 486 } 478 487 if (dropped_cycles > 0) { 479 debugWarning("(%p) dropped %d packets on cycle %u (last_cycle=%u, dropped=%d )\n",480 this, dropped_cycles, cycle, m_last_cycle, dropped );488 debugWarning("(%p) dropped %d packets on cycle %u (last_cycle=%u, dropped=%d, skipped: %d)\n", 489 this, dropped_cycles, cycle, m_last_cycle, dropped, skipped); 481 490 m_dropped += dropped_cycles; 482 491 // HACK: this should not be necessary, since the header generation functions should trigger the xrun. trunk/libffado/src/libstreaming/generic/StreamProcessor.h
r864 r906 152 152 putPacket(unsigned char *data, unsigned int length, 153 153 unsigned char channel, unsigned char tag, unsigned char sy, 154 unsigned int cycle, unsigned int dropped );154 unsigned int cycle, unsigned int dropped, unsigned int skipped); 155 155 156 156 enum raw1394_iso_disposition 157 157 getPacket(unsigned char *data, unsigned int *length, 158 158 unsigned char *tag, unsigned char *sy, 159 int cycle, unsigned int dropped, unsigned int max_length);159 int cycle, unsigned int dropped, unsigned int skipped, unsigned int max_length); 160 160 161 161 bool getFrames(unsigned int nbframes, int64_t ts); ///< transfer the buffer contents to the client