From: <tr...@ff...> - 2014-06-02 00:00:18
|
Author: jwoithe Date: 2014-06-01 17:00:10 -0700 (Sun, 01 Jun 2014) New Revision: 2541 Modified: branches/2.2.x/libffado/src/libieee1394/IsoHandlerManager.cpp branches/2.2.x/libffado/src/libieee1394/test-cyclecalc.cpp branches/2.2.x/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp branches/2.2.x/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp branches/2.2.x/libffado/src/libutil/TimestampedBuffer.cpp Log: Fix DEBUG=no compilation errors. Backport from r2540 in trunk. Modified: branches/2.2.x/libffado/src/libieee1394/IsoHandlerManager.cpp =================================================================== --- branches/2.2.x/libffado/src/libieee1394/IsoHandlerManager.cpp 2014-06-01 23:49:28 UTC (rev 2540) +++ branches/2.2.x/libffado/src/libieee1394/IsoHandlerManager.cpp 2014-06-02 00:00:10 UTC (rev 2541) @@ -1021,8 +1021,12 @@ { IsoHandler *h = getHandlerForStream(stream); if (h) { + #ifdef DEBUG debugOutputShort( DEBUG_LEVEL_NORMAL, " Packets, Dropped, Skipped : %d, %d, %d\n", h->m_packets, h->m_dropped, h->m_skipped); + #else + debugOutputShort( DEBUG_LEVEL_NORMAL, " Packets : %d\n", h->m_packets); + #endif } else { debugError("No handler for stream %p??\n", stream); } Modified: branches/2.2.x/libffado/src/libieee1394/test-cyclecalc.cpp =================================================================== --- branches/2.2.x/libffado/src/libieee1394/test-cyclecalc.cpp 2014-06-01 23:49:28 UTC (rev 2540) +++ branches/2.2.x/libffado/src/libieee1394/test-cyclecalc.cpp 2014-06-02 00:00:10 UTC (rev 2541) @@ -38,12 +38,11 @@ * */ - #ifdef DEBUG + #ifdef DEBUG_MESSAGES uint32_t now_ctr = 0x140001DA; uint64_t now = CYCLE_TIMER_TO_TICKS(0x140001DA); unsigned int cycle = 7968; uint16_t syt = 0x583B; - #endif debugOutput(DEBUG_LEVEL_VERBOSE,"NOW_CTR : %08X (%03us %04uc %04ut)\n", now_ctr, @@ -63,16 +62,16 @@ (unsigned int)CYCLE_TIMER_GET_OFFSET(syt)); debugOutput(DEBUG_LEVEL_VERBOSE,"CYCLE : %uc\n", cycle); - #ifdef DEBUG uint64_t calc_ts = sytRecvToFullTicks(syt, cycle, now_ctr); - #endif debugOutput(DEBUG_LEVEL_VERBOSE,"CALC_TS : %011"PRIu64" (%03us %04uc %04ut)\n", calc_ts, (unsigned int)TICKS_TO_SECS(calc_ts), (unsigned int)TICKS_TO_CYCLES(calc_ts), (unsigned int)TICKS_TO_OFFSET(calc_ts)); - + #else + printf("DEBUG_MESSAGES not enabled for build. This program won't show anything without it.\n"); + #endif // BL: 1211722982: Debug (IsoHandler.cpp)[ 420] putPacket: received packet: length=168, channel=0, cycle=7968 // BL: 1211723031: Debug (cycletimer.h)[ 308] sytRecvToFullTicks: SYT=583B CY=7968 CTR=140001DA Modified: branches/2.2.x/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp =================================================================== --- branches/2.2.x/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp 2014-06-01 23:49:28 UTC (rev 2540) +++ branches/2.2.x/libffado/src/libstreaming/amdtp/AmdtpReceiveStreamProcessor.cpp 2014-06-02 00:00:10 UTC (rev 2541) @@ -290,7 +290,9 @@ for (i = 0; i < m_nb_audio_ports; i++) { struct _MBLA_port_cache &p = m_audio_ports.at(i); target_event = (quadlet_t *)(data + i); +#ifdef DEBUG assert(nevents + offset <= p.buffer_size ); +#endif if(p.buffer && p.enabled) { quadlet_t *buffer = (quadlet_t *)(p.buffer); @@ -324,7 +326,9 @@ for (i = 0; i < m_nb_audio_ports; i++) { struct _MBLA_port_cache &p = m_audio_ports.at(i); target_event = (quadlet_t *)(data + i); +#ifdef DEBUG assert(nevents + offset <= p.buffer_size ); +#endif if(p.buffer && p.enabled) { float *buffer = (float *)(p.buffer); @@ -361,7 +365,9 @@ for (i = 0; i < m_nb_audio_ports; i++) { struct _MBLA_port_cache &p = m_audio_ports.at(i); target_event = (quadlet_t *)(data + i); +#ifdef DEBUG assert(nevents + offset <= p.buffer_size ); +#endif if(p.buffer && p.enabled) { quadlet_t *buffer = (quadlet_t *)(p.buffer); @@ -395,7 +401,9 @@ for (i = 0; i < m_nb_audio_ports; i++) { struct _MBLA_port_cache &p = m_audio_ports.at(i); target_event = (quadlet_t *)(data + i); +#ifdef DEBUG assert(nevents + offset <= p.buffer_size ); +#endif if(p.buffer && p.enabled) { float *buffer = (float *)(p.buffer); Modified: branches/2.2.x/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp =================================================================== --- branches/2.2.x/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp 2014-06-01 23:49:28 UTC (rev 2540) +++ branches/2.2.x/libffado/src/libstreaming/amdtp/AmdtpTransmitStreamProcessor.cpp 2014-06-02 00:00:10 UTC (rev 2541) @@ -648,7 +648,9 @@ for (; i < (int)m_nb_audio_ports; i++) { struct _MBLA_port_cache &p = m_audio_ports.at(i); target_event = (quadlet_t *)(data + i); +#ifdef DEBUG assert(nevents + offset <= p.buffer_size ); +#endif if(likely(p.buffer && p.enabled)) { float *buffer = (float *)(p.buffer); @@ -831,7 +833,9 @@ for (; i < ((int)m_nb_audio_ports); i++) { struct _MBLA_port_cache &p = m_audio_ports.at(i); target_event = (quadlet_t *)(data + i); +#ifdef DEBUG assert(nevents + offset <= p.buffer_size ); +#endif if(likely(p.buffer && p.enabled)) { uint32_t *buffer = (uint32_t *)(p.buffer); @@ -916,7 +920,9 @@ for (i = 0; i < m_nb_audio_ports; i++) { struct _MBLA_port_cache &p = m_audio_ports.at(i); target_event = (quadlet_t *)(data + i); +#ifdef DEBUG assert(nevents + offset <= p.buffer_size ); +#endif if(likely(p.buffer && p.enabled)) { quadlet_t *buffer = (quadlet_t *)(p.buffer); @@ -957,7 +963,9 @@ for (i = 0; i < m_nb_audio_ports; i++) { struct _MBLA_port_cache &p = m_audio_ports.at(i); target_event = (quadlet_t *)(data + i); +#ifdef DEBUG assert(nevents + offset <= p.buffer_size ); +#endif if(likely(p.buffer && p.enabled)) { quadlet_t *buffer = (quadlet_t *)(p.buffer); Modified: branches/2.2.x/libffado/src/libutil/TimestampedBuffer.cpp =================================================================== --- branches/2.2.x/libffado/src/libutil/TimestampedBuffer.cpp 2014-06-01 23:49:28 UTC (rev 2540) +++ branches/2.2.x/libffado/src/libutil/TimestampedBuffer.cpp 2014-06-02 00:00:10 UTC (rev 2541) @@ -1148,7 +1148,9 @@ this, m_framecounter, getBufferFill()); debugOutputShort( DEBUG_LEVEL_NORMAL, " Timestamps : head: "TIMESTAMP_FORMAT_SPEC", Tail: "TIMESTAMP_FORMAT_SPEC", Next tail: "TIMESTAMP_FORMAT_SPEC"\n", ts_head, m_buffer_tail_timestamp, m_buffer_next_tail_timestamp); +#ifdef DEBUG debugOutputShort( DEBUG_LEVEL_NORMAL, " Head - Tail : "TIMESTAMP_FORMAT_SPEC" (%f frames)\n", diff, diff/m_dll_e2*m_update_period); +#endif debugOutputShort( DEBUG_LEVEL_NORMAL, " DLL Rate : %f (%f)\n", m_dll_e2, m_dll_e2/m_update_period); debugOutputShort( DEBUG_LEVEL_NORMAL, " DLL Bandwidth : %10e 1/ticks (%f Hz)\n", getBandwidth(), getBandwidth() * TICKS_PER_SECOND); } |