Changeset 481

Show
Ignore:
Timestamp:
06/12/07 16:41:42 (16 years ago)
Author:
jwoithe
Message:

Fix for MOTU transmit stream failure to enable.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libstreaming/MotuStreamProcessor.cpp

    r480 r481  
    134134    int cycle_diff = diffCycles(cycle, now_cycles); 
    135135 
     136//debugOutput(DEBUG_LEVEL_VERBOSE,"tx: enabled=%d, cycle=%d, now_cycles=%d, diff=%d\n", 
     137//  !m_is_disabled,cycle, now_cycles, cycle_diff); 
     138 
    136139    // Signal that streaming is still active 
    137140    m_streaming_active = 1; 
     
    148151    if (!m_disabled && m_is_disabled) { 
    149152        // this means that we are trying to enable 
    150         if ((unsigned int)cycle == m_cycle_to_enable_at) { 
     153 
     154        // check if we are on or past the enable point 
     155        signed int cycles_past_enable=diffCycles(cycle, m_cycle_to_enable_at); 
     156         
     157        if (cycles_past_enable >= 0) { 
    151158            m_is_disabled=false; 
    152159 
     
    180187                            ts_head, sync_lag_cycles, m_data_buffer->getFrameCounter()); 
    181188        } else { 
     189static int foo=0; 
     190if (!foo) { 
     191  debugOutput(DEBUG_LEVEL_VERBOSE, 
     192    "will enable tx StreamProcessor %p at %u, now is %d\n", 
     193    this, m_cycle_to_enable_at, cycle); 
     194  foo=1; 
     195} 
    182196            debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 
    183197                        "will enable StreamProcessor %p at %u, now is %d\n", 
     
    314328            ts_frame += (unsigned int)((float)i * ticks_per_frame); 
    315329            *quadlet = htonl( TICKS_TO_CYCLE_TIMER(ts_frame) & 0x1ffffff); 
     330#if 0 
    316331if (cycle==0) { 
    317332  debugOutput(DEBUG_LEVEL_VERBOSE,"%d %d %d\n", 
     
    320335    TICKS_TO_OFFSET(ts_frame)); 
    321336} 
     337#endif 
    322338#if TESTTONE 
    323339            // FIXME: remove this hacked in 1 kHz test signal to 
     
    956972    m_last_cycle=cycle; 
    957973 
     974//debugOutput(DEBUG_LEVEL_VERBOSE,"rx: enabled=%d, cycle=%d\n",!m_is_disabled,cycle); 
     975 
    958976    // check our enable status 
    959977    if (!m_disabled && m_is_disabled) { 
     
    975993 
    976994        } else { 
     995static int foo=0; 
     996if (!foo) { 
     997debugOutput(DEBUG_LEVEL_VERBOSE, 
     998  "will enable rx StreamProcessor %p at %u, now is %d\n", 
     999  this, m_cycle_to_enable_at, cycle); 
     1000  foo=1; 
     1001} 
    9771002            debugOutput(DEBUG_LEVEL_VERY_VERBOSE, 
    9781003                "will enable StreamProcessor %p at %u, now is %d\n",