Changeset 4764:03260f93b84f in roaraudio
- Timestamp:
- 02/14/11 16:32:25 (13 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- roard
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/driver_pulsesimple.c
r4708 r4764 30 30 int driver_pulsesimple_open (struct roar_vio_calls * inst, char * device, struct roar_audio_info * info, int fh, struct roar_stream_server * sstream) { 31 31 struct driver_pulsesimple * self; 32 const char * subdev = NULL; 33 int pulseerror = -1; 32 34 pa_stream_direction_t dir = PA_STREAM_PLAYBACK; 33 35 pa_sample_spec ss; … … 82 84 return -1; 83 85 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); 85 87 86 88 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)); 87 90 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); 88 92 return -1; 89 93 } … … 103 107 struct driver_pulsesimple * self = vio->inst; 104 108 109 ROAR_DBG("driver_pulsesimple_close(vio=%p) = ?", vio); 110 105 111 pa_simple_free(self->handle); 106 112 … … 113 119 struct driver_pulsesimple * self = vio->inst; 114 120 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; 116 124 } 117 125 118 126 int driver_pulsesimple_sync (struct roar_vio_calls * vio) { 119 127 struct driver_pulsesimple * self = vio->inst; 128 129 ROAR_DBG("driver_pulsesimple_sync(vio=%p) = ?", vio); 120 130 121 131 return pa_simple_drain(self->handle, NULL); … … 127 137 (void)self; 128 138 139 ROAR_DBG("driver_pulsesimple_ctl(vio=%p) = ?", vio); 140 129 141 return -1; 130 142 } -
roard/include/driver.h
r4708 r4764 129 129 #ifdef ROAR_HAVE_LIBPULSE 130 130 #include <pulse/simple.h> 131 #include <pulse/error.h> 131 132 #include "driver_pulsesimple.h" 132 133 #endif
Note: See TracChangeset
for help on using the changeset viewer.