Changeset 1172

Show
Ignore:
Timestamp:
05/14/08 21:38:31 (13 years ago)
Author:
ppalmers
Message:

lay down the foundations for easy ALSA/Pulse support

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/bebob/focusrite/focusrite_saffire.cpp

    r1170 r1172  
    227227    if (!result) { 
    228228        debugWarning("One or more control elements could not be created."); 
    229         // clean up those that couldn't be created 
     229        // clean up those that were created 
    230230        destroyMixer(); 
    231231        return false; 
     
    242242    if (!addElement(new RegisterControl(*this, "Register", "Register Access", "Direct register access"))) { 
    243243        debugWarning("Could not create register control element."); 
    244         // clean up those that couldn't be created 
     244        // clean up those that were created 
    245245        destroyMixer(); 
    246246        return false; 
  • trunk/libffado/src/libieee1394/IsoHandler.cpp

    r1165 r1172  
    424424        } 
    425425    } 
    426      
     426 
    427427    #ifdef DEBUG 
    428428    if( (CYCLE_TIMER_GET_CYCLES(m_last_now) < cycle) 
     
    433433    { 
    434434        debugOutput(DEBUG_LEVEL_VERBOSE, "Special non-unwrapping happened\n"); 
    435     }     
     435    } 
    436436    #endif 
    437437    pkt_ctr |= (now_secs & 0x7F) << 25; 
  • trunk/libffado/src/libieee1394/IsoHandlerManager.cpp

    r1145 r1172  
    318318        if (errno == ETIMEDOUT) { 
    319319            debugOutput(DEBUG_LEVEL_VERBOSE, 
    320                         "(%p) pthread_cond_timedwait() timed out (result=%d)\n", 
     320                        "(%p) sem_timedwait() timed out (result=%d)\n", 
    321321                        this, result); 
    322322            return eAR_Timeout; 
    323323        } else if (errno == EINTR) { 
    324324            debugOutput(DEBUG_LEVEL_VERBOSE, 
    325                         "(%p) pthread_cond_[timed]wait() interrupted by signal (result=%d)\n", 
     325                        "(%p) sem_timedwait() interrupted by signal (result=%d)\n", 
    326326                        this, result); 
    327327            return eAR_Interrupted; 
    328328        } else { 
    329             debugError("(%p) pthread_cond_[timed]wait error (result=%d errno=%d)\n",  
     329            debugError("(%p) sem_timedwait error (result=%d errno=%d)\n",  
    330330                        this, result, errno); 
    331331            debugError("(%p) timeout_sec=%d timeout_nsec=%lld ts.sec=%d ts.nsec=%lld\n",  
  • trunk/libffado/src/libutil/Mutex.h

    r1163 r1172  
    4242    virtual void Unlock() = 0; 
    4343 
     44    virtual bool isLocked() = 0; 
     45 
    4446    virtual void show() = 0; 
    4547    virtual void setVerboseLevel(int) = 0; 
  • trunk/libffado/src/libutil/PosixMutex.cpp

    r1095 r1172  
    2323 
    2424#include "PosixMutex.h" 
     25#include <errno.h> 
    2526 
    2627// disable collision tracing for non-debug builds 
     
    9798} 
    9899 
     100bool 
     101PosixMutex::isLocked() 
     102{ 
     103    debugOutput(DEBUG_LEVEL_VERY_VERBOSE, "(%p) checking lock\n", this); 
     104    int res=pthread_mutex_trylock(&m_mutex); 
     105    if(res == 0) { 
     106        pthread_mutex_unlock(&m_mutex); 
     107        return false; 
     108    } else { 
     109        if(res != EBUSY) { 
     110            debugError("Bogus error code: %d\n", res); 
     111        } 
     112        return true; 
     113    } 
     114} 
     115 
    99116void 
    100117PosixMutex::Unlock() 
  • trunk/libffado/src/libutil/PosixMutex.h

    r1074 r1172  
    4949    virtual void Unlock(); 
    5050 
     51    virtual bool isLocked(); 
     52 
    5153    virtual void show(); 
    5254    virtual void setVerboseLevel(int l) {setDebugLevel(l);}; 
  • trunk/libffado/src/SConscript

    r1154 r1172  
    7373        libutil/cmd_serialize.cpp \ 
    7474        libutil/DelayLockedLoop.cpp \ 
     75        libutil/IpcRingBuffer.cpp \ 
    7576        libutil/PacketBuffer.cpp \ 
    7677        libutil/OptionContainer.cpp \ 
     78        libutil/PosixMessageQueue.cpp \ 
     79        libutil/PosixSharedMemory.cpp \ 
    7780        libutil/PosixMutex.cpp \ 
    7881        libutil/PosixThread.cpp \ 
  • trunk/libffado/tests/SConscript

    r1154 r1172  
    5656        "test-bufferops" : "test-bufferops.cpp", 
    5757        "test-watchdog" : "test-watchdog.cpp", 
     58        "test-messagequeue" : "test-messagequeue.cpp", 
     59        "test-shm" : "test-shm.cpp", 
     60        "test-ipcringbuffer" : "test-ipcringbuffer.cpp", 
    5861        "test-devicestringparser" : "test-devicestringparser.cpp", 
    5962        "dumpiso_mod" : "dumpiso_mod.cpp", 
  • trunk/libffado/tests/streaming/SConscript

    r864 r1172  
    3030env.PrependUnique( LIBS=["ffado"] ) 
    3131 
    32 cppapps = "teststreaming3
     32cppapps = "teststreaming3 teststreaming-ipc test-ipcclient
    3333 
    3434for app in env.Split( cppapps ): 
  • trunk/libffado/tests/streaming/teststreaming3.cpp

    r1146 r1172  
    352352    } 
    353353 
    354     audiobuffers_out = (float **)calloc(nb_out_channels, sizeof(float)); 
     354    audiobuffers_out = (float **)calloc(nb_out_channels, sizeof(float *)); 
    355355    for (i=0; i < nb_out_channels; i++) { 
    356356        audiobuffers_out[i] = (float *)calloc(arguments.period+1, sizeof(float));