Changeset 1964

Show
Ignore:
Timestamp:
03/04/11 04:57:40 (10 years ago)
Author:
jwoithe
Message:

digidesign: fix bug identified by compile-testing the new skeleton driver

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/digidesign/digidesign_avdevice.cpp

    r1959 r1964  
    8484bool 
    8585Device::buildMixer() { 
    86     signed int i; 
    87     bool result = true; 
    8886 
    8987    destroyMixer(); 
     
    10199bool 
    102100Device::destroyMixer() { 
    103     bool ret = true; 
    104101    debugOutput(DEBUG_LEVEL_VERBOSE, "destroy mixer...\n"); 
    105102 
     
    136133Device::discover() 
    137134{ 
    138     signed int i; 
    139135    unsigned int vendorId = getConfigRom().getNodeVendorId(); 
    140     unsigned int modelId = configRom.getModelId(); 
     136    unsigned int modelId = getConfigRom().getModelId(); 
    141137     
    142138    Util::Configuration &c = getDeviceManager().getConfiguration(); 
     
    274270Device::prepare() { 
    275271 
    276     signed int mult, bandwidth; 
    277     signed int freq, init_samplerate; 
     272    signed int bandwidth; 
    278273    signed int err = 0; 
    279     unsigned int stat[4]; 
    280274 
    281275    debugOutput(DEBUG_LEVEL_NORMAL, "Preparing Device...\n" ); 
     
    354348    // Set up receive stream processor, initialise it and set DLL bw 
    355349    m_receiveProcessor = new Streaming::DigidesignReceiveStreamProcessor(*this,  
    356       m_digidesign_model, event_size); 
     350      event_size); 
    357351    m_receiveProcessor->setVerboseLevel(getDebugLevel()); 
    358352    if (!m_receiveProcessor->init()) { 
     
    378372    /* Now set up the transmit stream processor */ 
    379373    m_transmitProcessor = new Streaming::DigidesignTransmitStreamProcessor(*this, 
    380       m_digidesign_model, event_size); 
     374      event_size); 
    381375    m_transmitProcessor->setVerboseLevel(getDebugLevel()); 
    382376    if (!m_transmitProcessor->init()) { 
     
    447441    // For some devices this is fixed, while for others it depends on the 
    448442    // current sampling rate. 
    449     signed int freq = getSamplingFrequency(); 
     443    // 
     444    // Getting the current sample rate is as simple as: 
     445    //   signed int freq = getSamplingFrequency(); 
    450446 
    451447    // This needs to be set as required. 
  • trunk/libffado/src/digidesign/digidesign_avdevice.h

    r1959 r1964  
    9797 
    9898    /* General information functions */ 
    99     signed int getDigidesignModel(void) { return m_digdesign_model; } 
     99    signed int getDigidesignModel(void) { return m_digidesign_model; } 
    100100 
    101101protected: 
  • trunk/libffado/src/libstreaming/digidesign/DigidesignReceiveStreamProcessor.cpp

    r1961 r1964  
    5353unsigned int 
    5454DigidesignReceiveStreamProcessor::getMaxPacketSize() { 
    55     int framerate = m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate(); 
     55 
     56    // Frame rate is accessible with something like this: 
     57    //   int framerate = m_Parent.getDeviceManager().getStreamProcessorManager().getNominalRate(); 
    5658 
    5759    // What's returned here is the maximum packet size seen at the current 
  • trunk/libffado/src/libstreaming/digidesign/DigidesignTransmitStreamProcessor.cpp

    r1961 r1964  
    4141#include <assert.h> 
    4242 
     43/* Provide more intuitive access to GCC's branch predition built-ins */ 
     44#define likely(x)   __builtin_expect((x),1) 
     45#define unlikely(x) __builtin_expect((x),0) 
     46 
    4347namespace Streaming 
    4448{ 
    4549 
    4650/* transmit */ 
    47 DigidesignTransmitStreamProcessor::DigidesigTransmitStreamProcessor(FFADODevice &parent, unsigned int event_size ) 
     51DigidesignTransmitStreamProcessor::DigidesignTransmitStreamProcessor(FFADODevice &parent, unsigned int event_size ) 
    4852        : StreamProcessor(parent, ePT_Transmit ) 
    4953        , m_event_size( event_size ) 
     
    279283 
    280284    signed n_events = getNominalFramesPerPacket(); 
    281     unsigned dbs = m_event_size / 4; 
     285    // unsigned dbs = m_event_size / 4; 
    282286 
    283287    // Encode data into packet.  If a CIP header is to be placed at the 
     
    440444    quadlet_t *quadlet = (quadlet_t *)data; 
    441445    quadlet += 2; // skip the header - remove if no CIP header is used 
     446 
    442447    // Size of a single data frame in quadlets 
    443     unsigned dbs = m_event_size / 4; 
     448    // unsigned dbs = m_event_size / 4; 
    444449 
    445450    signed n_events = getNominalFramesPerPacket(); 
    446451 
    447452    memset(quadlet, 0, n_events*m_event_size); 
    448     float ticks_per_frame = m_Parent.getDeviceManager().getStreamProcessorManager().getSyncSource().getTicksPerFrame(); 
    449  
    450     // If there are per-frame timestamps to set up (or other things), it's done here.  "quadlet" starts out 
    451     // pointing to the start of the first frame, and it can be advanced to the next frame by adding dbs to it. 
     453 
     454    // If there are per-frame timestamps to set up (or other things), it's 
     455    // done here.  "quadlet" starts out pointing to the start of the first 
     456    // frame, and it can be advanced to the next frame by adding dbs to it. 
     457    // 
     458    // Obtaining the "ticks per frame" is sometimes useful when constructing 
     459    // timestamps: 
     460    //   float ticks_per_frame = m_Parent.getDeviceManager().getStreamProcessorManager().getSyncSource().getTicksPerFrame(); 
    452461 
    453462    return eCRV_OK; 
     
    498507 
    499508    quadlet_t *quadlet = (quadlet_t *)data; 
    500     // Size of a single data frame in quadlets.  See comment in 
    501     // fillDataPacketHeader() regarding the Ultralite. 
    502     unsigned dbs = m_event_size / 4; 
     509 
    503510    // construct the packet CIP-like header.  Even if this is a data-less 
    504511    // packet the dbs field is still set as if there were data blocks 
    505     // present.  For data-less packets the dbc is the same as the previously 
     512    // present.  For data-less packets the tx_dbc is the same as the previously 
    506513    // transmitted block. 
    507514 
     515    unsigned dbs = m_event_size / 4; 
     516 
    508517    // Depending on the device this might have to be set to something sensible. 
    509     unsigned dbs = m_event_size / 4; 
     518    unsigned int tx_dbc = m_event_size / 4; 
    510519 
    511520    *quadlet = CondSwapToBus32(0x00000400 | ((m_Parent.get1394Service().getLocalNodeId()&0x3f)<<24) | tx_dbc | (dbs<<16)); 
     
    534543                       unsigned int nevents, unsigned int offset) { 
    535544    bool no_problem=true; 
    536     unsigned int i; 
    537545 
    538546    // This function is the transmit equivalent of