Changeset 2569:6997f3702901 in roaraudio for libroareio


Ignore:
Timestamp:
09/04/09 05:21:54 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

try out some settings for the sound card blocking, not a good way of doing it, but should work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroareio/driver_oss.c

    r2301 r2569  
    3434#endif 
    3535#include <sys/ioctl.h> 
     36 
     37#ifdef SNDCTL_DSP_SETFRAGMENT 
     38static void roar_cdriver_oss_try_buf_setups(int fh) { 
     39 int blocksizes[] = {11, 12, 13}; 
     40 int blocks[]     = {4, 5, 6, 3, 7, 2, 8}; 
     41 int bs, b; 
     42 int tmp; 
     43 
     44 for (bs = 0; bs < sizeof(blocksizes)/sizeof(int); bs++) { 
     45  for (b = 0; b  < sizeof(blocks)    /sizeof(int); b++ ) { 
     46   tmp = blocksizes[bs] | (blocks[b] << 16); 
     47   if ( ioctl(fh, SNDCTL_DSP_SETFRAGMENT, &tmp) == 0 ) 
     48    return; 
     49  } 
     50 } 
     51} 
     52#endif 
    3653 
    3754#define _err() roar_vio_close(calls); return -1 
     
    154171 } 
    155172 
     173#ifdef SNDCTL_DSP_SETFRAGMENT 
     174 roar_cdriver_oss_try_buf_setups(fh); 
     175#endif 
     176 
    156177 return 0; 
    157178} 
Note: See TracChangeset for help on using the changeset viewer.