Changeset 1451

Show
Ignore:
Timestamp:
11/22/08 07:01:20 (12 years ago)
Author:
wagi
Message:

Add workaround for the Edirol FA-101. The device issues more
than one FCP respond to one request. The IEEE1394 allows now
to filter for duplicated FCP packets. Though the filtering is
a rather ugly thing, it is only enabled for the FA-101. For all other
devices nothing changes.

Now with this fix the mixer should work for the FA-101 again.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/src/bebob/edirol/edirol_fa101.cpp

    r1371 r1451  
    4040    m_fixed_clocksource.slipping = false; 
    4141    m_fixed_clocksource.description = "Device Controlled"; 
     42 
     43    get1394Service().setFCPResponseFiltering(true); 
    4244} 
    4345 
  • branches/libffado-2.0/src/libieee1394/ieee1394service.cpp

    r1432 r1451  
    6363    , m_pCTRHelper ( new CycleTimerHelper( *this, IEEE1394SERVICE_CYCLETIMER_DLL_UPDATE_INTERVAL_USEC ) ) 
    6464    , m_have_new_ctr_read ( false ) 
     65    , m_filterFCPResponse ( false ) 
    6566    , m_pWatchdog ( new Util::Watchdog() ) 
    6667{ 
     
    9293                                           IEEE1394SERVICE_CYCLETIMER_HELPER_PRIO ) ) 
    9394    , m_have_new_ctr_read ( false ) 
     95    , m_filterFCPResponse ( false ) 
    9496    , m_pWatchdog ( new Util::Watchdog() ) 
    9597{ 
     
    822824                                   unsigned char *data) 
    823825{ 
     826    static struct sFcpBlock fcp_block_last; 
     827 
    824828    fb_quadlet_t *data_quads = (fb_quadlet_t *)data; 
    825829    #ifdef DEBUG 
     
    857861                             FCP_MASK_SUBUNIT_AND_OPCODE(first_quadlet), 
    858862                             FCP_MASK_SUBUNIT_AND_OPCODE(CondSwapFromBus32(m_fcp_block.request[0]))); 
     863            } else if(m_filterFCPResponse && (memcmp(fcp_block_last.response, data, length) == 0)) { 
     864                // This is workaround for the Edirol FA-101. The device tends to send more than 
     865                // one responde to one request. This seems to happen when discovering  
     866                // function blocks and looks very likely there is a race condition in the  
     867                // device. The workaround here compares the just arrived FCP responde 
     868                // to the last one. If it is the same as the previously one then we 
     869                // just ignore it. The downside of this approach is, we cannot issue 
     870                // the same FCP twice. 
     871                debugWarning("Received duplicate FCP response. Ignore it\n"); 
    859872            } else { 
    860873                m_fcp_block.response_length = (length + sizeof(quadlet_t) - 1) / sizeof(quadlet_t); 
    861874                memcpy(m_fcp_block.response, data, length); 
     875                if (m_filterFCPResponse) { 
     876                    memcpy(fcp_block_last.response, data, length); 
     877                } 
    862878                m_fcp_block.status = eFS_Responded; 
    863879            } 
     
    919935 
    920936    return (split_timeout_hi & 7) * 1000000 + (split_timeout_low >> 19) * 125; 
     937} 
     938 
     939void  
     940Ieee1394Service::setFCPResponseFiltering(bool enable) 
     941{ 
     942    m_filterFCPResponse = enable; 
    921943} 
    922944 
  • branches/libffado-2.0/src/libieee1394/ieee1394service.h

    r1409 r1451  
    322322 
    323323    Util::Configuration *getConfiguration() {return m_configuration;}; 
     324 
     325    /** 
     326     * @brief enable or disable FCP response doublicate filtering 
     327     * 
     328     * this is use only for devices (e.g. edirol fa101) which have a  
     329     * buggy FCP implementation and send more then one FCP response  
     330     * for one request.  
     331     */ 
     332    void setFCPResponseFiltering(bool enable); 
    324333 
    325334// ISO channel stuff 
     
    394403    bool                    m_have_new_ctr_read; 
    395404 
     405    bool            m_filterFCPResponse; 
     406 
    396407    // the RT watchdog 
    397408    Util::Watchdog*     m_pWatchdog;