Show
Ignore:
Timestamp:
10/18/07 17:51:38 (15 years ago)
Author:
jwoithe
Message:

MOTU: allow receive and transmit streams to have different bandwidth requirements, since not all interfaces have about the same number of input and output channels.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/motu/motu_avdevice.cpp

    r659 r660  
    191191    , m_iso_recv_channel ( -1 ) 
    192192    , m_iso_send_channel ( -1 ) 
    193     , m_bandwidth ( -1 ) 
     193    , m_rx_bandwidth ( -1 ) 
     194    , m_tx_bandwidth ( -1 ) 
    194195    , m_receiveProcessor ( 0 ) 
    195196    , m_transmitProcessor ( 0 ) 
     
    481482    //   * DATA_PREFIX = 0.16 us 
    482483    //   * DATA_END    = 0.26 us 
    483  
    484484    // These numbers are the worst-case figures given in the ieee1394 
    485485    // standard.  This gives approximately 0.5 us of overheads per packet - 
     
    492492    // 192 kHz for the traveler) but now do this based on the actual device 
    493493    // state by utilising the result from getEventSize() and remembering 
    494     // that each packet has an 8 byte CIP header.  Note that m_bandwidth is 
    495     // a *per stream* bandwidth - it must be allocated for both the transmit 
    496     // and receive streams. 
    497     signed int max_event_size = event_size_out>event_size_in?event_size_out:event_size_in; 
     494    // that each packet has an 8 byte CIP header.  Note that bandwidth is 
     495    // allocated on a *per stream* basis - it must be allocated for both the 
     496    // transmit and receive streams.  While most MOTU modules are close to 
     497    // symmetric in terms of the number of in/out channels there are 
     498    // exceptions, so we deal with receive and transmit bandwidth separately. 
    498499    signed int n_events_per_packet = samp_freq<=48000?8:(samp_freq<=96000?16:32); 
    499     m_bandwidth = 25 + (n_events_per_packet*max_event_size); 
     500    m_rx_bandwidth = 25 + (n_events_per_packet*event_size_in); 
     501    m_tx_bandwidth = 25 + (n_events_per_packet*event_size_out); 
    500502 
    501503    // Assign iso channels if not already done 
    502504    if (m_iso_recv_channel < 0) 
    503         m_iso_recv_channel = m_p1394Service->allocateIsoChannelGeneric(m_bandwidth); 
     505        m_iso_recv_channel = m_p1394Service->allocateIsoChannelGeneric(m_rx_bandwidth); 
    504506 
    505507    if (m_iso_send_channel < 0) 
    506         m_iso_send_channel = m_p1394Service->allocateIsoChannelGeneric(m_bandwidth); 
     508        m_iso_send_channel = m_p1394Service->allocateIsoChannelGeneric(m_tx_bandwidth); 
    507509 
    508510    debugOutput(DEBUG_LEVEL_VERBOSE, "recv channel = %d, send channel = %d\n", 
  • trunk/libffado/src/motu/motu_avdevice.h

    r659 r660  
    164164    struct VendorModelEntry * m_model; 
    165165    signed int m_iso_recv_channel, m_iso_send_channel; 
    166     signed int m_bandwidth; 
     166    signed int m_rx_bandwidth, m_tx_bandwidth; 
    167167 
    168168    Streaming::MotuReceiveStreamProcessor *m_receiveProcessor;