Changeset 4764:03260f93b84f in roaraudio


Ignore:
Timestamp:
02/14/11 16:32:25 (13 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

PulseAudio? is very broken by design. this patch tries to workaround some major bugs of it. DO NEVER EVER TRY TO USE PULSE*.

Location:
roard
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • roard/driver_pulsesimple.c

    r4708 r4764  
    3030int     driver_pulsesimple_open         (struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream) { 
    3131 struct driver_pulsesimple * self; 
     32 const char                * subdev = NULL; 
     33 int                         pulseerror = -1; 
    3234 pa_stream_direction_t dir = PA_STREAM_PLAYBACK; 
    3335 pa_sample_spec        ss; 
     
    8284  return -1; 
    8385 
    84  self->handle = pa_simple_new(device, "roard", dir, NULL, "RoarAudio Sound Server", &ss, NULL, NULL, NULL); 
     86 self->handle = pa_simple_new(device, "roard", dir, subdev, "RoarAudio Sound Server", &ss, NULL, NULL, &pulseerror); 
    8587 
    8688 if ( self->handle == NULL ) { 
     89  ROAR_ERR("driver_pulsesimple_open(inst=%p, device='%s', info=%p, fh=%i, sstream=%p): can not open device: %s", inst, device, info, fh, sstream, pa_strerror(pulseerror)); 
    8790  roar_mm_free(self); 
     91  ROAR_DBG("driver_pulsesimple_open(inst=%p, device='%s', info=%p, fh=%i, sstream=%p) = -1", inst, device, info, fh, sstream); 
    8892  return -1; 
    8993 } 
     
    103107 struct driver_pulsesimple * self = vio->inst; 
    104108 
     109 ROAR_DBG("driver_pulsesimple_close(vio=%p) = ?", vio); 
     110 
    105111 pa_simple_free(self->handle); 
    106112 
     
    113119 struct driver_pulsesimple * self = vio->inst; 
    114120 
    115  return pa_simple_write(self->handle, buf, count, NULL); 
     121 ROAR_DBG("driver_pulsesimple_write(vio=%p, buf=%p, count=%llu) = ?", vio, buf, (long long unsigned int)count); 
     122 
     123 return pa_simple_write(self->handle, buf, count, NULL) == 0 ? count : -1; 
    116124} 
    117125 
    118126int     driver_pulsesimple_sync         (struct roar_vio_calls * vio) { 
    119127 struct driver_pulsesimple * self = vio->inst; 
     128 
     129 ROAR_DBG("driver_pulsesimple_sync(vio=%p) = ?", vio); 
    120130 
    121131 return pa_simple_drain(self->handle, NULL); 
     
    127137 (void)self; 
    128138 
     139 ROAR_DBG("driver_pulsesimple_ctl(vio=%p) = ?", vio); 
     140 
    129141 return -1; 
    130142} 
  • roard/include/driver.h

    r4708 r4764  
    129129#ifdef ROAR_HAVE_LIBPULSE 
    130130#include <pulse/simple.h> 
     131#include <pulse/error.h> 
    131132#include "driver_pulsesimple.h" 
    132133#endif 
Note: See TracChangeset for help on using the changeset viewer.