Changeset 1806

Show
Ignore:
Timestamp:
03/17/10 12:34:03 (13 years ago)
Author:
arnonym
Message:

Fix #266

And some stuff I had on disk: When showDevice is called, the device info should be shown. Not depending on the debug-verbosity but just shown... Makes test-dice-eap _much_ nicer to use.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/dice/dice_avdevice.cpp

    r1804 r1806  
    623623    FFADODevice::showDevice(); 
    624624 
    625     debugOutput(DEBUG_LEVEL_VERBOSE," DICE Parameter Space info:\n"); 
    626     debugOutput(DEBUG_LEVEL_VERBOSE,"  Global  : offset=0x%04X size=%04d\n", m_global_reg_offset, m_global_reg_size); 
    627     debugOutput(DEBUG_LEVEL_VERBOSE,"  TX      : offset=0x%04X size=%04d\n", m_tx_reg_offset, m_tx_reg_size); 
    628     debugOutput(DEBUG_LEVEL_VERBOSE,"                nb=%4d size=%04d\n", m_nb_tx, m_tx_size); 
    629     debugOutput(DEBUG_LEVEL_VERBOSE,"  RX      : offset=0x%04X size=%04d\n", m_rx_reg_offset, m_rx_reg_size); 
    630     debugOutput(DEBUG_LEVEL_VERBOSE,"                nb=%4d size=%04d\n", m_nb_rx, m_rx_size); 
    631     debugOutput(DEBUG_LEVEL_VERBOSE,"  UNUSED1 : offset=0x%04X size=%04d\n", m_unused1_reg_offset, m_unused1_reg_size); 
    632     debugOutput(DEBUG_LEVEL_VERBOSE,"  UNUSED2 : offset=0x%04X size=%04d\n", m_unused2_reg_offset, m_unused2_reg_size); 
    633  
    634     debugOutput(DEBUG_LEVEL_VERBOSE," Global param space:\n"); 
     625    printMessage(" DICE Parameter Space info:\n"); 
     626    printMessage("  Global  : offset=0x%04X size=%04d\n", m_global_reg_offset, m_global_reg_size); 
     627    printMessage("  TX      : offset=0x%04X size=%04d\n", m_tx_reg_offset, m_tx_reg_size); 
     628    printMessage("                nb=%4d size=%04d\n", m_nb_tx, m_tx_size); 
     629    printMessage("  RX      : offset=0x%04X size=%04d\n", m_rx_reg_offset, m_rx_reg_size); 
     630    printMessage("                nb=%4d size=%04d\n", m_nb_rx, m_rx_size); 
     631    printMessage("  UNUSED1 : offset=0x%04X size=%04d\n", m_unused1_reg_offset, m_unused1_reg_size); 
     632    printMessage("  UNUSED2 : offset=0x%04X size=%04d\n", m_unused2_reg_offset, m_unused2_reg_size); 
     633 
     634    printMessage(" Global param space:\n"); 
    635635 
    636636    readGlobalRegBlock(DICE_REGISTER_GLOBAL_OWNER, reinterpret_cast<fb_quadlet_t *>(&tmp_octlet), sizeof(fb_octlet_t)); 
    637     debugOutput(DEBUG_LEVEL_VERBOSE,"  Owner            : 0x%016"PRIX64"\n",tmp_octlet); 
     637    printMessage("  Owner            : 0x%016"PRIX64"\n",tmp_octlet); 
    638638 
    639639    readGlobalReg(DICE_REGISTER_GLOBAL_NOTIFICATION, &tmp_quadlet); 
    640     debugOutput(DEBUG_LEVEL_VERBOSE,"  Notification     : 0x%08"PRIX32"\n",tmp_quadlet); 
     640    printMessage("  Notification     : 0x%08"PRIX32"\n",tmp_quadlet); 
    641641 
    642642    readGlobalReg(DICE_REGISTER_GLOBAL_NOTIFICATION, &tmp_quadlet); 
    643     debugOutput(DEBUG_LEVEL_NORMAL,"  Nick name        : %s\n",getNickname().c_str()); 
     643    printMessage("  Nick name        : %s\n",getNickname().c_str()); 
    644644 
    645645    readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &tmp_quadlet); 
    646     debugOutput(DEBUG_LEVEL_NORMAL,"  Clock Select     : 0x%02X 0x%02X\n", 
     646    printMessage("  Clock Select     : 0x%02X 0x%02X\n", 
    647647        (tmp_quadlet>>8) & 0xFF, tmp_quadlet & 0xFF); 
    648648 
    649649    readGlobalReg(DICE_REGISTER_GLOBAL_ENABLE, &tmp_quadlet); 
    650     debugOutput(DEBUG_LEVEL_NORMAL,"  Enable           : %s\n", 
     650    printMessage("  Enable           : %s\n", 
    651651        (tmp_quadlet&0x1?"true":"false")); 
    652652 
    653653    readGlobalReg(DICE_REGISTER_GLOBAL_STATUS, &tmp_quadlet); 
    654     debugOutput(DEBUG_LEVEL_NORMAL,"  Clock Status     : %s 0x%02X\n", 
     654    printMessage("  Clock Status     : %s 0x%02X\n", 
    655655        (tmp_quadlet&0x1?"locked":"not locked"), (tmp_quadlet>>8) & 0xFF); 
    656656 
    657657    readGlobalReg(DICE_REGISTER_GLOBAL_EXTENDED_STATUS, &tmp_quadlet); 
    658     debugOutput(DEBUG_LEVEL_VERBOSE, "  Extended Status  : 0x%08"PRIX32"\n", tmp_quadlet); 
     658    printMessage("  Extended Status  : 0x%08"PRIX32"\n", tmp_quadlet); 
    659659 
    660660    readGlobalReg(DICE_REGISTER_GLOBAL_SAMPLE_RATE, &tmp_quadlet); 
    661     debugOutput(DEBUG_LEVEL_NORMAL, "  Samplerate       : 0x%08"PRIX32" (%"PRIu32")\n", tmp_quadlet, tmp_quadlet); 
     661    printMessage("  Samplerate       : 0x%08"PRIX32" (%"PRIu32")\n", tmp_quadlet, tmp_quadlet); 
    662662 
    663663    readGlobalRegBlock(DICE_REGISTER_GLOBAL_VERSION, reinterpret_cast<fb_quadlet_t *>(&tmp_quadlet), sizeof(fb_quadlet_t)); 
    664     debugOutput(DEBUG_LEVEL_NORMAL,"  Version          : 0x%08"PRIX32"\n", tmp_quadlet); 
     664    printMessage("  Version          : 0x%08"PRIX32"\n", tmp_quadlet); 
    665665     
    666666    readGlobalReg(DICE_REGISTER_GLOBAL_VERSION, &tmp_quadlet); 
    667     debugOutput(DEBUG_LEVEL_NORMAL,"  Version          : 0x%08"PRIX32" (%u.%u.%u.%u)\n", 
     667    printMessage("  Version          : 0x%08"PRIX32" (%u.%u.%u.%u)\n", 
    668668        tmp_quadlet, 
    669669        DICE_DRIVER_SPEC_VERSION_NUMBER_GET_A(tmp_quadlet), 
     
    674674 
    675675    readGlobalReg(DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, &tmp_quadlet); 
    676     debugOutput(DEBUG_LEVEL_VERBOSE,"  Clock caps       : 0x%08"PRIX32"\n", tmp_quadlet); 
     676    printMessage("  Clock caps       : 0x%08"PRIX32"\n", tmp_quadlet); 
    677677 
    678678    stringlist names=getClockSourceNameString(); 
    679     debugOutput(DEBUG_LEVEL_VERBOSE,"  Clock sources    :\n"); 
     679    printMessage("  Clock sources    :\n"); 
    680680 
    681681    for ( stringlist::iterator it = names.begin(); 
     
    683683          ++it ) 
    684684    { 
    685         debugOutput(DEBUG_LEVEL_VERBOSE,"    %s\n", (*it).c_str()); 
    686     } 
    687  
    688     debugOutput(DEBUG_LEVEL_VERBOSE," TX param space:\n"); 
    689     debugOutput(DEBUG_LEVEL_VERBOSE,"  Nb of xmit        : %1d\n", m_nb_tx); 
     685        printMessage("    %s\n", (*it).c_str()); 
     686    } 
     687 
     688    printMessage(" TX param space:\n"); 
     689    printMessage("  Nb of xmit        : %1d\n", m_nb_tx); 
    690690    for (unsigned int i=0;i<m_nb_tx;i++) { 
    691         debugOutput(DEBUG_LEVEL_VERBOSE,"  Transmitter %d:\n",i); 
     691        printMessage("  Transmitter %d:\n",i); 
    692692 
    693693        readTxReg(i, DICE_REGISTER_TX_ISOC_BASE, &tmp_quadlet); 
    694         debugOutput(DEBUG_LEVEL_VERBOSE,"   ISO channel       : %3d\n", tmp_quadlet); 
     694        printMessage("   ISO channel       : %3d\n", tmp_quadlet); 
    695695        readTxReg(i, DICE_REGISTER_TX_SPEED_BASE, &tmp_quadlet); 
    696         debugOutput(DEBUG_LEVEL_VERBOSE,"   ISO speed         : %3d\n", tmp_quadlet); 
     696        printMessage("   ISO speed         : %3d\n", tmp_quadlet); 
    697697 
    698698        readTxReg(i, DICE_REGISTER_TX_NB_AUDIO_BASE, &tmp_quadlet); 
    699         debugOutput(DEBUG_LEVEL_VERBOSE,"   Nb audio channels : %3d\n", tmp_quadlet); 
     699        printMessage("   Nb audio channels : %3d\n", tmp_quadlet); 
    700700        readTxReg(i, DICE_REGISTER_TX_MIDI_BASE, &tmp_quadlet); 
    701         debugOutput(DEBUG_LEVEL_VERBOSE,"   Nb midi channels  : %3d\n", tmp_quadlet); 
     701        printMessage("   Nb midi channels  : %3d\n", tmp_quadlet); 
    702702 
    703703        readTxReg(i, DICE_REGISTER_TX_AC3_CAPABILITIES_BASE, &tmp_quadlet); 
    704         debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 caps          : 0x%08"PRIX32"\n", tmp_quadlet); 
     704        printMessage("   AC3 caps          : 0x%08"PRIX32"\n", tmp_quadlet); 
    705705        readTxReg(i, DICE_REGISTER_TX_AC3_ENABLE_BASE, &tmp_quadlet); 
    706         debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 enable        : 0x%08"PRIX32"\n", tmp_quadlet); 
     706        printMessage("   AC3 enable        : 0x%08"PRIX32"\n", tmp_quadlet); 
    707707 
    708708        stringlist channel_names=getTxNameString(i); 
    709         debugOutput(DEBUG_LEVEL_VERBOSE,"   Channel names     :\n"); 
     709        printMessage("   Channel names     :\n"); 
    710710        for ( stringlist::iterator it = channel_names.begin(); 
    711711            it != channel_names.end(); 
    712712            ++it ) 
    713713        { 
    714             debugOutput(DEBUG_LEVEL_VERBOSE,"     %s\n", (*it).c_str()); 
    715         } 
    716     } 
    717  
    718     debugOutput(DEBUG_LEVEL_VERBOSE," RX param space:\n"); 
    719     debugOutput(DEBUG_LEVEL_VERBOSE,"  Nb of recv        : %1d\n", m_nb_tx); 
     714            printMessage("     %s\n", (*it).c_str()); 
     715        } 
     716    } 
     717 
     718    printMessage(" RX param space:\n"); 
     719    printMessage("  Nb of recv        : %1d\n", m_nb_tx); 
    720720    for (unsigned int i=0;i<m_nb_rx;i++) { 
    721         debugOutput(DEBUG_LEVEL_VERBOSE,"  Receiver %d:\n",i); 
     721        printMessage("  Receiver %d:\n",i); 
    722722 
    723723        readRxReg(i, DICE_REGISTER_RX_ISOC_BASE, &tmp_quadlet); 
    724         debugOutput(DEBUG_LEVEL_VERBOSE,"   ISO channel       : %3d\n", tmp_quadlet); 
     724        printMessage("   ISO channel       : %3d\n", tmp_quadlet); 
    725725        readRxReg(i, DICE_REGISTER_RX_SEQ_START_BASE, &tmp_quadlet); 
    726         debugOutput(DEBUG_LEVEL_VERBOSE,"   Sequence start    : %3d\n", tmp_quadlet); 
     726        printMessage("   Sequence start    : %3d\n", tmp_quadlet); 
    727727 
    728728        readRxReg(i, DICE_REGISTER_RX_NB_AUDIO_BASE, &tmp_quadlet); 
    729         debugOutput(DEBUG_LEVEL_VERBOSE,"   Nb audio channels : %3d\n", tmp_quadlet); 
     729        printMessage("   Nb audio channels : %3d\n", tmp_quadlet); 
    730730        readRxReg(i, DICE_REGISTER_RX_MIDI_BASE, &tmp_quadlet); 
    731         debugOutput(DEBUG_LEVEL_VERBOSE,"   Nb midi channels  : %3d\n", tmp_quadlet); 
     731        printMessage("   Nb midi channels  : %3d\n", tmp_quadlet); 
    732732 
    733733        readRxReg(i, DICE_REGISTER_RX_AC3_CAPABILITIES_BASE, &tmp_quadlet); 
    734         debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 caps          : 0x%08"PRIX32"\n", tmp_quadlet); 
     734        printMessage("   AC3 caps          : 0x%08"PRIX32"\n", tmp_quadlet); 
    735735        readRxReg(i, DICE_REGISTER_RX_AC3_ENABLE_BASE, &tmp_quadlet); 
    736         debugOutput(DEBUG_LEVEL_VERBOSE,"   AC3 enable        : 0x%08"PRIX32"\n", tmp_quadlet); 
     736        printMessage("   AC3 enable        : 0x%08"PRIX32"\n", tmp_quadlet); 
    737737 
    738738        stringlist channel_names = getRxNameString(i); 
    739         debugOutput(DEBUG_LEVEL_VERBOSE,"   Channel names     :\n"); 
     739        printMessage("   Channel names     :\n"); 
    740740        for ( stringlist::iterator it = channel_names.begin(); 
    741741            it != channel_names.end(); 
    742742            ++it ) 
    743743        { 
    744             debugOutput(DEBUG_LEVEL_VERBOSE,"     %s\n", (*it).c_str()); 
     744            printMessage("     %s\n", (*it).c_str()); 
    745745        } 
    746746    } 
     
    16711671    } 
    16721672 
     1673    if(!readReg(m_tx_reg_offset + DICE_REGISTER_RX_SZ_RX, &m_rx_size)) { 
     1674        debugError("Could not initialize m_rx_size\n"); 
     1675        return false; 
     1676    } 
     1677    m_rx_size*=4; 
     1678 
    16731679    // FIXME: verify this and clean it up. 
    16741680    /* special case for Alesis io14, which announces two receive transmitters, 
     
    16761682     */ 
    16771683    if (FW_VENDORID_ALESIS == getConfigRom().getNodeVendorId()) { 
    1678         /* we may want to use a switch-case-statement some day... */ 
    1679         if ((0x00000001 == getConfigRom().getModelId()) || 
    1680             (0x00000000 == getConfigRom().getModelId())) { 
    1681             m_nb_rx = 1; 
    1682         } 
    1683     } 
    1684  
    1685     if(!readReg(m_tx_reg_offset + DICE_REGISTER_RX_SZ_RX, &m_rx_size)) { 
    1686         debugError("Could not initialize m_rx_size\n"); 
    1687         return false; 
    1688     } 
    1689     m_rx_size*=4; 
     1684        switch (getConfigRom().getModelId()) { 
     1685            case 0x00000001: 
     1686            case 0x00000000: 
     1687                m_nb_rx = 1; 
     1688                break; 
     1689        } 
     1690    } 
    16901691 
    16911692    debugOutput(DEBUG_LEVEL_VERBOSE,"DICE Parameter Space info:\n"); 
  • trunk/libffado/src/dice/dice_eap.cpp

    r1787 r1806  
    2828 
    2929#include "libutil/SystemTimeSource.h" 
     30#include "libutil/ByteSwap.h" 
    3031 
    3132#include <cstdio> 
     
    534535    } 
    535536 
    536     printMessage("--- Active Router/Stream ---\n"); 
     537    printMessage("--- Active Router ---\n"); 
    537538    RouterConfig *rcfg = getActiveRouterConfig(); 
    538539    if(rcfg) { 
    539540        rcfg->show(); 
    540541    } 
     542    printMessage("--- Active Stream ---\n"); 
    541543    StreamConfig *scfg = getActiveStreamConfig(); 
    542544    if(scfg) { 
     
    16871689EAP::StreamConfig::showConfigBlock(struct ConfigBlock &b) 
    16881690{ 
    1689     debugOutput(DEBUG_LEVEL_VERBOSE, " Channel count : %u audio, %u midi\n", b.nb_audio, b.nb_midi); 
    1690     debugOutput(DEBUG_LEVEL_VERBOSE, " AC3 Map       : 0x%08X\n", b.ac3_map); 
     1691    printMessage(" Channel count : %u audio, %u midi\n", b.nb_audio, b.nb_midi); 
     1692    printMessage(" AC3 Map       : 0x%08X\n", b.ac3_map); 
    16911693    stringlist channel_names  = getNamesForBlock(b); 
    1692     debugOutput(DEBUG_LEVEL_VERBOSE,"  Channel names :\n"); 
     1694    printMessage("  Channel names :\n"); 
    16931695    for ( stringlist::iterator it = channel_names.begin(); 
    16941696        it != channel_names.end(); 
    16951697        ++it ) 
    16961698    { 
    1697         debugOutput(DEBUG_LEVEL_VERBOSE,"     %s\n", (*it).c_str()); 
     1699        printMessage("     %s\n", (*it).c_str()); 
    16981700    } 
    16991701} 
     
    17031705{ 
    17041706    for(unsigned int i=0; i<m_nb_tx; i++) { 
    1705         debugOutput(DEBUG_LEVEL_VERBOSE, "TX Config block %d\n", i); 
     1707        printMessage("TX Config block %d\n", i); 
    17061708        showConfigBlock(m_tx_configs[i]); 
    17071709    } 
    17081710    for(unsigned int i=0; i<m_nb_rx; i++) { 
    1709         debugOutput(DEBUG_LEVEL_VERBOSE, "RX Config block %d\n", i); 
     1711        printMessage("RX Config block %d\n", i); 
    17101712        showConfigBlock(m_rx_configs[i]); 
    17111713    } 
     
    17151717 
    17161718 
    1717  
     1719// vim: et 
  • trunk/libffado/src/dice/dice_eap.h

    r1780 r1806  
    264264 
    265265    /** 
    266       the peak space is a special version of a router config 
     266      @brief Description of the peak space in hardware 
    267267      */ 
    268268    class PeakSpace {