Changeset 1081

Show
Ignore:
Timestamp:
05/01/08 07:36:26 (13 years ago)
Author:
ppalmers
Message:

work around clock_nanosleep issue (related to ticket #97)

Files:

Legend:

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

    r1074 r1081  
    2323/* Define to the version of the cace. */ 
    2424#define CACHE_VERSION "$VERSION-$REVISION" 
     25#define CACHEDIR "$CACHEDIR" 
    2526 
    2627/* Define to the api version */ 
    2728#define FFADO_API_VERSION $FFADO_API_VERSION 
    28  
    29 #define CACHEDIR "$CONFIGDIR" 
    3029 
    3130#define BINDIR "$BINDIR" 
     
    7473#define WATCHDOG_DEFAULT_PRIORITY               98 
    7574 
     75// threading 
     76#define THREAD_MAX_RTPRIO                   98 
     77#define THREAD_MIN_RTPRIO                   1 
     78 
     79// time 
     80 
     81// we should be using absolute clock_nanosleep 
     82// but on my system it causes a lockup. 
     83#define USE_ABSOLUTE_NANOSLEEP 0 
     84 
    7685// 1394 service constants  
    7786#define IEEE1394SERVICE_USE_CYCLETIMER_DLL  1 
     
    8695// bandwidth allocation when doing CMP connections. 
    8796#define IEEE1394SERVICE_SKIP_IEC61883_BANDWIDTH_ALLOCATION 1 
    88  
    89 #define THREAD_MAX_RTPRIO                   98 
    90 #define THREAD_MIN_RTPRIO                   1 
    9197 
    9298#define MINIMUM_INTERRUPTS_PER_PERIOD       2U 
  • trunk/libffado/src/libutil/SystemTimeSource.cpp

    r1027 r1081  
    3333#include <stdlib.h> 
    3434 
     35DECLARE_GLOBAL_DEBUG_MODULE; 
     36 
    3537namespace Util { 
    3638 
     
    4850SystemTimeSource::SleepUsecAbsolute(ffado_microsecs_t wake_at_usec) 
    4951{ 
     52#if USE_ABSOLUTE_NANOSLEEP 
    5053    struct timespec ts; 
    5154    ts.tv_sec = wake_at_usec / (1000000LL); 
    5255    ts.tv_nsec = (wake_at_usec % (1000000LL)) * 1000LL; 
    53     clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, NULL); 
     56    debugOutput(DEBUG_LEVEL_VERBOSE, 
     57                "clock_nanosleep until %lld sec, %lld nanosec\n", 
     58                (int64_t)ts.tv_sec, (int64_t)ts.tv_nsec); 
     59    int err = clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, NULL); 
     60    debugOutput(DEBUG_LEVEL_VERBOSE, 
     61                "back with err=%d\n", 
     62                err); 
     63#else 
     64    ffado_microsecs_t to_sleep = wake_at_usec - getCurrentTime(); 
     65    SleepUsecRelative(to_sleep); 
     66#endif 
    5467} 
    5568