Changeset 1539

Show
Ignore:
Timestamp:
04/19/09 06:39:40 (14 years ago)
Author:
ppalmers
Message:

- Fix bug in dice transmit channel detection
- Implement snoop mode for DICE

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/config.h.in

    r1531 r1539  
    5454 
    5555// FCP defines 
    56 #define IEEE1394SERVICE_FCP_MAX_TRIES                       20 
     56#define IEEE1394SERVICE_FCP_MAX_TRIES                        2 
    5757#define IEEE1394SERVICE_FCP_SLEEP_BETWEEN_FAILURES_USECS  1000 
    5858#define IEEE1394SERVICE_FCP_POLL_TIMEOUT_MSEC              200 
    59 #define IEEE1394SERVICE_FCP_RESPONSE_TIMEOUT_USEC      2000000 
     59#define IEEE1394SERVICE_FCP_RESPONSE_TIMEOUT_USEC      200000 
    6060 
    6161// The current version of libiec61883 doesn't seem to calculate 
  • trunk/libffado/src/devicemanager.cpp

    r1535 r1539  
    9999    , m_thread_priority( 0 ) 
    100100{ 
    101     addOption(Util::OptionContainer::Option("slaveMode",false)); 
    102     addOption(Util::OptionContainer::Option("snoopMode",false)); 
     101    addOption(Util::OptionContainer::Option("slaveMode", false)); 
     102    addOption(Util::OptionContainer::Option("snoopMode", false)); 
    103103} 
    104104 
  • trunk/libffado/src/dice/dice_avdevice.cpp

    r1515 r1539  
    4343#include <assert.h> 
    4444 
     45#include "libutil/Configuration.h" 
     46#include "devicemanager.h" 
     47 
    4548using namespace std; 
    4649 
     
    5154{ 
    5255    // vendor id, model id, vendor name, model name 
     56    {FW_VENDORID_TCAT,   0x00000001, "TCAT", "DiceII EVM"}, 
    5357    {FW_VENDORID_TCAT,   0x00000002, "TCAT", "DiceII EVM"}, 
    5458    {FW_VENDORID_TCAT,   0x00000004, "TCAT", "DiceII EVM (vxx)"}, 
     
    8690    debugOutput( DEBUG_LEVEL_VERBOSE, "Created Dice::DiceAvDevice (NodeID %d)\n", 
    8791                 getConfigRom().getNodeId() ); 
    88  
     92    addOption(Util::OptionContainer::Option("snoopMode",false)); 
    8993} 
    9094 
     
    233237    fb_quadlet_t select=0x0; 
    234238 
    235     switch ( samplingFrequency ) { 
    236     default: 
    237     case 22050: 
    238     case 24000: 
    239         supported=false; 
    240         break; 
    241     case 32000: 
    242         supported=maskedCheckNotZeroGlobalReg( 
    243                     DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
    244                     DICE_CLOCKCAP_RATE_32K); 
    245         select=DICE_RATE_32K; 
    246         break; 
    247     case 44100: 
    248         supported=maskedCheckNotZeroGlobalReg( 
    249                     DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
    250                     DICE_CLOCKCAP_RATE_44K1); 
    251         select=DICE_RATE_44K1; 
    252         break; 
    253     case 48000: 
    254         supported=maskedCheckNotZeroGlobalReg( 
    255                     DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
    256                     DICE_CLOCKCAP_RATE_48K); 
    257         select=DICE_RATE_48K; 
    258         break; 
    259     case 88200: 
    260         supported=maskedCheckNotZeroGlobalReg( 
    261                     DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
    262                     DICE_CLOCKCAP_RATE_88K2); 
    263         select=DICE_RATE_88K2; 
    264         break; 
    265     case 96000: 
    266         supported=maskedCheckNotZeroGlobalReg( 
    267                     DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
    268                     DICE_CLOCKCAP_RATE_96K); 
    269         select=DICE_RATE_96K; 
    270         break; 
    271     case 176400: 
    272         supported=maskedCheckNotZeroGlobalReg( 
    273                     DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
    274                     DICE_CLOCKCAP_RATE_176K4); 
    275         select=DICE_RATE_176K4; 
    276         break; 
    277     case 192000: 
    278         supported=maskedCheckNotZeroGlobalReg( 
    279                     DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
    280                     DICE_CLOCKCAP_RATE_192K); 
    281         select=DICE_RATE_192K; 
    282         break; 
    283     } 
    284  
    285     if (!supported) { 
    286         debugWarning("Unsupported sample rate: %d\n", (samplingFrequency)); 
    287         return false; 
    288     } 
    289  
    290     if (isIsoStreamingEnabled()) { 
    291         debugError("Cannot change samplerate while streaming is enabled\n"); 
    292         return false; 
    293     } 
    294  
    295     fb_quadlet_t clockreg; 
    296     if (!readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clockreg)) { 
    297         debugError("Could not read CLOCK_SELECT register\n"); 
    298         return false; 
    299     } 
    300  
    301     clockreg = DICE_SET_RATE(clockreg, select); 
    302  
    303     if (!writeGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, clockreg)) { 
    304         debugError("Could not write CLOCK_SELECT register\n"); 
    305         return false; 
    306     } 
    307  
    308     // check if the write succeeded 
    309     fb_quadlet_t clockreg_verify; 
    310     if (!readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clockreg_verify)) { 
    311         debugError("Could not read CLOCK_SELECT register\n"); 
    312         return false; 
    313     } 
    314  
    315     if(clockreg != clockreg_verify) { 
    316         debugError("Samplerate register write failed\n"); 
    317         return false; 
    318     } 
    319  
     239    bool snoopMode = false; 
     240    if(!getOption("snoopMode", snoopMode)) { 
     241        debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 
     242    } 
     243 
     244    if(snoopMode) { 
     245        int current_sr = getSamplingFrequency(); 
     246        if (current_sr != samplingFrequency ) { 
     247            debugError("In snoop mode it is impossible to set the sample rate.\n"); 
     248            debugError("Please start the client with the correct setting.\n"); 
     249            return false; 
     250        } 
     251        return true; 
     252    } else { 
     253        switch ( samplingFrequency ) { 
     254        default: 
     255        case 22050: 
     256        case 24000: 
     257            supported=false; 
     258            break; 
     259        case 32000: 
     260            supported=maskedCheckNotZeroGlobalReg( 
     261                        DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     262                        DICE_CLOCKCAP_RATE_32K); 
     263            select=DICE_RATE_32K; 
     264            break; 
     265        case 44100: 
     266            supported=maskedCheckNotZeroGlobalReg( 
     267                        DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     268                        DICE_CLOCKCAP_RATE_44K1); 
     269            select=DICE_RATE_44K1; 
     270            break; 
     271        case 48000: 
     272            supported=maskedCheckNotZeroGlobalReg( 
     273                        DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     274                        DICE_CLOCKCAP_RATE_48K); 
     275            select=DICE_RATE_48K; 
     276            break; 
     277        case 88200: 
     278            supported=maskedCheckNotZeroGlobalReg( 
     279                        DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     280                        DICE_CLOCKCAP_RATE_88K2); 
     281            select=DICE_RATE_88K2; 
     282            break; 
     283        case 96000: 
     284            supported=maskedCheckNotZeroGlobalReg( 
     285                        DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     286                        DICE_CLOCKCAP_RATE_96K); 
     287            select=DICE_RATE_96K; 
     288            break; 
     289        case 176400: 
     290            supported=maskedCheckNotZeroGlobalReg( 
     291                        DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     292                        DICE_CLOCKCAP_RATE_176K4); 
     293            select=DICE_RATE_176K4; 
     294            break; 
     295        case 192000: 
     296            supported=maskedCheckNotZeroGlobalReg( 
     297                        DICE_REGISTER_GLOBAL_CLOCKCAPABILITIES, 
     298                        DICE_CLOCKCAP_RATE_192K); 
     299            select=DICE_RATE_192K; 
     300            break; 
     301        } 
     302     
     303        if (!supported) { 
     304            debugWarning("Unsupported sample rate: %d\n", (samplingFrequency)); 
     305            return false; 
     306        } 
     307     
     308        if (isIsoStreamingEnabled()) { 
     309            debugError("Cannot change samplerate while streaming is enabled\n"); 
     310            return false; 
     311        } 
     312     
     313        fb_quadlet_t clockreg; 
     314        if (!readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clockreg)) { 
     315            debugError("Could not read CLOCK_SELECT register\n"); 
     316            return false; 
     317        } 
     318     
     319        clockreg = DICE_SET_RATE(clockreg, select); 
     320     
     321        if (!writeGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, clockreg)) { 
     322            debugError("Could not write CLOCK_SELECT register\n"); 
     323            return false; 
     324        } 
     325     
     326        // check if the write succeeded 
     327        fb_quadlet_t clockreg_verify; 
     328        if (!readGlobalReg(DICE_REGISTER_GLOBAL_CLOCK_SELECT, &clockreg_verify)) { 
     329            debugError("Could not read CLOCK_SELECT register\n"); 
     330            return false; 
     331        } 
     332     
     333        if(clockreg != clockreg_verify) { 
     334            debugError("Samplerate register write failed\n"); 
     335            return false; 
     336        } 
     337    } 
    320338    return true; 
    321339} 
     
    690708bool 
    691709DiceAvDevice::prepare() { 
     710    fb_quadlet_t nb_audio; 
     711    fb_quadlet_t nb_midi; 
     712    unsigned int nb_channels = 0; 
     713 
     714    bool snoopMode = false; 
     715    if(!getOption("snoopMode", snoopMode)) { 
     716        debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 
     717    } 
     718 
     719    // get the device specific and/or global SP configuration 
     720    Util::Configuration &config = getDeviceManager().getConfiguration(); 
     721    // base value is the config.h value 
     722    float recv_sp_dll_bw = STREAMPROCESSOR_DLL_BW_HZ; 
     723    float xmit_sp_dll_bw = STREAMPROCESSOR_DLL_BW_HZ; 
     724 
     725    int xmit_max_cycles_early_transmit = AMDTP_MAX_CYCLES_TO_TRANSMIT_EARLY; 
     726    int xmit_transfer_delay = AMDTP_TRANSMIT_TRANSFER_DELAY; 
     727    int xmit_min_cycles_before_presentation = AMDTP_MIN_CYCLES_BEFORE_PRESENTATION; 
     728 
     729    // we can override that globally 
     730    config.getValueForSetting("streaming.common.recv_sp_dll_bw", recv_sp_dll_bw); 
     731    config.getValueForSetting("streaming.common.xmit_sp_dll_bw", xmit_sp_dll_bw); 
     732    config.getValueForSetting("streaming.amdtp.xmit_max_cycles_early_transmit", xmit_max_cycles_early_transmit); 
     733    config.getValueForSetting("streaming.amdtp.xmit_transfer_delay", xmit_transfer_delay); 
     734    config.getValueForSetting("streaming.amdtp.xmit_min_cycles_before_presentation", xmit_min_cycles_before_presentation); 
     735 
     736    // or override in the device section 
     737    uint32_t vendorid = getConfigRom().getNodeVendorId(); 
     738    uint32_t modelid = getConfigRom().getModelId(); 
     739    config.getValueForDeviceSetting(vendorid, modelid, "recv_sp_dll_bw", recv_sp_dll_bw); 
     740    config.getValueForDeviceSetting(vendorid, modelid, "xmit_sp_dll_bw", xmit_sp_dll_bw); 
     741    config.getValueForDeviceSetting(vendorid, modelid, "xmit_max_cycles_early_transmit", xmit_max_cycles_early_transmit); 
     742    config.getValueForDeviceSetting(vendorid, modelid, "xmit_transfer_delay", xmit_transfer_delay); 
     743    config.getValueForDeviceSetting(vendorid, modelid, "xmit_min_cycles_before_presentation", xmit_min_cycles_before_presentation); 
     744 
     745    diceNameVector names_audio; 
     746    diceNameVector names_midi; 
    692747    // prepare receive SP's 
    693748//     for (unsigned int i=0;i<1;i++) { 
    694     for (unsigned int i=0;i<m_nb_tx;i++) { 
    695         fb_quadlet_t nb_audio; 
    696         fb_quadlet_t nb_midi; 
    697         unsigned int nb_channels=0; 
     749    for (unsigned int i=0; i<m_nb_tx; i++) { 
    698750 
    699751        if(!readTxReg(i, DICE_REGISTER_TX_NB_AUDIO_BASE, &nb_audio)) { 
     
    707759 
    708760        // request the channel names 
    709         diceNameVector names_audio=getTxNameString(i); 
    710  
     761        names_audio = getTxNameString(i); 
    711762        if (names_audio.size() != nb_audio) { 
    712763            debugWarning("The audio channel name vector is incorrect, using default names\n"); 
     
    720771        } 
    721772 
    722         nb_channels=nb_audio; 
     773        nb_channels = nb_audio; 
    723774        if(nb_midi) nb_channels += 1; // midi-muxed counts as one 
    724775 
    725776        // construct the MIDI names 
    726         diceNameVector names_midi; 
    727777        for (unsigned int j=0;j<nb_midi;j++) { 
    728778            std::ostringstream newname; 
     
    733783        // construct the streamprocessor 
    734784        Streaming::AmdtpReceiveStreamProcessor *p; 
    735         p=new Streaming::AmdtpReceiveStreamProcessor(*this, 
     785        p = new Streaming::AmdtpReceiveStreamProcessor(*this, 
    736786                             nb_channels); 
    737787 
     
    772822        } 
    773823 
     824        if(!p->setDllBandwidth(recv_sp_dll_bw)) { 
     825            debugFatal("Could not set DLL bandwidth\n"); 
     826            delete p; 
     827            return false; 
     828        } 
     829 
     830        debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) Receive SP on channel [%d audio, %d midi]\n", this, nb_audio, nb_midi); 
    774831        // add the SP to the vector 
    775832        m_receiveProcessors.push_back(p); 
     
    777834 
    778835    // prepare transmit SP's 
    779     //for (unsigned int i=0;i<1;i++) { 
    780     for (unsigned int i=0;i<m_nb_rx;i++) { 
    781         fb_quadlet_t nb_audio; 
    782         fb_quadlet_t nb_midi; 
    783         unsigned int nb_channels=0; 
    784  
    785         if(!readTxReg(i, DICE_REGISTER_RX_NB_AUDIO_BASE, &nb_audio)) { 
    786             debugError("Could not read DICE_REGISTER_RX_NB_AUDIO_BASE register for ARX%u\n",i); 
     836    names_audio.clear(); 
     837    names_midi.clear(); 
     838//     for (unsigned int i=0;i<1;i++) { 
     839    for (unsigned int i=0; i<m_nb_rx; i++) { 
     840 
     841        // construct the streamprocessor 
     842        Streaming::StreamProcessor *p; 
     843        if(!readRxReg(i, DICE_REGISTER_RX_NB_AUDIO_BASE, &nb_audio)) { 
     844            debugError("Could not read DICE_REGISTER_RX_NB_AUDIO_BASE register for ARX%u\n", i); 
    787845            continue; 
    788846        } 
    789         if(!readTxReg(i, DICE_REGISTER_RX_MIDI_BASE, &nb_midi)) { 
    790             debugError("Could not read DICE_REGISTER_RX_MIDI_BASE register for ARX%u\n",i); 
     847        if(!readRxReg(i, DICE_REGISTER_RX_MIDI_BASE, &nb_midi)) { 
     848            debugError("Could not read DICE_REGISTER_RX_MIDI_BASE register for ARX%u\n", i); 
    791849            continue; 
    792850        } 
    793851 
     852        // request the channel names 
     853        names_audio = getRxNameString(i); 
     854 
    794855        /* Vendor-specific hacks */ 
     856        // PP: I think this was a workaround for a bug that is not required anymore 
     857        #if 0 
    795858        if (FW_VENDORID_ALESIS == getConfigRom().getNodeVendorId()) { 
    796859            /* Alesis io14 RX0 claims to have six audio channels. Ignore 
    797             * it, just use 8 for Bus1-L+R .. Bus4-L+R. 
    798             */ 
     860            * it, just use 8 for Bus1-L+R .. Bus4-L+R. 
     861            */ 
    799862            if (0x00000001 == getConfigRom().getModelId()) { 
    800863                nb_audio = 8; 
     
    806869            } 
    807870        } 
    808  
    809         // request the channel names 
    810         diceNameVector names_audio=getRxNameString(i); 
     871        #endif 
     872 
     873        nb_channels = nb_audio; 
     874        if(nb_midi) nb_channels += 1; // midi-muxed counts as one 
    811875 
    812876        if (names_audio.size() != nb_audio) { 
     
    814878            names_audio.clear(); 
    815879 
    816             for (unsigned int j=0;j<nb_audio;j++) { 
     880            for (unsigned int j=0; j < nb_audio; j++) { 
    817881                std::ostringstream newname; 
    818882                newname << "output_" << j; 
     
    821885        } 
    822886 
    823         nb_channels=nb_audio; 
    824         if(nb_midi) nb_channels += 1; // midi-muxed counts as one 
    825  
    826887        // construct the MIDI names 
    827         diceNameVector names_midi; 
    828         for (unsigned int j=0;j<nb_midi;j++) { 
     888        for (unsigned int j=0; j < nb_midi; j++) { 
    829889            std::ostringstream newname; 
    830890            newname << "midi_out_" << j; 
     
    832892        } 
    833893 
    834         // construct the streamprocessor 
    835         Streaming::AmdtpTransmitStreamProcessor *p; 
    836         p=new Streaming::AmdtpTransmitStreamProcessor(*this, 
    837                              nb_channels); 
     894        enum Streaming::Port::E_Direction port_type; 
     895        float dll_bw; 
     896        if (snoopMode) { 
     897            // we are snooping, so this is receive too. 
     898            p = new Streaming::AmdtpReceiveStreamProcessor(*this, nb_channels); 
     899            port_type = Streaming::Port::E_Capture; 
     900            dll_bw = recv_sp_dll_bw; 
     901        } else { 
     902            // this is a normal situation 
     903            Streaming::AmdtpTransmitStreamProcessor *t; 
     904            t = new Streaming::AmdtpTransmitStreamProcessor(*this, nb_channels); 
     905            #if AMDTP_ALLOW_PAYLOAD_IN_NODATA_XMIT 
     906            // the DICE-II cannot handle payload in the NO-DATA packets. 
     907            // the other DICE chips don't need payload. Therefore 
     908            // we disable it. 
     909            t->sendPayloadForNoDataPackets(false); 
     910            #endif 
     911     
     912            // transmit control parameters 
     913            t->setMaxCyclesToTransmitEarly(xmit_max_cycles_early_transmit); 
     914            t->setTransferDelay(xmit_transfer_delay); 
     915            t->setMinCyclesBeforePresentation(xmit_min_cycles_before_presentation); 
     916 
     917            p = t; 
     918            port_type = Streaming::Port::E_Playback; 
     919            dll_bw = xmit_sp_dll_bw; 
     920        } 
    838921 
    839922        if(!p->init()) { 
    840             debugFatal("Could not initialize transmit processor!\n"); 
     923            debugFatal("Could not initialize transmit processor %s!\n", 
     924                (snoopMode?" in snoop mode":"")); 
    841925            delete p; 
    842926            continue; 
    843927        } 
    844928 
    845 #if AMDTP_ALLOW_PAYLOAD_IN_NODATA_XMIT 
    846         // the DICE-II cannot handle payload in the NO-DATA packets. 
    847         // the other DICE chips don't need payload. Therefore 
    848         // we disable it. 
    849         p->sendPayloadForNoDataPackets(false); 
    850 #endif 
    851  
    852929        // add audio ports to the processor 
    853         for (unsigned int j=0;j<nb_audio;j++) { 
     930        for (unsigned int j=0; j < nb_audio; j++) { 
    854931            diceChannelInfo channelInfo; 
    855             channelInfo.name=names_audio.at(j); 
    856             channelInfo.portType=ePT_Analog; 
    857             channelInfo.streamPosition=j; 
    858             channelInfo.streamLocation=0; 
    859  
    860             if (!addChannelToProcessor(&channelInfo, p, Streaming::Port::E_Playback)) { 
     932            channelInfo.name = names_audio.at(j); 
     933            channelInfo.portType = ePT_Analog; 
     934            channelInfo.streamPosition = j; 
     935            channelInfo.streamLocation = 0; 
     936 
     937            if (!addChannelToProcessor(&channelInfo, p, port_type)) { 
    861938                debugError("Could not add channel %s to StreamProcessor\n", 
    862939                    channelInfo.name.c_str()); 
     
    866943 
    867944        // add midi ports to the processor 
    868         for (unsigned int j=0;j<nb_midi;j++) { 
     945        for (unsigned int j=0; j < nb_midi; j++) { 
    869946            diceChannelInfo channelInfo; 
    870             channelInfo.name=names_midi.at(j); 
    871             channelInfo.portType=ePT_MIDI; 
    872             channelInfo.streamPosition=nb_audio; 
    873             channelInfo.streamLocation=j; 
    874  
    875             if (!addChannelToProcessor(&channelInfo, p, Streaming::Port::E_Playback)) { 
     947            channelInfo.name = names_midi.at(j); 
     948            channelInfo.portType = ePT_MIDI; 
     949            channelInfo.streamPosition = nb_audio; 
     950            channelInfo.streamLocation = j; 
     951 
     952            if (!addChannelToProcessor(&channelInfo, p, port_type)) { 
    876953                debugError("Could not add channel %s to StreamProcessor\n", 
    877954                    channelInfo.name.c_str()); 
     
    880957        } 
    881958 
     959        // set DLL bandwidth 
     960        if(!p->setDllBandwidth(recv_sp_dll_bw)) { 
     961            debugFatal("Could not set DLL bandwidth\n"); 
     962            delete p; 
     963            return false; 
     964        } 
     965         
     966        debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) Transmit SP on channel [%d audio, %d midi]%s\n",  
     967                                         this, nb_audio, nb_midi, (snoopMode?" snoop mode":"")); 
     968 
     969        // we put this SP into the transmit SP vector, 
     970        // no matter if we are in snoop mode or not 
     971        // this allows us to find out what direction 
     972        // a certain stream should have. 
    882973        m_transmitProcessors.push_back(p); 
    883974    } 
     
    9491040        m_model->vendor_name, m_model->model_name, getNodeId()); 
    9501041 
     1042    bool snoopMode = false; 
     1043    if(!getOption("snoopMode", snoopMode)) { 
     1044        debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 
     1045    } 
     1046 
     1047    if (snoopMode) { 
     1048        debugWarning("Lock not supported in snoop mode\n"); 
     1049        return true; //FIXME: this should be false 
     1050    } else { 
     1051 
    9511052    // get a notifier to handle device notifications 
    952     nodeaddr_t notify_address; 
    953     notify_address = get1394Service().findFreeARMBlock( 
    954                         DICE_NOTIFIER_BASE_ADDRESS, 
    955                         DICE_NOTIFIER_BLOCK_LENGTH, 
    956                         DICE_NOTIFIER_BLOCK_LENGTH); 
    957  
    958     if (notify_address == 0xFFFFFFFFFFFFFFFFLLU) { 
    959         debugError("Could not find free ARM block for notification\n"); 
    960         return false; 
    961     } 
    962  
    963     m_notifier=new DiceAvDevice::DiceNotifier(this, notify_address); 
    964  
    965     if(!m_notifier) { 
    966         debugError("Could not allocate notifier\n"); 
    967         return false; 
    968     } 
    969  
    970     if (!get1394Service().registerARMHandler(m_notifier)) { 
    971         debugError("Could not register notifier\n"); 
     1053        nodeaddr_t notify_address; 
     1054        notify_address = get1394Service().findFreeARMBlock( 
     1055                            DICE_NOTIFIER_BASE_ADDRESS, 
     1056                            DICE_NOTIFIER_BLOCK_LENGTH, 
     1057                            DICE_NOTIFIER_BLOCK_LENGTH); 
     1058     
     1059        if (notify_address == 0xFFFFFFFFFFFFFFFFLLU) { 
     1060            debugError("Could not find free ARM block for notification\n"); 
     1061            return false; 
     1062        } 
     1063     
     1064        m_notifier=new DiceAvDevice::DiceNotifier(this, notify_address); 
     1065     
     1066        if(!m_notifier) { 
     1067            debugError("Could not allocate notifier\n"); 
     1068            return false; 
     1069        } 
     1070     
     1071        if (!get1394Service().registerARMHandler(m_notifier)) { 
     1072            debugError("Could not register notifier\n"); 
     1073            delete m_notifier; 
     1074            m_notifier=NULL; 
     1075            return false; 
     1076        } 
     1077     
     1078        // register this notifier 
     1079        fb_nodeaddr_t addr = DICE_REGISTER_BASE 
     1080                        + m_global_reg_offset 
     1081                        + DICE_REGISTER_GLOBAL_OWNER; 
     1082     
     1083        // registry offsets should always be smaller than 0x7FFFFFFF 
     1084        // because otherwise base + offset > 64bit 
     1085        if(m_global_reg_offset & 0x80000000) { 
     1086            debugError("register offset not initialized yet\n"); 
     1087            return false; 
     1088        } 
     1089     
     1090        fb_nodeaddr_t swap_value = ((0xFFC0) | get1394Service().getLocalNodeId()); 
     1091        swap_value = swap_value << 48; 
     1092        swap_value |= m_notifier->getStart(); 
     1093     
     1094        if (!get1394Service().lockCompareSwap64(getNodeId() | 0xFFC0, 
     1095                                                addr, DICE_OWNER_NO_OWNER, 
     1096                                                swap_value, &result )) { 
     1097            debugWarning("Could not register ourselves as device owner\n"); 
     1098            return false; 
     1099        } 
     1100     
     1101        if (result != DICE_OWNER_NO_OWNER) { 
     1102            debugWarning("Could not register ourselves as device owner, unexpected register value: 0x%016llX\n", result); 
     1103            return false; 
     1104        } 
     1105     
     1106        return true; 
     1107    } 
     1108
     1109 
     1110 
     1111bool 
     1112DiceAvDevice::unlock() { 
     1113    fb_octlet_t result; 
     1114 
     1115    bool snoopMode = false; 
     1116    if(!getOption("snoopMode", snoopMode)) { 
     1117        debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 
     1118    } 
     1119 
     1120    if (snoopMode) { 
     1121        debugWarning("Unlock not supported in snoop mode\n"); 
     1122        return true; //FIXME: this should be false 
     1123    } else { 
     1124        if(!m_notifier) { 
     1125            debugWarning("Request to unlock, but no notifier present!\n"); 
     1126            return false; 
     1127        } 
     1128     
     1129        fb_nodeaddr_t addr = DICE_REGISTER_BASE 
     1130                        + m_global_reg_offset 
     1131                        + DICE_REGISTER_GLOBAL_OWNER; 
     1132     
     1133        // registry offsets should always be smaller than 0x7FFFFFFF 
     1134        // because otherwise base + offset > 64bit 
     1135        if(m_global_reg_offset & 0x80000000) { 
     1136            debugError("register offset not initialized yet\n"); 
     1137            return false; 
     1138        } 
     1139     
     1140        fb_nodeaddr_t compare_value = ((0xFFC0) | get1394Service().getLocalNodeId()); 
     1141        compare_value <<= 48; 
     1142        compare_value |= m_notifier->getStart(); 
     1143     
     1144        if (!get1394Service().lockCompareSwap64(  getNodeId() | 0xFFC0, addr, compare_value, 
     1145                                        DICE_OWNER_NO_OWNER, &result )) { 
     1146            debugWarning("Could not unregister ourselves as device owner\n"); 
     1147            return false; 
     1148        } 
     1149     
     1150        get1394Service().unregisterARMHandler(m_notifier); 
    9721151        delete m_notifier; 
    9731152        m_notifier=NULL; 
    974         return false; 
    975     } 
    976  
    977     // register this notifier 
    978     fb_nodeaddr_t addr = DICE_REGISTER_BASE 
    979                        + m_global_reg_offset 
    980                        + DICE_REGISTER_GLOBAL_OWNER; 
    981  
    982     // registry offsets should always be smaller than 0x7FFFFFFF 
    983     // because otherwise base + offset > 64bit 
    984     if(m_global_reg_offset & 0x80000000) { 
    985         debugError("register offset not initialized yet\n"); 
    986         return false; 
    987     } 
    988  
    989     fb_nodeaddr_t swap_value = ((0xFFC0) | get1394Service().getLocalNodeId()); 
    990     swap_value = swap_value << 48; 
    991     swap_value |= m_notifier->getStart(); 
    992  
    993     if (!get1394Service().lockCompareSwap64(getNodeId() | 0xFFC0, 
    994                                             addr, DICE_OWNER_NO_OWNER, 
    995                                             swap_value, &result )) { 
    996         debugWarning("Could not register ourselves as device owner\n"); 
    997         return false; 
    998     } 
    999  
    1000     if (result != DICE_OWNER_NO_OWNER) { 
    1001         debugWarning("Could not register ourselves as device owner, unexpected register value: 0x%016llX\n", result); 
    1002         return false; 
    1003     } 
    1004  
    1005     return true; 
    1006 
    1007  
    1008  
    1009 bool 
    1010 DiceAvDevice::unlock() { 
    1011     fb_octlet_t result; 
    1012  
    1013     if(!m_notifier) { 
    1014         debugWarning("Request to unlock, but no notifier present!\n"); 
    1015         return false; 
    1016     } 
    1017  
    1018     fb_nodeaddr_t addr = DICE_REGISTER_BASE 
    1019                        + m_global_reg_offset 
    1020                        + DICE_REGISTER_GLOBAL_OWNER; 
    1021  
    1022     // registry offsets should always be smaller than 0x7FFFFFFF 
    1023     // because otherwise base + offset > 64bit 
    1024     if(m_global_reg_offset & 0x80000000) { 
    1025         debugError("register offset not initialized yet\n"); 
    1026         return false; 
    1027     } 
    1028  
    1029     fb_nodeaddr_t compare_value = ((0xFFC0) | get1394Service().getLocalNodeId()); 
    1030     compare_value <<= 48; 
    1031     compare_value |= m_notifier->getStart(); 
    1032  
    1033     if (!get1394Service().lockCompareSwap64(  getNodeId() | 0xFFC0, addr, compare_value, 
    1034                                        DICE_OWNER_NO_OWNER, &result )) { 
    1035         debugWarning("Could not unregister ourselves as device owner\n"); 
    1036         return false; 
    1037     } 
    1038  
    1039     get1394Service().unregisterARMHandler(m_notifier); 
    1040     delete m_notifier; 
    1041     m_notifier=NULL; 
    1042  
    1043     return true; 
     1153     
     1154        return true; 
     1155    } 
    10441156} 
    10451157 
    10461158bool 
    10471159DiceAvDevice::enableStreaming() { 
    1048     return enableIsoStreaming(); 
     1160    bool snoopMode = false; 
     1161    if(!getOption("snoopMode", snoopMode)) { 
     1162        debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 
     1163    } 
     1164 
     1165    if (snoopMode) { 
     1166        debugWarning("Stream should be already running for snoop mode\n"); 
     1167        return true; 
     1168    } else { 
     1169        return enableIsoStreaming(); 
     1170    } 
    10491171} 
    10501172 
    10511173bool 
    10521174DiceAvDevice::disableStreaming() { 
    1053     return disableIsoStreaming(); 
     1175    bool snoopMode = false; 
     1176    if(!getOption("snoopMode", snoopMode)) { 
     1177        debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 
     1178    } 
     1179 
     1180    if (snoopMode) { 
     1181        debugWarning("Won't disable stream in snoop mode\n"); 
     1182        return true; 
     1183    } else { 
     1184        return disableIsoStreaming(); 
     1185    } 
    10541186} 
    10551187 
     
    10731205bool 
    10741206DiceAvDevice::startStreamByIndex(int i) { 
    1075  
    1076     if (isIsoStreamingEnabled()) { 
     1207    bool snoopMode = false; 
     1208    if(!getOption("snoopMode", snoopMode)) { 
     1209        debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 
     1210    } 
     1211 
     1212    if (!snoopMode && isIsoStreamingEnabled()) { 
    10771213        debugError("Cannot start streams while streaming is enabled\n"); 
     1214        return false; 
     1215    } 
     1216 
     1217    if (i<(int)m_receiveProcessors.size()) { 
     1218        int n=i; 
     1219        Streaming::StreamProcessor *p = m_receiveProcessors.at(n); 
     1220 
     1221        if(snoopMode) { // a stream from the device to another host 
     1222            fb_quadlet_t reg_isoch; 
     1223            // check value of ISO_CHANNEL register 
     1224            if(!readTxReg(n, DICE_REGISTER_TX_ISOC_BASE, &reg_isoch)) { 
     1225                debugError("Could not read ISO_CHANNEL register for ATX %d\n", n); 
     1226                p->setChannel(-1); 
     1227                return false; 
     1228            } 
     1229            int isochannel = reg_isoch; 
     1230            debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) Snooping RX from channel %d\n", isochannel); 
     1231            p->setChannel(isochannel); 
     1232        } else { 
     1233            // allocate ISO channel 
     1234            int isochannel = allocateIsoChannel(p->getMaxPacketSize()); 
     1235            if(isochannel<0) { 
     1236                debugError("Could not allocate iso channel for SP %d (ATX %d)\n",i,n); 
     1237                return false; 
     1238            } 
     1239            debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) Allocated channel %lu for RX\n", isochannel); 
     1240            p->setChannel(isochannel); 
     1241     
     1242            fb_quadlet_t reg_isoch; 
     1243            // check value of ISO_CHANNEL register 
     1244            if(!readTxReg(n, DICE_REGISTER_TX_ISOC_BASE, &reg_isoch)) { 
     1245                debugError("Could not read ISO_CHANNEL register for ATX %d\n", n); 
     1246                p->setChannel(-1); 
     1247                deallocateIsoChannel(isochannel); 
     1248                return false; 
     1249            } 
     1250            if(reg_isoch != 0xFFFFFFFFUL) { 
     1251                debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08X) for ATX %d\n", reg_isoch, n); 
     1252                p->setChannel(-1); 
     1253                deallocateIsoChannel(isochannel); 
     1254                return false; 
     1255            } 
     1256     
     1257            // write value of ISO_CHANNEL register 
     1258            reg_isoch = isochannel; 
     1259            if(!writeTxReg(n, DICE_REGISTER_TX_ISOC_BASE, reg_isoch)) { 
     1260                debugError("Could not write ISO_CHANNEL register for ATX %d\n", n); 
     1261                p->setChannel(-1); 
     1262                deallocateIsoChannel(isochannel); 
     1263                return false; 
     1264            } 
     1265        } 
     1266        return true; 
     1267 
     1268    } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 
     1269        int n=i-m_receiveProcessors.size(); 
     1270        Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 
     1271 
     1272        if(snoopMode) { // a stream from the device to another host 
     1273            fb_quadlet_t reg_isoch; 
     1274            // check value of ISO_CHANNEL register 
     1275            if(!readRxReg(n, DICE_REGISTER_RX_ISOC_BASE, &reg_isoch)) { 
     1276                debugError("Could not read ISO_CHANNEL register for ARX %d\n", n); 
     1277                p->setChannel(-1); 
     1278                return false; 
     1279            } 
     1280            int isochannel = reg_isoch; 
     1281            debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) Snooping TX from channel %d\n", isochannel); 
     1282            p->setChannel(isochannel); 
     1283        } else { 
     1284            // allocate ISO channel 
     1285            int isochannel = allocateIsoChannel(p->getMaxPacketSize()); 
     1286            if(isochannel<0) { 
     1287                debugError("Could not allocate iso channel for SP %d (ARX %d)\n",i,n); 
     1288                return false; 
     1289            } 
     1290            debugOutput(DEBUG_LEVEL_VERBOSE, "(%p) Allocated channel %lu for TX\n", isochannel); 
     1291            p->setChannel(isochannel); 
     1292     
     1293            fb_quadlet_t reg_isoch; 
     1294            // check value of ISO_CHANNEL register 
     1295            if(!readRxReg(n, DICE_REGISTER_RX_ISOC_BASE, &reg_isoch)) { 
     1296                debugError("Could not read ISO_CHANNEL register for ARX %d\n", n); 
     1297                p->setChannel(-1); 
     1298                deallocateIsoChannel(isochannel); 
     1299                return false; 
     1300            } 
     1301            if(reg_isoch != 0xFFFFFFFFUL) { 
     1302                debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08X) for ARX %d\n", reg_isoch, n); 
     1303                p->setChannel(-1); 
     1304                deallocateIsoChannel(isochannel); 
     1305                return false; 
     1306            } 
     1307     
     1308            // write value of ISO_CHANNEL register 
     1309            reg_isoch=isochannel; 
     1310            if(!writeRxReg(n, DICE_REGISTER_RX_ISOC_BASE, reg_isoch)) { 
     1311                debugError("Could not write ISO_CHANNEL register for ARX %d\n", n); 
     1312                p->setChannel(-1); 
     1313                deallocateIsoChannel(isochannel); 
     1314                return false; 
     1315            } 
     1316        } 
     1317        return true; 
     1318    } 
     1319 
     1320    debugError("SP index %d out of range!\n",i); 
     1321    return false; 
     1322} 
     1323 
     1324bool 
     1325DiceAvDevice::stopStreamByIndex(int i) { 
     1326    bool snoopMode = false; 
     1327    if(!getOption("snoopMode", snoopMode)) { 
     1328        debugWarning("Could not retrieve snoopMode parameter, defauling to false\n"); 
     1329    } 
     1330 
     1331    if (!snoopMode && isIsoStreamingEnabled()) { 
     1332        debugError("Cannot stop streams while streaming is enabled\n"); 
    10781333        return false; 
    10791334    } 
     
    10821337        int n=i; 
    10831338        Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 
    1084  
    1085         // allocate ISO channel 
    1086         int isochannel=allocateIsoChannel(p->getMaxPacketSize()); 
    1087         if(isochannel<0) { 
    1088             debugError("Could not allocate iso channel for SP %d (ATX %d)\n",i,n); 
    1089             return false; 
    1090         } 
    1091         p->setChannel(isochannel); 
    1092  
    1093         fb_quadlet_t reg_isoch; 
    1094         // check value of ISO_CHANNEL register 
    1095         if(!readTxReg(n, DICE_REGISTER_TX_ISOC_BASE, &reg_isoch)) { 
    1096             debugError("Could not read ISO_CHANNEL register for ATX %d\n", n); 
    1097             p->setChannel(-1); 
    1098             deallocateIsoChannel(isochannel); 
    1099             return false; 
    1100         } 
    1101         if(reg_isoch != 0xFFFFFFFFUL) { 
    1102             debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08X) for ATX %d\n", reg_isoch, n); 
    1103             p->setChannel(-1); 
    1104             deallocateIsoChannel(isochannel); 
    1105             return false; 
    1106         } 
    1107  
    1108         // write value of ISO_CHANNEL register 
    1109         reg_isoch=isochannel; 
    1110         if(!writeTxReg(n, DICE_REGISTER_TX_ISOC_BASE, reg_isoch)) { 
    1111             debugError("Could not write ISO_CHANNEL register for ATX %d\n", n); 
    1112             p->setChannel(-1); 
    1113             deallocateIsoChannel(isochannel); 
    1114             return false; 
    1115         } 
    1116  
     1339        if(snoopMode) { // a stream from the device to another host 
     1340            // nothing to do 
     1341        } else { 
     1342            unsigned int isochannel = p->getChannel(); 
     1343     
     1344            fb_quadlet_t reg_isoch; 
     1345            // check value of ISO_CHANNEL register 
     1346            if(!readTxReg(n, DICE_REGISTER_TX_ISOC_BASE, &reg_isoch)) { 
     1347                debugError("Could not read ISO_CHANNEL register for ATX %d\n", n); 
     1348                return false; 
     1349            } 
     1350            if(reg_isoch != isochannel) { 
     1351                debugError("ISO_CHANNEL register != 0x%08X (=0x%08X) for ATX %d\n", isochannel, reg_isoch, n); 
     1352                return false; 
     1353            } 
     1354     
     1355            // write value of ISO_CHANNEL register 
     1356            reg_isoch=0xFFFFFFFFUL; 
     1357            if(!writeTxReg(n, DICE_REGISTER_TX_ISOC_BASE, reg_isoch)) { 
     1358                debugError("Could not write ISO_CHANNEL register for ATX %d\n", n); 
     1359                return false; 
     1360            } 
     1361     
     1362            // deallocate ISO channel 
     1363            if(!deallocateIsoChannel(isochannel)) { 
     1364                debugError("Could not deallocate iso channel for SP %d (ATX %d)\n",i,n); 
     1365                return false; 
     1366            } 
     1367        } 
     1368        p->setChannel(-1); 
    11171369        return true; 
    11181370 
     
    11211373        Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 
    11221374 
    1123         // allocate ISO channel 
    1124         int isochannel=allocateIsoChannel(p->getMaxPacketSize()); 
    1125         if(isochannel<0) { 
    1126             debugError("Could not allocate iso channel for SP %d (ARX %d)\n",i,n); 
    1127             return false; 
    1128         } 
    1129         p->setChannel(isochannel); 
    1130  
    1131         fb_quadlet_t reg_isoch; 
    1132         // check value of ISO_CHANNEL register 
    1133         if(!readRxReg(n, DICE_REGISTER_RX_ISOC_BASE, &reg_isoch)) { 
    1134             debugError("Could not read ISO_CHANNEL register for ARX %d\n", n); 
    1135             p->setChannel(-1); 
    1136             deallocateIsoChannel(isochannel); 
    1137             return false; 
    1138         } 
    1139         if(reg_isoch != 0xFFFFFFFFUL) { 
    1140             debugError("ISO_CHANNEL register != 0xFFFFFFFF (=0x%08X) for ARX %d\n", reg_isoch, n); 
    1141             p->setChannel(-1); 
    1142             deallocateIsoChannel(isochannel); 
    1143             return false; 
    1144         } 
    1145  
    1146         // write value of ISO_CHANNEL register 
    1147         reg_isoch=isochannel; 
    1148         if(!writeRxReg(n, DICE_REGISTER_RX_ISOC_BASE, reg_isoch)) { 
    1149             debugError("Could not write ISO_CHANNEL register for ARX %d\n", n); 
    1150             p->setChannel(-1); 
    1151             deallocateIsoChannel(isochannel); 
    1152             return false; 
    1153         } 
    1154  
    1155         return true; 
    1156     } 
    1157  
    1158     debugError("SP index %d out of range!\n",i); 
    1159  
    1160     return false; 
    1161 
    1162  
    1163 bool 
    1164 DiceAvDevice::stopStreamByIndex(int i) { 
    1165  
    1166     if (isIsoStreamingEnabled()) { 
    1167         debugError("Cannot stop streams while streaming is enabled\n"); 
    1168         return false; 
    1169     } 
    1170  
    1171     if (i<(int)m_receiveProcessors.size()) { 
    1172         int n=i; 
    1173         Streaming::StreamProcessor *p=m_receiveProcessors.at(n); 
    1174         unsigned int isochannel=p->getChannel(); 
    1175  
    1176         fb_quadlet_t reg_isoch; 
    1177         // check value of ISO_CHANNEL register 
    1178         if(!readTxReg(n, DICE_REGISTER_TX_ISOC_BASE, &reg_isoch)) { 
    1179             debugError("Could not read ISO_CHANNEL register for ATX %d\n", n); 
    1180             return false; 
    1181         } 
    1182         if(reg_isoch != isochannel) { 
    1183             debugError("ISO_CHANNEL register != 0x%08X (=0x%08X) for ATX %d\n", isochannel, reg_isoch, n); 
    1184             return false; 
    1185         } 
    1186  
    1187         // write value of ISO_CHANNEL register 
    1188         reg_isoch=0xFFFFFFFFUL; 
    1189         if(!writeTxReg(n, DICE_REGISTER_TX_ISOC_BASE, reg_isoch)) { 
    1190             debugError("Could not write ISO_CHANNEL register for ATX %d\n", n); 
    1191             return false; 
    1192         } 
    1193  
    1194         // deallocate ISO channel 
    1195         if(!deallocateIsoChannel(isochannel)) { 
    1196             debugError("Could not deallocate iso channel for SP %d (ATX %d)\n",i,n); 
    1197             return false; 
    1198         } 
    1199  
    1200         p->setChannel(-1); 
    1201         return true; 
    1202  
    1203     } else if (i<(int)m_receiveProcessors.size() + (int)m_transmitProcessors.size()) { 
    1204         int n=i-m_receiveProcessors.size(); 
    1205         Streaming::StreamProcessor *p=m_transmitProcessors.at(n); 
    1206  
    1207         unsigned int isochannel=p->getChannel(); 
    1208  
    1209         fb_quadlet_t reg_isoch; 
    1210         // check value of ISO_CHANNEL register 
    1211         if(!readRxReg(n, DICE_REGISTER_RX_ISOC_BASE, &reg_isoch)) { 
    1212             debugError("Could not read ISO_CHANNEL register for ARX %d\n", n); 
    1213             return false; 
    1214         } 
    1215         if(reg_isoch != isochannel) { 
    1216             debugError("ISO_CHANNEL register != 0x%08X (=0x%08X) for ARX %d\n", isochannel, reg_isoch, n); 
    1217             return false; 
    1218         } 
    1219  
    1220         // write value of ISO_CHANNEL register 
    1221         reg_isoch=0xFFFFFFFFUL; 
    1222         if(!writeRxReg(n, DICE_REGISTER_RX_ISOC_BASE, reg_isoch)) { 
    1223             debugError("Could not write ISO_CHANNEL register for ARX %d\n", n); 
    1224             return false; 
    1225         } 
    1226  
    1227         // deallocate ISO channel 
    1228         if(!deallocateIsoChannel(isochannel)) { 
    1229             debugError("Could not deallocate iso channel for SP %d (ARX %d)\n",i,n); 
    1230             return false; 
     1375        if(snoopMode) { // a stream from the device to another host 
     1376            // nothing to do 
     1377        } else { 
     1378            unsigned int isochannel = p->getChannel(); 
     1379     
     1380            fb_quadlet_t reg_isoch; 
     1381            // check value of ISO_CHANNEL register 
     1382            if(!readRxReg(n, DICE_REGISTER_RX_ISOC_BASE, &reg_isoch)) { 
     1383                debugError("Could not read ISO_CHANNEL register for ARX %d\n", n); 
     1384                return false; 
     1385            } 
     1386            if(reg_isoch != isochannel) { 
     1387                debugError("ISO_CHANNEL register != 0x%08X (=0x%08X) for ARX %d\n", isochannel, reg_isoch, n); 
     1388                return false; 
     1389            } 
     1390     
     1391            // write value of ISO_CHANNEL register 
     1392            reg_isoch=0xFFFFFFFFUL; 
     1393            if(!writeRxReg(n, DICE_REGISTER_RX_ISOC_BASE, reg_isoch)) { 
     1394                debugError("Could not write ISO_CHANNEL register for ARX %d\n", n); 
     1395                return false; 
     1396            } 
     1397     
     1398            // deallocate ISO channel 
     1399            if(!deallocateIsoChannel(isochannel)) { 
     1400                debugError("Could not deallocate iso channel for SP %d (ARX %d)\n",i,n); 
     1401                return false; 
     1402            } 
    12311403        } 
    12321404 
     
    17241896bool 
    17251897DiceAvDevice::readTxReg(unsigned int i, fb_nodeaddr_t offset, fb_quadlet_t *result) { 
    1726     debugOutput(DEBUG_LEVEL_VERY_VERBOSE,"Reading tx %d register offset 0x%04llX\n", i, offset); 
    1727  
    1728     fb_nodeaddr_t offset_tx=txOffsetGen(i, offset, sizeof(fb_quadlet_t)); 
     1898    debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "Reading tx %d register offset 0x%04llX\n", i, offset); 
     1899 
     1900    fb_nodeaddr_t offset_tx = txOffsetGen(i, offset, sizeof(fb_quadlet_t)); 
    17291901    return readReg(m_tx_reg_offset + offset_tx, result); 
    17301902} 
  • trunk/libffado/src/dice/dice_defines.h

    r864 r1539  
    2525#define DICEDEFINES_H 
    2626 
    27 #define DICE_VER_1_0_4_0 
    28 // #define DICE_VER_1_0_7_0 
     27// #define DICE_VER_1_0_4_0 
     28#define DICE_VER_1_0_7_0 
    2929 
    3030#define DICE_INVALID_OFFSET                  0xFFFFF00000000000ULL 
  • trunk/libffado/src/genericavc/avc_avdevice.cpp

    r1535 r1539  
    508508bool 
    509509AvDevice::prepare() { 
    510     bool snoopMode=false; 
     510    bool snoopMode = false; 
    511511    Util::MutexLockHelper lock(m_DeviceMutex); 
    512512    if(!getOption("snoopMode", snoopMode)) { 
     
    595595                                  inputPlug->getNrOfChannels()); 
    596596    } else { 
    597         Streaming::AmdtpTransmitStreamProcessor * t; 
    598         t=new Streaming::AmdtpTransmitStreamProcessor(*this, 
     597        Streaming::AmdtpTransmitStreamProcessor *t; 
     598        t = new Streaming::AmdtpTransmitStreamProcessor(*this, 
    599599                                inputPlug->getNrOfChannels()); 
    600600        #if AMDTP_ALLOW_PAYLOAD_IN_NODATA_XMIT