Changeset 1847

Show
Ignore:
Timestamp:
06/07/10 07:37:38 (2 years ago)
Author:
jwoithe
Message:

RME: fix some streaming setup errors. Add debug output to assist with further development of the streaming interface.

Files:

Legend:

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

    r1749 r1847  
    7373RmeReceiveStreamProcessor::getMaxPacketSize() { 
    7474    int framerate = m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate(); 
     75    // FIXME: the additional 8 bytes is not needed. 
     76    // FIXME: the upper bounds of the 1x and 2x rates need to account for the 
     77    //   DDS capability to run fast by 4%. 
    7578    if (m_rme_model == Rme::RME_MODEL_FIREFACE800) 
    7679        return 8 + (framerate<=48000?784:(framerate<=96000?1200:1200)); 
     
    107110{ 
    108111// For testing 
    109 debugOutput(DEBUG_LEVEL_VERBOSE, "data packet header\n"); 
     112debugOutput(DEBUG_LEVEL_VERBOSE, "data packet header, len=%d\n", length); 
    110113 
    111114    if (length > 8) { 
     
    129132        // value of the cycle timer as the "last timestamp".  In practice  
    130133        // there a fixed offset that we'll have to include eventually. 
    131         m_last_timestamp = CYCLE_TIMER_TO_TICKS(m_Parent.get1394Service().getCycleTimer()); 
    132  
     134uint32_t ct = m_Parent.get1394Service().getCycleTimer(); 
     135//        m_last_timestamp = CYCLE_TIMER_TO_TICKS(ctm_Parent.get1394Service().getCycleTimer()); 
     136        m_last_timestamp = CYCLE_TIMER_TO_TICKS(ct); 
     137debugOutput(DEBUG_LEVEL_VERBOSE, "  timestamp: %lld, ct=%08x (%03ld,%04ld,%04ld)\n", m_last_timestamp, ct, 
     138  CYCLE_TIMER_GET_SECS(ct), CYCLE_TIMER_GET_CYCLES(ct), CYCLE_TIMER_GET_OFFSET(ct)); 
    133139        return eCRV_OK; 
    134140    } else { 
     
    151157RmeReceiveStreamProcessor::processPacketData(unsigned char *data, unsigned int length) { 
    152158    // m_event_size should never be zero 
    153     unsigned int n_events = (length-8) / m_event_size; 
     159    unsigned int n_events = length / m_event_size; 
    154160 
    155161    // we have to keep in mind that there are also 
     
    168174 
    169175// For testing 
    170 debugOutput(DEBUG_LEVEL_VERBOSE, "data packet data\n"); 
     176debugOutput(DEBUG_LEVEL_VERBOSE, "data packet data, length=%d, ev_size=%d, n_events=%d\n", length, m_event_size, n_events); 
    171177 
    172178    if(m_data_buffer->writeFrames(n_events, (char *)data, m_last_timestamp)) { 
  • trunk/libffado/src/rme/rme_avdevice.cpp

    r1813 r1847  
    645645    config.getValueForDeviceSetting(getConfigRom().getNodeVendorId(), getConfigRom().getModelId(), "xmit_sp_dll_bw", xmit_sp_dll_bw); 
    646646 
     647    // Calculate the event size.  Each audio channel is allocated 4 bytes in 
     648    // the data stream. 
     649    /* FIXME: this will still require fine-tuning, but it's a start */ 
     650    signed int event_size = num_channels * 4; 
     651 
    647652    // Set up receive stream processor, initialise it and set DLL bw 
    648     // TODO: set event_size properly; the value below is just a placeholder. 
    649     signed int event_size = 0x1000; 
    650     #warning event_size needs setting up 
    651653    m_receiveProcessor = new Streaming::RmeReceiveStreamProcessor(*this,  
    652654      m_rme_model, event_size);